Merge trunk head (r43756)
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 25 Oct 2009 22:13:11 +0000 (22:13 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 25 Oct 2009 22:13:11 +0000 (22:13 +0000)
svn path=/branches/ros-amd64-bringup/; revision=43759

623 files changed:
reactos/COPYING
reactos/COPYING.LIB [moved from reactos/LGPL.txt with 98% similarity]
reactos/COPYING3 [moved from reactos/base/applications/paint/gpl.txt with 100% similarity]
reactos/COPYING3.LIB [moved from reactos/base/applications/paint/lgpl.txt with 100% similarity]
reactos/ReactOS-generic.rbuild
reactos/ReactOS-i386.rbuild
reactos/base/applications/cmdutils/cmdutils.rbuild
reactos/base/applications/cmdutils/reg/Da.rc [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/De.rc [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/En.rc [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/Fr.rc [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/Ja.rc [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/Ko.rc [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/Lt.rc [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/Nl.rc [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/No.rc [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/Pl.rc [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/Pt.rc [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/Ru.rc [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/Si.rc [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/reg.c [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/reg.h [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/reg.rbuild [new file with mode: 0644]
reactos/base/applications/cmdutils/reg/rsrc.rc [new file with mode: 0644]
reactos/base/applications/fontview/fontview.rc
reactos/base/applications/fontview/lang/zh-CN.rc [new file with mode: 0644]
reactos/base/applications/fontview/lang/zh-TW.rc [new file with mode: 0644]
reactos/base/applications/kbswitch/lang/zh-CN.rc [new file with mode: 0644]
reactos/base/applications/kbswitch/lang/zh-TW.rc [new file with mode: 0644]
reactos/base/applications/kbswitch/rsrc.rc
reactos/base/applications/logoff/lang/zh-CN.rc [new file with mode: 0644]
reactos/base/applications/logoff/lang/zh-TW.rc [new file with mode: 0644]
reactos/base/applications/logoff/rsrc.rc
reactos/base/applications/network/ftp/ftp.c
reactos/base/applications/network/ftp/ftp_var.h
reactos/base/applications/network/ftp/main.c
reactos/base/applications/network/network.rbuild
reactos/base/applications/network/nslookup/nslookup.c [new file with mode: 0644]
reactos/base/applications/network/nslookup/nslookup.h [new file with mode: 0644]
reactos/base/applications/network/nslookup/nslookup.rbuild [new file with mode: 0644]
reactos/base/applications/network/nslookup/nslookup.rc [new file with mode: 0644]
reactos/base/applications/network/nslookup/utility.c [new file with mode: 0644]
reactos/base/applications/network/ping/ping.c
reactos/base/applications/network/tracert/tracert.c
reactos/base/applications/network/tracert/tracert.h
reactos/base/applications/paint/definitions.h
reactos/base/applications/paint/dialogs.c
reactos/base/applications/paint/dialogs.h
reactos/base/applications/paint/dib.c
reactos/base/applications/paint/dib.h
reactos/base/applications/paint/drawing.c
reactos/base/applications/paint/drawing.h
reactos/base/applications/paint/globalvar.h
reactos/base/applications/paint/history.c
reactos/base/applications/paint/lang/bg-BG.rc
reactos/base/applications/paint/lang/cs-CZ.rc
reactos/base/applications/paint/lang/de-DE.rc
reactos/base/applications/paint/lang/en-GB.rc
reactos/base/applications/paint/lang/en-US.rc
reactos/base/applications/paint/lang/es-ES.rc
reactos/base/applications/paint/lang/eu-ES.rc
reactos/base/applications/paint/lang/fr-FR.rc
reactos/base/applications/paint/lang/it-IT.rc
reactos/base/applications/paint/lang/ja-JP.rc
reactos/base/applications/paint/lang/nl-NL.rc
reactos/base/applications/paint/lang/no-NO.rc
reactos/base/applications/paint/lang/pl-PL.rc
reactos/base/applications/paint/lang/pt-BR.rc
reactos/base/applications/paint/lang/pt-PT.rc
reactos/base/applications/paint/lang/ro-RO.rc
reactos/base/applications/paint/lang/ru-RU.rc
reactos/base/applications/paint/lang/sk-SK.rc
reactos/base/applications/paint/lang/uk-UA.rc
reactos/base/applications/paint/main.c
reactos/base/applications/paint/mouse.c
reactos/base/applications/paint/mouse.h
reactos/base/applications/paint/palette.c
reactos/base/applications/paint/palette.h
reactos/base/applications/paint/registry.c
reactos/base/applications/paint/registry.h
reactos/base/applications/paint/rsrc.rc
reactos/base/applications/paint/selection.c
reactos/base/applications/paint/selection.h
reactos/base/applications/paint/sizebox.c
reactos/base/applications/paint/sizebox.h
reactos/base/applications/paint/toolsettings.c
reactos/base/applications/paint/toolsettings.h
reactos/base/applications/paint/winproc.c
reactos/base/applications/paint/winproc.h
reactos/base/applications/rapps/rapps/smplayer.txt
reactos/base/applications/rapps/rapps/vlc.txt [new file with mode: 0644]
reactos/base/applications/screensavers/3dtext/3dtext.h
reactos/base/applications/winhlp32/callback.c
reactos/base/applications/winhlp32/lex.yy.c
reactos/base/applications/winhlp32/macro.c
reactos/base/applications/winhlp32/macro.lex.l
reactos/base/applications/winhlp32/winhelp.h
reactos/base/applications/wordpad/Ru.rc
reactos/base/services/audiosrv/pnp_list_manager.c
reactos/base/services/dhcp/adapter.c
reactos/base/system/runonce/lang/en-US.rc [new file with mode: 0644]
reactos/base/system/runonce/lang/ru-RU.rc [new file with mode: 0644]
reactos/base/system/runonce/res/icon.ico [new file with mode: 0644]
reactos/base/system/runonce/resource.h [new file with mode: 0644]
reactos/base/system/runonce/rsrc.rc [new file with mode: 0644]
reactos/base/system/runonce/runonce.c [new file with mode: 0644]
reactos/base/system/runonce/runonce.h [new file with mode: 0644]
reactos/base/system/runonce/runonce.rbuild [new file with mode: 0644]
reactos/base/system/runonce/runonce.rc [new file with mode: 0644]
reactos/base/system/system.rbuild
reactos/baseaddress.rbuild
reactos/boot/bootdata/hivedef_i386.inf
reactos/boot/bootdata/hivesft_i386.inf
reactos/boot/bootdata/hivesys_i386.inf
reactos/boot/freeldr/freeldr/arch/i386/xboxhw.c
reactos/boot/freeldr/freeldr/fs/ntfs.c
reactos/boot/freeldr/freeldr/include/arch.h
reactos/boot/freeldr/freeldr/include/arch/i386/machxbox.h
reactos/boot/freeldr/freeldr/reactos/setupldr.c
reactos/dll/3rdparty/libxslt/ChangeLog
reactos/dll/3rdparty/libxslt/Makefile.am
reactos/dll/3rdparty/libxslt/Makefile.in
reactos/dll/3rdparty/libxslt/attributes.c
reactos/dll/3rdparty/libxslt/attrvt.c
reactos/dll/3rdparty/libxslt/extensions.c
reactos/dll/3rdparty/libxslt/extensions.h
reactos/dll/3rdparty/libxslt/extra.c
reactos/dll/3rdparty/libxslt/functions.c
reactos/dll/3rdparty/libxslt/imports.c
reactos/dll/3rdparty/libxslt/keys.c
reactos/dll/3rdparty/libxslt/libxslt.h
reactos/dll/3rdparty/libxslt/libxslt.rbuild
reactos/dll/3rdparty/libxslt/namespaces.c
reactos/dll/3rdparty/libxslt/pattern.c
reactos/dll/3rdparty/libxslt/preproc.c
reactos/dll/3rdparty/libxslt/security.c
reactos/dll/3rdparty/libxslt/templates.c
reactos/dll/3rdparty/libxslt/transform.c
reactos/dll/3rdparty/libxslt/transform.h
reactos/dll/3rdparty/libxslt/trio.h
reactos/dll/3rdparty/libxslt/triodef.h
reactos/dll/3rdparty/libxslt/variables.c
reactos/dll/3rdparty/libxslt/xslt.c
reactos/dll/3rdparty/libxslt/xsltInternals.h
reactos/dll/3rdparty/libxslt/xsltconfig.h
reactos/dll/3rdparty/libxslt/xsltconfig.h.in
reactos/dll/3rdparty/libxslt/xsltlocale.c [new file with mode: 0644]
reactos/dll/3rdparty/libxslt/xsltlocale.h [new file with mode: 0644]
reactos/dll/3rdparty/libxslt/xsltutils.c
reactos/dll/3rdparty/libxslt/xsltwin32config.h
reactos/dll/cpl/main/mouse.c
reactos/dll/cpl/mmsys/mmsys.c
reactos/dll/directx/ddraw/Ddraw/ddraw_main.c
reactos/dll/directx/ddraw/Surface/callbacks_surf_hel.c
reactos/dll/directx/ddraw/Surface/createsurface.c
reactos/dll/directx/ddraw/Surface/surface_main.c
reactos/dll/directx/ddraw/rosdraw.h
reactos/dll/directx/ddraw/startup.c
reactos/dll/ntdll/dispatch/arm/stubs_asm.s
reactos/dll/ntdll/rtl/libsupp.c
reactos/dll/win32/atl/atlbase.h
reactos/dll/win32/cabinet/fdi.c
reactos/dll/win32/gdi32/objects/font.c
reactos/dll/win32/iphlpapi/iphlpapi_main.c
reactos/dll/win32/iphlpapi/iphlpapi_private.h
reactos/dll/win32/iphlpapi/ipstats_reactos.c
reactos/dll/win32/iphlpapi/route_reactos.c
reactos/dll/win32/jscript/activex.c [new file with mode: 0644]
reactos/dll/win32/jscript/array.c
reactos/dll/win32/jscript/bool.c
reactos/dll/win32/jscript/date.c
reactos/dll/win32/jscript/dispex.c
reactos/dll/win32/jscript/engine.c
reactos/dll/win32/jscript/engine.h
reactos/dll/win32/jscript/error.c
reactos/dll/win32/jscript/function.c
reactos/dll/win32/jscript/global.c
reactos/dll/win32/jscript/jscript.c
reactos/dll/win32/jscript/jscript.h
reactos/dll/win32/jscript/jscript.rbuild
reactos/dll/win32/jscript/jscript_De.rc
reactos/dll/win32/jscript/jscript_En.rc
reactos/dll/win32/jscript/jscript_Fr.rc
reactos/dll/win32/jscript/jscript_Lt.rc
reactos/dll/win32/jscript/jscript_Nl.rc
reactos/dll/win32/jscript/jscript_main.c
reactos/dll/win32/jscript/jsutils.c
reactos/dll/win32/jscript/lex.c
reactos/dll/win32/jscript/math.c
reactos/dll/win32/jscript/number.c
reactos/dll/win32/jscript/object.c
reactos/dll/win32/jscript/parser.tab.c
reactos/dll/win32/jscript/parser.tab.h
reactos/dll/win32/jscript/parser.y
reactos/dll/win32/jscript/regexp.c
reactos/dll/win32/jscript/resource.h
reactos/dll/win32/jscript/string.c
reactos/dll/win32/kernel32/except/except.c
reactos/dll/win32/kernel32/misc/atom.c
reactos/dll/win32/kernel32/misc/lang.c
reactos/dll/win32/kernel32/misc/profile.c
reactos/dll/win32/mapi32/mapi32.rbuild
reactos/dll/win32/mapi32/mapi32.spec
reactos/dll/win32/mapi32/mapi32_main.c
reactos/dll/win32/mapi32/sendmail.c
reactos/dll/win32/mapi32/util.c
reactos/dll/win32/mapi32/util.h [new file with mode: 0644]
reactos/dll/win32/mapi32/version.rc
reactos/dll/win32/mmdrv/mmdrv.h
reactos/dll/win32/msgina/msgina.c
reactos/dll/win32/msgina/msgina.h
reactos/dll/win32/mshtml/dispex.c
reactos/dll/win32/mshtml/editor.c
reactos/dll/win32/mshtml/htmlanchor.c
reactos/dll/win32/mshtml/htmlbody.c
reactos/dll/win32/mshtml/htmlcomment.c
reactos/dll/win32/mshtml/htmlcurstyle.c
reactos/dll/win32/mshtml/htmldoc.c
reactos/dll/win32/mshtml/htmldoc3.c
reactos/dll/win32/mshtml/htmldoc5.c
reactos/dll/win32/mshtml/htmlelem.c
reactos/dll/win32/mshtml/htmlelem2.c
reactos/dll/win32/mshtml/htmlelemcol.c
reactos/dll/win32/mshtml/htmlevent.c
reactos/dll/win32/mshtml/htmlevent.h
reactos/dll/win32/mshtml/htmlgeneric.c
reactos/dll/win32/mshtml/htmliframe.c
reactos/dll/win32/mshtml/htmlimg.c
reactos/dll/win32/mshtml/htmlinput.c
reactos/dll/win32/mshtml/htmllocation.c
reactos/dll/win32/mshtml/htmlnode.c
reactos/dll/win32/mshtml/htmloption.c
reactos/dll/win32/mshtml/htmlscript.c
reactos/dll/win32/mshtml/htmlselect.c
reactos/dll/win32/mshtml/htmlstyle.c
reactos/dll/win32/mshtml/htmlstyle.h
reactos/dll/win32/mshtml/htmltable.c
reactos/dll/win32/mshtml/htmltablerow.c
reactos/dll/win32/mshtml/htmltextarea.c
reactos/dll/win32/mshtml/htmltextcont.c
reactos/dll/win32/mshtml/htmltextnode.c
reactos/dll/win32/mshtml/htmlwindow.c
reactos/dll/win32/mshtml/mshtml.rbuild
reactos/dll/win32/mshtml/mshtml_private.h
reactos/dll/win32/mshtml/mutation.c
reactos/dll/win32/mshtml/navigate.c
reactos/dll/win32/mshtml/nsembed.c
reactos/dll/win32/mshtml/nsevents.c
reactos/dll/win32/mshtml/nsiface.idl
reactos/dll/win32/mshtml/nsio.c
reactos/dll/win32/mshtml/olecmd.c
reactos/dll/win32/mshtml/oleobj.c
reactos/dll/win32/mshtml/olewnd.c
reactos/dll/win32/mshtml/persist.c
reactos/dll/win32/mshtml/protocol.c
reactos/dll/win32/mshtml/script.c
reactos/dll/win32/mshtml/secmgr.c [new file with mode: 0644]
reactos/dll/win32/mshtml/selection.c
reactos/dll/win32/mshtml/service.c
reactos/dll/win32/mshtml/task.c
reactos/dll/win32/mshtml/txtrange.c
reactos/dll/win32/mshtml/view.c
reactos/dll/win32/msi/action.c
reactos/dll/win32/msi/appsearch.c
reactos/dll/win32/msi/classes.c
reactos/dll/win32/msi/cond.tab.c
reactos/dll/win32/msi/cond.tab.h
reactos/dll/win32/msi/cond.y
reactos/dll/win32/msi/custom.c
reactos/dll/win32/msi/database.c
reactos/dll/win32/msi/dialog.c
reactos/dll/win32/msi/events.c
reactos/dll/win32/msi/files.c
reactos/dll/win32/msi/helpers.c
reactos/dll/win32/msi/media.c
reactos/dll/win32/msi/msi.c
reactos/dll/win32/msi/msi_De.rc
reactos/dll/win32/msi/msipriv.h
reactos/dll/win32/msi/msiquery.c
reactos/dll/win32/msi/package.c
reactos/dll/win32/msi/preview.c
reactos/dll/win32/msi/registry.c
reactos/dll/win32/msi/source.c
reactos/dll/win32/msi/string.c
reactos/dll/win32/msi/suminfo.c
reactos/dll/win32/msi/table.c
reactos/dll/win32/msi/upgrade.c
reactos/dll/win32/msxml3/attribute.c
reactos/dll/win32/msxml3/cdata.c
reactos/dll/win32/msxml3/comment.c
reactos/dll/win32/msxml3/docfrag.c
reactos/dll/win32/msxml3/domdoc.c
reactos/dll/win32/msxml3/element.c
reactos/dll/win32/msxml3/entityref.c
reactos/dll/win32/msxml3/msxml_private.h
reactos/dll/win32/msxml3/node.c
reactos/dll/win32/msxml3/pi.c
reactos/dll/win32/msxml3/text.c
reactos/dll/win32/netapi32/access.c
reactos/dll/win32/netapi32/nbt.c
reactos/dll/win32/netapi32/netapi32.c
reactos/dll/win32/netapi32/netapi32.spec
reactos/dll/win32/netapi32/share.c
reactos/dll/win32/rpcrt4/ndr_es.c
reactos/dll/win32/rpcrt4/ndr_marshall.c
reactos/dll/win32/rpcrt4/rpcrt4.spec
reactos/dll/win32/rsaenh/rsaenh.c
reactos/dll/win32/shell32/shelllink.c
reactos/dll/win32/shell32/shv_def_cmenu.c
reactos/dll/win32/syssetup/lang/ru-RU.rc
reactos/dll/win32/urlmon/bindctx.c
reactos/dll/win32/urlmon/binding.c
reactos/dll/win32/urlmon/bindprot.c
reactos/dll/win32/urlmon/ftp.c
reactos/dll/win32/urlmon/gopher.c
reactos/dll/win32/urlmon/http.c
reactos/dll/win32/urlmon/protocol.c
reactos/dll/win32/urlmon/rsrc.rc
reactos/dll/win32/urlmon/sec_mgr.c
reactos/dll/win32/urlmon/session.c
reactos/dll/win32/urlmon/urlmon.inf
reactos/dll/win32/urlmon/urlmon_main.c
reactos/dll/win32/urlmon/urlmon_main.h
reactos/dll/win32/user32/windows/font.c
reactos/dll/win32/user32/windows/menu.c
reactos/dll/win32/wdmaud.drv/wdmaud.c
reactos/dll/win32/wininet/ftp.c
reactos/dll/win32/winmm/driver.c
reactos/dll/win32/winmm/joystick.c
reactos/dll/win32/winmm/lolvldrv.c
reactos/dll/win32/winmm/mci.c
reactos/dll/win32/winmm/message16.c [deleted file]
reactos/dll/win32/winmm/mmio.c
reactos/dll/win32/winmm/mmsystem.c [deleted file]
reactos/dll/win32/winmm/mmsystem.spec [deleted file]
reactos/dll/win32/winmm/playsound.c
reactos/dll/win32/winmm/sound.spec [deleted file]
reactos/dll/win32/winmm/sound16.c [deleted file]
reactos/dll/win32/winmm/time.c
reactos/dll/win32/winmm/winemm.h
reactos/dll/win32/winmm/winmm.c
reactos/dll/win32/winmm/winmm.rbuild
reactos/dll/win32/winmm/winmm.spec
reactos/dll/win32/wintrust/asn.c
reactos/dll/win32/wintrust/softpub.c
reactos/dll/win32/wintrust/wintrust.spec
reactos/drivers/filesystems/fastfat/fcb.c
reactos/drivers/filesystems/fastfat/vfat.h
reactos/drivers/filesystems/fastfat_new/blockdev.c [deleted file]
reactos/drivers/filesystems/fastfat_new/cleanup.c
reactos/drivers/filesystems/fastfat_new/close.c
reactos/drivers/filesystems/fastfat_new/create.c
reactos/drivers/filesystems/fastfat_new/device.c
reactos/drivers/filesystems/fastfat_new/dir.c
reactos/drivers/filesystems/fastfat_new/direntry.c [deleted file]
reactos/drivers/filesystems/fastfat_new/ea.c
reactos/drivers/filesystems/fastfat_new/fastfat.c
reactos/drivers/filesystems/fastfat_new/fastfat.h
reactos/drivers/filesystems/fastfat_new/fastfat.rbuild
reactos/drivers/filesystems/fastfat_new/fastio.c
reactos/drivers/filesystems/fastfat_new/fat.c
reactos/drivers/filesystems/fastfat_new/fatstruc.h
reactos/drivers/filesystems/fastfat_new/fcb.c
reactos/drivers/filesystems/fastfat_new/finfo.c
reactos/drivers/filesystems/fastfat_new/flush.c
reactos/drivers/filesystems/fastfat_new/fsctl.c
reactos/drivers/filesystems/fastfat_new/fullfat.c
reactos/drivers/filesystems/fastfat_new/lock.c
reactos/drivers/filesystems/fastfat_new/rw.c
reactos/drivers/filesystems/fastfat_new/shutdown.c
reactos/drivers/filesystems/fastfat_new/volume.c
reactos/drivers/network/afd/include/debug.h
reactos/drivers/network/dd/ne2000/include/debug.h
reactos/drivers/network/dd/ne2000/include/ne2000.h
reactos/drivers/network/dd/ne2000/ne2000/8390.c
reactos/drivers/network/dd/ne2000/ne2000/main.c
reactos/drivers/network/dd/pcnet/pcnet.c
reactos/drivers/network/dd/pcnet/pcnet.h
reactos/drivers/network/lan/include/debug.h
reactos/drivers/network/ndis/ndis/protocol.c
reactos/drivers/network/tcpip/include/checksum.h
reactos/drivers/network/tcpip/include/info.h
reactos/drivers/network/tcpip/tcpip/iinfo.c
reactos/drivers/network/tcpip/tcpip/info.c
reactos/drivers/network/tcpip/tcpip/ninfo.c
reactos/drivers/usb/nt4compat/usbdriver/ehci.c
reactos/drivers/usb/nt4compat/usbdriver/ohci.c
reactos/drivers/usb/nt4compat/usbdriver/uhci.c
reactos/drivers/wdm/audio/backpln/portcls/adapter.cpp
reactos/drivers/wdm/audio/backpln/portcls/api.cpp
reactos/drivers/wdm/audio/backpln/portcls/dma_slave.cpp
reactos/drivers/wdm/audio/backpln/portcls/drm_port.cpp
reactos/drivers/wdm/audio/backpln/portcls/filter_dmus.cpp
reactos/drivers/wdm/audio/backpln/portcls/filter_topology.cpp
reactos/drivers/wdm/audio/backpln/portcls/filter_wavecyclic.cpp
reactos/drivers/wdm/audio/backpln/portcls/filter_wavepci.cpp
reactos/drivers/wdm/audio/backpln/portcls/filter_wavert.cpp
reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp
reactos/drivers/wdm/audio/backpln/portcls/interrupt.cpp
reactos/drivers/wdm/audio/backpln/portcls/irp.cpp
reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp
reactos/drivers/wdm/audio/backpln/portcls/pin_dmus.cpp
reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp
reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp
reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.cpp
reactos/drivers/wdm/audio/backpln/portcls/port.cpp
reactos/drivers/wdm/audio/backpln/portcls/port_dmus.cpp
reactos/drivers/wdm/audio/backpln/portcls/port_topology.cpp
reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.cpp
reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.cpp
reactos/drivers/wdm/audio/backpln/portcls/port_wavert.cpp
reactos/drivers/wdm/audio/backpln/portcls/port_wavertstream.cpp
reactos/drivers/wdm/audio/backpln/portcls/power.cpp
reactos/drivers/wdm/audio/backpln/portcls/propertyhandler.cpp
reactos/drivers/wdm/audio/backpln/portcls/purecall.cpp
reactos/drivers/wdm/audio/backpln/portcls/registry.cpp
reactos/drivers/wdm/audio/backpln/portcls/resource.cpp
reactos/drivers/wdm/audio/backpln/portcls/service_group.cpp
reactos/drivers/wdm/audio/backpln/portcls/undoc.cpp
reactos/drivers/wdm/audio/backpln/portcls/unregister.cpp
reactos/drivers/wdm/audio/legacy/wdmaud/control.c
reactos/hal/halarm/generic/hal.c
reactos/hal/halppc/generic/bus.c
reactos/hal/halppc/generic/irql.c
reactos/hal/halppc/generic/profil.c
reactos/hal/halppc/include/haldma.h
reactos/hal/halx86/generic/bios.c
reactos/hal/halx86/generic/profil.c
reactos/hal/halx86/include/haldma.h
reactos/hal/halx86/mp/apic.c
reactos/hal/halx86/mp/mpconfig.c
reactos/include/crt/mingw32/intrin_arm.h
reactos/include/ddk/usb200.h
reactos/include/ddk/winddk.h
reactos/include/ndk/i386/asm.h
reactos/include/ndk/i386/ketypes.h
reactos/include/ndk/rtlfuncs.h
reactos/include/psdk/activdbg.idl
reactos/include/psdk/basetsd.h
reactos/include/psdk/cvconst.h
reactos/include/psdk/lmshare.h
reactos/include/psdk/mapidefs.h
reactos/include/psdk/mapitags.h
reactos/include/psdk/mmddk.h
reactos/include/psdk/mmsystem.h
reactos/include/psdk/mshtmdid.h
reactos/include/psdk/mshtml.idl
reactos/include/psdk/urlmon.idl
reactos/include/psdk/wincrypt.h
reactos/include/psdk/winnls.h
reactos/include/psdk/winuser.h
reactos/include/reactos/libs/libxml/Makefile.in
reactos/include/reactos/libs/libxml/c14n.h
reactos/include/reactos/libs/libxml/globals.h
reactos/include/reactos/libs/libxml/parser.h
reactos/include/reactos/libs/libxml/relaxng.h
reactos/include/reactos/libs/libxml/valid.h
reactos/include/reactos/libs/libxml/xinclude.h
reactos/include/reactos/libs/libxml/xmlerror.h
reactos/include/reactos/libs/libxml/xmlexports.h
reactos/include/reactos/libs/libxml/xmlmemory.h
reactos/include/reactos/libs/libxml/xmlschemas.h
reactos/include/reactos/libs/libxml/xmlstring.h
reactos/include/reactos/libs/libxml/xmlversion.h
reactos/include/reactos/libs/libxml/xmlversion.h.in
reactos/include/reactos/libs/libxml/xmlwriter.h
reactos/include/reactos/libs/libxslt/extensions.h
reactos/include/reactos/libs/libxslt/libxslt.h
reactos/include/reactos/libs/libxslt/xsltconfig.h
reactos/include/reactos/libs/libxslt/xsltlocale.h [new file with mode: 0644]
reactos/include/reactos/win32k/ntgdityp.h
reactos/include/reactos/windbgkd.h
reactos/lib/3rdparty/adns/src/internal.h
reactos/lib/3rdparty/libxml2/ChangeLog
reactos/lib/3rdparty/libxml2/HTMLparser.c
reactos/lib/3rdparty/libxml2/HTMLtree.c
reactos/lib/3rdparty/libxml2/INSTALL
reactos/lib/3rdparty/libxml2/Makefile.am
reactos/lib/3rdparty/libxml2/Makefile.in
reactos/lib/3rdparty/libxml2/NEWS
reactos/lib/3rdparty/libxml2/README
reactos/lib/3rdparty/libxml2/SAX2.c
reactos/lib/3rdparty/libxml2/TODO
reactos/lib/3rdparty/libxml2/aclocal.m4
reactos/lib/3rdparty/libxml2/c14n.c
reactos/lib/3rdparty/libxml2/catalog.c
reactos/lib/3rdparty/libxml2/config.guess
reactos/lib/3rdparty/libxml2/config.h.in
reactos/lib/3rdparty/libxml2/config.sub
reactos/lib/3rdparty/libxml2/configure
reactos/lib/3rdparty/libxml2/configure.in
reactos/lib/3rdparty/libxml2/debugXML.c
reactos/lib/3rdparty/libxml2/depcomp
reactos/lib/3rdparty/libxml2/dict.c
reactos/lib/3rdparty/libxml2/elfgcchack.h
reactos/lib/3rdparty/libxml2/encoding.c
reactos/lib/3rdparty/libxml2/entities.c
reactos/lib/3rdparty/libxml2/error.c
reactos/lib/3rdparty/libxml2/globals.c
reactos/lib/3rdparty/libxml2/hash.c
reactos/lib/3rdparty/libxml2/include/Makefile.in
reactos/lib/3rdparty/libxml2/include/win32config.h
reactos/lib/3rdparty/libxml2/include/wsockcompat.h
reactos/lib/3rdparty/libxml2/libxml.spec.in
reactos/lib/3rdparty/libxml2/libxml2.spec
reactos/lib/3rdparty/libxml2/ltmain.sh
reactos/lib/3rdparty/libxml2/nanoftp.c
reactos/lib/3rdparty/libxml2/nanohttp.c
reactos/lib/3rdparty/libxml2/parser.c
reactos/lib/3rdparty/libxml2/parserInternals.c
reactos/lib/3rdparty/libxml2/relaxng.c
reactos/lib/3rdparty/libxml2/runsuite.c
reactos/lib/3rdparty/libxml2/runtest.c
reactos/lib/3rdparty/libxml2/schematron.c
reactos/lib/3rdparty/libxml2/testC14N.c
reactos/lib/3rdparty/libxml2/testapi.c
reactos/lib/3rdparty/libxml2/threads.c
reactos/lib/3rdparty/libxml2/tree.c
reactos/lib/3rdparty/libxml2/trio.c
reactos/lib/3rdparty/libxml2/trio.h
reactos/lib/3rdparty/libxml2/triodef.h
reactos/lib/3rdparty/libxml2/trionan.c
reactos/lib/3rdparty/libxml2/trionan.h
reactos/lib/3rdparty/libxml2/triop.h
reactos/lib/3rdparty/libxml2/triostr.c
reactos/lib/3rdparty/libxml2/triostr.h
reactos/lib/3rdparty/libxml2/uri.c
reactos/lib/3rdparty/libxml2/valid.c
reactos/lib/3rdparty/libxml2/xinclude.c
reactos/lib/3rdparty/libxml2/xmlIO.c
reactos/lib/3rdparty/libxml2/xmlcatalog.c
reactos/lib/3rdparty/libxml2/xmllint.c
reactos/lib/3rdparty/libxml2/xmlmemory.c
reactos/lib/3rdparty/libxml2/xmlreader.c
reactos/lib/3rdparty/libxml2/xmlregexp.c
reactos/lib/3rdparty/libxml2/xmlsave.c
reactos/lib/3rdparty/libxml2/xmlschemas.c
reactos/lib/3rdparty/libxml2/xmlschemastypes.c
reactos/lib/3rdparty/libxml2/xmlstring.c
reactos/lib/3rdparty/libxml2/xmlwriter.c
reactos/lib/3rdparty/libxml2/xpath.c
reactos/lib/3rdparty/libxml2/xpointer.c
reactos/lib/3rdparty/mingw/mingw_helpers.c
reactos/lib/atl/atl.rbuild [new file with mode: 0644]
reactos/lib/atl/atlbase.cpp [new file with mode: 0644]
reactos/lib/atl/atlbase.h [new file with mode: 0644]
reactos/lib/atl/atlcom.h [new file with mode: 0644]
reactos/lib/atl/atlcore.cpp [new file with mode: 0644]
reactos/lib/atl/atlcore.h [new file with mode: 0644]
reactos/lib/atl/atlwin.h [new file with mode: 0644]
reactos/lib/atl/statreg.h [new file with mode: 0644]
reactos/lib/drivers/ip/network/arp.c
reactos/lib/drivers/ip/network/checksum.c
reactos/lib/drivers/ip/network/routines.c
reactos/lib/drivers/ip/transport/udp/udp.c
reactos/lib/drivers/oskittcp/include/oskitdebug.h
reactos/lib/lib.rbuild
reactos/lib/rtl/assert.c [new file with mode: 0644]
reactos/lib/rtl/debug.c
reactos/lib/rtl/error.c
reactos/lib/rtl/exception.c
reactos/lib/rtl/heap.c
reactos/lib/rtl/i386/except.c
reactos/lib/rtl/i386/except_asm.s
reactos/lib/rtl/powerpc/debug.c
reactos/lib/rtl/powerpc/except.c
reactos/lib/rtl/rangelist.c
reactos/lib/rtl/rtl.rbuild
reactos/lib/rtl/rtlp.h
reactos/lib/rtl/time.c
reactos/media/doc/3rd Party Files.txt
reactos/media/doc/README.WINE
reactos/ntoskrnl/config/cmdata.c
reactos/ntoskrnl/config/cmdelay.c
reactos/ntoskrnl/config/cmkcbncb.c
reactos/ntoskrnl/config/cmsysini.c
reactos/ntoskrnl/ex/init.c
reactos/ntoskrnl/include/internal/ex.h
reactos/ntoskrnl/include/internal/kd.h
reactos/ntoskrnl/include/internal/kd64.h
reactos/ntoskrnl/include/internal/ke.h
reactos/ntoskrnl/include/internal/mm.h
reactos/ntoskrnl/io/iomgr/driver.c
reactos/ntoskrnl/io/iomgr/file.c
reactos/ntoskrnl/io/iomgr/iomdl.c
reactos/ntoskrnl/io/iomgr/irp.c
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
reactos/ntoskrnl/kd/kdmain.c
reactos/ntoskrnl/kd64/amd64/kdsup.c
reactos/ntoskrnl/kd64/arm/kdsup.c
reactos/ntoskrnl/kd64/i386/kdsup.c
reactos/ntoskrnl/kd64/kdapi.c
reactos/ntoskrnl/kd64/kdbreak.c
reactos/ntoskrnl/kd64/kddata.c
reactos/ntoskrnl/kd64/kdinit.c
reactos/ntoskrnl/kd64/kdprint.c
reactos/ntoskrnl/kd64/kdtrap.c
reactos/ntoskrnl/kdbg/kdb_cli.c
reactos/ntoskrnl/ke/arm/stubs_asm.s
reactos/ntoskrnl/ke/bug.c
reactos/ntoskrnl/ke/i386/exp.c
reactos/ntoskrnl/ke/i386/trap.s
reactos/ntoskrnl/ke/powerpc/exp.c
reactos/ntoskrnl/ke/powerpc/kiinit.c
reactos/ntoskrnl/ke/timerobj.c
reactos/ntoskrnl/lpc/reply.c
reactos/ntoskrnl/lpc/send.c
reactos/ntoskrnl/mm/ARM3/contmem.c
reactos/ntoskrnl/mm/ARM3/drvmgmt.c
reactos/ntoskrnl/mm/ARM3/iosup.c
reactos/ntoskrnl/mm/ARM3/mdlsup.c
reactos/ntoskrnl/mm/i386/pagepae.c
reactos/ntoskrnl/mm/mminit.c
reactos/ntoskrnl/mm/ppool.c
reactos/ntoskrnl/mm/sysldr.c
reactos/ntoskrnl/rtl/libsupp.c
reactos/subsystems/win32/win32k/include/sysparams.h
reactos/subsystems/win32/win32k/ntuser/accelerator.c
reactos/subsystems/win32/win32k/objects/coord.c
reactos/tools/widl/header.c
reactos/tools/widl/typegen.c
reactos/tools/widl/widl.c
reactos/tools/widl/widl.h

index 10828e0..d159169 100644 (file)
@@ -1,13 +1,12 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 2, June 1991
 
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-                       51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
-                           Preamble
+                            Preamble
 
   The licenses for most software are designed to take away your
 freedom to share and change it.  By contrast, the GNU General Public
@@ -16,7 +15,7 @@ software--to make sure the software is free for all its users.  This
 General Public License applies to most of the Free Software
 Foundation's software and to any other program whose authors commit to
 using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
+the GNU Lesser General Public License instead.)  You can apply it to
 your programs, too.
 
   When we speak of free software, we are referring to freedom, not
@@ -56,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
 
   The precise terms and conditions for copying, distribution and
 modification follow.
-\f
-                   GNU GENERAL PUBLIC LICENSE
+
+                    GNU GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. This License applies to any program or other work which contains
@@ -111,7 +110,7 @@ above, provided that you also meet all of these conditions:
     License.  (Exception: if the Program itself is interactive but
     does not normally print such an announcement, your work based on
     the Program is not required to print an announcement.)
-\f
+
 These requirements apply to the modified work as a whole.  If
 identifiable sections of that work are not derived from the Program,
 and can be reasonably considered independent and separate works in
@@ -169,7 +168,7 @@ access to copy from a designated place, then offering equivalent
 access to copy the source code from the same place counts as
 distribution of the source code, even though third parties are not
 compelled to copy the source along with the object code.
-\f
+
   4. You may not copy, modify, sublicense, or distribute the Program
 except as expressly provided under this License.  Any attempt
 otherwise to copy, modify, sublicense or distribute the Program is
@@ -226,7 +225,7 @@ impose that choice.
 
 This section is intended to make thoroughly clear what is believed to
 be a consequence of the rest of this License.
-\f
+
   8. If the distribution and/or use of the Program is restricted in
 certain countries either by patents or by copyrighted interfaces, the
 original copyright holder who places the Program under this License
@@ -256,7 +255,7 @@ make exceptions for this.  Our decision will be guided by the two goals
 of preserving the free status of all derivatives of our free software and
 of promoting the sharing and reuse of software generally.
 
-                           NO WARRANTY
+                            NO WARRANTY
 
   11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
@@ -278,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 POSSIBILITY OF SUCH DAMAGES.
 
-                    END OF TERMS AND CONDITIONS
-\f
-           How to Apply These Terms to Your New Programs
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
 
   If you develop a new program, and you want it to be of the greatest
 possible use to the public, the best way to achieve this is to make it
@@ -304,10 +303,9 @@ the "copyright" line and a pointer to where the full notice is found.
     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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-
+    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.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -337,5 +335,5 @@ necessary.  Here is a sample; alter the names:
 This General Public License does not permit incorporating your program into
 proprietary programs.  If your program is a subroutine library, you may
 consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
+library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.
similarity index 98%
rename from reactos/LGPL.txt
rename to reactos/COPYING.LIB
index 8add30a..67870f6 100644 (file)
@@ -1,8 +1,8 @@
-                 GNU LESSER GENERAL PUBLIC LICENSE
-                      Version 2.1, February 1999
+                  GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 2.1, February 1999
 
  Copyright (C) 1991, 1999 Free Software Foundation, Inc.
    51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -10,7 +10,7 @@
  as the successor of the GNU Library Public License, version 2, hence
  the version number 2.1.]
 
-                           Preamble
+                            Preamble
 
   The licenses for most software are designed to take away your
 freedom to share and change it.  By contrast, the GNU General Public
@@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know
 that what they have is not the original version, so that the original
 author's reputation will not be affected by problems that might be
 introduced by others.
-\f
+
   Finally, software patents pose a constant threat to the existence of
 any free program.  We wish to make sure that a company cannot
 effectively restrict the users of a free program by obtaining a
@@ -111,8 +111,8 @@ modification follow.  Pay close attention to the difference between a
 "work based on the library" and a "work that uses the library".  The
 former contains code derived from the library, whereas the latter must
 be combined with the library in order to run.
-\f
-                 GNU LESSER GENERAL PUBLIC LICENSE
+
+                  GNU LESSER GENERAL PUBLIC LICENSE
    TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
   0. This License Agreement applies to any software library or other
@@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based
 on the Library (independent of the use of the Library in a tool for
 writing it).  Whether that is true depends on what the Library does
 and what the program that uses the Library does.
-  
+
   1. You may copy and distribute verbatim copies of the Library's
 complete source code as you receive it, in any medium, provided that
 you conspicuously and appropriately publish on each copy an
@@ -158,7 +158,7 @@ Library.
   You may charge a fee for the physical act of transferring a copy,
 and you may at your option offer warranty protection in exchange for a
 fee.
-\f
+
   2. You may modify your copy or copies of the Library or any portion
 of it, thus forming a work based on the Library, and copy and
 distribute such modifications or work under the terms of Section 1
@@ -216,7 +216,7 @@ instead of to this License.  (If a newer version than version 2 of the
 ordinary GNU General Public License has appeared, then you can specify
 that version instead if you wish.)  Do not make any other change in
 these notices.
-\f
+
   Once this change is made in a given copy, it is irreversible for
 that copy, so the ordinary GNU General Public License applies to all
 subsequent copies and derivative works made from that copy.
@@ -267,7 +267,7 @@ Library will still fall under Section 6.)
 distribute the object code for the work under the terms of Section 6.
 Any executables containing that work also fall under Section 6,
 whether or not they are linked directly with the Library itself.
-\f
+
   6. As an exception to the Sections above, you may also combine or
 link a "work that uses the Library" with the Library to produce a
 work containing portions of the Library, and distribute that work
@@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally
 accompany the operating system.  Such a contradiction means you cannot
 use both them and the Library together in an executable that you
 distribute.
-\f
+
   7. You may place library facilities that are a work based on the
 Library side-by-side in a single library together with other library
 facilities not covered by this License, and distribute such a combined
@@ -370,7 +370,7 @@ subject to these terms and conditions.  You may not impose any further
 restrictions on the recipients' exercise of the rights granted herein.
 You are not responsible for enforcing compliance by third parties with
 this License.
-\f
+
   11. If, as a consequence of a court judgment or allegation of patent
 infringement or for any other reason (not limited to patent issues),
 conditions are imposed on you (whether by court order, agreement or
@@ -422,7 +422,7 @@ conditions either of that version or of any later version published by
 the Free Software Foundation.  If the Library does not specify a
 license version number, you may choose any version ever published by
 the Free Software Foundation.
-\f
+
   14. If you wish to incorporate parts of the Library into other free
 programs whose distribution conditions are incompatible with these,
 write to the author to ask for permission.  For software which is
@@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status
 of all derivatives of our free software and of promoting the sharing
 and reuse of software generally.
 
-                           NO WARRANTY
+                            NO WARRANTY
 
   15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
 WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
@@ -455,8 +455,8 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 DAMAGES.
 
-                    END OF TERMS AND CONDITIONS
-\f
+                     END OF TERMS AND CONDITIONS
+
            How to Apply These Terms to Your New Libraries
 
   If you develop a new library, and you want it to be of the greatest
@@ -485,7 +485,7 @@ convey the exclusion of warranty; and each file should have at least the
 
     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
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
 Also add information on how to contact you by electronic and paper mail.
 
index 7b1388b..86d3a2d 100644 (file)
@@ -91,7 +91,6 @@
                <compilerflag compiler="cxx">-Wno-non-virtual-dtor</compilerflag>
                <compilerflag compiler="cc,cxx">-gstabs+</compilerflag>
                <compilerflag compiler="as">-gstabs+</compilerflag>
-               <compilerflag compiler="midl">-m32 --win32</compilerflag>
        </group>
 
        <group compilerset="msc">
index 5567697..6f295ee 100644 (file)
@@ -25,6 +25,7 @@
                        <compilerflag>-momit-leaf-frame-pointer</compilerflag>
                </if>
                <compilerflag>-mpreferred-stack-boundary=2</compilerflag>
+               <compilerflag compiler="midl">-m32 --win32</compilerflag>
        </group>
 
        <group linkerset="ld">
index 747856b..23f964d 100644 (file)
@@ -19,6 +19,9 @@
        <directory name="more">
                <xi:include href="more/more.rbuild" />
        </directory>
+       <directory name="reg">
+               <xi:include href="reg/reg.rbuild" />
+       </directory>
        <directory name="xcopy">
                <xi:include href="xcopy/xcopy.rbuild" />
        </directory>
diff --git a/reactos/base/applications/cmdutils/reg/Da.rc b/reactos/base/applications/cmdutils/reg/Da.rc
new file mode 100644 (file)
index 0000000..353b94d
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * REG.EXE - Wine-compatible reg program.
+ * Danish language support
+ *
+ * Copyright 2008 Jens Albretsen <jens@albretsen.dk>
+ *
+ * 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 "reg.h"
+
+LANGUAGE LANG_DANISH, SUBLANG_DEFAULT
+
+STRINGTABLE
+{
+    STRING_USAGE, "Syntaksen for dette kommando er:\n\nREG [ ADD | DELETE | QUERY ]\nREG kommando /?\n"
+    STRING_ADD_USAGE, "REG ADD nøgle_navn [/v værdi | /ve] [/t type] [/s separator] [/d data] [/f]\n"
+    STRING_DELETE_USAGE, "REG DELETE nøgle_navn [/v værdi | /ve | /va] [/f]\n"
+    STRING_QUERY_USAGE, "REG QUERY nøgle_navn [/v værdi | /ve] [/s]\n"
+}
diff --git a/reactos/base/applications/cmdutils/reg/De.rc b/reactos/base/applications/cmdutils/reg/De.rc
new file mode 100644 (file)
index 0000000..0940640
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * REG.EXE - Wine-compatible reg program.
+ * German language support
+ *
+ * Copyright 2008 Andrej Sinicyn
+ * Copyright 2009 Michael Stefaniuc
+ *
+ * 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 "reg.h"
+
+LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
+
+#pragma code_page(65001)
+
+STRINGTABLE
+{
+    STRING_USAGE, "Die Syntax von diesem Befehl ist:\n\nREG [ ADD | DELETE | QUERY ]\nREG Befehl /?\n"
+    STRING_ADD_USAGE, "REG ADD Schlüssel [/v Wert | /ve] [/t Typ] [/s Trenner] [/d Daten] [/f]\n"
+    STRING_DELETE_USAGE, "REG DELETE Schlüssel [/v Wert | /ve | /va] [/f]\n"
+    STRING_QUERY_USAGE, "REG QUERY Schlüssel [/v Wert | /ve] [/s]\n"
+    STRING_SUCCESS, "Der Vorgang wurde erfolgreich abgeschlossen\n"
+    STRING_INVALID_KEY, "Fehler: Ungültiger Schlüssel\n"
+    STRING_INVALID_CMDLINE, "Fehler: Ungültige Befehlszeilenargumente\n"
+    STRING_NO_REMOTE, "Fehler: Konnte Schlüssel nicht zum remote Rechner hinzufügen\n"
+    STRING_CANNOT_FIND, "Fehler: Der angegebene Schlüssel oder Wert konnte nicht gefunden werden\n"
+}
diff --git a/reactos/base/applications/cmdutils/reg/En.rc b/reactos/base/applications/cmdutils/reg/En.rc
new file mode 100644 (file)
index 0000000..10cfa2b
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * REG.EXE - Wine-compatible reg program.
+ * English language support
+ *
+ * Copyright 2008 Andrew Riedi
+ *
+ * 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 "reg.h"
+
+LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
+
+STRINGTABLE
+{
+    STRING_USAGE, "The syntax of this command is:\n\nREG [ ADD | DELETE | QUERY ]\nREG command /?\n"
+    STRING_ADD_USAGE, "REG ADD key_name [/v value_name | /ve] [/t type] [/s separator] [/d data] [/f]\n"
+    STRING_DELETE_USAGE, "REG DELETE key_name [/v value_name | /ve | /va] [/f]\n"
+    STRING_QUERY_USAGE, "REG QUERY key_name [/v value_name | /ve] [/s]\n"
+    STRING_SUCCESS, "The operation completed successfully\n"
+    STRING_INVALID_KEY, "Error: Invalid key name\n"
+    STRING_INVALID_CMDLINE, "Error: Invalid command line parameters\n"
+    STRING_NO_REMOTE, "Error: Unable to add keys to remote machine\n"
+    STRING_CANNOT_FIND, "Error: The system was unable to find the specified registry key or value\n"
+}
diff --git a/reactos/base/applications/cmdutils/reg/Fr.rc b/reactos/base/applications/cmdutils/reg/Fr.rc
new file mode 100644 (file)
index 0000000..1560c13
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * REG.EXE - Wine-compatible reg program.
+ * French language support
+ *
+ * Copyright 2008 Francois Gouget
+ * Copyright 2009 Jonathan Ernst
+ *
+ * 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 "reg.h"
+
+/* UTF-8 */
+#pragma code_page(65001)
+
+LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
+
+STRINGTABLE
+{
+    STRING_USAGE, "La syntaxe de cette commande est :\n\nREG [ ADD | DELETE | QUERY ]\nREG commande /?\n"
+    STRING_ADD_USAGE, "REG ADD nom_de_clé [/v nom_de_valeur | /ve] [/t type] [/s séparateur] [/d données] [/f]\n"
+    STRING_DELETE_USAGE, "REG DELETE nom_de_clé [/v nom_de_valeur | /ve | /va] [/f]\n"
+    STRING_QUERY_USAGE, "REG QUERY nom_de_clé [/v nom_de_valeur | /ve] [/s]\n"
+    STRING_SUCCESS, "L'opération s'est terminée avec succès\n"
+    STRING_INVALID_KEY, "Erreur : nom de clé non valable\n"
+    STRING_INVALID_CMDLINE, "Erreur : paramètre de ligne de commande non valable\n"
+    STRING_NO_REMOTE, "Erreur : impossible d'ajouter des clés à une machine distante\n"
+    STRING_CANNOT_FIND, "Erreur : le système n'a pas pu trouver la clé ou la valeur de registre spécifiée\n"
+}
diff --git a/reactos/base/applications/cmdutils/reg/Ja.rc b/reactos/base/applications/cmdutils/reg/Ja.rc
new file mode 100644 (file)
index 0000000..28ac408
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * REG.EXE - Wine-compatible reg program.
+ * Japanese language support
+ *
+ * Copyright 2008 Andrew Riedi
+ *
+ * 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 "reg.h"
+
+/* UTF-8 */
+#pragma code_page(65001)
+
+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
+
+STRINGTABLE
+{
+    STRING_USAGE, "このコマンドの構文は次のとおりです:\n\nREG [ ADD | DELETE | QUERY ]\nREG コマンド /?\n"
+    STRING_ADD_USAGE, "REG ADD キー名 [/v 値名 | /ve] [/t type] [/s セパレータ] [/d データ] [/f]\n"
+    STRING_DELETE_USAGE, "REG DELETE キー名 [/v 値名 | /ve | /va] [/f]\n"
+    STRING_QUERY_USAGE, "REG QUERY キー名 [/v 値名 | /ve] [/s]\n"
+    STRING_SUCCESS, "操作は正常に完了しました\n"
+    STRING_INVALID_KEY, "エラー: キー名が無効です\n"
+    STRING_INVALID_CMDLINE, "エラー: コマンド ライン引数が無効です\n"
+    STRING_NO_REMOTE, "エラー: リモート マシンにキーを追加できませんでした\n"
+    STRING_CANNOT_FIND, "エラー: システムは指定されたキーまたは値を見つけられませんでした\n"
+}
diff --git a/reactos/base/applications/cmdutils/reg/Ko.rc b/reactos/base/applications/cmdutils/reg/Ko.rc
new file mode 100644 (file)
index 0000000..46efd91
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * REG.EXE - Wine-compatible reg program.
+ * Korean language support
+ *
+ * Copyright 2008 Andrew Riedi
+ * Copyright 2008 YunSong Hwang
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "reg.h"
+
+LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
+
+STRINGTABLE
+{
+    STRING_USAGE, "¸í·É¾î Çü½Ä:\n\nREG [ ADD | DELETE | QUERY ]\nREG ¸í·É¾î /?\n"
+    STRING_ADD_USAGE, "REG ADD °ª [/v °ª | /ve] [/t Çü½Ä] [/s ºÐ¸®±âÈ£] [/d µ¥ÀÌŸ] [/f]\n"
+    STRING_DELETE_USAGE, "REG DELETE Å° À̸§ [/v °ª | /ve | /va] [/f]\n"
+    STRING_QUERY_USAGE, "REG QUERY Å° À̸§ [/v °ª| /ve] [/s]\n"
+    STRING_SUCCESS, "ÀÛ¾÷ÀÌ ¼º°øÀûÀ¸·Î ³¡³µ½À´Ï´Ù\n"
+    STRING_INVALID_KEY, "¿¡·¯: ¿Ã¹Ù¸£Áö ¾ÊÀº Å° À̸§\n"
+    STRING_INVALID_CMDLINE, "¿¡·¯:¿Ã¹Ù¸£Áö ¾ÊÀº ¸í·É¶óÀΠ¸Å°³º¯¼ö\n"
+    STRING_NO_REMOTE, "¿¡·¯: ¿ø°Ý ¸Ó½Å¿¡  Å°¸¦ ´õÇϴ °ÍÀº °¡´ÉÇÏÁö ¾Ê½À´Ï´Ù\n"
+    STRING_CANNOT_FIND, "¿¡·¯: ÀÌ ½Ã½ºÅÛ¿¡¼­ ÁöÁ¤µÈ ·¹Áö½ºÆ®¸® Å°³ª °ªÀ» Ã£À»¼ö ¾ø½À´Ï´Ù\n"
+}
diff --git a/reactos/base/applications/cmdutils/reg/Lt.rc b/reactos/base/applications/cmdutils/reg/Lt.rc
new file mode 100644 (file)
index 0000000..98aea18
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * REG.EXE - Wine-compatible reg program.
+ * Lithuanian language support
+ *
+ * Copyright 2009 Aurimas Fišeras <aurimas@gmail.com>
+ *
+ * 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 "reg.h"
+
+/* UTF-8 */
+#pragma code_page(65001)
+
+LANGUAGE LANG_LITHUANIAN, SUBLANG_NEUTRAL
+
+STRINGTABLE
+{
+    STRING_USAGE, "Šios komandos sintaksė yra:\n\nREG [ ADD | DELETE | QUERY ]\nREG komanda /?\n"
+    STRING_ADD_USAGE, "REG ADD rakto_vardas [/v reikšmės_vardas | /ve] [/t tipas] [/s skirtukas] [/d duomenys] [/f]\n"
+    STRING_DELETE_USAGE, "REG DELETE rakto_vardas [/v reikšmės_vardas | /ve | /va] [/f]\n"
+    STRING_QUERY_USAGE, "REG QUERY rakto_vardas [/v reikšmės_vardas | /ve] [/s]\n"
+    STRING_SUCCESS, "Operacija sėkmingai įvykdyta\n"
+    STRING_INVALID_KEY, "Klaida: Netinkamas rakto vardas\n"
+    STRING_INVALID_CMDLINE, "Klaida: Netinkami komandos eilutės parametrai\n"
+    STRING_NO_REMOTE, "Klaida: Negalima pridėti raktų nuotoliniame kompiuteryje\n"
+    STRING_CANNOT_FIND, "Klaida: Sistemai nepavyko rasti nurodyto registro rakto ar reikšmės\n"
+}
diff --git a/reactos/base/applications/cmdutils/reg/Nl.rc b/reactos/base/applications/cmdutils/reg/Nl.rc
new file mode 100644 (file)
index 0000000..c34e395
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * REG.EXE - Wine-compatible reg program.
+ * Dutch language support
+ *
+ * Copyright 2008 Frans Kool
+ *
+ * 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 "reg.h"
+
+LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
+
+STRINGTABLE
+{
+    STRING_USAGE, "Gebruik van dit commando is:\n\nREG [ ADD | DELETE | QUERY ]\nREG commando /?\n"
+    STRING_ADD_USAGE, "REG ADD sleutel_naam [/v waarde_naam | /ve] [/t type] [/s scheidingsteken] [/d data] [/f]\n"
+    STRING_DELETE_USAGE, "REG DELETE sleutel_naam [/v waarde_naam | /ve | /va] [/f]\n"
+    STRING_QUERY_USAGE, "REG QUERY sleutel_naam [/v waarde_naam | /ve] [/s]\n"
+    STRING_SUCCESS, "De bewerking is succesvol voltooid\n"
+    STRING_INVALID_KEY, "Fout: Foutieve sleutel naam\n"
+    STRING_INVALID_CMDLINE, "Fout: Foutieve commando regel parameters\n"
+    STRING_NO_REMOTE, "Fout: Sleutels konden niet toegevoegd worden aan de remote machine\n"
+    STRING_CANNOT_FIND, "Fout: Het systeem kon de gespecificeerde registry sleutel of waarde niet vinden\n"
+}
diff --git a/reactos/base/applications/cmdutils/reg/No.rc b/reactos/base/applications/cmdutils/reg/No.rc
new file mode 100644 (file)
index 0000000..cc43c39
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * REG.EXE - Wine-compatible reg program.
+ * Norwegian (Bokmål) language support
+ *
+ * Copyright 2008-2009 Alexander N. Sørnes <alex@thehandofagony.com>
+ *
+ * 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 "reg.h"
+
+#pragma code_page(65001)
+
+LANGUAGE LANG_NORWEGIAN, SUBLANG_NORWEGIAN_BOKMAL
+
+STRINGTABLE
+{
+    STRING_USAGE, "Programmer kjøres som følger:\n\nREG [ ADD | DELETE | QUERY ]\nREG kommando /?\n"
+    STRING_ADD_USAGE, "REG ADD nøkkelnavn [/v verdi | /ve] [/t type] [/s separator] [/d data] [/f]\n"
+    STRING_DELETE_USAGE, "REG DELETE nøkkelnavn [/v verdi | /ve | /va] [/f]\n"
+    STRING_QUERY_USAGE, "REG QUERY nøkkelnavn [/v verdi | /ve] [/s]\n"
+    STRING_SUCCESS, "Operasjonen ble utført\n"
+    STRING_INVALID_KEY, "Feil: Ugyldig nøkkelnavn\n"
+    STRING_INVALID_CMDLINE, "Feil: Ugyldige parametere på kommandolinjen\n"
+    STRING_NO_REMOTE, "Feil: Kan ikke legge til nøkler på ekstern maskin\n"
+    STRING_CANNOT_FIND, "Feil: Systemet klarte ikke finne den angitte registernøkkelen eller -verdien\n"
+}
diff --git a/reactos/base/applications/cmdutils/reg/Pl.rc b/reactos/base/applications/cmdutils/reg/Pl.rc
new file mode 100644 (file)
index 0000000..01c4244
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * REG.EXE - Wine-compatible reg program.
+ * Polish language support
+ *
+ * Copyright 2008 Andrew Riedi
+ * Copyright 2008 Mikolaj Zalewski
+ *
+ * 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 "reg.h"
+
+LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
+
+STRINGTABLE
+{
+    STRING_USAGE, "Sk³adnia tego polecenia:\n\nREG [ ADD | DELETE | QUERY ]\nREG polecenie /?\n"
+    STRING_ADD_USAGE, "REG ADD nazwa_klucza [/v nazwa_warto\9cci | /ve] [/t typ] [/s separator] [/d dane] [/f]\n"
+    STRING_DELETE_USAGE, "REG DELETE nazwa_klucza [/v nazwa_warto\9cci | /ve | /va] [/f]\n"
+    STRING_QUERY_USAGE, "REG QUERY nazwa_klucza [/v nazwa_warto\9cci | /ve] [/s]\n"
+}
diff --git a/reactos/base/applications/cmdutils/reg/Pt.rc b/reactos/base/applications/cmdutils/reg/Pt.rc
new file mode 100644 (file)
index 0000000..0de0e33
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * REG.EXE - Wine-compatible reg program.
+ * Portuguese language support
+ *
+ * Copyright 2008 Andrew Riedi
+ * Copyright 2008 Ricardo Filipe
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * 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 "reg.h"
+
+#pragma code_page(65001)
+
+LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
+
+STRINGTABLE
+{
+    STRING_USAGE, "A sintaxe deste comando é:\n\nREG [ ADD | DELETE | QUERY ]\nREG comando /?\n"
+    STRING_ADD_USAGE, "REG ADD nome_chave [/v nome_valor | /ve] [/t tipo] [/s separador] [/d dados] [/f]\n"
+    STRING_DELETE_USAGE, "REG DELETE nome_chave [/v nome_valor | /ve | /va] [/f]\n"
+    STRING_QUERY_USAGE, "REG QUERY nome_chave [/v nome_valor | /ve] [/s]\n"
+    STRING_SUCCESS, "A operação foi completada com sucesso\n"
+    STRING_INVALID_KEY, "Erro: Nome de chave inválido\n"
+    STRING_INVALID_CMDLINE, "Erro: Parâmetros da linha de comandos inválidos\n"
+    STRING_NO_REMOTE, "Erro: Incapaz de adicionar chaves à máquina remota\n"
+    STRING_CANNOT_FIND, "Erro: O sistema foi incapaz de encontrar a chave de registo ou valor especificado\n"
+}
diff --git a/reactos/base/applications/cmdutils/reg/Ru.rc b/reactos/base/applications/cmdutils/reg/Ru.rc
new file mode 100644 (file)
index 0000000..cac53a3
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Russian language support
+ *
+ * Copyright 2008 Vitaliy Margolen
+ *
+ * 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 "reg.h"
+
+/* UTF-8 */
+#pragma code_page(65001)
+
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+
+STRINGTABLE
+{
+    STRING_USAGE, "Использование программы:\n\nREG [ ADD | DELETE | QUERY ]\nREG <команда> /?\n"
+    STRING_ADD_USAGE, "REG ADD <ключ> [/v <параметр> | /ve] [/t <тип>] [/s <разделитель>] [/d данные] [/f]\n"
+    STRING_DELETE_USAGE, "REG DELETE <ключ> [/v <параметр> | /ve | /va] [/f]\n"
+    STRING_QUERY_USAGE, "REG QUERY <ключ> [/v <параметр> | /ve] [/s]\n"
+}
diff --git a/reactos/base/applications/cmdutils/reg/Si.rc b/reactos/base/applications/cmdutils/reg/Si.rc
new file mode 100644 (file)
index 0000000..6f3e01c
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * REG.EXE - Wine-compatible reg program.
+ * Slovenian language support
+ *
+ * Copyright 2008 Rok Mandeljc
+ *
+ * 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 "reg.h"
+
+#pragma code_page(65001)
+
+LANGUAGE LANG_SLOVENIAN, SUBLANG_DEFAULT
+
+STRINGTABLE
+{
+    STRING_USAGE, "Sintaksa ukaza:\n\nREG [ ADD | DELETE | QUERY ]\nREG ukaz /?\n"
+    STRING_ADD_USAGE, "REG ADD ime_ključa [/v ime_vrednosti | /ve] [/t vrsta] [/s ločilo] [/d podatki] [/f]\n"
+    STRING_DELETE_USAGE, "REG DELETE ime_ključa [/v ime_vrednosti | /ve | /va] [/f]\n"
+    STRING_QUERY_USAGE, "REG QUERY ime_ključa [/v ime_vrednosti | /ve] [/s]\n"
+    STRING_SUCCESS, "Operacija se je uspešno izvedla\n"
+    STRING_INVALID_KEY, "Napaka: Napačno ime ključa\n"
+    STRING_INVALID_CMDLINE, "Napaka: Napačen parameter v ukazni vrstici\n"
+    STRING_NO_REMOTE, "Napaka: Na morem dodati ključa na oddaljen računalnik\n"
+    STRING_CANNOT_FIND, "Napaka: Sistem ni našel zahtevanega ključa ali vrednosti\n"
+}
diff --git a/reactos/base/applications/cmdutils/reg/reg.c b/reactos/base/applications/cmdutils/reg/reg.c
new file mode 100644 (file)
index 0000000..a538d81
--- /dev/null
@@ -0,0 +1,471 @@
+/*
+ * Copyright 2008 Andrew Riedi
+ *
+ * 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 <windows.h>
+#include <wine/unicode.h>
+#include "reg.h"
+
+static int reg_printfW(const WCHAR *msg, ...)
+{
+    va_list va_args;
+    int wlen;
+    DWORD count, ret;
+    WCHAR msg_buffer[8192];
+
+    va_start(va_args, msg);
+    vsprintfW(msg_buffer, msg, va_args);
+    va_end(va_args);
+
+    wlen = lstrlenW(msg_buffer);
+    ret = WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), msg_buffer, wlen, &count, NULL);
+    if (!ret)
+    {
+        DWORD len;
+        char  *msgA;
+
+        len = WideCharToMultiByte(GetConsoleOutputCP(), 0, msg_buffer, wlen,
+            NULL, 0, NULL, NULL);
+        msgA = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char));
+        if (!msgA)
+            return 0;
+
+        WideCharToMultiByte(GetConsoleOutputCP(), 0, msg_buffer, wlen, msgA, len,
+            NULL, NULL);
+        WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msgA, len, &count, FALSE);
+        HeapFree(GetProcessHeap(), 0, msgA);
+    }
+
+    return count;
+}
+
+static int reg_message(int msg)
+{
+    static const WCHAR formatW[] = {'%','s',0};
+    WCHAR msg_buffer[8192];
+
+    LoadStringW(GetModuleHandleW(NULL), msg, msg_buffer,
+        sizeof(msg_buffer)/sizeof(WCHAR));
+    return reg_printfW(formatW, msg_buffer);
+}
+
+static HKEY get_rootkey(LPWSTR key)
+{
+    static const WCHAR szHKLM[] = {'H','K','L','M',0};
+    static const WCHAR szHKCU[] = {'H','K','C','U',0};
+    static const WCHAR szHKCR[] = {'H','K','C','R',0};
+    static const WCHAR szHKU[] = {'H','K','U',0};
+    static const WCHAR szHKCC[] = {'H','K','C','C',0};
+
+    if (CompareStringW(CP_ACP,NORM_IGNORECASE,key,4,szHKLM,4)==2)
+        return HKEY_LOCAL_MACHINE;
+    else if (CompareStringW(CP_ACP,NORM_IGNORECASE,key,4,szHKCU,4)==2)
+        return HKEY_CURRENT_USER;
+    else if (CompareStringW(CP_ACP,NORM_IGNORECASE,key,4,szHKCR,4)==2)
+        return HKEY_CLASSES_ROOT;
+    else if (CompareStringW(CP_ACP,NORM_IGNORECASE,key,3,szHKU,3)==2)
+        return HKEY_USERS;
+    else if (CompareStringW(CP_ACP,NORM_IGNORECASE,key,4,szHKCC,4)==2)
+        return HKEY_CURRENT_CONFIG;
+    else return NULL;
+}
+
+static DWORD get_regtype(LPWSTR type)
+{
+    static const WCHAR szREG_SZ[] = {'R','E','G','_','S','Z',0};
+    static const WCHAR szREG_MULTI_SZ[] = {'R','E','G','_','M','U','L','T','I','_','S','Z',0};
+    static const WCHAR szREG_DWORD_BIG_ENDIAN[] = {'R','E','G','_','D','W','O','R','D','_','B','I','G','_','E','N','D','I','A','N',0};
+    static const WCHAR szREG_DWORD[] = {'R','E','G','_','D','W','O','R','D',0};
+    static const WCHAR szREG_BINARY[] = {'R','E','G','_','B','I','N','A','R','Y',0};
+    static const WCHAR szREG_DWORD_LITTLE_ENDIAN[] = {'R','E','G','_','D','W','O','R','D','_','L','I','T','T','L','E','_','E','N','D','I','A','N',0};
+    static const WCHAR szREG_NONE[] = {'R','E','G','_','N','O','N','E',0};
+    static const WCHAR szREG_EXPAND_SZ[] = {'R','E','G','_','E','X','P','A','N','D','_','S','Z',0};
+
+    if (!type)
+        return REG_SZ;
+
+    if (lstrcmpiW(type,szREG_SZ)==0) return REG_SZ;
+    if (lstrcmpiW(type,szREG_DWORD)==0) return REG_DWORD;
+    if (lstrcmpiW(type,szREG_MULTI_SZ)==0) return REG_MULTI_SZ;
+    if (lstrcmpiW(type,szREG_EXPAND_SZ)==0) return REG_EXPAND_SZ;
+    if (lstrcmpiW(type,szREG_DWORD_BIG_ENDIAN)==0) return REG_DWORD_BIG_ENDIAN;
+    if (lstrcmpiW(type,szREG_DWORD_LITTLE_ENDIAN)==0) return REG_DWORD_LITTLE_ENDIAN;
+    if (lstrcmpiW(type,szREG_BINARY)==0) return REG_BINARY;
+    if (lstrcmpiW(type,szREG_NONE)==0) return REG_NONE;
+
+    return -1;
+}
+
+static LPBYTE get_regdata(LPWSTR data, DWORD reg_type, WCHAR separator, DWORD *reg_count)
+{
+    LPBYTE out_data = NULL;
+    *reg_count = 0;
+
+    switch (reg_type)
+    {
+        case REG_SZ:
+        {
+            *reg_count = (lstrlenW(data) + 1) * sizeof(WCHAR);
+            out_data = HeapAlloc(GetProcessHeap(),0,*reg_count);
+            lstrcpyW((LPWSTR)out_data,data);
+            break;
+        }
+        default:
+        {
+            static const WCHAR unhandled[] = {'U','n','h','a','n','d','l','e','d',' ','T','y','p','e',' ','0','x','%','x',' ',' ','d','a','t','a',' ','%','s','\n',0};
+            reg_printfW(unhandled, reg_type,data);
+        }
+    }
+
+    return out_data;
+}
+
+static int reg_add(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
+    WCHAR *type, WCHAR separator, WCHAR *data, BOOL force)
+{
+    static const WCHAR stubW[] = {'A','D','D',' ','-',' ','%','s',
+        ' ','%','s',' ','%','d',' ','%','s',' ','%','s',' ','%','d','\n',0};
+    LPWSTR p;
+    HKEY root,subkey;
+
+    reg_printfW(stubW, key_name, value_name, value_empty, type, data, force);
+
+    if (key_name[0]=='\\' && key_name[1]=='\\')
+    {
+        reg_message(STRING_NO_REMOTE);
+        return 1;
+    }
+
+    p = strchrW(key_name,'\\');
+    if (!p)
+    {
+        reg_message(STRING_INVALID_KEY);
+        return 1;
+    }
+    p++;
+
+    root = get_rootkey(key_name);
+    if (!root)
+    {
+        reg_message(STRING_INVALID_KEY);
+        return 1;
+    }
+
+    if(RegCreateKeyW(root,p,&subkey)!=ERROR_SUCCESS)
+    {
+        reg_message(STRING_INVALID_KEY);
+        return 1;
+    }
+
+    if (value_name || data)
+    {
+        DWORD reg_type;
+        DWORD reg_count = 0;
+        BYTE* reg_data = NULL;
+
+        if (!force)
+        {
+            if (RegQueryValueW(subkey,value_name,NULL,NULL)==ERROR_SUCCESS)
+            {
+                /* FIXME:  Prompt for overwrite */
+            }
+        }
+
+        reg_type = get_regtype(type);
+        if (reg_type == -1)
+        {
+            RegCloseKey(subkey);
+            reg_message(STRING_INVALID_CMDLINE);
+            return 1;
+        }
+
+        if (data)
+            reg_data = get_regdata(data,reg_type,separator,&reg_count);
+
+        RegSetValueExW(subkey,value_name,0,reg_type,reg_data,reg_count);
+        HeapFree(GetProcessHeap(),0,reg_data);
+    }
+
+    RegCloseKey(subkey);
+    reg_message(STRING_SUCCESS);
+
+    return 0;
+}
+
+static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
+    BOOL value_all, BOOL force)
+{
+    LPWSTR p;
+    HKEY root,subkey;
+
+    static const WCHAR stubW[] = {'D','E','L','E','T','E',
+        ' ','-',' ','%','s',' ','%','s',' ','%','d',' ','%','d',' ','%','d','\n'
+        ,0};
+    reg_printfW(stubW, key_name, value_name, value_empty, value_all, force);
+
+    if (key_name[0]=='\\' && key_name[1]=='\\')
+    {
+        reg_message(STRING_NO_REMOTE);
+        return 1;
+    }
+
+    p = strchrW(key_name,'\\');
+    if (!p)
+    {
+        reg_message(STRING_INVALID_KEY);
+        return 1;
+    }
+    p++;
+
+    root = get_rootkey(key_name);
+    if (!root)
+    {
+        reg_message(STRING_INVALID_KEY);
+        return 1;
+    }
+
+    if (value_name && value_empty)
+    {
+        reg_message(STRING_INVALID_CMDLINE);
+        return 1;
+    }
+
+    if (value_empty && value_all)
+    {
+        reg_message(STRING_INVALID_CMDLINE);
+        return 1;
+    }
+
+    if (!force)
+    {
+        /* FIXME:  Prompt for delete */
+    }
+
+    if (!value_name)
+    {
+        if (RegDeleteTreeW(root,p)!=ERROR_SUCCESS)
+        {
+            reg_message(STRING_CANNOT_FIND);
+            return 1;
+        }
+        reg_message(STRING_SUCCESS);
+        return 0;
+    }
+
+    if(RegOpenKeyW(root,p,&subkey)!=ERROR_SUCCESS)
+    {
+        reg_message(STRING_CANNOT_FIND);
+        return 1;
+    }
+
+    if (value_all)
+    {
+        LPWSTR szValue;
+        DWORD maxValue;
+        DWORD count;
+        LONG rc;
+
+        if (value_name)
+        {
+            RegCloseKey(subkey);
+            reg_message(STRING_INVALID_CMDLINE);
+            return 1;
+        }
+
+        rc = RegQueryInfoKeyW(subkey, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+            &maxValue, NULL, NULL, NULL);
+        if (rc != ERROR_SUCCESS)
+        {
+            /* FIXME: failure */
+            RegCloseKey(subkey);
+            return 1;
+        }
+        maxValue++;
+        szValue = HeapAlloc(GetProcessHeap(),0,maxValue*sizeof(WCHAR));
+
+        while (1)
+        {
+            count = maxValue;
+            rc = RegEnumValueW(subkey, 0, value_name, &count, NULL, NULL, NULL, NULL);
+            if (rc == ERROR_SUCCESS)
+            {
+                rc = RegDeleteValueW(subkey,value_name);
+                if (rc != ERROR_SUCCESS)
+                    break;
+            }
+            else break;
+        }
+        if (rc != ERROR_SUCCESS)
+        {
+            /* FIXME  delete failed */
+        }
+    }
+    else if (value_name)
+    {
+        if (RegDeleteValueW(subkey,value_name) != ERROR_SUCCESS)
+        {
+            RegCloseKey(subkey);
+            reg_message(STRING_CANNOT_FIND);
+            return 1;
+        }
+    }
+    else if (value_empty)
+    {
+        RegSetValueExW(subkey,NULL,0,REG_SZ,NULL,0);
+    }
+
+    RegCloseKey(subkey);
+    reg_message(STRING_SUCCESS);
+    return 0;
+}
+
+static int reg_query(WCHAR *key_name, WCHAR *value_name, BOOL value_empty,
+    BOOL subkey)
+{
+    static const WCHAR stubW[] = {'S','T','U','B',' ','Q','U','E','R','Y',' ',
+        '-',' ','%','s',' ','%','s',' ','%','d',' ','%','d','\n',0};
+    reg_printfW(stubW, key_name, value_name, value_empty, subkey);
+
+    return 1;
+}
+
+int wmain(int argc, WCHAR *argvW[])
+{
+    int i;
+
+    static const WCHAR addW[] = {'a','d','d',0};
+    static const WCHAR deleteW[] = {'d','e','l','e','t','e',0};
+    static const WCHAR queryW[] = {'q','u','e','r','y',0};
+    static const WCHAR slashDW[] = {'/','d',0};
+    static const WCHAR slashFW[] = {'/','f',0};
+    static const WCHAR slashHW[] = {'/','h',0};
+    static const WCHAR slashSW[] = {'/','s',0};
+    static const WCHAR slashTW[] = {'/','t',0};
+    static const WCHAR slashVW[] = {'/','v',0};
+    static const WCHAR slashVAW[] = {'/','v','a',0};
+    static const WCHAR slashVEW[] = {'/','v','e',0};
+    static const WCHAR slashHelpW[] = {'/','?',0};
+
+    if (argc < 2 || !lstrcmpW(argvW[1], slashHelpW)
+                 || !lstrcmpiW(argvW[1], slashHW))
+    {
+        reg_message(STRING_USAGE);
+        return 0;
+    }
+
+    if (!lstrcmpiW(argvW[1], addW))
+    {
+        WCHAR *key_name, *value_name = NULL, *type = NULL, separator = '\0', *data = NULL;
+        BOOL value_empty = FALSE, force = FALSE;
+
+        if (argc < 3)
+        {
+            reg_message(STRING_INVALID_CMDLINE);
+            return 1;
+        }
+        else if (argc == 3 && (!lstrcmpW(argvW[2], slashHelpW) ||
+                               !lstrcmpiW(argvW[2], slashHW)))
+        {
+            reg_message(STRING_ADD_USAGE);
+            return 0;
+        }
+
+        key_name = argvW[2];
+        for (i = 1; i < argc; i++)
+        {
+            if (!lstrcmpiW(argvW[i], slashVW))
+                value_name = argvW[++i];
+            else if (!lstrcmpiW(argvW[i], slashVEW))
+                value_empty = TRUE;
+            else if (!lstrcmpiW(argvW[i], slashTW))
+                type = argvW[++i];
+            else if (!lstrcmpiW(argvW[i], slashSW))
+                separator = argvW[++i][0];
+            else if (!lstrcmpiW(argvW[i], slashDW))
+                data = argvW[++i];
+            else if (!lstrcmpiW(argvW[i], slashFW))
+                force = TRUE;
+        }
+        return reg_add(key_name, value_name, value_empty, type, separator,
+            data, force);
+    }
+    else if (!lstrcmpiW(argvW[1], deleteW))
+    {
+        WCHAR *key_name, *value_name = NULL;
+        BOOL value_empty = FALSE, value_all = FALSE, force = FALSE;
+
+        if (argc < 3)
+        {
+            reg_message(STRING_INVALID_CMDLINE);
+            return 1;
+        }
+        else if (argc == 3 && (!lstrcmpW(argvW[2], slashHelpW) ||
+                               !lstrcmpiW(argvW[2], slashHW)))
+        {
+            reg_message(STRING_DELETE_USAGE);
+            return 0;
+        }
+
+        key_name = argvW[2];
+        for (i = 1; i < argc; i++)
+        {
+            if (!lstrcmpiW(argvW[i], slashVW))
+                value_name = argvW[++i];
+            else if (!lstrcmpiW(argvW[i], slashVEW))
+                value_empty = TRUE;
+            else if (!lstrcmpiW(argvW[i], slashVAW))
+                value_all = TRUE;
+            else if (!lstrcmpiW(argvW[i], slashFW))
+                force = TRUE;
+        }
+        return reg_delete(key_name, value_name, value_empty, value_all, force);
+    }
+    else if (!lstrcmpiW(argvW[1], queryW))
+    {
+        WCHAR *key_name, *value_name = NULL;
+        BOOL value_empty = FALSE, subkey = FALSE;
+
+        if (argc < 3)
+        {
+            reg_message(STRING_INVALID_CMDLINE);
+            return 1;
+        }
+        else if (argc == 3 && (!lstrcmpW(argvW[2], slashHelpW) ||
+                               !lstrcmpiW(argvW[2], slashHW)))
+        {
+            reg_message(STRING_QUERY_USAGE);
+            return 0;
+        }
+
+        key_name = argvW[2];
+        for (i = 1; i < argc; i++)
+        {
+            if (!lstrcmpiW(argvW[i], slashVW))
+                value_name = argvW[++i];
+            else if (!lstrcmpiW(argvW[i], slashVEW))
+                value_empty = TRUE;
+            else if (!lstrcmpiW(argvW[i], slashSW))
+                subkey = TRUE;
+        }
+        return reg_query(key_name, value_name, value_empty, subkey);
+    }
+    else
+    {
+        reg_message(STRING_INVALID_CMDLINE);
+        return 1;
+    }
+}
diff --git a/reactos/base/applications/cmdutils/reg/reg.h b/reactos/base/applications/cmdutils/reg/reg.h
new file mode 100644 (file)
index 0000000..2221647
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * REG.EXE - Wine-compatible reg program.
+ *
+ * Copyright 2008 Andrew Riedi
+ *
+ * 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 <windef.h>
+
+/* Translation IDs. */
+#define STRING_USAGE            101
+#define STRING_ADD_USAGE        102
+#define STRING_DELETE_USAGE     103
+#define STRING_QUERY_USAGE      104
+#define STRING_SUCCESS          105
+#define STRING_INVALID_KEY      106
+#define STRING_INVALID_CMDLINE  107
+#define STRING_NO_REMOTE        108
+#define STRING_CANNOT_FIND      109
diff --git a/reactos/base/applications/cmdutils/reg/reg.rbuild b/reactos/base/applications/cmdutils/reg/reg.rbuild
new file mode 100644 (file)
index 0000000..2daf43b
--- /dev/null
@@ -0,0 +1,10 @@
+<module name="reg" type="win32cui" installbase="system32" installname="reg.exe" unicode="true">
+       <include base="reg">.</include>
+       <redefine name="_WIN32_WINNT">0x600</redefine>
+       <library>wine</library>
+       <library>advapi32</library>
+       <library>user32</library>
+       <library>kernel32</library>
+       <file>reg.c</file>
+       <file>rsrc.rc</file>
+</module>
diff --git a/reactos/base/applications/cmdutils/reg/rsrc.rc b/reactos/base/applications/cmdutils/reg/rsrc.rc
new file mode 100644 (file)
index 0000000..1ab7f7f
--- /dev/null
@@ -0,0 +1,13 @@
+#include "Da.rc"
+#include "De.rc"
+#include "En.rc"
+#include "Fr.rc"
+#include "Ja.rc"
+//#include "Ko.rc"
+#include "Lt.rc"
+#include "Nl.rc"
+#include "No.rc"
+//#include "Pl.rc"
+#include "Pt.rc"
+#include "Ru.rc"
+#include "Si.rc"
index 358c37c..b6b325b 100644 (file)
@@ -25,3 +25,5 @@ END
 #include "lang/sk-SK.rc"
 #include "lang/uk-UA.rc"
 #include "lang/no-NO.rc"
+#include "lang/zh-CN.rc"
+#include "lang/zh-TW.rc"
diff --git a/reactos/base/applications/fontview/lang/zh-CN.rc b/reactos/base/applications/fontview/lang/zh-CN.rc
new file mode 100644 (file)
index 0000000..46d2623
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * PROJECT:     ReactOS FontView
+ * LICENSE:     GPL - See COPYING in the top level directory
+ * FILE:        rosapps/fontview/lang/zh-CN.rc
+ * PURPOSE:     Chinese (Simplified) Language File for FontView
+ * TRANSLATOR:  Elton Chung <elton328@gmail.com>
+ */
+
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
+
+STRINGTABLE DISCARDABLE
+BEGIN
+       IDS_QUIT, "½áÊø" 
+       IDS_PRINT, "ÁÐÓ¡" 
+       IDS_STRING, "ReactOS¸øËùÓÐÈËÒ»¸ö×ÔÓɵIJÙ×÷ϵͳ£¡1234567890" 
+       IDS_ERROR, "´íÎó" 
+       IDS_ERROR_NOMEM, "ûÓÐ×ã¹»µÄÄÚ´æÀ´Íê³É²Ù×÷¡£" 
+       IDS_ERROR_NOFONT, "£¥1²»ÊÇÒ»¸öÓÐЧµÄ×ÖÌåµµ°¸¡£" 
+       IDS_ERROR_NOCLASS, "´°¿ÚÎÞ·¨³õʼ»¯¡£" 
+       IDS_ERROR_BADCMD, "ûÓÐÌṩ×ÖÌåÎļþ¡£\nÓï·¨£º\n  fontview.exe <×ÖÌåµµ°¸>"  
+END
\ No newline at end of file
diff --git a/reactos/base/applications/fontview/lang/zh-TW.rc b/reactos/base/applications/fontview/lang/zh-TW.rc
new file mode 100644 (file)
index 0000000..ab70eba
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * PROJECT:     ReactOS FontView
+ * LICENSE:     GPL - See COPYING in the top level directory
+ * FILE:        rosapps/fontview/lang/zh-TW.rc
+ * PURPOSE:     Chinese (Traditional) Language File for FontView
+ * TRANSLATOR:  Elton Chung <elton328@gmail.com>
+ */
+
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
+
+STRINGTABLE DISCARDABLE
+BEGIN
+       IDS_QUIT, "µ²§ô"
+       IDS_PRINT, "¦C¦L"
+       IDS_STRING, "ReactOS µ¹©Ò¦³¤H¤@­Ó¦Û¥Ñªº¾Þ§@¨t²Î¡I 1234567890"
+       IDS_ERROR, "¿ù»~"
+       IDS_ERROR_NOMEM, "¨S¦³¨¬°÷ªº°O¾ÐÅé¨Ó§¹¦¨¾Þ§@¡C"
+       IDS_ERROR_NOFONT, "%1 ¤£¬O¤@­Ó¦³®Äªº¦rÅéÀɮסC"
+       IDS_ERROR_NOCLASS, "µ¡¤fµLªkªì©l¤Æ¡C"
+       IDS_ERROR_BADCMD, "¨S¦³´£¨Ñ¦rÅé¤å¥ó¡C\n»yªk¡G\n  fontview.exe <¦rÅéÀÉ®×>"
+END
\ No newline at end of file
diff --git a/reactos/base/applications/kbswitch/lang/zh-CN.rc b/reactos/base/applications/kbswitch/lang/zh-CN.rc
new file mode 100644 (file)
index 0000000..075bc31
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * PROJECT:     ReactOS KBSwitch
+ * LICENSE:     GPL - See COPYING in the top level directory
+ * FILE:        rosapps/kbswitch/lang/zh-CN.rc
+ * PURPOSE:     Chinese (Simplified) Language File for KBSwitch
+ * TRANSLATOR:  Elton Chung <elton328@gmail.com>
+ */
+
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
+
+IDR_POPUP MENU
+BEGIN
+    POPUP "popup"
+    BEGIN
+        MENUITEM "&Ñ¡Ïî...",  ID_PREFERENCES
+        MENUITEM SEPARATOR
+        MENUITEM "&½áÊø",            ID_EXIT
+    END
+END
diff --git a/reactos/base/applications/kbswitch/lang/zh-TW.rc b/reactos/base/applications/kbswitch/lang/zh-TW.rc
new file mode 100644 (file)
index 0000000..bd24850
--- /dev/null
@@ -0,0 +1,19 @@
+/*
+ * PROJECT:     ReactOS KBSwitch
+ * LICENSE:     GPL - See COPYING in the top level directory
+ * FILE:        rosapps/kbswitch/lang/zh-TW.rc
+ * PURPOSE:     Chinese (Traditional) Language File for KBSwitch
+ * TRANSLATOR:  Elton Chung <elton328@gmail.com>
+ */
+
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
+
+IDR_POPUP MENU
+BEGIN
+    POPUP "popup"
+    BEGIN
+        MENUITEM "&¿ï¶µ...",  ID_PREFERENCES
+        MENUITEM SEPARATOR
+        MENUITEM "&µ²§ô",            ID_EXIT
+    END
+END
index 8261fcc..b3a70f2 100644 (file)
@@ -12,3 +12,5 @@
 #include "lang/ru-RU.rc"
 #include "lang/sk-SK.rc"
 #include "lang/uk-UA.rc"
+#include "lang/zh-CN.rc"
+#include "lang/zh-TW.rc"
diff --git a/reactos/base/applications/logoff/lang/zh-CN.rc b/reactos/base/applications/logoff/lang/zh-CN.rc
new file mode 100644 (file)
index 0000000..fdf5f79
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * PROJECT:     ReactOS Logout
+ * LICENSE:     GPL - See COPYING in the top level directory
+ * FILE:        rosapps/logout/lang/zh-CN.rc
+ * PURPOSE:     Chinese (Simplified) Language File for Logout
+ * TRANSLATOR:  Elton Chung <elton328@gmail.com>
+ */
+
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
+
+STRINGTABLE DISCARDABLE
+BEGIN
+
+IDS_USAGE, "ÖÕÖ¹Ò»¸ö½×¶Î¡£\n\n\
+  /v\t\tÏÔʾÓйØÒÑÖ´Ðж¯×÷µÄ×ÊѶ¡£\n\
+  /?\t\tÏÔʾ´Ë×ÊѶ¡£\n\n"
+
+IDS_LOGOFF_REMOTE, "ÕýÔÚÖÕÖ¹Ô¶¶Ë»úÆ÷µÄ½×¶Î¡£"
+IDS_LOGOFF_LOCAL, "ÕýÔÚÖÕÖ¹±¾»úÆ÷µÄµ±Ç°½×¶Î¡£"
+
+IDS_ILLEGAL_PARAM, "ÎÞЧ²ÎÊý\n"
+END
+/* EOF */
diff --git a/reactos/base/applications/logoff/lang/zh-TW.rc b/reactos/base/applications/logoff/lang/zh-TW.rc
new file mode 100644 (file)
index 0000000..b01ef94
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * PROJECT:     ReactOS Logout
+ * LICENSE:     GPL - See COPYING in the top level directory
+ * FILE:        rosapps/logout/lang/zh-TW.rc
+ * PURPOSE:     Chinese (Traditional) Language File for Logout
+ * TRANSLATOR:  Elton Chung <elton328@gmail.com>
+ */
+
+LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL
+
+STRINGTABLE DISCARDABLE
+BEGIN
+
+IDS_USAGE, "²×¤î¤@­Ó¶¥¬q¡C\n\n\
+  /v\t\tÅã¥Ü¦³Ãö¤w°õ¦æ°Ê§@ªº¸ê°T¡C\n\
+  /?\t\tÅã¥Ü¦¹¸ê°T¡C\n\n"
+
+IDS_LOGOFF_REMOTE, "¥¿¦b²×¤î»·ºÝ¾÷¾¹ªº¶¥¬q¡C"
+IDS_LOGOFF_LOCAL, "¥¿¦b²×¤î¥»¾÷¾¹ªº·í«e¶¥¬q¡C"
+
+IDS_ILLEGAL_PARAM, "µL®Ä°Ñ¼Æ\n"
+END
+/* EOF */
index fccb3f2..d215ef6 100644 (file)
@@ -18,4 +18,5 @@
 #include "lang/ru-RU.rc"
 #include "lang/sk-SK.rc"
 #include "lang/uk-UA.rc"
-
+#include "lang/zh-CN.rc"
+#include "lang/zh-TW.rc"
index a401623..2b09522 100644 (file)
@@ -1136,13 +1136,6 @@ null();//                (void) signal(SIGINT,oldintr);
 null();//      (void) signal(SIGINT,oldintr);
 }
 
-/*
- * Need to start a listen on the data channel
- * before we send the command, otherwise the
- * server's connect may fail.
- */
-int sendport = -1;
-
 int
 initconn()
 {
index dbac29b..a0a99b2 100644 (file)
@@ -101,7 +101,7 @@ extern int  mapflag;                /* use mapin mapout templates on file names */
 extern int     code;                   /* return/reply code for ftp command */
 extern int     crflag;                 /* if 1, strip car. rets. on ascii gets */
 extern char    pasv[64];               /* passive port for proxy data connection */
-extern int  passivemode;    /* passive mode enabled */
+extern int     passivemode;            /* passive mode enabled */
 extern char    *altarg;                /* argv[1] with no shell-like preprocessing  */
 extern char    ntin[17];               /* input translation table */
 extern char    ntout[17];              /* output translation table */
@@ -126,8 +126,8 @@ extern char *stringbase;            /* current scan point in line buffer */
 extern char    argbuf[200];            /* argument storage buffer */
 extern char    *argbase;               /* current storage point in arg buffer */
 extern int     margc;                  /* count of arguments on input line */
-extern const char      *margv[20];             /* args parsed from input line */
-extern int     cpend;                  /* flag: if != 0, then pending server reply */
+extern const char      *margv[20];     /* args parsed from input line */
+extern int     cpend;                  /* flag: if != 0, then pending server reply */
 extern int     mflag;                  /* flag: if != 0, then active multi command */
 
 extern int     options;                /* used during socket creation */
@@ -138,21 +138,21 @@ extern int        options;                /* used during socket creation */
 struct cmd {
        const char      *c_name;        /* name of command */
        const char      *c_help;        /* help string */
-       char    c_bell;         /* give bell when command completes */
-       char    c_conn;         /* must be connected to use command */
-       char    c_proxy;        /* proxy server may execute */
-       void    (*c_handler)(); /* function to call */
+       char    c_bell;                 /* give bell when command completes */
+       char    c_conn;                 /* must be connected to use command */
+       char    c_proxy;                /* proxy server may execute */
+       void    (*c_handler)();         /* function to call */
 };
 
 struct macel {
-       char mac_name[9];       /* macro name */
-       char *mac_start;        /* start of macro in macbuf */
-       char *mac_end;          /* end of macro in macbuf */
+       char mac_name[9];               /* macro name */
+       char *mac_start;                /* start of macro in macbuf */
+       char *mac_end;                  /* end of macro in macbuf */
 };
 
-int macnum;                    /* number of defined macros */
-struct macel macros[16];
-char macbuf[4096];
+extern int macnum;                     /* number of defined macros */
+extern struct macel macros[16];
+extern char macbuf[4096];
 
 #if    defined(__ANSI__) || defined(sparc)
 typedef void sig_t;
index aaf42d1..745e908 100644 (file)
@@ -58,11 +58,11 @@ void        intr();
 void   lostpeer();
 char   *getlogin();
 
-short   portnum;
+short  portnum;
 
-char     home[128];
+char   home[128];
 char   *globerr;
-int     autologin;
+int    autologin;
 
 
 
@@ -72,7 +72,7 @@ int     autologin;
  */
 int    trace;                  /* trace packets exchanged */
 int    hash;                   /* print # for each buffer transferred */
-int    sendport;               /* use PORT cmd for each data connection */
+//int  sendport;               /* use PORT cmd for each data connection */
 int    verbose;                /* print messages coming back from server */
 int    connected;              /* connected to server */
 int    fromatty;               /* input is from a terminal */
@@ -81,7 +81,7 @@ int   debug;                  /* debugging level */
 int    bell;                   /* ring bell on cmd completion */
 int    doglob;                 /* glob local file names */
 int    proxy;                  /* proxy server connection active */
-int passivemode;
+int    passivemode;
 int    proxflag;               /* proxy connection exists */
 int    sunique;                /* store files on server with unique name */
 int    runique;                /* store local files with unique name */
@@ -115,12 +115,23 @@ char      *stringbase;            /* current scan point in line buffer */
 char   argbuf[200];            /* argument storage buffer */
 char   *argbase;               /* current storage point in arg buffer */
 int    margc;                  /* count of arguments on input line */
-const char     *margv[20];             /* args parsed from input line */
-int     cpend;                  /* flag: if != 0, then pending server reply */
+const char     *margv[20];     /* args parsed from input line */
+int    cpend;                  /* flag: if != 0, then pending server reply */
 int    mflag;                  /* flag: if != 0, then active multi command */
 
 int    options;                /* used during socket creation */
 
+int    macnum;                 /* number of defined macros */
+struct macel macros[16];
+char   macbuf[4096];
+
+/* 
+ * Need to start a listen on the data channel 
+ * before we send the command, otherwise the 
+ * server's connect may fail. 
+ */
+int sendport = -1;
+
 static const char *slurpstring();
 
 
index e1766f6..64f344a 100644 (file)
@@ -22,6 +22,9 @@
        <directory name="netstat">
                <xi:include href="netstat/netstat.rbuild" />
        </directory>
+       <directory name="nslookup">
+               <xi:include href="nslookup/nslookup.rbuild" />
+       </directory>
        <directory name="ping">
                <xi:include href="ping/ping.rbuild" />
        </directory>
diff --git a/reactos/base/applications/network/nslookup/nslookup.c b/reactos/base/applications/network/nslookup/nslookup.c
new file mode 100644 (file)
index 0000000..993ab04
--- /dev/null
@@ -0,0 +1,858 @@
+/*
+ * PROJECT:     ReactOS nslookup utility
+ * LICENSE:     GPL - See COPYING in the top level directory
+ * FILE:        applications/network/nslookup/nslookup.c
+ * PURPOSE:     Perform DNS lookups
+ * COPYRIGHT:   Copyright 2009 Lucas Suggs <lucas.suggs@gmail.com>
+ */
+
+#include <windows.h>
+#include <windns.h>
+#include <winsock2.h>
+#include <tchar.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <iphlpapi.h>
+#include "nslookup.h"
+
+STATE   State;
+HANDLE  ProcessHeap;
+ULONG   RequestID;
+
+void PrintState()
+{
+    _tprintf( _T("Default Server:  (null)\n\n") );
+    _tprintf( _T("Set options:\n") );
+
+    _tprintf( _T("  ") );
+    if( !State.debug ) _tprintf( _T("no") );
+    _tprintf( _T("debug\n") );
+
+    _tprintf( _T("  ") );
+    if( !State.defname ) _tprintf( _T("no") );
+    _tprintf( _T("defname\n") );
+
+    _tprintf( _T("  ") );
+    if( !State.search ) _tprintf( _T("no") );
+    _tprintf( _T("search\n") );
+
+    _tprintf( _T("  ") );
+    if( !State.recurse ) _tprintf( _T("no") );
+    _tprintf( _T("recurse\n") );
+
+    _tprintf( _T("  ") );
+    if( !State.d2 ) _tprintf( _T("no") );
+    _tprintf( _T("d2\n") );
+
+    _tprintf( _T("  ") );
+    if( !State.vc ) _tprintf( _T("no") );
+    _tprintf( _T("vc\n") );
+
+    _tprintf( _T("  ") );
+    if( !State.ignoretc ) _tprintf( _T("no") );
+    _tprintf( _T("ignoretc\n") );
+
+    _tprintf( _T("  port=%d\n"), State.port );
+    _tprintf( _T("  type=%s\n"), State.type );
+    _tprintf( _T("  class=%s\n"), State.Class );
+    _tprintf( _T("  timeout=%d\n"), (int)State.timeout );
+    _tprintf( _T("  retry=%d\n"), (int)State.retry );
+    _tprintf( _T("  root=%s\n"), State.root );
+    _tprintf( _T("  domain=%s\n"), State.domain );
+
+    _tprintf( _T("  ") );
+    if( !State.MSxfr ) _tprintf( _T("no") );
+    _tprintf( _T("MSxfr\n") );
+
+    _tprintf( _T("  IXFRversion=%d\n"), (int)State.ixfrver );
+
+    _tprintf( _T("  srchlist=%s\n\n"), State.srchlist[0] );
+}
+
+void PrintUsage()
+{
+    _tprintf( _T("Usage:\n"
+                 "   nslookup [-opt ...]             # interactive mode using"
+                 " default server\n   nslookup [-opt ...] - server    #"
+                 " interactive mode using 'server'\n   nslookup [-opt ...]"
+                 " host        # just look up 'host' using default server\n"
+                 "   nslookup [-opt ...] host server # just look up 'host'"
+                 " using 'server'\n") );
+}
+
+BOOL PerformInternalLookup( PCHAR pAddr, PCHAR pResult )
+{
+    /* Needed to issue DNS packets and parse them. */
+    PCHAR Buffer = NULL, RecBuffer = NULL;
+    CHAR pResolve[256];
+    ULONG BufferLength = 0, RecBufferLength = 512;
+    int i = 0, j = 0, k = 0, d = 0;
+    BOOL bOk = FALSE;
+
+    /* Makes things easier when parsing the response packet. */
+    UCHAR Header1, Header2;
+    USHORT NumQuestions;
+    USHORT NumAnswers;
+    USHORT NumAuthority;
+    USHORT NumAdditional;
+    USHORT Type;
+
+    if( (strlen( pAddr ) + 1) > 255 ) return FALSE;
+
+    Type = TYPE_A;
+    if( IsValidIP( pAddr ) ) Type = TYPE_PTR;
+
+    /* If it's a PTR lookup then append the ARPA sig to the end. */
+    if( Type == TYPE_PTR )
+    {
+        ReverseIP( pAddr, pResolve );
+        strcat( pResolve, ARPA_SIG );
+    }
+    else
+    {
+        strcpy( pResolve, pAddr );
+    }
+
+    /* Base header length + length of QNAME + length of QTYPE and QCLASS */
+    BufferLength = 12 + (strlen( pResolve ) + 2) + 4;
+
+    /* Allocate memory for the buffer. */
+    Buffer = HeapAlloc( ProcessHeap, 0, BufferLength );
+    if( !Buffer )
+    {
+        _tprintf( _T("ERROR: Out of memory\n") );
+        goto cleanup;
+    }
+
+    /* Allocate the receiving buffer. */
+    RecBuffer = HeapAlloc( ProcessHeap, 0, RecBufferLength );
+    if( !RecBuffer )
+    {
+        _tprintf( _T("ERROR: Out of memory\n") );
+        goto cleanup;
+    }
+
+    /* Insert the ID field. */
+    ((PSHORT)&Buffer[i])[0] = htons( RequestID );
+    i += 2;
+
+    /* Bits 0-7 of the second 16 are all 0, except for when recursion is
+       desired. */
+    Buffer[i] = 0x00;
+    if( State.recurse) Buffer[i] |= 0x01;
+    i += 1;
+
+    /* Bits 8-15 of the second 16 are 0 for a query. */
+    Buffer[i] = 0x00;
+    i += 1;
+
+    /* Only 1 question. */
+    ((PSHORT)&Buffer[i])[0] = htons( 1 );
+    i += 2;
+
+    /* We aren't sending a response, so 0 out the rest of the header. */
+    Buffer[i] = 0x00;
+    Buffer[i + 1] = 0x00;
+    Buffer[i + 2] = 0x00;
+    Buffer[i + 3] = 0x00;
+    Buffer[i + 4] = 0x00;
+    Buffer[i + 5] = 0x00;
+    i += 6;
+
+    /* Walk through the query address. Split each section delimited by '.'.
+       Format of the QNAME section is length|data, etc. Last one is null */
+    j = i;
+    i += 1;
+
+    for( k = 0; k < strlen( pResolve ); k += 1 )
+    {
+        if( pResolve[k] != '.' )
+        {
+            Buffer[i] = pResolve[k];
+            i += 1;
+        }
+        else
+        {
+            Buffer[j] = (i - j) - 1;
+            j = i;
+            i += 1;
+        }
+    }
+
+    Buffer[j] = (i - j) - 1;
+    Buffer[i] = 0x00;
+    i += 1;
+
+    /* QTYPE */
+    ((PSHORT)&Buffer[i])[0] = htons( Type );
+    i += 2;
+
+    /* QCLASS */
+    ((PSHORT)&Buffer[i])[0] = htons( CLASS_IN );
+
+    /* Ship the request off to the DNS server. */
+    bOk = SendRequest( Buffer,
+                       BufferLength,
+                       RecBuffer,
+                       &RecBufferLength );
+    if( !bOk ) goto cleanup;
+
+    /* Start parsing the received packet. */
+    Header1 = RecBuffer[2];
+    Header2 = RecBuffer[3];
+    NumQuestions = ntohs( ((PSHORT)&RecBuffer[4])[0] );
+    NumAnswers = ntohs( ((PSHORT)&RecBuffer[6])[0] );
+    NumAuthority = ntohs( ((PUSHORT)&RecBuffer[8])[0] );
+    NumAdditional = ntohs( ((PUSHORT)&RecBuffer[10])[0] );
+
+    k = 12;
+
+    /* We don't care about the questions section, blow through it. */
+    if( NumQuestions )
+    {
+        for( i = 0; i < NumQuestions; i += 1 )
+        {
+            /* Quick way to skip the domain name section. */
+            k += ExtractName( RecBuffer, pResult, k, 0 );
+            k += 4;
+        }
+    }
+
+    /* Skip the answer name. */
+    k += ExtractName( RecBuffer, pResult, k, 0 );
+
+    Type = ntohs( ((PUSHORT)&RecBuffer[k])[0] );
+    k += 8;
+
+    d = ntohs( ((PUSHORT)&RecBuffer[k])[0] );
+    k += 2;
+
+    if( TYPE_PTR == Type )
+    {
+        k += ExtractName( RecBuffer, pResult, k, d );
+    }
+    else if( TYPE_A == Type )
+    {
+        k += ExtractIP( RecBuffer, pResult, k );
+    }
+
+cleanup:
+    /* Free memory. */
+    if( Buffer ) HeapFree( ProcessHeap, 0, Buffer );
+    if( RecBuffer ) HeapFree( ProcessHeap, 0, RecBuffer );
+
+    RequestID += 1;
+
+    return bOk;
+}
+
+void PerformLookup( PCHAR pAddr )
+{
+    /* Needed to issue DNS packets and parse them. */
+    PCHAR Buffer = NULL, RecBuffer = NULL;
+    CHAR pResolve[256];
+    CHAR pResult[256];
+    ULONG BufferLength = 0, RecBufferLength = 512;
+    int i = 0, j = 0, k = 0, d = 0;
+    BOOL bOk = FALSE;
+
+    /* Makes things easier when parsing the response packet. */
+    UCHAR Header1, Header2;
+    USHORT NumQuestions;
+    USHORT NumAnswers;
+    USHORT NumAuthority;
+    USHORT NumAdditional;
+    USHORT Type;
+
+    if( (strlen( pAddr ) + 1) > 255 ) return;
+
+    _tprintf( _T("Server:  %s\n"), State.DefaultServer );
+    _tprintf( _T("Address:  %s\n\n"), State.DefaultServerAddress );
+
+    if( !strcmp( TypeA, State.type )
+        || !strcmp( TypeAAAA, State.type )
+        || !strcmp( TypeBoth, State.type ) )
+    {
+        Type = TYPE_A;
+        if( IsValidIP( pAddr ) ) Type = TYPE_PTR;
+    }
+    else
+        Type = TypeNametoTypeID( State.type );
+
+    /* If it's a PTR lookup then append the ARPA sig to the end. */
+    if( (Type == TYPE_PTR) && IsValidIP( pAddr ) )
+    {
+        ReverseIP( pAddr, pResolve );
+        strcat( pResolve, ARPA_SIG );
+    }
+    else
+    {
+        strcpy( pResolve, pAddr );
+    }
+
+    /* Base header length + length of QNAME + length of QTYPE and QCLASS */
+    BufferLength = 12 + (strlen( pResolve ) + 2) + 4;
+
+    /* Allocate memory for the buffer. */
+    Buffer = HeapAlloc( ProcessHeap, 0, BufferLength );
+    if( !Buffer )
+    {
+        _tprintf( _T("ERROR: Out of memory\n") );
+        goto cleanup;
+    }
+
+    /* Allocate memory for the return buffer. */
+    RecBuffer = HeapAlloc( ProcessHeap, 0, RecBufferLength );
+    if( !RecBuffer )
+    {
+        _tprintf( _T("ERROR: Out of memory\n") );
+        goto cleanup;
+    }
+
+    /* Insert the ID field. */
+    ((PSHORT)&Buffer[i])[0] = htons( RequestID );
+    i += 2;
+
+    /* Bits 0-7 of the second 16 are all 0, except for when recursion is
+    desired. */
+    Buffer[i] = 0x00;
+    if( State.recurse) Buffer[i] |= 0x01;
+    i += 1;
+
+    /* Bits 8-15 of the second 16 are 0 for a query. */
+    Buffer[i] = 0x00;
+    i += 1;
+
+    /* Only 1 question. */
+    ((PSHORT)&Buffer[i])[0] = htons( 1 );
+    i += 2;
+
+    /* We aren't sending a response, so 0 out the rest of the header. */
+    Buffer[i] = 0x00;
+    Buffer[i + 1] = 0x00;
+    Buffer[i + 2] = 0x00;
+    Buffer[i + 3] = 0x00;
+    Buffer[i + 4] = 0x00;
+    Buffer[i + 5] = 0x00;
+    i += 6;
+
+    /* Walk through the query address. Split each section delimited by '.'.
+       Format of the QNAME section is length|data, etc. Last one is null */
+    j = i;
+    i += 1;
+
+    for( k = 0; k < strlen( pResolve ); k += 1 )
+    {
+        if( pResolve[k] != '.' )
+        {
+            Buffer[i] = pResolve[k];
+            i += 1;
+        }
+        else
+        {
+            Buffer[j] = (i - j) - 1;
+            j = i;
+            i += 1;
+        }
+    }
+
+    Buffer[j] = (i - j) - 1;
+    Buffer[i] = 0x00;
+    i += 1;
+
+    /* QTYPE */
+    ((PSHORT)&Buffer[i])[0] = htons( Type );
+    i += 2;
+
+    /* QCLASS */
+    ((PSHORT)&Buffer[i])[0] = htons( ClassNametoClassID( State.Class ) );
+
+    /* Ship off the request to the DNS server. */
+       bOk = SendRequest( Buffer,
+                       BufferLength,
+                       RecBuffer,
+                       &RecBufferLength );
+    if( !bOk ) goto cleanup;
+
+    /* Start parsing the received packet. */
+    Header1 = RecBuffer[2];
+    Header2 = RecBuffer[3];
+    NumQuestions = ntohs( ((PSHORT)&RecBuffer[4])[0] );
+    NumAnswers = ntohs( ((PSHORT)&RecBuffer[6])[0] );
+    NumAuthority = ntohs( ((PUSHORT)&RecBuffer[8])[0] );
+    NumAdditional = ntohs( ((PUSHORT)&RecBuffer[10])[0] );
+    Type = 0;
+
+    /* Check the RCODE for failure. */
+    d = Header2 & 0x0F;
+    if( d != RCODE_NOERROR )
+    {
+        switch( d )
+        {
+        case RCODE_NXDOMAIN:
+            _tprintf( _T("*** %s can't find %s: Non-existant domain\n"), State.DefaultServer, pAddr );
+            break;
+            
+        case RCODE_REFUSED:
+            _tprintf( _T("*** %s can't find %s: Query refused\n"), State.DefaultServer, pAddr );
+            break;
+
+        default:
+            _tprintf( _T("*** %s can't find %s: Unknown RCODE\n"), State.DefaultServer, pAddr );
+        }
+            
+        goto cleanup;
+    }
+
+    k = 12;
+
+    if( NumQuestions )
+    {
+        /* Blow through the questions section since we don't care about it. */
+        for( i = 0; i < NumQuestions; i += 1 )
+        {
+            k += ExtractName( RecBuffer, pResult, k, 0 );
+            k += 4;
+        }
+    }
+
+    if( NumAnswers )
+    {
+        /* Skip the name. */
+        k += ExtractName( RecBuffer, pResult, k, 0 );
+
+        Type = ntohs( ((PUSHORT)&RecBuffer[k])[0] );
+        k += 8;
+
+        d = ntohs( ((PUSHORT)&RecBuffer[k])[0] );
+        k += 2;
+
+        if( TYPE_PTR == Type )
+        {
+            k += ExtractName( RecBuffer, pResult, k, d );
+        }
+        else if( TYPE_A == Type )
+        {
+            k += ExtractIP( RecBuffer, pResult, k );
+        }
+    }
+
+    /* FIXME: This'll need to support more than PTR and A at some point. */
+    if( !strcmp( State.type, TypePTR ) )
+    {
+        if( TYPE_PTR == Type )
+        {
+            _tprintf( _T("%s     name = %s\n"), pResolve, pResult );
+        }
+        else
+        {
+        }
+    }
+    else if( !strcmp( State.type, TypeA )
+          || !strcmp( State.type, TypeAAAA )
+          || !strcmp( State.type, TypeBoth ) )
+    {
+        if( (TYPE_A == Type) /*|| (TYPE_AAAA == Type)*/ )
+        {
+            if( 0 == NumAuthority )
+                _tprintf( _T("Non-authoritative answer:\n") );
+
+            _tprintf( _T("Name:    %s\n"), pAddr );
+            _tprintf( _T("Address:  %s\n\n"), pResult );
+        }
+        else
+        {
+            _tprintf( _T("Name:    %s\n"), pResult );
+            _tprintf( _T("Address:  %s\n\n"), pAddr );
+        }
+    }
+
+cleanup:
+    /* Free memory. */
+    if( Buffer ) HeapFree( ProcessHeap, 0, Buffer );
+    if( RecBuffer ) HeapFree( ProcessHeap, 0, RecBuffer );
+
+    RequestID += 1;
+}
+
+BOOL ParseCommandLine( int argc, char* argv[] )
+{
+    int i;
+    BOOL NoMoreOptions = FALSE;
+    BOOL Interactive = FALSE;
+    CHAR AddrToResolve[256];
+    CHAR Server[256];
+
+    RtlZeroMemory( AddrToResolve, 256 );
+    RtlZeroMemory( Server, 256 );
+
+    if( 2 == argc )
+    {
+        /* In the Windows nslookup, usage is only displayed if /? is the only
+           option specified on the command line. */
+        if( !strncmp( "/?", argv[1], 2 ) )
+        {
+            PrintUsage();
+            return 0;
+        }
+    }
+
+    if( argc > 1 )
+    {
+        for( i = 1; i < argc; i += 1 )
+        {
+            if( NoMoreOptions )
+            {
+                strncpy( Server, argv[i], 255 );
+
+                /* Determine which one to resolve. This is based on whether the
+                   DNS server provided was an IP or an FQDN. */
+                if( IsValidIP( Server ) )
+                {
+                    strncpy( State.DefaultServerAddress, Server, 16 );
+
+                    PerformInternalLookup( State.DefaultServerAddress,
+                                           State.DefaultServer );
+                }
+                else
+                {
+                    strncpy( State.DefaultServer, Server, 255 );
+
+                    PerformInternalLookup( State.DefaultServer,
+                                           State.DefaultServerAddress );
+                }
+
+                if( Interactive ) return 1;
+
+                PerformLookup( AddrToResolve );
+
+                return 0;
+            }
+            else
+            {
+                if( !strncmp( "-all", argv[i], 4 ) )
+                {
+                    PrintState();
+                }
+                else if( !strncmp( "-type=", argv[i], 6 ) )
+                {
+                    if( !strncmp( TypeA, &argv[i][6], strlen( TypeA ) ) )
+                    {
+                        State.type = TypeA;
+                    }
+                    else if( !strncmp( TypeAAAA, &argv[i][6], strlen( TypeAAAA ) ) )
+                    {
+                        State.type = TypeAAAA;
+                    }
+                    else if( !strncmp( TypeBoth, &argv[i][6], strlen( TypeBoth ) ) )
+                    {
+                        State.type = TypeBoth;
+                    }
+                    else if( !strncmp( TypeAny, &argv[i][6], strlen( TypeAny ) ) )
+                    {
+                        State.type = TypeAny;
+                    }
+                    else if( !strncmp( TypeCNAME, &argv[i][6], strlen( TypeCNAME ) ) )
+                    {
+                        State.type = TypeCNAME;
+                    }
+                    else if( !strncmp( TypeMX, &argv[i][6], strlen( TypeMX ) ) )
+                    {
+                        State.type = TypeMX;
+                    }
+                    else if( !strncmp( TypeNS, &argv[i][6], strlen( TypeNS ) ) )
+                    {
+                        State.type = TypeNS;
+                    }
+                    else if( !strncmp( TypePTR, &argv[i][6], strlen( TypePTR ) ) )
+                    {
+                        State.type = TypePTR;
+                    }
+                    else if( !strncmp( TypeSOA, &argv[i][6], strlen( TypeSOA ) ) )
+                    {
+                        State.type = TypeSOA;
+                    }
+                    else if( !strncmp( TypeSRV, &argv[i][6], strlen( TypeSRV ) ) )
+                    {
+                        State.type = TypeSRV;
+                    }
+                    else
+                    {
+                        _tprintf( _T("unknown query type: %s"), &argv[i][6] );
+                    }
+                }
+                else if( !strncmp( "-domain=", argv[i], 8 ) )
+                {
+                    strcpy( State.domain, &argv[i][8] );
+                }
+                else if( !strncmp( "-srchlist=", argv[i], 10 ) )
+                {
+                }
+                else if( !strncmp( "-root=", argv[i], 6 ) )
+                {
+                    strcpy( State.root, &argv[i][6] );
+                }
+                else if( !strncmp( "-retry=", argv[i], 7 ) )
+                {
+                }
+                else if( !strncmp( "-timeout=", argv[i], 9 ) )
+                {
+                }
+                else if( !strncmp( "-querytype=", argv[i], 11 ) )
+                {
+                    if( !strncmp( TypeA, &argv[i][11], strlen( TypeA ) ) )
+                    {
+                        State.type = TypeA;
+                    }
+                    else if( !strncmp( TypeAAAA, &argv[i][11], strlen( TypeAAAA ) ) )
+                    {
+                        State.type = TypeAAAA;
+                    }
+                    else if( !strncmp( TypeBoth, &argv[i][11], strlen( TypeBoth ) ) )
+                    {
+                        State.type = TypeBoth;
+                    }
+                    else if( !strncmp( TypeAny, &argv[i][11], strlen( TypeAny ) ) )
+                    {
+                        State.type = TypeAny;
+                    }
+                    else if( !strncmp( TypeCNAME, &argv[i][11], strlen( TypeCNAME ) ) )
+                    {
+                        State.type = TypeCNAME;
+                    }
+                    else if( !strncmp( TypeMX, &argv[i][11], strlen( TypeMX ) ) )
+                    {
+                        State.type = TypeMX;
+                    }
+                    else if( !strncmp( TypeNS, &argv[i][11], strlen( TypeNS ) ) )
+                    {
+                        State.type = TypeNS;
+                    }
+                    else if( !strncmp( TypePTR, &argv[i][11], strlen( TypePTR ) ) )
+                    {
+                        State.type = TypePTR;
+                    }
+                    else if( !strncmp( TypeSOA, &argv[i][11], strlen( TypeSOA ) ) )
+                    {
+                        State.type = TypeSOA;
+                    }
+                    else if( !strncmp( TypeSRV, &argv[i][11], strlen( TypeSRV ) ) )
+                    {
+                        State.type = TypeSRV;
+                    }
+                    else
+                    {
+                        _tprintf( _T("unknown query type: %s"), &argv[i][6] );
+                    }
+                }
+                else if( !strncmp( "-class=", argv[i], 7 ) )
+                {
+                    if( !strncmp( ClassIN, &argv[i][7], strlen( ClassIN ) ) )
+                    {
+                        State.Class = ClassIN;
+                    }
+                    else if( !strncmp( ClassAny, &argv[i][7], strlen( ClassAny ) ) )
+                    {
+                        State.Class = ClassAny;
+                    }
+                    else
+                    {
+                        _tprintf( _T("unknown query class: %s"), &argv[i][7] );
+                    }
+                }
+                else if( !strncmp( "-ixfrver=", argv[i], 9 ) )
+                {
+                }
+                else if( !strncmp( "-debug", argv[i], 6 ) )
+                {
+                    State.debug = TRUE;
+                }
+                else if( !strncmp( "-nodebug", argv[i], 8 ) )
+                {
+                    State.debug = FALSE;
+                    State.d2 = FALSE;
+                }
+                else if( !strncmp( "-d2", argv[i], 3 ) )
+                {
+                    State.d2 = TRUE;
+                    State.debug = TRUE;
+                }
+                else if( !strncmp( "-nod2", argv[i], 5 ) )
+                {
+                    if( State.debug ) _tprintf( _T("d2 mode disabled; still in debug mode\n") );
+
+                    State.d2 = FALSE;
+                }
+                else if( !strncmp( "-defname", argv[i], 8 ) )
+                {
+                    State.defname = TRUE;
+                }
+                else if( !strncmp( "-noddefname", argv[i], 10 ) )
+                {
+                    State.defname = FALSE;
+                }
+                else if( !strncmp( "-recurse", argv[i], 8 ) )
+                {
+                    State.recurse = TRUE;
+                }
+                else if( !strncmp( "-norecurse", argv[i], 10 ) )
+                {
+                    State.recurse = FALSE;
+                }
+                else if( !strncmp( "-search", argv[i], 7 ) )
+                {
+                    State.search = TRUE;
+                }
+                else if( !strncmp( "-nosearch", argv[i], 9 ) )
+                {
+                    State.search = FALSE;
+                }
+                else if( !strncmp( "-vc", argv[i], 3 ) )
+                {
+                    State.vc = TRUE;
+                }
+                else if( !strncmp( "-novc", argv[i], 5 ) )
+                {
+                    State.vc = FALSE;
+                }
+                else if( !strncmp( "-msxfr", argv[i], 6 ) )
+                {
+                    State.MSxfr = TRUE;
+                }
+                else if( !strncmp( "-nomsxfr", argv[i], 8 ) )
+                {
+                    State.MSxfr = FALSE;
+                }
+                else if( !strncmp( "-", argv[i], 1 ) && (strlen( argv[i] ) == 1) )
+                {
+                    /* Since we received just the plain - switch, we are going
+                       to be entering interactive mode. We also will not be
+                       parsing any more options. */
+                    NoMoreOptions = TRUE;
+                    Interactive = TRUE;
+                }
+                else
+                {
+                    /* Grab the address to resolve. No more options accepted
+                       past this point. */
+                    strncpy( AddrToResolve, argv[i], 255 );
+                    NoMoreOptions = TRUE;
+                }
+            }
+        }
+
+        if( NoMoreOptions && !Interactive )
+        {
+            /* Get the FQDN of the DNS server. */
+            PerformInternalLookup( State.DefaultServerAddress,
+                                   State.DefaultServer );
+
+            PerformLookup( AddrToResolve );
+
+            return 0;
+        }
+    }
+
+    /* Get the FQDN of the DNS server. */
+    PerformInternalLookup( State.DefaultServerAddress,
+                           State.DefaultServer );
+
+    return 1;
+}
+
+void InteractiveMode()
+{
+    _tprintf( _T("Default Server:  %s\n"), State.DefaultServer );
+    _tprintf( _T("Address:  %s\n\n"), State.DefaultServerAddress );
+
+    /* TODO: Implement interactive mode. */
+
+    _tprintf( _T("ERROR: Feature not implemented.\n") );
+}
+
+int main( int argc, char* argv[] )
+{
+    int i;
+    ULONG Status;
+    PFIXED_INFO pNetInfo = NULL;
+    ULONG NetBufLen = 0;
+    WSADATA wsaData;
+
+    ProcessHeap = GetProcessHeap();
+    RequestID = 1;
+
+    /* Set up the initial state. */
+    State.debug = FALSE;
+    State.defname = TRUE;
+    State.search = TRUE;
+    State.recurse = TRUE;
+    State.d2 = FALSE;
+    State.vc = FALSE;
+    State.ignoretc = FALSE;
+    State.port = 53;
+    State.type = TypeBoth;
+    State.Class = ClassIN;
+    State.timeout = 2;
+    State.retry = 1;
+    State.MSxfr = TRUE;
+    State.ixfrver = 1;
+
+    RtlZeroMemory( State.root, 256 );
+    RtlZeroMemory( State.domain, 256 );
+    for( i = 0; i < 6; i += 1 ) RtlZeroMemory( State.srchlist[i], 256 );
+    RtlZeroMemory( State.DefaultServer, 256 );
+    RtlZeroMemory( State.DefaultServerAddress, 16 );
+
+    strncpy( State.root, DEFAULT_ROOT, strlen( DEFAULT_ROOT ) );
+
+    /* We don't know how long of a buffer it will want to return. So we'll
+       pass an empty one now and let it fail only once, instead of guessing. */
+    Status = GetNetworkParams( pNetInfo, &NetBufLen );
+    if( Status == ERROR_BUFFER_OVERFLOW )
+    {
+        pNetInfo = (PFIXED_INFO)HeapAlloc( ProcessHeap, 0, NetBufLen );
+        if( pNetInfo == NULL )
+        {
+            _tprintf( _T("ERROR: Out of memory\n") );
+
+            return -1;
+        }
+
+        /* For real this time. */
+        Status = GetNetworkParams( pNetInfo, &NetBufLen );
+        if( Status != NO_ERROR )
+        {
+            _tprintf( _T("Error in GetNetworkParams call\n") );
+
+            HeapFree( ProcessHeap, 0, pNetInfo );
+
+            return -2;
+        }
+    }
+
+    strncpy( State.domain, pNetInfo->DomainName, 255 );
+    strncpy( State.srchlist[0], pNetInfo->DomainName, 255 );
+    strncpy( State.DefaultServerAddress,
+             pNetInfo->DnsServerList.IpAddress.String,
+             15 );
+
+    HeapFree( ProcessHeap, 0, pNetInfo );
+
+    WSAStartup( MAKEWORD(2,2), &wsaData );
+
+    switch( ParseCommandLine( argc, argv ) )
+    {
+    case 0:
+        /* This means that it was a /? parameter. */
+        break;
+
+    default:
+        /* Anything else means we enter interactive mode. The only exception
+           to this is when the host to resolve was provided on the command
+           line. */
+        InteractiveMode();
+    }
+
+    WSACleanup();
+    return 0;
+}
diff --git a/reactos/base/applications/network/nslookup/nslookup.h b/reactos/base/applications/network/nslookup/nslookup.h
new file mode 100644 (file)
index 0000000..51ff023
--- /dev/null
@@ -0,0 +1,104 @@
+#define TypeA       "A"
+#define TypeAAAA    "AAAA"
+#define TypeBoth    "A+AAAA"
+#define TypeAny     "ANY"
+#define TypeCNAME   "CNAME"
+#define TypeMX      "MX"
+#define TypeNS      "NS"
+#define TypePTR     "PTR"
+#define TypeSOA     "SOA"
+#define TypeSRV     "SRV"
+
+#define TYPE_A      0x01
+#define TYPE_NS     0x02
+#define TYPE_CNAME  0x05
+#define TYPE_SOA    0x06
+#define TYPE_WKS    0x0B
+#define TYPE_PTR    0x0C
+#define TYPE_MX     0x0F
+#define TYPE_ANY    0xFF
+
+#define ClassIN     "IN"
+#define ClassAny    "ANY"
+
+#define CLASS_IN    0x01
+#define CLASS_ANY   0xFF
+
+#define OPCODE_QUERY    0x00
+#define OPCODE_IQUERY   0x01
+#define OPCODE_STATUS   0x02
+
+#define OpcodeQuery     "QUERY"
+#define OpcodeIQuery    "IQUERY"
+#define OpcodeStatus    "STATUS"
+#define OpcodeReserved  "RESERVED"
+
+#define RCODE_NOERROR   0x00
+#define RCODE_FORMERR   0x01
+#define RCODE_FAILURE   0x02
+#define RCODE_NXDOMAIN  0x03
+#define RCODE_NOTIMP    0x04
+#define RCODE_REFUSED   0x05
+
+#define RCodeNOERROR    "NOERROR"
+#define RCodeFORMERR    "FORMERR"
+#define RCodeFAILURE    "FAILURE"
+#define RCodeNXDOMAIN   "NXDOMAIN"
+#define RCodeNOTIMP     "NOTIMP"
+#define RCodeREFUSED    "REFUSED"
+#define RCodeReserved   "RESERVED"
+
+#define DEFAULT_ROOT    "A.ROOT-SERVERS.NET."
+#define ARPA_SIG        ".in-addr.arpa"
+
+typedef struct _STATE
+{
+    BOOL debug;
+    BOOL defname;
+    BOOL d2;
+    BOOL recurse;
+    BOOL search;
+    BOOL vc;
+    BOOL ignoretc;
+    BOOL MSxfr;
+    CHAR domain[256];
+    CHAR srchlist[6][256];
+    CHAR root[256];
+    DWORD retry;
+    DWORD timeout;
+    DWORD ixfrver;
+    PCHAR type;
+    PCHAR Class;
+    USHORT port;
+    CHAR DefaultServer[256];
+    CHAR DefaultServerAddress[16];
+} STATE, *PSTATE;
+
+/* nslookup.c */
+
+extern STATE    State;
+extern HANDLE   ProcessHeap;
+
+/* utility.c */
+
+BOOL SendRequest( PCHAR pInBuffer,
+                  ULONG InBufferLength,
+                  PCHAR pOutBuffer,
+                  PULONG pOutBufferLength );
+
+int     ExtractName( PCHAR pBuffer,
+                     PCHAR pOutput,
+                     USHORT Offset,
+                     UCHAR Limit );
+
+void    ReverseIP( PCHAR pIP, PCHAR pReturn );
+BOOL    IsValidIP( PCHAR pInput );
+int     ExtractIP( PCHAR pBuffer, PCHAR pOutput, USHORT Offset );
+void    PrintD2( PCHAR pBuffer, DWORD BufferLength );
+void    PrintDebug( PCHAR pBuffer, DWORD BufferLength );
+PCHAR   OpcodeIDtoOpcodeName( UCHAR Opcode );
+PCHAR   RCodeIDtoRCodeName( UCHAR RCode );
+PCHAR   TypeIDtoTypeName( USHORT TypeID );
+USHORT  TypeNametoTypeID( PCHAR TypeName );
+PCHAR   ClassIDtoClassName( USHORT ClassID );
+USHORT  ClassNametoClassID( PCHAR ClassName );
diff --git a/reactos/base/applications/network/nslookup/nslookup.rbuild b/reactos/base/applications/network/nslookup/nslookup.rbuild
new file mode 100644 (file)
index 0000000..b4d02f9
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
+<module name="nslookup" type="win32cui" installbase="system32" installname="nslookup.exe">
+       <include base="nslookup">.</include>
+       <library>kernel32</library>
+       <library>user32</library>
+       <library>ws2_32</library>
+       <library>snmpapi</library>
+       <library>iphlpapi</library>
+       <file>nslookup.c</file>
+       <file>utility.c</file>
+       <file>nslookup.rc</file>
+</module>
diff --git a/reactos/base/applications/network/nslookup/nslookup.rc b/reactos/base/applications/network/nslookup/nslookup.rc
new file mode 100644 (file)
index 0000000..0bc0c0f
--- /dev/null
@@ -0,0 +1,5 @@
+#define REACTOS_STR_FILE_DESCRIPTION    "ReactOS TCP/IPv4 Win32 nslookup\0"
+#define REACTOS_STR_INTERNAL_NAME       "nslookup\0"
+#define REACTOS_STR_ORIGINAL_FILENAME   "nslookup.exe\0"
+#define REACTOS_STR_ORIGINAL_COPYRIGHT  "Lucas Suggs (lucas.suggs@gmail.com)\0"
+#include <reactos/version.rc>
diff --git a/reactos/base/applications/network/nslookup/utility.c b/reactos/base/applications/network/nslookup/utility.c
new file mode 100644 (file)
index 0000000..50e8cc1
--- /dev/null
@@ -0,0 +1,852 @@
+/*
+ * PROJECT:     ReactOS nslookup utility
+ * LICENSE:     GPL - See COPYING in the top level directory
+ * FILE:        applications/network/nslookup/utility.c
+ * PURPOSE:     Support functions for nslookup.c
+ * COPYRIGHT:   Copyright 2009 Lucas Suggs <lucas.suggs@gmail.com>
+ */
+
+#include <windows.h>
+#include <tchar.h>
+#include <stdio.h>
+#include "nslookup.h"
+
+BOOL SendRequest( PCHAR pInBuffer,
+                  ULONG InBufferLength,
+                  PCHAR pOutBuffer,
+                  PULONG pOutBufferLength )
+{
+    int j;
+    USHORT RequestID, ResponseID;
+    BOOL bWait;
+    SOCKET s;
+    SOCKADDR_IN RecAddr, RecAddr2, SendAddr;
+    int SendAddrLen = sizeof(SendAddr);
+
+    RtlZeroMemory( &RecAddr, sizeof(SOCKADDR_IN) );
+    RtlZeroMemory( &RecAddr2, sizeof(SOCKADDR_IN) );
+    RtlZeroMemory( &SendAddr, sizeof(SOCKADDR_IN) );
+
+    /* Pull the request ID from the buffer. */
+    RequestID = ntohs( ((PSHORT)&pInBuffer[0])[0] );
+
+    /* If D2 flags is enabled, then display D2 information. */
+    if( State.d2 ) PrintD2( pInBuffer, InBufferLength );
+
+    /* Create the sockets for both send and receive. */
+    s = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
+
+    /* Set up the structure to tell it where we are going. */
+    RecAddr.sin_family = AF_INET;
+    RecAddr.sin_port = htons( State.port );
+    RecAddr.sin_addr.s_addr = inet_addr( State.DefaultServerAddress );
+
+    /* Set up the structure to tell it what port to listen on. */
+    RecAddr2.sin_family = AF_INET;
+    RecAddr2.sin_port = htons( State.port );
+    RecAddr2.sin_addr.s_addr = htonl( INADDR_ANY );
+
+    /* Bind the receive socket. */
+    bind( s, (SOCKADDR*)&RecAddr2, sizeof(RecAddr2) );
+
+    /* Send the datagram to the DNS server. */
+    j = sendto( s,
+                pInBuffer,
+                InBufferLength,
+                0,
+                (SOCKADDR*)&RecAddr,
+                sizeof(RecAddr) );
+    if( j == SOCKET_ERROR )
+    {
+        switch( WSAGetLastError() )
+        {
+        case WSANOTINITIALISED:
+            _tprintf( _T("sendto() failed with WSANOTINITIALIZED\n") );
+            break;
+        case WSAENETDOWN:
+            _tprintf( _T("sendto() failed with WSAENETDOWN\n") );
+            break;
+        case WSAEACCES:
+            _tprintf( _T("sendto() failed with WSAEACCES\n") );
+            break;
+        case WSAEINVAL:
+            _tprintf( _T("sendto() failed with WSAEINVAL\n") );
+            break;
+        case WSAEINTR:
+            _tprintf( _T("sendto() failed with WSAEINTR\n") );
+            break;
+        case WSAEINPROGRESS:
+            _tprintf( _T("sendto() failed with WSAEINPROGRESS\n") );
+            break;
+        case WSAEFAULT:
+            _tprintf( _T("sendto() failed with WSAEFAULT\n") );
+            break;
+        case WSAENETRESET:
+            _tprintf( _T("sendto() failed with WSAENETRESET\n") );
+            break;
+        case WSAENOBUFS:
+            _tprintf( _T("sendto() failed with WSAENOBUFS\n") );
+            break;
+        case WSAENOTCONN:
+            _tprintf( _T("sendto() failed with WSAENOTCONN\n") );
+            break;
+        case WSAENOTSOCK:
+            _tprintf( _T("sendto() failed with WSAENOTSOCK\n") );
+            break;
+        case WSAEOPNOTSUPP:
+            _tprintf( _T("sendto() failed with WSAEOPNOTSUPP\n") );
+            break;
+        case WSAESHUTDOWN:
+            _tprintf( _T("sendto() failed with WSAESHUTDOWN\n") );
+            break;
+        case WSAEWOULDBLOCK:
+            _tprintf( _T("sendto() failed with WSAEWOULDBLOCK\n") );
+            break;
+        case WSAEMSGSIZE:
+            _tprintf( _T("sendto() failed with WSAEMSGSIZE\n") );
+            break;
+        case WSAEHOSTUNREACH:
+            _tprintf( _T("sendto() failed with WSAEHOSTUNREACH\n") );
+            break;
+        case WSAECONNABORTED:
+            _tprintf( _T("sendto() failed with WSAECONNABORTED\n") );
+            break;
+        case WSAECONNRESET:
+            _tprintf( _T("sendto() failed with WSAECONNRESET\n") );
+            break;
+        case WSAEADDRNOTAVAIL:
+            _tprintf( _T("sendto() failed with WSAEADDRNOTAVAIL\n") );
+            break;
+        case WSAEAFNOSUPPORT:
+            _tprintf( _T("sendto() failed with WSAEAFNOSUPPORT\n") );
+            break;
+        case WSAEDESTADDRREQ:
+            _tprintf( _T("sendto() failed with WSAEDESTADDRREQ\n") );
+            break;
+        case WSAENETUNREACH:
+            _tprintf( _T("sendto() failed with WSAENETUNREACH\n") );
+            break;
+        case WSAETIMEDOUT:
+            _tprintf( _T("sendto() failed with WSAETIMEDOUT\n") );
+            break;
+        default:
+            _tprintf( _T("sendto() failed with unknown error\n") );
+        }
+
+        return FALSE;
+    }
+
+    bWait = TRUE;
+
+    while( bWait )
+    {
+        /* Wait for the DNS reply. */
+        j = recvfrom( s,
+                      pOutBuffer,
+                      *pOutBufferLength,
+                      0,
+                      (SOCKADDR*)&SendAddr,
+                      &SendAddrLen );
+        if( j == SOCKET_ERROR )
+        {
+            switch( WSAGetLastError() )
+            {
+            case WSANOTINITIALISED:
+                _tprintf( _T("recvfrom() failed with WSANOTINITIALIZED\n") );
+                break;
+            case WSAENETDOWN:
+                _tprintf( _T("recvfrom() failed with WSAENETDOWN\n") );
+                break;
+            case WSAEACCES:
+                _tprintf( _T("recvfrom() failed with WSAEACCES\n") );
+                break;
+            case WSAEINVAL:
+                _tprintf( _T("recvfrom() failed with WSAEINVAL\n") );
+                break;
+            case WSAEINTR:
+                _tprintf( _T("recvfrom() failed with WSAEINTR\n") );
+                break;
+            case WSAEINPROGRESS:
+                _tprintf( _T("recvfrom() failed with WSAEINPROGRESS\n") );
+                break;
+            case WSAEFAULT:
+                _tprintf( _T("recvfrom() failed with WSAEFAULT\n") );
+                break;
+            case WSAENETRESET:
+                _tprintf( _T("recvfrom() failed with WSAENETRESET\n") );
+                break;
+            case WSAENOBUFS:
+                _tprintf( _T("recvfrom() failed with WSAENOBUFS\n") );
+                break;
+            case WSAENOTCONN:
+                _tprintf( _T("recvfrom() failed with WSAENOTCONN\n") );
+                break;
+            case WSAENOTSOCK:
+                _tprintf( _T("recvfrom() failed with WSAENOTSOCK\n") );
+                break;
+            case WSAEOPNOTSUPP:
+                _tprintf( _T("recvfrom() failed with WSAEOPNOTSUPP\n") );
+                break;
+            case WSAESHUTDOWN:
+                _tprintf( _T("recvfrom() failed with WSAESHUTDOWN\n") );
+                break;
+            case WSAEWOULDBLOCK:
+                _tprintf( _T("recvfrom() failed with WSAEWOULDBLOCK\n") );
+                break;
+            case WSAEMSGSIZE:
+                _tprintf( _T("recvfrom() failed with WSAEMSGSIZE\n") );
+                break;
+            case WSAEHOSTUNREACH:
+                _tprintf( _T("recvfrom() failed with WSAEHOSTUNREACH\n") );
+                break;
+            case WSAECONNABORTED:
+                _tprintf( _T("recvfrom() failed with WSAECONNABORTED\n") );
+                break;
+            case WSAECONNRESET:
+                _tprintf( _T("recvfrom() failed with WSAECONNRESET\n") );
+                break;
+            case WSAEADDRNOTAVAIL:
+                _tprintf( _T("recvfrom() failed with WSAEADDRNOTAVAIL\n") );
+                break;
+            case WSAEAFNOSUPPORT:
+                _tprintf( _T("recvfrom() failed with WSAEAFNOSUPPORT\n") );
+                break;
+            case WSAEDESTADDRREQ:
+                _tprintf( _T("recvfrom() failed with WSAEDESTADDRREQ\n") );
+                break;
+            case WSAENETUNREACH:
+                _tprintf( _T("recvfrom() failed with WSAENETUNREACH\n") );
+                break;
+            case WSAETIMEDOUT:
+                _tprintf( _T("recvfrom() failed with WSAETIMEDOUT\n") );
+                break;
+            default:
+                _tprintf( _T("recvfrom() failed with unknown error\n") );
+            }
+
+            return FALSE;
+        }
+
+        ResponseID = ntohs( ((PSHORT)&pOutBuffer[0])[0] );
+
+        if( ResponseID == RequestID ) bWait = FALSE;
+    }
+
+    /* We don't need the sockets anymore. */
+    closesocket( s );
+
+    /* If debug information then display debug information. */
+    if( State.debug ) PrintDebug( pOutBuffer, j );
+
+    /* Return the real output buffer length. */
+    *pOutBufferLength = j;
+
+    return TRUE;
+}
+
+void ReverseIP( PCHAR pIP, PCHAR pReturn )
+{
+    int i;
+    int j;
+    int k = 0;
+
+    j = strlen( pIP ) - 1;
+    i = j;
+
+    /* We have A.B.C.D
+       We will turn this into D.C.B.A and stick it in pReturn */
+
+    /* A */
+    for( ; i > 0; i -= 1 ) if( '.' == pIP[i] ) break;
+
+    strncpy( &pReturn[k], &pIP[i + 1], (j - i) );
+    k += (j - i);
+
+    pReturn[k] = '.';
+    k += 1;
+
+    i -= 1;
+    j = i;
+
+    /* B */
+    for( ; i > 0; i -= 1 ) if( '.' == pIP[i] ) break;
+
+    strncpy( &pReturn[k], &pIP[i + 1], (j - i) );
+    k += (j - i);
+
+    pReturn[k] = '.';
+    k += 1;
+
+    i -= 1;
+    j = i;
+
+    /* C */
+    for( ; i > 0; i -= 1 ) if( '.' == pIP[i] ) break;
+
+    strncpy( &pReturn[k], &pIP[i + 1], (j - i) );
+    k += (j - i);
+
+    pReturn[k] = '.';
+    k += 1;
+
+    i -= 1;
+    j = i;
+
+    /* D */
+    for( ; i > 0; i -= 1 );
+
+    strncpy( &pReturn[k], &pIP[i], (j - i) + 1 );
+    k += (j - i) + 1;
+
+    pReturn[k] = '\0';
+}
+
+BOOL IsValidIP( PCHAR pInput )
+{
+    int i = 0, l = 0, b = 0, c = 1;
+
+    /* Max length of an IP, e.g. 255.255.255.255, is 15 characters. */
+    l = strlen( pInput );
+    if( l > 15 ) return FALSE;
+
+    /* 'b' is the count of the current segment. It gets reset after seeing a
+       '.'. */
+    for( ; i < l; i += 1 )
+    {
+        if( '.' == pInput[i] )
+        {
+            if( !b ) return FALSE;
+            if( b > 3 ) return FALSE;
+
+            b = 0;
+            c += 1;
+        }
+        else
+        {
+            b += 1;
+
+            if( (pInput[i] < '0') || (pInput[i] > '9') ) return FALSE;
+        }
+    }
+
+    if( b > 3 ) return FALSE;
+
+    /* 'c' is the number of segments seen. If it's less than 4, then it's not
+       a valid IP. */
+    if( c < 4 ) return FALSE;
+
+    return TRUE;
+}
+
+int ExtractName( PCHAR pBuffer, PCHAR pOutput, USHORT Offset, UCHAR Limit )
+{
+    int c = 0, d = 0, i = 0, j = 0, k = 0, l = 0, m = 0;
+
+    i = Offset;
+
+    /* If Limit == 0, then we assume "no" limit. */
+    d = Limit;
+    if( 0 == Limit ) d = 255;
+
+    while( d > 0 )
+    {
+        l = pBuffer[i] & 0xFF;
+        i += 1;
+        if( !m ) c += 1;
+
+        if( 0xC0 == l )
+        {
+            if( !m ) c += 1;
+            m = 1;
+            d += (255 - Limit);
+            i = pBuffer[i];
+        }
+        else
+        {
+            for( j = 0; j < l; j += 1 )
+            {
+                pOutput[k] = pBuffer[i];
+
+                i += 1;
+                if( !m ) c += 1;
+                k += 1;
+                d -= 1;
+            }
+
+            d -= 1;
+
+            if( !pBuffer[i] || (d < 1) ) break;
+
+            pOutput[k] = '.';
+            k += 1;
+        }
+    };
+
+    if( !m )
+    {
+        if( !Limit ) c += 1;
+    }
+
+    pOutput[k] = '\0';
+
+    return c;
+}
+
+int ExtractIP( PCHAR pBuffer, PCHAR pOutput, USHORT Offset )
+{
+    int c = 0, l = 0, i = 0, v = 0;
+
+    i = Offset;
+
+    v = (UCHAR)pBuffer[i];
+    l += 1;
+    i += 1;
+
+    sprintf( &pOutput[c], "%d.", v );
+    c += strlen( &pOutput[c] );
+
+    v = (UCHAR)pBuffer[i];
+    l += 1;
+    i += 1;
+
+    sprintf( &pOutput[c], "%d.", v );
+    c += strlen( &pOutput[c] );
+
+    v = (UCHAR)pBuffer[i];
+    l += 1;
+    i += 1;
+
+    sprintf( &pOutput[c], "%d.", v );
+    c += strlen( &pOutput[c] );
+
+    v = (UCHAR)pBuffer[i];
+    l += 1;
+    i += 1;
+
+    sprintf( &pOutput[c], "%d", v );
+    c += strlen( &pOutput[c] );
+
+    pOutput[c] = '\0';
+
+    return l;
+}
+
+void PrintD2( PCHAR pBuffer, DWORD BufferLength )
+{
+    USHORT RequestID;
+    UCHAR Header1, Header2;
+    USHORT NumQuestions, NumAnswers, NumAuthority, NumAdditional;
+    USHORT Type, Class;
+    CHAR pName[255];
+    int i = 0, k = 0;
+
+    RequestID = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+    i += 2;
+
+    Header1 = pBuffer[i];
+    i += 1;
+
+    Header2 = pBuffer[i];
+    i += 1;
+
+    NumQuestions = ntohs( ((PSHORT)&pBuffer[i])[0] );
+    i += 2;
+
+    NumAnswers = ntohs( ((PSHORT)&pBuffer[i])[0] );
+    i += 2;
+
+    NumAuthority = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+    i += 2;
+
+    NumAdditional = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+    i += 2;
+
+    _tprintf( _T("------------\n") );
+    _tprintf( _T("SendRequest(), len %d\n"), (int)BufferLength );
+    _tprintf( _T("    HEADER:\n") );
+    _tprintf( _T("        opcode = %s, id = %d, rcode = %s\n"),
+                 OpcodeIDtoOpcodeName( (Header1 & 0x78) >> 3 ),
+                 (int)RequestID,
+                 RCodeIDtoRCodeName( Header2 & 0x0F ) );
+
+    _tprintf( _T("        header flags:  query") );
+    if( Header1 & 0x01 ) _tprintf( _T(", want recursion") );
+    _tprintf( _T("\n") );
+
+    _tprintf( _T("        questions = %d,  answers = %d,"
+                 "  authority records = %d,  additional = %d\n\n"),
+                 (int)NumQuestions,
+                 (int)NumAnswers,
+                 (int)NumAuthority,
+                 (int)NumAdditional );
+
+    if( NumQuestions )
+    {
+        _tprintf( _T("    QUESTIONS:\n") );
+
+        for( k = 0; k < NumQuestions; k += 1 )
+        {
+            i += ExtractName( pBuffer, pName, i, 0 );
+
+            _tprintf( _T("        %s"), pName );
+
+            Type = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+            i += 2;
+
+            Class = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+            i += 2;
+
+            _tprintf( _T(", type = %s, class = %s\n"),
+                      TypeIDtoTypeName( Type ),
+                      ClassIDtoClassName( Class ) );
+        }
+    }
+
+    _tprintf( _T("\n------------\n") );
+}
+
+void PrintDebug( PCHAR pBuffer, DWORD BufferLength )
+{
+    USHORT ResponseID;
+    UCHAR Header1, Header2;
+    USHORT NumQuestions, NumAnswers, NumAuthority, NumAdditional;
+    USHORT Type, Class;
+    ULONG TTL;
+    CHAR pName[255];
+    int d = 0, i = 0, k = 0;
+
+    ResponseID = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+    i += 2;
+
+    Header1 = pBuffer[i];
+    i += 1;
+
+    Header2 = pBuffer[i];
+    i += 1;
+
+    NumQuestions = ntohs( ((PSHORT)&pBuffer[i])[0] );
+    i += 2;
+
+    NumAnswers = ntohs( ((PSHORT)&pBuffer[i])[0] );
+    i += 2;
+
+    NumAuthority = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+    i += 2;
+
+    NumAdditional = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+    i += 2;
+
+    _tprintf( _T("------------\n") );
+    _tprintf( _T("Got answer (%d bytes):\n"), (int)BufferLength );
+    _tprintf( _T("    HEADER:\n") );
+    _tprintf( _T("        opcode = %s, id = %d, rcode = %s\n"),
+                 OpcodeIDtoOpcodeName( (Header1 & 0x78) >> 3 ),
+                 (int)ResponseID,
+                 RCodeIDtoRCodeName( Header2 & 0x0F ) );
+
+    _tprintf( _T("        header flags:  response") );
+    if( Header1 & 0x01 ) _tprintf( _T(", want recursion") );
+    if( Header2 & 0x80 ) _tprintf( _T(", recursion avail.") );
+    _tprintf( _T("\n") );
+
+    _tprintf( _T("        questions = %d,  answers = %d,  "
+                 "authority records = %d,  additional = %d\n\n"),
+                 (int)NumQuestions,
+                 (int)NumAnswers,
+                 (int)NumAuthority,
+                 (int)NumAdditional );
+
+    if( NumQuestions )
+    {
+        _tprintf( _T("    QUESTIONS:\n") );
+
+        for( k = 0; k < NumQuestions; k += 1 )
+        {
+            i += ExtractName( pBuffer, pName, i, 0 );
+
+            _tprintf( _T("        %s"), pName );
+
+            Type = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+            i += 2;
+
+            Class = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+            i += 2;
+
+            _tprintf( _T(", type = %s, class = %s\n"),
+                      TypeIDtoTypeName( Type ),
+                      ClassIDtoClassName( Class ) );
+        }
+    }
+
+    if( NumAnswers )
+    {
+        _tprintf( _T("    ANSWERS:\n") );
+
+        for( k = 0; k < NumAnswers; k += 1 )
+        {
+            _tprintf( _T("    ->  ") );
+
+            /* Print out the name. */
+            i += ExtractName( pBuffer, pName, i, 0 );
+
+            _tprintf( _T("%s\n"), pName );
+
+            /* Print out the type, class and data length. */
+            Type = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+            i += 2;
+
+            Class = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+            i += 2;
+
+            TTL = ntohl( ((PULONG)&pBuffer[i])[0] );
+            i += 4;
+
+            d = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+            i += 2;
+
+            _tprintf( _T("        type = %s, class = %s, dlen = %d\n"),
+                      TypeIDtoTypeName( Type ),
+                      ClassIDtoClassName( Class ),
+                      d );
+
+            /* Print out the answer. */
+            if( TYPE_A == Type )
+            {
+                i += ExtractIP( pBuffer, pName, i );
+
+                _tprintf( _T("        internet address = %s\n"), pName );
+            }
+            else
+            {
+                i += ExtractName( pBuffer, pName, i, d );
+
+                _tprintf( _T("        name = %s\n"), pName );
+            }
+
+            _tprintf( _T("        ttl = %d ()\n"), (int)TTL );
+        }
+    }
+
+    if( NumAuthority )
+    {
+        _tprintf( _T("    AUTHORITY RECORDS:\n") );
+
+        for( k = 0; k < NumAuthority; k += 1 )
+        {
+            /* Print out the zone name. */
+            i += ExtractName( pBuffer, pName, i, 0 );
+
+            _tprintf( _T("    ->  %s\n"), pName );
+
+            /* Print out the type, class, data length and TTL. */
+            Type = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+            i += 2;
+
+            Class = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+            i += 2;
+
+            TTL = ntohl( ((PULONG)&pBuffer[i])[0] );
+            i += 4;
+
+            d = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+            i += 2;
+
+            _tprintf( _T("        type = %s, class = %s, dlen = %d\n"),
+                      TypeIDtoTypeName( Type ),
+                      ClassIDtoClassName( Class ),
+                      d );
+
+            /* TODO: There might be more types? */
+            if( TYPE_NS == Type )
+            {
+                /* Print out the NS. */
+                i += ExtractName( pBuffer, pName, i, d );
+
+                _tprintf( _T("        nameserver = %s\n"), pName );
+
+                _tprintf( _T("        ttl = %d ()\n"), (int)TTL );
+            }
+            else if( TYPE_SOA == Type )
+            {
+                _tprintf( _T("        ttl = %d ()\n"), (int)TTL );
+
+                /* Print out the primary NS. */
+                i += ExtractName( pBuffer, pName, i, 0 );
+
+                _tprintf( _T("        primary name server = %s\n"), pName );
+
+                /* Print out the responsible mailbox. */
+                i += ExtractName( pBuffer, pName, i, 0 );
+
+                _tprintf( _T("        responsible mail addr = %s\n"), pName );
+
+                /* Print out the serial, refresh, retry, expire and default TTL. */
+                _tprintf( _T("        serial = ()\n") );
+                _tprintf( _T("        refresh = ()\n") );
+                _tprintf( _T("        retry = ()\n") );
+                _tprintf( _T("        expire = ()\n") );
+                _tprintf( _T("        default TTL = ()\n") );
+                i += 20;
+            }
+        }
+    }
+
+    if( NumAdditional )
+    {
+        _tprintf( _T("    ADDITIONAL:\n") );
+
+        for( k = 0; k < NumAdditional; k += 1 )
+        {
+            /* Print the name. */
+            i += ExtractName( pBuffer, pName, i, 0 );
+
+            _tprintf( _T("    ->  %s\n"), pName );
+
+            /* Print out the type, class, data length and TTL. */
+            Type = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+            i += 2;
+
+            Class = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+            i += 2;
+
+            TTL = ntohl( ((PULONG)&pBuffer[i])[0] );
+            i += 4;
+
+            d = ntohs( ((PUSHORT)&pBuffer[i])[0] );
+            i += 2;
+
+            _tprintf( _T("        type = %s, class = %s, dlen = %d\n"),
+                      TypeIDtoTypeName( Type ),
+                      ClassIDtoClassName( Class ),
+                      d );
+
+            /* TODO: There might be more types? */
+            if( TYPE_A == Type )
+            {
+                /* Print out the NS. */
+                i += ExtractIP( pBuffer, pName, i );
+
+                _tprintf( _T("        internet address = %s\n"), pName );
+
+                _tprintf( _T("        ttl = %d ()\n"), (int)TTL );
+            }
+        }
+    }
+
+    _tprintf( _T("\n------------\n") );
+}
+
+PCHAR OpcodeIDtoOpcodeName( UCHAR Opcode )
+{
+    switch( Opcode & 0x0F )
+    {
+    case OPCODE_QUERY:
+        return OpcodeQuery;
+
+    case OPCODE_IQUERY:
+        return OpcodeIQuery;
+
+    case OPCODE_STATUS:
+        return OpcodeStatus;
+
+    default:
+        return OpcodeReserved;
+    }
+}
+
+PCHAR RCodeIDtoRCodeName( UCHAR RCode )
+{
+    switch( RCode & 0x0F )
+    {
+    case RCODE_NOERROR:
+        return RCodeNOERROR;
+
+    case RCODE_FORMERR:
+        return RCodeFORMERR;
+
+    case RCODE_FAILURE:
+        return RCodeFAILURE;
+
+    case RCODE_NXDOMAIN:
+        return RCodeNXDOMAIN;
+
+    case RCODE_NOTIMP:
+        return RCodeNOTIMP;
+
+    case RCODE_REFUSED:
+        return RCodeREFUSED;
+
+    default:
+        return RCodeReserved;
+    }
+}
+
+PCHAR TypeIDtoTypeName( USHORT TypeID )
+{
+    switch( TypeID )
+    {
+    case TYPE_A:
+        return TypeA;
+
+    case TYPE_NS:
+        return TypeNS;
+
+    case TYPE_CNAME:
+        return TypeCNAME;
+
+    case TYPE_SOA:
+        return TypeSOA;
+
+    case TYPE_WKS:
+        return TypeSRV;
+
+    case TYPE_PTR:
+        return TypePTR;
+
+    case TYPE_MX:
+        return TypeMX;
+
+    case TYPE_ANY:
+        return TypeAny;
+
+    default:
+        return "Unknown";
+    }
+}
+
+USHORT TypeNametoTypeID( PCHAR TypeName )
+{
+    if( !strncmp( TypeName, TypeA, strlen( TypeA ) ) ) return TYPE_A;
+    if( !strncmp( TypeName, TypeNS, strlen( TypeNS ) ) ) return TYPE_NS;
+    if( !strncmp( TypeName, TypeCNAME, strlen( TypeCNAME ) ) ) return TYPE_CNAME;
+    if( !strncmp( TypeName, TypeSOA, strlen( TypeSOA ) ) ) return TYPE_SOA;
+    if( !strncmp( TypeName, TypeSRV, strlen( TypeSRV ) ) ) return TYPE_WKS;
+    if( !strncmp( TypeName, TypePTR, strlen( TypePTR ) ) ) return TYPE_PTR;
+    if( !strncmp( TypeName, TypeMX, strlen( TypeMX ) ) ) return TYPE_MX;
+    if( !strncmp( TypeName, TypeAny, strlen( TypeAny ) ) ) return TYPE_ANY;
+
+    return 0;
+}
+
+PCHAR ClassIDtoClassName( USHORT ClassID )
+{
+    switch( ClassID )
+    {
+    case CLASS_IN:
+        return ClassIN;
+
+    case CLASS_ANY:
+        return ClassAny;
+        
+    default:
+        return "Unknown";
+    }
+}
+
+USHORT ClassNametoClassID( PCHAR ClassName )
+{
+    if( !strncmp( ClassName, ClassIN, strlen( ClassIN ) ) ) return CLASS_IN;
+    if( !strncmp( ClassName, ClassAny, strlen( ClassAny ) ) ) return CLASS_ANY;
+
+    return 0;
+}
index 3901d26..eaae762 100644 (file)
@@ -338,7 +338,7 @@ static BOOL Setup(VOID)
         Target.sin_family = AF_INET;
 
     TargetIP = inet_ntoa(Target.sin_addr);
-    CurrentSeqNum = 0;
+    CurrentSeqNum = 1;
     SentCount = 0;
     LostCount = 0;
     MinRTT.QuadPart = 0;
index faf5973..97bc8b8 100644 (file)
@@ -260,10 +260,10 @@ PreparePacket(PAPPINFO pInfo,
     pInfo->SendPacket->icmpheader.code     = 0;
     pInfo->SendPacket->icmpheader.checksum = 0;
     pInfo->SendPacket->icmpheader.id       = (USHORT)GetCurrentProcessId();
-    pInfo->SendPacket->icmpheader.seq      = iSeqNum;
+    pInfo->SendPacket->icmpheader.seq      = htons((USHORT)iSeqNum);
 
     /* calculate checksum of packet */
-    pInfo->SendPacket->icmpheader.checksum  = CheckSum((PUSHORT)&pInfo->SendPacket,
+    pInfo->SendPacket->icmpheader.checksum  = CheckSum((PUSHORT)&pInfo->SendPacket->icmpheader,
                                                        sizeof(ICMP_HEADER) + PACKET_SIZE);
 }
 
@@ -279,8 +279,8 @@ SendPacket(PAPPINFO pInfo)
     pInfo->lTimeStart = GetTime(pInfo);
 
     iSockRet = sendto(pInfo->icmpSock,              //socket
-                      (char *)pInfo->SendPacket,   //buffer
-                      PACKET_SIZE,                  //size of buffer
+                      (char *)&pInfo->SendPacket->icmpheader,//buffer
+                      sizeof(ICMP_HEADER) + PACKET_SIZE,//size of buffer
                       0,                            //flags
                       (SOCKADDR *)&pInfo->dest,     //destination
                       sizeof(pInfo->dest));         //address length
@@ -598,7 +598,7 @@ Cleanup(PAPPINFO pInfo)
                  0,
                  pInfo->SendPacket);
 
-    if (pInfo->SendPacket)
+    if (pInfo->RecvPacket)
         HeapFree(GetProcessHeap(),
                  0,
                  pInfo->RecvPacket);
index e7b5e4c..cc38b55 100644 (file)
@@ -13,7 +13,7 @@
 #define TTL_EXCEEDED 11
 
 #define MAX_PING_PACKET_SIZE 1024
-#define MAX_PING_DATA_SIZE (MAX_PING_PACKET_SIZE + sizeof(IPv4Header)
+#define MAX_PING_DATA_SIZE (MAX_PING_PACKET_SIZE + sizeof(IPv4Header))
 #define PACKET_SIZE 32
 #define ICMP_MIN_SIZE 8
 
@@ -53,8 +53,8 @@ typedef struct ICMPHeader
 /* ICMP Echo Reply Header, 12 bytes */
 typedef struct EchoReplyHeader
 {
-    struct ICMPHeader icmpheader;
     struct timeval timestamp;
+    struct ICMPHeader icmpheader;
 } ECHO_REPLY_HEADER, *PECHO_REPLY_HEADER;
 
 /* ICMP Echo Reply Header, 12 bytes */
index eb6f025..5fb041e 100644 (file)
@@ -1,8 +1,8 @@
 /*
  * PROJECT:     PAINT for ReactOS
  * LICENSE:     LGPL
- * FILE:        definitions.h
- * PURPOSE:     Defines the resource ids
+ * FILE:        base/applications/paint/definitions.h
+ * PURPOSE:     Defines the resource ids and other stuff
  * PROGRAMMERS: Benedikt Freisen
  */
  
@@ -12,6 +12,7 @@
 /* HISTORYSIZE = number of possible undo-steps + 1 */
 
 #define SIZEOF(a)  (sizeof(a) / sizeof((a)[0]))
+/* sizeof for string constants; equals max. number of characters */
 
 #define IDI_APPICON 500
 
@@ -72,7 +73,7 @@
 #define IDM_IMAGEINVERTCOLORS   253
 #define IDM_IMAGEATTRIBUTES     254
 #define IDM_IMAGEDELETEIMAGE    255
-#define IDM_IMAGEDRAWOPAQUE    256
+#define IDM_IMAGEDRAWOPAQUE     256
 
 #define IDM_COLORSEDITPALETTE   260
 
 
 #define IDS_OPENFILTER  926
 #define IDS_SAVEFILTER  927
+#define IDS_FILESIZE    928
+#define IDS_PRINTRES    929
index 310a6ea..bf3111b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PROJECT:     PAINT for ReactOS
  * LICENSE:     LGPL
- * FILE:        dialogs.c
+ * FILE:        base/applications/paint/dialogs.c
  * PURPOSE:     Window procedures of the dialog windows plus launching functions
  * PROGRAMMERS: Benedikt Freisen
  */
@@ -9,12 +9,14 @@
 /* INCLUDES *********************************************************/
 
 #include <windows.h>
+#include <tchar.h>
 #include "definitions.h"
 #include "globalvar.h"
 
 /* FUNCTIONS ********************************************************/
 
-LRESULT CALLBACK MRDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+LRESULT CALLBACK
+MRDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
     switch (message)
     {
@@ -62,21 +64,46 @@ LRESULT CALLBACK MRDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lP
     return TRUE;
 }
 
-int mirrorRotateDlg()
+int
+mirrorRotateDlg()
 {
-    return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_MIRRORROTATE), hMainWnd, (DLGPROC)MRDlgWinProc);
+    return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_MIRRORROTATE), hMainWnd, (DLGPROC) MRDlgWinProc);
 }
 
-LRESULT CALLBACK ATTDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+LRESULT CALLBACK
+ATTDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
     switch (message)
     {
         case WM_INITDIALOG:
+        {
+            TCHAR strrc[100];
+            TCHAR res[100];
+
             CheckDlgButton(hwnd, IDD_ATTRIBUTESRB3, BST_CHECKED);
             CheckDlgButton(hwnd, IDD_ATTRIBUTESRB5, BST_CHECKED);
             SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT1, imgXRes, FALSE);
             SetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT2, imgYRes, FALSE);
+
+            if (isAFile)
+            {
+                TCHAR date[100];
+                TCHAR size[100];
+                TCHAR temp[100];
+                GetDateFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, date, SIZEOF(date));
+                GetTimeFormat(LOCALE_USER_DEFAULT, 0, &fileTime, NULL, temp, SIZEOF(temp));
+                _tcscat(date, _T(" "));
+                _tcscat(date, temp);
+                LoadString(hProgInstance, IDS_FILESIZE, strrc, SIZEOF(strrc));
+                _stprintf(size, strrc, fileSize);
+                SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT6, date);
+                SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT7, size);
+            }
+            LoadString(hProgInstance, IDS_PRINTRES, strrc, SIZEOF(strrc));
+            _stprintf(res, strrc, fileHPPM, fileVPPM);
+            SetDlgItemText(hwnd, IDD_ATTRIBUTESTEXT8, res);
             return TRUE;
+        }
         case WM_CLOSE:
             EndDialog(hwnd, 0);
             break;
@@ -84,7 +111,10 @@ LRESULT CALLBACK ATTDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
             switch (LOWORD(wParam))
             {
                 case IDOK:
-                    EndDialog(hwnd, GetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT1, NULL, FALSE) | (GetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT2, NULL, FALSE)<<16));
+                    EndDialog(hwnd,
+                              GetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT1, NULL,
+                                            FALSE) | (GetDlgItemInt(hwnd, IDD_ATTRIBUTESEDIT2, NULL,
+                                                                    FALSE) << 16));
                     break;
                 case IDCANCEL:
                     EndDialog(hwnd, 0);
@@ -103,12 +133,14 @@ LRESULT CALLBACK ATTDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM l
     return TRUE;
 }
 
-int attributesDlg()
+int
+attributesDlg()
 {
-    return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_ATTRIBUTES), hMainWnd, (DLGPROC)ATTDlgWinProc);
+    return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_ATTRIBUTES), hMainWnd, (DLGPROC) ATTDlgWinProc);
 }
 
-LRESULT CALLBACK CHSIZEDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+LRESULT CALLBACK
+CHSIZEDlgWinProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 {
     switch (message)
     {
@@ -123,7 +155,10 @@ LRESULT CALLBACK CHSIZEDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
             switch (LOWORD(wParam))
             {
                 case IDOK:
-                    EndDialog(hwnd, GetDlgItemInt(hwnd, IDD_CHANGESIZEEDIT1, NULL, FALSE) | (GetDlgItemInt(hwnd, IDD_CHANGESIZEEDIT2, NULL, FALSE)<<16));
+                    EndDialog(hwnd,
+                              GetDlgItemInt(hwnd, IDD_CHANGESIZEEDIT1, NULL,
+                                            FALSE) | (GetDlgItemInt(hwnd, IDD_CHANGESIZEEDIT2, NULL,
+                                                                    FALSE) << 16));
                     break;
                 case IDCANCEL:
                     EndDialog(hwnd, 0);
@@ -136,7 +171,8 @@ LRESULT CALLBACK CHSIZEDlgWinProc (HWND hwnd, UINT message, WPARAM wParam, LPARA
     return TRUE;
 }
 
-int changeSizeDlg()
+int
+changeSizeDlg()
 {
-    return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_CHANGESIZE), hMainWnd, (DLGPROC)CHSIZEDlgWinProc);
+    return DialogBox(hProgInstance, MAKEINTRESOURCE(IDD_CHANGESIZE), hMainWnd, (DLGPROC) CHSIZEDlgWinProc);
 }
index 9f4b38b..dc608da 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PROJECT:     PAINT for ReactOS
  * LICENSE:     LGPL
- * FILE:        dialogs.h
+ * FILE:        base/applications/paint/dialogs.h
  * PURPOSE:     Window procedures of the dialog windows plus launching functions
  * PROGRAMMERS: Benedikt Freisen
  */
index efd4825..7c58f43 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PROJECT:     PAINT for ReactOS
  * LICENSE:     LGPL
- * FILE:        dib.c
+ * FILE:        base/applications/paint/dib.c
  * PURPOSE:     Some DIB related functions
  * PROGRAMMERS: Benedikt Freisen
  */
@@ -12,7 +12,8 @@
 
 /* FUNCTIONS ********************************************************/
 
-HBITMAP CreateDIBWithProperties(int width, int height)
+HBITMAP
+CreateDIBWithProperties(int width, int height)
 {
     BITMAPINFO bmi;
     ZeroMemory(&bmi, sizeof(BITMAPINFO));
@@ -25,21 +26,24 @@ HBITMAP CreateDIBWithProperties(int width, int height)
     return CreateDIBSection(NULL, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
 }
 
-int GetDIBWidth(HBITMAP hBitmap)
+int
+GetDIBWidth(HBITMAP hBitmap)
 {
     BITMAP bm;
     GetObject(hBitmap, sizeof(BITMAP), &bm);
     return bm.bmWidth;
 }
 
-int GetDIBHeight(HBITMAP hBitmap)
+int
+GetDIBHeight(HBITMAP hBitmap)
 {
     BITMAP bm;
     GetObject(hBitmap, sizeof(BITMAP), &bm);
     return bm.bmHeight;
 }
 
-void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC)
+void
+SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time, int *size, int hRes, int vRes)
 {
     BITMAP bm;
     HANDLE hFile;
@@ -47,7 +51,7 @@ void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC)
     BITMAPINFOHEADER bi;
     int imgDataSize;
     DWORD dwBytesWritten;
-    charbuffer;
+    char *buffer;
 
     GetObject(hBitmap, sizeof(BITMAP), &bm);
 
@@ -55,7 +59,7 @@ void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC)
     ZeroMemory(&bi, sizeof(BITMAPINFOHEADER));
 
     imgDataSize = bm.bmWidthBytes * bm.bmHeight;
-    bf.bfType = 0x4d42; /* BM */
+    bf.bfType = 0x4d42;         /* BM */
     bf.bfSize = imgDataSize + 52;
     bf.bfOffBits = 54;
     bi.biSize = sizeof(BITMAPINFOHEADER);
@@ -64,9 +68,11 @@ void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC)
     bi.biPlanes = bm.bmPlanes;
     bi.biBitCount = bm.bmBitsPixel;
     bi.biCompression = BI_RGB;
+    bi.biXPelsPerMeter = hRes;
+    bi.biYPelsPerMeter = vRes;
 
     buffer = HeapAlloc(GetProcessHeap(), 0, imgDataSize);
-    GetDIBits(hDC, hBitmap, 0, bm.bmHeight, buffer, (LPBITMAPINFO)&bi, DIB_RGB_COLORS);
+    GetDIBits(hDC, hBitmap, 0, bm.bmHeight, buffer, (LPBITMAPINFO) & bi, DIB_RGB_COLORS);
 
     hFile = CreateFile(FileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
     if (hFile == INVALID_HANDLE_VALUE)
@@ -76,39 +82,66 @@ void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC)
     WriteFile(hFile, &bi, sizeof(BITMAPINFOHEADER), &dwBytesWritten, NULL);
     WriteFile(hFile, buffer, imgDataSize, &dwBytesWritten, NULL);
 
+    if (time)
+    {
+        FILETIME ft;
+        GetFileTime(hFile, NULL, NULL, &ft);
+        FileTimeToSystemTime(&ft, time);
+    }
+    if (size)
+        *size = GetFileSize(hFile, NULL);
+
     CloseHandle(hFile);
     HeapFree(GetProcessHeap(), 0, buffer);
 }
 
-HBITMAP LoadDIBFromFile(LPTSTR name)
+void
+LoadDIBFromFile(HBITMAP * hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size, int *hRes, int *vRes)
 {
-    HBITMAP hBitmap;
     BITMAPFILEHEADER bfh;
     BITMAPINFO *bi;
     PVOID pvBits;
     DWORD dwBytesRead;
     HANDLE hFile;
 
-    hFile = CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
+    if (!hBitmap)
+        return;
+
+    hFile =
+        CreateFile(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL);
     if (hFile == INVALID_HANDLE_VALUE)
-        return NULL;
+        return;
 
     /* read header and check for 'BM' magic */
     ReadFile(hFile, &bfh, sizeof(BITMAPFILEHEADER), &dwBytesRead, NULL);
     if (bfh.bfType != 0x4d42)
     {
         CloseHandle(hFile);
-        return NULL;
+        return;
     }
 
+    if (time)
+    {
+        FILETIME ft;
+        GetFileTime(hFile, NULL, NULL, &ft);
+        FileTimeToSystemTime(&ft, time);
+    }
+    if (size)
+        *size = GetFileSize(hFile, NULL);
+
     bi = HeapAlloc(GetProcessHeap(), 0, bfh.bfOffBits - sizeof(BITMAPFILEHEADER));
     if (!bi)
-        return NULL;
+        return;
 
     ReadFile(hFile, bi, bfh.bfOffBits - sizeof(BITMAPFILEHEADER), &dwBytesRead, NULL);
-    hBitmap = CreateDIBSection(NULL, bi, DIB_RGB_COLORS, &pvBits, NULL, 0);
+    *hBitmap = CreateDIBSection(NULL, bi, DIB_RGB_COLORS, &pvBits, NULL, 0);
     ReadFile(hFile, pvBits, bfh.bfSize - bfh.bfOffBits, &dwBytesRead, NULL);
+
+    if (hRes)
+        *hRes = (*bi).bmiHeader.biXPelsPerMeter;
+    if (vRes)
+        *vRes = (*bi).bmiHeader.biYPelsPerMeter;
+
     CloseHandle(hFile);
     HeapFree(GetProcessHeap(), 0, bi);
-    return hBitmap;
 }
index ce7f3d5..22a2116 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PROJECT:     PAINT for ReactOS
  * LICENSE:     LGPL
- * FILE:        dib.h
+ * FILE:        base/applications/paint/dib.h
  * PURPOSE:     Some DIB related functions
  * PROGRAMMERS: Benedikt Freisen
  */
@@ -12,6 +12,7 @@ int GetDIBWidth(HBITMAP hbm);
 
 int GetDIBHeight(HBITMAP hbm);
 
-void SaveDIBToFile(HBITMAP hbm, LPTSTR name, HDC hdc);
+void SaveDIBToFile(HBITMAP hBitmap, LPTSTR FileName, HDC hDC, LPSYSTEMTIME time, int *size, int hRes,
+                   int vRes);
 
-HBITMAP LoadDIBFromFile(LPTSTR name);
+void LoadDIBFromFile(HBITMAP *hBitmap, LPTSTR name, LPSYSTEMTIME time, int *size, int *hRes, int *vRes);
index bb8d24a..bafbe1c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PROJECT:     PAINT for ReactOS
  * LICENSE:     LGPL
- * FILE:        drawing.c
+ * FILE:        base/applications/paint/drawing.c
  * PURPOSE:     The drawing functions used by the tools
  * PROGRAMMERS: Benedikt Freisen
  */
@@ -12,7 +12,8 @@
 
 /* FUNCTIONS ********************************************************/
 
-void Line(HDC hdc, short x1, short y1, short x2, short y2, int color, int thickness)
+void
+Line(HDC hdc, short x1, short y1, short x2, short y2, int color, int thickness)
 {
     HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, color));
     MoveToEx(hdc, x1, y1, NULL);
@@ -20,13 +21,14 @@ void Line(HDC hdc, short x1, short y1, short x2, short y2, int color, int thickn
     DeleteObject(SelectObject(hdc, oldPen));
 }
 
-void Rect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
+void
+Rect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
 {
     HBRUSH oldBrush;
     LOGBRUSH logbrush;
     HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
-    if (style==0) logbrush.lbStyle = BS_HOLLOW; else logbrush.lbStyle = BS_SOLID;
-    if (style==2) logbrush.lbColor = fg; else logbrush.lbColor = bg;
+    logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
+    logbrush.lbColor = (style == 2) ? fg : bg;
     logbrush.lbHatch = 0;
     oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush));
     Rectangle(hdc, x1, y1, x2, y2);
@@ -34,13 +36,14 @@ void Rect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int t
     DeleteObject(SelectObject(hdc, oldPen));
 }
 
-void Ellp(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
+void
+Ellp(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
 {
     HBRUSH oldBrush;
     LOGBRUSH logbrush;
     HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
-    if (style==0) logbrush.lbStyle = BS_HOLLOW; else logbrush.lbStyle = BS_SOLID;
-    if (style==2) logbrush.lbColor = fg; else logbrush.lbColor = bg;
+    logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
+    logbrush.lbColor = (style == 2) ? fg : bg;
     logbrush.lbHatch = 0;
     oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush));
     Ellipse(hdc, x1, y1, x2, y2);
@@ -48,13 +51,14 @@ void Ellp(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int t
     DeleteObject(SelectObject(hdc, oldPen));
 }
 
-void RRect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
+void
+RRect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int thickness, int style)
 {
     LOGBRUSH logbrush;
     HBRUSH oldBrush;
     HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
-    if (style==0) logbrush.lbStyle = BS_HOLLOW; else logbrush.lbStyle = BS_SOLID;
-    if (style==2) logbrush.lbColor = fg; else logbrush.lbColor = bg;
+    logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
+    logbrush.lbColor = (style == 2) ? fg : bg;
     logbrush.lbHatch = 0;
     oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush));
     RoundRect(hdc, x1, y1, x2, y2, 16, 16);
@@ -62,13 +66,14 @@ void RRect(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int
     DeleteObject(SelectObject(hdc, oldPen));
 }
 
-void Poly(HDC hdc, POINT *lpPoints, int nCount, int fg, int bg, int thickness, int style, BOOL closed)
+void
+Poly(HDC hdc, POINT * lpPoints, int nCount, int fg, int bg, int thickness, int style, BOOL closed)
 {
     LOGBRUSH logbrush;
     HBRUSH oldBrush;
     HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, thickness, fg));
-    if (style==0) logbrush.lbStyle = BS_HOLLOW; else logbrush.lbStyle = BS_SOLID;
-    if (style==2) logbrush.lbColor = fg; else logbrush.lbColor = bg;
+    logbrush.lbStyle = (style == 0) ? BS_HOLLOW : BS_SOLID;
+    logbrush.lbColor = (style == 2) ? fg : bg;
     logbrush.lbHatch = 0;
     oldBrush = SelectObject(hdc, CreateBrushIndirect(&logbrush));
     if (closed)
@@ -79,7 +84,8 @@ void Poly(HDC hdc, POINT *lpPoints, int nCount, int fg, int bg, int thickness, i
     DeleteObject(SelectObject(hdc, oldPen));
 }
 
-void Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, int color, int thickness)
+void
+Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, int color, int thickness)
 {
     HPEN oldPen;
     POINT fourPoints[4];
@@ -92,42 +98,55 @@ void Bezier(HDC hdc, POINT p1, POINT p2, POINT p3, POINT p4, int color, int thic
     DeleteObject(SelectObject(hdc, oldPen));
 }
 
-void Fill(HDC hdc, int x, int y, int color)
+void
+Fill(HDC hdc, int x, int y, int color)
 {
     HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color));
     ExtFloodFill(hdc, x, y, GetPixel(hdc, x, y), FLOODFILLSURFACE);
     DeleteObject(SelectObject(hdc, oldBrush));
 }
 
-void Erase(HDC hdc, short x1, short y1, short x2, short y2, int color, int radius)
+void
+Erase(HDC hdc, short x1, short y1, short x2, short y2, int color, int radius)
 {
     short a;
     HPEN oldPen;
     HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color));
     oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, color));
-    for (a=0; a<=100; a++)
-        Rectangle(hdc, (x1*(100-a)+x2*a)/100-radius+1, (y1*(100-a)+y2*a)/100-radius+1, (x1*(100-a)+x2*a)/100+radius+1, (y1*(100-a)+y2*a)/100+radius+1);
+    for(a = 0; a <= 100; a++)
+        Rectangle(hdc, (x1 * (100 - a) + x2 * a) / 100 - radius + 1,
+                  (y1 * (100 - a) + y2 * a) / 100 - radius + 1, (x1 * (100 - a) + x2 * a) / 100 + radius + 1,
+                  (y1 * (100 - a) + y2 * a) / 100 + radius + 1);
     DeleteObject(SelectObject(hdc, oldBrush));
     DeleteObject(SelectObject(hdc, oldPen));
 }
 
-void Replace(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int radius)
+void
+Replace(HDC hdc, short x1, short y1, short x2, short y2, int fg, int bg, int radius)
 {
     short a, x, y;
-    for (a=0; a<=100; a++)
-        for (y=(y1*(100-a)+y2*a)/100-radius+1; y<(y1*(100-a)+y2*a)/100+radius+1; y++)
-            for (x=(x1*(100-a)+x2*a)/100-radius+1; x<(x1*(100-a)+x2*a)/100+radius+1; x++)
-                if (GetPixel(hdc, x, y)==fg) SetPixel(hdc, x, y, bg);
+    for(a = 0; a <= 100; a++)
+        for(y = (y1 * (100 - a) + y2 * a) / 100 - radius + 1;
+            y < (y1 * (100 - a) + y2 * a) / 100 + radius + 1; y++)
+            for(x = (x1 * (100 - a) + x2 * a) / 100 - radius + 1;
+                x < (x1 * (100 - a) + x2 * a) / 100 + radius + 1; x++)
+                if (GetPixel(hdc, x, y) == fg)
+                    SetPixel(hdc, x, y, bg);
 }
 
-void Airbrush(HDC hdc, short x, short y, int color, int r)
+void
+Airbrush(HDC hdc, short x, short y, int color, int r)
 {
     short a;
     short b;
-    for (b=-r; b<=r; b++) for (a=-r; a<=r; a++) if ((a*a+b*b<=r*r)&&(rand()%4==0)) SetPixel(hdc, x+a, y+b, color);
+    for(b = -r; b <= r; b++)
+        for(a = -r; a <= r; a++)
+            if ((a * a + b * b <= r * r) && (rand() % 4 == 0))
+                SetPixel(hdc, x + a, y + b, color);
 }
 
-void Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style)
+void
+Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style)
 {
     HPEN oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, color));
     HBRUSH oldBrush = SelectObject(hdc, CreateSolidBrush(color));
@@ -135,12 +154,14 @@ void Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style
     switch (style)
     {
         case 0:
-            for (a=0; a<=100; a++)
-                Ellipse(hdc, (x1*(100-a)+x2*a)/100-3, (y1*(100-a)+y2*a)/100-3, (x1*(100-a)+x2*a)/100+4, (y1*(100-a)+y2*a)/100+4);
+            for(a = 0; a <= 100; a++)
+                Ellipse(hdc, (x1 * (100 - a) + x2 * a) / 100 - 3, (y1 * (100 - a) + y2 * a) / 100 - 3,
+                        (x1 * (100 - a) + x2 * a) / 100 + 4, (y1 * (100 - a) + y2 * a) / 100 + 4);
             break;
         case 1:
-            for (a=0; a<=100; a++)
-                Ellipse(hdc, (x1*(100-a)+x2*a)/100-1, (y1*(100-a)+y2*a)/100-1, (x1*(100-a)+x2*a)/100+3, (y1*(100-a)+y2*a)/100+3);
+            for(a = 0; a <= 100; a++)
+                Ellipse(hdc, (x1 * (100 - a) + x2 * a) / 100 - 1, (y1 * (100 - a) + y2 * a) / 100 - 1,
+                        (x1 * (100 - a) + x2 * a) / 100 + 3, (y1 * (100 - a) + y2 * a) / 100 + 3);
             break;
         case 2:
             MoveToEx(hdc, x1, y1, NULL);
@@ -148,57 +169,60 @@ void Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style
             SetPixel(hdc, x2, y2, color);
             break;
         case 3:
-            for (a=0; a<=100; a++)
-                Rectangle(hdc, (x1*(100-a)+x2*a)/100-3, (y1*(100-a)+y2*a)/100-3, (x1*(100-a)+x2*a)/100+5, (y1*(100-a)+y2*a)/100+5);
+            for(a = 0; a <= 100; a++)
+                Rectangle(hdc, (x1 * (100 - a) + x2 * a) / 100 - 3, (y1 * (100 - a) + y2 * a) / 100 - 3,
+                          (x1 * (100 - a) + x2 * a) / 100 + 5, (y1 * (100 - a) + y2 * a) / 100 + 5);
             break;
         case 4:
-            for (a=0; a<=100; a++)
-                Rectangle(hdc, (x1*(100-a)+x2*a)/100-2, (y1*(100-a)+y2*a)/100-2, (x1*(100-a)+x2*a)/100+3, (y1*(100-a)+y2*a)/100+3);
+            for(a = 0; a <= 100; a++)
+                Rectangle(hdc, (x1 * (100 - a) + x2 * a) / 100 - 2, (y1 * (100 - a) + y2 * a) / 100 - 2,
+                          (x1 * (100 - a) + x2 * a) / 100 + 3, (y1 * (100 - a) + y2 * a) / 100 + 3);
             break;
         case 5:
-            for (a=0; a<=100; a++)
-                Rectangle(hdc, (x1*(100-a)+x2*a)/100-1, (y1*(100-a)+y2*a)/100-1, (x1*(100-a)+x2*a)/100+1, (y1*(100-a)+y2*a)/100+1);
+            for(a = 0; a <= 100; a++)
+                Rectangle(hdc, (x1 * (100 - a) + x2 * a) / 100 - 1, (y1 * (100 - a) + y2 * a) / 100 - 1,
+                          (x1 * (100 - a) + x2 * a) / 100 + 1, (y1 * (100 - a) + y2 * a) / 100 + 1);
             break;
         case 6:
-            for (a=0; a<=100; a++)
+            for(a = 0; a <= 100; a++)
             {
-                MoveToEx(hdc, (x1*(100-a)+x2*a)/100-3, (y1*(100-a)+y2*a)/100+5, NULL);
-                LineTo(hdc, (x1*(100-a)+x2*a)/100+5, (y1*(100-a)+y2*a)/100-3);
+                MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 3, (y1 * (100 - a) + y2 * a) / 100 + 5, NULL);
+                LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 5, (y1 * (100 - a) + y2 * a) / 100 - 3);
             }
             break;
         case 7:
-            for (a=0; a<=100; a++)
+            for(a = 0; a <= 100; a++)
             {
-                MoveToEx(hdc, (x1*(100-a)+x2*a)/100-2, (y1*(100-a)+y2*a)/100+3, NULL);
-                LineTo(hdc, (x1*(100-a)+x2*a)/100+3, (y1*(100-a)+y2*a)/100-2);
+                MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 2, (y1 * (100 - a) + y2 * a) / 100 + 3, NULL);
+                LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 3, (y1 * (100 - a) + y2 * a) / 100 - 2);
             }
             break;
         case 8:
-            for (a=0; a<=100; a++)
+            for(a = 0; a <= 100; a++)
             {
-                MoveToEx(hdc, (x1*(100-a)+x2*a)/100-1, (y1*(100-a)+y2*a)/100+1, NULL);
-                LineTo(hdc, (x1*(100-a)+x2*a)/100+1, (y1*(100-a)+y2*a)/100-1);
+                MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 1, (y1 * (100 - a) + y2 * a) / 100 + 1, NULL);
+                LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 1, (y1 * (100 - a) + y2 * a) / 100 - 1);
             }
             break;
         case 9:
-            for (a=0; a<=100; a++)
+            for(a = 0; a <= 100; a++)
             {
-                MoveToEx(hdc, (x1*(100-a)+x2*a)/100-3, (y1*(100-a)+y2*a)/100-3, NULL);
-                LineTo(hdc, (x1*(100-a)+x2*a)/100+5, (y1*(100-a)+y2*a)/100+5);
+                MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 3, (y1 * (100 - a) + y2 * a) / 100 - 3, NULL);
+                LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 5, (y1 * (100 - a) + y2 * a) / 100 + 5);
             }
             break;
         case 10:
-            for (a=0; a<=100; a++)
+            for(a = 0; a <= 100; a++)
             {
-                MoveToEx(hdc, (x1*(100-a)+x2*a)/100-2, (y1*(100-a)+y2*a)/100-2, NULL);
-                LineTo(hdc, (x1*(100-a)+x2*a)/100+3, (y1*(100-a)+y2*a)/100+3);
+                MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 2, (y1 * (100 - a) + y2 * a) / 100 - 2, NULL);
+                LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 3, (y1 * (100 - a) + y2 * a) / 100 + 3);
             }
             break;
         case 11:
-            for (a=0; a<=100; a++)
+            for(a = 0; a <= 100; a++)
             {
-                MoveToEx(hdc, (x1*(100-a)+x2*a)/100-1, (y1*(100-a)+y2*a)/100-1, NULL);
-                LineTo(hdc, (x1*(100-a)+x2*a)/100+1, (y1*(100-a)+y2*a)/100+1);
+                MoveToEx(hdc, (x1 * (100 - a) + x2 * a) / 100 - 1, (y1 * (100 - a) + y2 * a) / 100 - 1, NULL);
+                LineTo(hdc, (x1 * (100 - a) + x2 * a) / 100 + 1, (y1 * (100 - a) + y2 * a) / 100 + 1);
             }
             break;
     }
@@ -206,7 +230,8 @@ void Brush(HDC hdc, short x1, short y1, short x2, short y2, int color, int style
     DeleteObject(SelectObject(hdc, oldPen));
 }
 
-void RectSel(HDC hdc, short x1, short y1, short x2, short y2)
+void
+RectSel(HDC hdc, short x1, short y1, short x2, short y2)
 {
     HBRUSH oldBrush;
     LOGBRUSH logbrush;
@@ -220,7 +245,8 @@ void RectSel(HDC hdc, short x1, short y1, short x2, short y2)
     DeleteObject(SelectObject(hdc, oldPen));
 }
 
-void SelectionFrame(HDC hdc, int x1, int y1, int x2, int y2)
+void
+SelectionFrame(HDC hdc, int x1, int y1, int x2, int y2)
 {
     HBRUSH oldBrush;
     LOGBRUSH logbrush;
@@ -234,14 +260,14 @@ void SelectionFrame(HDC hdc, int x1, int y1, int x2, int y2)
     DeleteObject(SelectObject(hdc, oldPen));
     oldPen = SelectObject(hdc, CreatePen(PS_SOLID, 1, 0x00000000));
     oldBrush = SelectObject(hdc, CreateSolidBrush(0x00000000));
-    Rectangle(hdc, x1-1, y1-1, x1+2, y1+2);
-    Rectangle(hdc, x2-2, y1-1, x2+2, y1+2);
-    Rectangle(hdc, x1-1, y2-2, x1+2, y2+1);
-    Rectangle(hdc, x2-2, y2-2, x2+2, y2+1);
-    Rectangle(hdc, (x1+x2)/2-1, y1-1, (x1+x2)/2+2, y1+2);
-    Rectangle(hdc, (x1+x2)/2-1, y2-2, (x1+x2)/2+2, y2+1);
-    Rectangle(hdc, x1-1, (y1+y2)/2-1, x1+2, (y1+y2)/2+2);
-    Rectangle(hdc, x2-2, (y1+y2)/2-1, x2+1, (y1+y2)/2+2);
+    Rectangle(hdc, x1 - 1, y1 - 1, x1 + 2, y1 + 2);
+    Rectangle(hdc, x2 - 2, y1 - 1, x2 + 2, y1 + 2);
+    Rectangle(hdc, x1 - 1, y2 - 2, x1 + 2, y2 + 1);
+    Rectangle(hdc, x2 - 2, y2 - 2, x2 + 2, y2 + 1);
+    Rectangle(hdc, (x1 + x2) / 2 - 1, y1 - 1, (x1 + x2) / 2 + 2, y1 + 2);
+    Rectangle(hdc, (x1 + x2) / 2 - 1, y2 - 2, (x1 + x2) / 2 + 2, y2 + 1);
+    Rectangle(hdc, x1 - 1, (y1 + y2) / 2 - 1, x1 + 2, (y1 + y2) / 2 + 2);
+    Rectangle(hdc, x2 - 2, (y1 + y2) / 2 - 1, x2 + 1, (y1 + y2) / 2 + 2);
     DeleteObject(SelectObject(hdc, oldBrush));
     DeleteObject(SelectObject(hdc, oldPen));
 }
index 71671d9..db0d050 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PROJECT:     PAINT for ReactOS
  * LICENSE:     LGPL
- * FILE:        drawing.h
+ * FILE:        base/applications/paint/drawing.h
  * PURPOSE:     The drawing functions used by the tools
  * PROGRAMMERS: Benedikt Freisen
  */
index e9e8e12..964f28b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PROJECT:     PAINT for ReactOS
  * LICENSE:     LGPL
- * FILE:        globalvar.h
+ * FILE:        base/applications/paint/globalvar.h
  * PURPOSE:     Declaring global variables for later initialization
  * PROGRAMMERS: Benedikt Freisen
  */
@@ -45,13 +45,16 @@ extern HWND hImageArea;
 extern HBITMAP hSelBm;
 
 extern int palColors[28];
+
 extern int fgColor;
 extern int bgColor;
+
 extern HWND hStatusBar;
 extern HWND hScrollbox;
 extern HWND hMainWnd;
 extern HWND hPalWin;
 extern HWND hToolSettings;
+extern HWND hTrackbarZoom;
 extern CHOOSECOLOR choosecolor;
 extern OPENFILENAME ofn;
 extern OPENFILENAME sfn;
@@ -73,6 +76,10 @@ extern HINSTANCE hProgInstance;
 extern TCHAR filename[256];
 extern TCHAR filepathname[1000];
 extern BOOL isAFile;
+extern int fileSize;
+extern int fileHPPM;
+extern int fileVPPM;
+extern SYSTEMTIME fileTime;
 
 extern BOOL showGrid;
 extern BOOL showMiniature;
@@ -88,9 +95,7 @@ extern HWND hSizeboxLeftBottom;
 extern HWND hSizeboxCenterBottom;
 extern HWND hSizeboxRightBottom;
 
-extern HWND hTrackbarZoom;
-
-/* VARIABLES declared in mouse.c *************************************/
+/* VARIABLES declared in mouse.c ************************************/
 
 extern POINT pointStack[256];
 extern short pointSP;
index 8331c9d..e105dab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * PROJECT:     PAINT for ReactOS
  * LICENSE:     LGPL
- * FILE:        history.c
+ * FILE:        base/applications/paint/history.c
  * PURPOSE:     Undo and redo functionality
  * PROGRAMMERS: Benedikt Freisen
  */
 
 extern void updateCanvasAndScrollbars(void);
 
-void setImgXYRes(int x, int y)
+void
+setImgXYRes(int x, int y)
 {
-    if ((imgXRes!=x)||(imgYRes!=y))
+    if ((imgXRes != x) || (imgYRes != y))
     {
         imgXRes = x;
         imgYRes = y;
@@ -27,12 +28,14 @@ void setImgXYRes(int x, int y)
     }
 }
 
-void newReversible()
+void
+newReversible()
 {
-    DeleteObject(hBms[(currInd+1)%HISTORYSIZE]);
-    hBms[(currInd+1)%HISTORYSIZE] = CopyImage( hBms[currInd], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG);
-    currInd = (currInd+1)%HISTORYSIZE;
-    if (undoSteps<HISTORYSIZE-1) undoSteps++;
+    DeleteObject(hBms[(currInd + 1) % HISTORYSIZE]);
+    hBms[(currInd + 1) % HISTORYSIZE] = CopyImage(hBms[currInd], IMAGE_BITMAP, 0, 0, LR_COPYRETURNORG);
+    currInd = (currInd + 1) % HISTORYSIZE;
+    if (undoSteps < HISTORYSIZE - 1)
+        undoSteps++;
     redoSteps = 0;
     SelectObject(hDrawingDC, hBms[currInd]);
     imgXRes = GetDIBWidth(hBms[currInd]);
@@ -40,74 +43,85 @@ void newReversible()
     imageSaved = FALSE;
 }
 
-void undo()
+void
+undo()
 {
-    if (undoSteps>0)
+    if (undoSteps > 0)
     {
         ShowWindow(hSelection, SW_HIDE);
-        currInd = (currInd+HISTORYSIZE-1)%HISTORYSIZE;
+        currInd = (currInd + HISTORYSIZE - 1) % HISTORYSIZE;
         SelectObject(hDrawingDC, hBms[currInd]);
         undoSteps--;
-        if (redoSteps<HISTORYSIZE-1) redoSteps++;
+        if (redoSteps < HISTORYSIZE - 1)
+            redoSteps++;
         setImgXYRes(GetDIBWidth(hBms[currInd]), GetDIBHeight(hBms[currInd]));
     }
 }
 
-void redo()
+void
+redo()
 {
-    if (redoSteps>0)
+    if (redoSteps