Sync with trunk revision 63128.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 3 May 2014 12:58:22 +0000 (12:58 +0000)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sat, 3 May 2014 12:58:22 +0000 (12:58 +0000)
svn path=/branches/ntvdm/; revision=63129

632 files changed:
1  2 
base/applications/cmdutils/comp/comp.c
base/applications/cmdutils/find/find.c
base/applications/mplay32/mplay32.c
base/applications/mscutils/devmgmt/mainwnd.c
base/applications/mscutils/eventvwr/eventvwr.c
base/applications/mspaint/registry.c
base/applications/mspaint/winproc.c
base/applications/network/dwnl/dwnl.c
base/applications/notepad/dialog.c
base/applications/rapps/available.c
base/applications/rapps/loaddlg.c
base/applications/regedit/regproc.c
base/applications/winhlp32/hlpfile.c
base/applications/winver/CMakeLists.txt
base/applications/winver/winver.c
base/applications/winver/winver.rc
base/services/umpnpmgr/umpnpmgr.c
base/setup/usetup/mui.c
base/shell/cmd/alias.c
base/shell/explorer/services/startup.c
base/system/msiexec/service.c
base/system/services/database.c
boot/armllb/os/loader.c
boot/bootdata/hivesft.inf
boot/bootdata/hivesys.inf
boot/bootdata/packages/reactos.dff.in
boot/freeldr/freeldr/include/mm.h
configure.cmd
configure.sh
dll/cpl/appwiz/addons.c
dll/cpl/sysdm/general.c
dll/cpl/sysdm/lang/bg-BG.rc
dll/cpl/sysdm/lang/cs-CZ.rc
dll/cpl/sysdm/lang/da-DK.rc
dll/cpl/sysdm/lang/de-DE.rc
dll/cpl/sysdm/lang/el-GR.rc
dll/cpl/sysdm/lang/en-US.rc
dll/cpl/sysdm/lang/es-ES.rc
dll/cpl/sysdm/lang/fr-FR.rc
dll/cpl/sysdm/lang/he-IL.rc
dll/cpl/sysdm/lang/hu-HU.rc
dll/cpl/sysdm/lang/id-ID.rc
dll/cpl/sysdm/lang/it-IT.rc
dll/cpl/sysdm/lang/ja-JP.rc
dll/cpl/sysdm/lang/nl-NL.rc
dll/cpl/sysdm/lang/no-NO.rc
dll/cpl/sysdm/lang/pl-PL.rc
dll/cpl/sysdm/lang/ro-RO.rc
dll/cpl/sysdm/lang/ru-RU.rc
dll/cpl/sysdm/lang/sk-SK.rc
dll/cpl/sysdm/lang/sq-AL.rc
dll/cpl/sysdm/lang/sv-SE.rc
dll/cpl/sysdm/lang/tr-TR.rc
dll/cpl/sysdm/lang/uk-UA.rc
dll/cpl/sysdm/lang/zh-CN.rc
dll/cpl/sysdm/resource.h
dll/cpl/sysdm/resources/rosbitmap.bmp
dll/cpl/sysdm/resources/rosbitmap_mask.bmp
dll/cpl/sysdm/sysdm.rc
dll/ntdll/ldr/ldrutils.c
dll/win32/atl/CMakeLists.txt
dll/win32/atl/atl.c
dll/win32/atl/atl.spec
dll/win32/atl/atl30.c
dll/win32/atl/atl_ax.c
dll/win32/atl/atl_classes.idl
dll/win32/atl/precomp.h
dll/win32/atl/registrar.c
dll/win32/atl100/CMakeLists.txt
dll/win32/atl100/atl100.spec
dll/win32/atl100/precomp.h
dll/win32/atl80/CMakeLists.txt
dll/win32/atl80/atl80.c
dll/win32/atl80/atl80.manifest
dll/win32/atl80/atl80.rc
dll/win32/atl80/atl80.spec
dll/win32/atl80/precomp.h
dll/win32/avifil32/api.c
dll/win32/avifil32/avifil32.idl
dll/win32/avifil32/avifile.c
dll/win32/avifil32/avifile_private.h
dll/win32/avifil32/factory.c
dll/win32/avifil32/icmstream.c
dll/win32/avifil32/wavfile.c
dll/win32/bcrypt/CMakeLists.txt
dll/win32/bcrypt/bcrypt.spec
dll/win32/bcrypt/bcrypt_main.c
dll/win32/cabinet/CMakeLists.txt
dll/win32/cabinet/fdi.c
dll/win32/comctl32/comboex.c
dll/win32/comctl32/comctl32_ros.diff
dll/win32/comctl32/commctrl.c
dll/win32/comctl32/datetime.c
dll/win32/comctl32/dpa.c
dll/win32/comctl32/dsa.c
dll/win32/comctl32/header.c
dll/win32/comctl32/imagelist.c
dll/win32/comctl32/listview.c
dll/win32/comctl32/propsheet.c
dll/win32/comctl32/rebar.c
dll/win32/comctl32/status.c
dll/win32/comctl32/tab.c
dll/win32/comctl32/toolbar.c
dll/win32/comctl32/tooltips.c
dll/win32/comctl32/trackbar.c
dll/win32/comctl32/treeview.c
dll/win32/comctl32/updown.c
dll/win32/comdlg32/colordlg.c
dll/win32/comdlg32/comdlg32_classes.idl
dll/win32/comdlg32/comdlg32_ros.diff
dll/win32/comdlg32/filedlg.c
dll/win32/comdlg32/filedlg31.c
dll/win32/comdlg32/fontdlg.c
dll/win32/comdlg32/printdlg.c
dll/win32/crypt32/CMakeLists.txt
dll/win32/crypt32/cert.c
dll/win32/crypt32/chain.c
dll/win32/crypt32/collectionstore.c
dll/win32/crypt32/context.c
dll/win32/crypt32/crl.c
dll/win32/crypt32/crypt32_private.h
dll/win32/crypt32/ctl.c
dll/win32/crypt32/encode.c
dll/win32/crypt32/filestore.c
dll/win32/crypt32/main.c
dll/win32/crypt32/msg.c
dll/win32/crypt32/object.c
dll/win32/crypt32/oid.c
dll/win32/crypt32/proplist.c
dll/win32/crypt32/provstore.c
dll/win32/crypt32/regstore.c
dll/win32/crypt32/rootstore.c
dll/win32/crypt32/serialize.c
dll/win32/crypt32/store.c
dll/win32/crypt32/str.c
dll/win32/cryptnet/cryptnet_main.c
dll/win32/dbghelp/cpu_arm.c
dll/win32/dbghelp/cpu_arm64.c
dll/win32/dbghelp/cpu_i386.c
dll/win32/dbghelp/cpu_ppc.c
dll/win32/dbghelp/cpu_x86_64.c
dll/win32/dbghelp/dbghelp.c
dll/win32/dbghelp/dbghelp_private.h
dll/win32/dbghelp/dwarf.c
dll/win32/dbghelp/elf_module.c
dll/win32/dbghelp/macho_module.c
dll/win32/dbghelp/module.c
dll/win32/dbghelp/msc.c
dll/win32/dbghelp/storage.c
dll/win32/dbghelp/symbol.c
dll/win32/dwmapi/dwmapi_main.c
dll/win32/gdiplus/brush.c
dll/win32/gdiplus/font.c
dll/win32/gdiplus/gdiplus.c
dll/win32/gdiplus/gdiplus_private.h
dll/win32/gdiplus/graphics.c
dll/win32/gdiplus/graphicspath.c
dll/win32/gdiplus/image.c
dll/win32/gdiplus/metafile.c
dll/win32/gdiplus/pathiterator.c
dll/win32/gdiplus/region.c
dll/win32/hhctrl.ocx/hhctrl.c
dll/win32/hhctrl.ocx/hhctrl_tlb.idl
dll/win32/hhctrl.ocx/stream.c
dll/win32/hlink/hlink_classes.idl
dll/win32/hlink/hlink_main.c
dll/win32/hnetcfg/hnetcfg.idl
dll/win32/hnetcfg/hnetcfg_tlb.idl
dll/win32/ieframe/ieframe.h
dll/win32/ieframe/ieframe.rgs
dll/win32/ieframe/ieframe_v1.idl
dll/win32/ieframe/navigate.c
dll/win32/ieframe/shellbrowser.c
dll/win32/imagehlp/imagehlp.spec
dll/win32/inetcomm/inetcomm.idl
dll/win32/inetcomm/mimeole.c
dll/win32/inetcomm/pop3transport.c
dll/win32/inseng/inseng.idl
dll/win32/itss/chm_lib.c
dll/win32/itss/chm_lib.h
dll/win32/itss/itss.idl
dll/win32/jscript/CMakeLists.txt
dll/win32/jscript/global.c
dll/win32/jscript/jscript.rc
dll/win32/jscript/jscript_classes.idl
dll/win32/jscript/jscript_classes.rgs
dll/win32/jscript/jsglobal.idl
dll/win32/jscript/jsglobal.rgs
dll/win32/jscript/jsutils.c
dll/win32/jscript/lex.c
dll/win32/jscript/parser.y
dll/win32/jscript/regexp.c
dll/win32/jscript/string.c
dll/win32/localspl/provider.c
dll/win32/mapi32/mapi32.spec
dll/win32/mciqtz32/mciqtz.c
dll/win32/mlang/mlang.c
dll/win32/mlang/mlang_classes.idl
dll/win32/msacm32/msacm32.drv/CMakeLists.txt
dll/win32/msacm32/msacm32.drv/wavemap.c
dll/win32/msacm32/stream.c
dll/win32/msadp32.acm/msadp32.c
dll/win32/mscms/mscms_main.c
dll/win32/mscms/transform.c
dll/win32/msctf/categorymgr.c
dll/win32/msctf/compartmentmgr.c
dll/win32/msctf/context.c
dll/win32/msctf/displayattributemgr.c
dll/win32/msctf/documentmgr.c
dll/win32/msctf/inputprocessor.c
dll/win32/msctf/langbarmgr.c
dll/win32/msctf/msctf_classes.idl
dll/win32/msctf/msctf_classes.rgs
dll/win32/msctf/range.c
dll/win32/msctf/threadmgr.c
dll/win32/msctf/version.rc
dll/win32/msgina/gui.c
dll/win32/msgina/resources/reactos.bmp
dll/win32/msgina/resources/reactos.svg
dll/win32/msgsm32.acm/msgsm32.c
dll/win32/mshtml.tlb/mshtml_tlb.idl
dll/win32/mshtml/CMakeLists.txt
dll/win32/mshtml/binding.h
dll/win32/mshtml/htmlanchor.c
dll/win32/mshtml/htmlbody.c
dll/win32/mshtml/htmldoc.c
dll/win32/mshtml/htmlelem.c
dll/win32/mshtml/htmlelem2.c
dll/win32/mshtml/htmlevent.c
dll/win32/mshtml/htmlevent.h
dll/win32/mshtml/htmlform.c
dll/win32/mshtml/htmlframebase.c
dll/win32/mshtml/htmlselect.c
dll/win32/mshtml/htmlstyle.c
dll/win32/mshtml/htmlstyle.h
dll/win32/mshtml/htmlstyle3.c
dll/win32/mshtml/htmlstylesheet.c
dll/win32/mshtml/htmltable.c
dll/win32/mshtml/htmltablerow.c
dll/win32/mshtml/htmlwindow.c
dll/win32/mshtml/main.c
dll/win32/mshtml/mshtml_classes.idl
dll/win32/mshtml/mshtml_private.h
dll/win32/mshtml/mutation.c
dll/win32/mshtml/navigate.c
dll/win32/mshtml/npplugin.c
dll/win32/mshtml/nsembed.c
dll/win32/mshtml/nsiface.idl
dll/win32/mshtml/nsio.c
dll/win32/mshtml/olecmd.c
dll/win32/mshtml/oleobj.c
dll/win32/mshtml/persist.c
dll/win32/mshtml/pluginhost.c
dll/win32/mshtml/script.c
dll/win32/msi/action.c
dll/win32/msi/classes.c
dll/win32/msi/custom.c
dll/win32/msi/dialog.c
dll/win32/msi/format.c
dll/win32/msi/media.c
dll/win32/msi/msi.c
dll/win32/msi/msi.rc
dll/win32/msi/msipriv.h
dll/win32/msi/msiserver.idl
dll/win32/msi/msiserver.rgs
dll/win32/msi/msiserver_r.rgs
dll/win32/msi/msiserver_t.rgs
dll/win32/msi/package.c
dll/win32/msi/record.c
dll/win32/msi/source.c
dll/win32/msi/sql.y
dll/win32/msi/table.c
dll/win32/msimtf/msimtf.idl
dll/win32/msrle32/msrle32.c
dll/win32/msrle32/msrle_private.h
dll/win32/mstask/mstask_local.idl
dll/win32/msvidc32/msvideo1.c
dll/win32/msxml/msxml_tlb.idl
dll/win32/msxml2/msxml2_tlb.idl
dll/win32/msxml3/bsc.c
dll/win32/msxml3/dispex.c
dll/win32/msxml3/domdoc.c
dll/win32/msxml3/domimpl.c
dll/win32/msxml3/factory.c
dll/win32/msxml3/httprequest.c
dll/win32/msxml3/main.c
dll/win32/msxml3/msxml3_v1.idl
dll/win32/msxml3/msxml_private.h
dll/win32/msxml3/mxnamespace.c
dll/win32/msxml3/mxwriter.c
dll/win32/msxml3/node.c
dll/win32/msxml3/nodelist.c
dll/win32/msxml3/nodemap.c
dll/win32/msxml3/parseerror.c
dll/win32/msxml3/saxreader.c
dll/win32/msxml3/schema.c
dll/win32/msxml3/selection.c
dll/win32/msxml3/stylesheet.c
dll/win32/msxml3/text.c
dll/win32/msxml3/xmldoc.c
dll/win32/msxml3/xmlelem.c
dll/win32/msxml3/xmlparser.c
dll/win32/msxml3/xmlparser.idl
dll/win32/msxml3/xmlview.c
dll/win32/msxml4/msxml4_tlb.idl
dll/win32/msxml6/msxml6_tlb.idl
dll/win32/netapi32/nbcmdqueue.h
dll/win32/netapi32/nbnamecache.h
dll/win32/netapi32/nbt.c
dll/win32/netapi32/netapi32.c
dll/win32/netapi32/netapi32.h
dll/win32/netapi32/netapi32.spec
dll/win32/netapi32/netbios.c
dll/win32/netapi32/netbios.h
dll/win32/netapi32/wksta.c
dll/win32/netcfgx/tcpipconf_notify.c
dll/win32/objsel/objsel_classes.idl
dll/win32/odbc32/proxyodbc.c
dll/win32/ole32/antimoniker.c
dll/win32/ole32/bindctx.c
dll/win32/ole32/classmoniker.c
dll/win32/ole32/comcat.c
dll/win32/ole32/compobj.c
dll/win32/ole32/compobj_private.h
dll/win32/ole32/compositemoniker.c
dll/win32/ole32/dcom.idl
dll/win32/ole32/filemoniker.c
dll/win32/ole32/ifs.c
dll/win32/ole32/irot.idl
dll/win32/ole32/itemmoniker.c
dll/win32/ole32/marshal.c
dll/win32/ole32/moniker.c
dll/win32/ole32/ole2.c
dll/win32/ole32/ole32.spec
dll/win32/ole32/ole32_objidl.idl
dll/win32/ole32/ole32_oleidl.idl
dll/win32/ole32/ole32_ros.diff
dll/win32/ole32/ole32_unknwn.idl
dll/win32/ole32/stg_prop.c
dll/win32/ole32/storage32.c
dll/win32/ole32/storage32.h
dll/win32/ole32/stubmanager.c
dll/win32/oleacc/main.c
dll/win32/oleacc/oleacc.spec
dll/win32/oleacc/oleacc_classes.idl
dll/win32/oleaut32/connpt.c
dll/win32/oleaut32/dispatch.c
dll/win32/oleaut32/oleaut.c
dll/win32/oleaut32/oleaut32.spec
dll/win32/oleaut32/oleaut32_oaidl.idl
dll/win32/oleaut32/oleaut32_ocidl.idl
dll/win32/oleaut32/olefont.c
dll/win32/oleaut32/olepicture.c
dll/win32/oleaut32/recinfo.c
dll/win32/oleaut32/safearray.c
dll/win32/oleaut32/tmarshal.c
dll/win32/oleaut32/typelib.c
dll/win32/oleaut32/usrmarshal.c
dll/win32/oleaut32/varformat.c
dll/win32/oleaut32/variant.c
dll/win32/oleaut32/variant.h
dll/win32/oleaut32/vartype.c
dll/win32/propsys/propstore.c
dll/win32/propsys/propsys.spec
dll/win32/propsys/propsys_classes.idl
dll/win32/propsys/propsys_main.c
dll/win32/propsys/propvar.c
dll/win32/psapi/psapi.c
dll/win32/pstorec/pstorec_tlb.idl
dll/win32/qmgr/CMakeLists.txt
dll/win32/qmgr/enum_files.c
dll/win32/qmgr/enum_jobs.c
dll/win32/qmgr/factory.c
dll/win32/qmgr/file.c
dll/win32/qmgr/job.c
dll/win32/qmgr/qmgr.c
dll/win32/qmgr/qmgr.h
dll/win32/qmgr/qmgr.rgs
dll/win32/qmgr/qmgr_local.idl
dll/win32/qmgr/qmgr_main.c
dll/win32/qmgr/rsrc.rc
dll/win32/qmgrprxy/qmgrprxy.idl
dll/win32/qmgrprxy/qmgrprxy.rgs
dll/win32/riched20/CMakeLists.txt
dll/win32/riched20/caret.c
dll/win32/riched20/editor.c
dll/win32/riched20/editor.h
dll/win32/riched20/editstr.h
dll/win32/riched20/list.c
dll/win32/riched20/msvc-thiscall.c
dll/win32/riched20/msvc.h
dll/win32/riched20/paint.c
dll/win32/riched20/reader.c
dll/win32/riched20/richole.c
dll/win32/riched20/row.c
dll/win32/riched20/rtf.h
dll/win32/riched20/run.c
dll/win32/riched20/string.c
dll/win32/riched20/style.c
dll/win32/riched20/table.c
dll/win32/riched20/txtsrv.c
dll/win32/riched20/wrap.c
dll/win32/riched20/writer.c
dll/win32/rpcrt4/epm.idl
dll/win32/rpcrt4/ndr_marshall.c
dll/win32/rpcrt4/rpc_message.c
dll/win32/rpcrt4/rpc_transport.c
dll/win32/rpcrt4/rpcrt4_main.c
dll/win32/scrrun/filesystem.c
dll/win32/scrrun/scrrun.c
dll/win32/scrrun/scrrun.idl
dll/win32/scrrun/scrrun_private.h
dll/win32/scrrun/scrrun_tlb.rgs
dll/win32/shdocvw/shdocvw_v1.idl
dll/win32/shell32/bitmap_res.rc
dll/win32/shell32/res/bitmaps/reactos.bmp
dll/win32/shell32/shell32_main.cpp
dll/win32/shell32/shellole.cpp
dll/win32/shell32/shresdef.h
dll/win32/shell32/stubs.cpp
dll/win32/shlwapi/istream.c
dll/win32/shlwapi/ordinal.c
dll/win32/shlwapi/path.c
dll/win32/shlwapi/shlwapi.spec
dll/win32/shlwapi/string.c
dll/win32/shlwapi/url.c
dll/win32/shlwapi/wsprintf.c
dll/win32/stdole2.tlb/std_ole_v2.idl
dll/win32/stdole32.tlb/std_ole_v1.idl
dll/win32/sti/sti.rc
dll/win32/sti/sti_wia.idl
dll/win32/sti/sti_wia.rgs
dll/win32/tapi32/line.c
dll/win32/tapi32/tapi32.spec
dll/win32/twain_32/dsm_ctrl.c
dll/win32/url/url_main.c
dll/win32/urlmon/axinstall.c
dll/win32/urlmon/bindprot.c
dll/win32/urlmon/http.c
dll/win32/urlmon/internet.c
dll/win32/urlmon/protocol.c
dll/win32/urlmon/sec_mgr.c
dll/win32/urlmon/session.c
dll/win32/urlmon/uri.c
dll/win32/urlmon/urlmon.spec
dll/win32/urlmon/urlmon_ros.diff
dll/win32/urlmon/urlmon_urlmon.idl
dll/win32/usp10/mirror.c
dll/win32/usp10/opentype.c
dll/win32/usp10/usp10.c
dll/win32/vbscript/CMakeLists.txt
dll/win32/vbscript/compile.c
dll/win32/vbscript/global.c
dll/win32/vbscript/interp.c
dll/win32/vbscript/parse.h
dll/win32/vbscript/parser.tab.c
dll/win32/vbscript/parser.tab.h
dll/win32/vbscript/parser.y
dll/win32/vbscript/regexp.c
dll/win32/vbscript/vbdisp.c
dll/win32/vbscript/vbregexp.c
dll/win32/vbscript/vbscript.h
dll/win32/vbscript/vbscript_classes.idl
dll/win32/vbscript/vbsglobal.idl
dll/win32/vbscript/vbsregexp10.idl
dll/win32/vbscript/vbsregexp55.idl
dll/win32/version/version.c
dll/win32/wbemdisp/locator.c
dll/win32/wbemdisp/main.c
dll/win32/wbemdisp/wbemdisp_classes.idl
dll/win32/wbemdisp/wbemdisp_private.h
dll/win32/wbemdisp/wbemdisp_tlb.idl
dll/win32/wbemprox/builtin.c
dll/win32/wbemprox/class.c
dll/win32/wbemprox/main.c
dll/win32/wbemprox/qualifier.c
dll/win32/wbemprox/query.c
dll/win32/wbemprox/services.c
dll/win32/wbemprox/wbemlocator.c
dll/win32/wbemprox/wbemprox.idl
dll/win32/wbemprox/wbemprox_private.h
dll/win32/wbemprox/wql.tab.c
dll/win32/wbemprox/wql.y
dll/win32/windowscodecs/bitmap.c
dll/win32/windowscodecs/bmpdecode.c
dll/win32/windowscodecs/bmpencode.c
dll/win32/windowscodecs/clsfactory.c
dll/win32/windowscodecs/converter.c
dll/win32/windowscodecs/gifformat.c
dll/win32/windowscodecs/guid.c
dll/win32/windowscodecs/icnsformat.c
dll/win32/windowscodecs/icoformat.c
dll/win32/windowscodecs/imgfactory.c
dll/win32/windowscodecs/info.c
dll/win32/windowscodecs/jpegformat.c
dll/win32/windowscodecs/metadatahandler.c
dll/win32/windowscodecs/pngformat.c
dll/win32/windowscodecs/proxy.c
dll/win32/windowscodecs/regsvr.c
dll/win32/windowscodecs/tgaformat.c
dll/win32/windowscodecs/tiffformat.c
dll/win32/windowscodecs/wincodecs_private.h
dll/win32/windowscodecs/windowscodecs.spec
dll/win32/windowscodecs/windowscodecs_wincodec.idl
dll/win32/winhttp/cookie.c
dll/win32/winhttp/main.c
dll/win32/winhttp/net.c
dll/win32/winhttp/request.c
dll/win32/winhttp/session.c
dll/win32/winhttp/winhttp_private.h
dll/win32/winhttp/winhttp_tlb.idl
dll/win32/wininet/dialogs.c
dll/win32/wininet/ftp.c
dll/win32/wininet/http.c
dll/win32/wininet/internet.c
dll/win32/wininet/internet.h
dll/win32/wininet/netconnection.c
dll/win32/wininet/utility.c
dll/win32/wintrust/crypt.c
dll/win32/wintrust/register.c
dll/win32/wldap32/init.c
dll/win32/wmi/wmi.spec
dll/win32/wtsapi32/wtsapi32.c
dll/win32/wuapi/downloader.c
dll/win32/wuapi/installer.c
dll/win32/wuapi/main.c
dll/win32/wuapi/searcher.c
dll/win32/wuapi/session.c
dll/win32/wuapi/systeminfo.c
dll/win32/wuapi/updates.c
dll/win32/wuapi/wuapi_private.h
dll/win32/wuapi/wuapi_tlb.idl
dll/win32/xmllite/guid.c
dll/win32/xmllite/reader.c
dll/win32/xmllite/writer.c
dll/win32/xmllite/xmllite.spec
dll/win32/xmllite/xmllite_private.h
drivers/bus/acpi/CMakeLists.txt
drivers/filesystems/fastfat/create.c
drivers/filesystems/fs_rec/fs_rec.c
drivers/input/i8042prt/i8042prt.c
drivers/input/i8042prt/i8042prt.h
drivers/input/i8042prt/keyboard.c
drivers/input/i8042prt/misc.c
drivers/input/i8042prt/mouse.c
drivers/input/i8042prt/pnp.c
include/crt/errno.h
include/psdk/CMakeLists.txt
include/psdk/bcrypt.h
include/psdk/bits.idl
include/psdk/bits3_0.idl
include/psdk/driverspecs.h
include/psdk/ks.h
include/psdk/mshtmdid.h
include/psdk/mshtml.idl
include/psdk/msi.h
include/psdk/mswsock.h
include/psdk/msxml2.idl
include/psdk/msxml6.idl
include/psdk/objbase.h
include/psdk/shlobj.h
include/psdk/urlmon.idl
include/psdk/winnt.h
include/psdk/wsnwlink.h
include/psdk/xmllite.idl
include/reactos/libs/libxslt/imports.h
include/reactos/libs/pseh/pseh2.h
include/reactos/wine/commctrl.h
include/reactos/wine/typeof.h
lib/3rdparty/adns/adns_win32/adns_win32.h
lib/3rdparty/cardlib/cardbutton.cpp
lib/pseh/dummy.c
lib/rtl/actctx.c
lib/rtl/heap.c
lib/rtl/image.c
lib/rtl/rtlavl.h
lib/sdk/crt/except/cpp.c
lib/sdk/crt/include/internal/wine/cppexcept.h
lib/sdk/crt/include/internal/wine/msvcrt.h
lib/sdk/crt/stdio/file.c
lib/sdk/crt/string/scanf.h
lib/sdk/crt/wine/undname.c
media/doc/README.WINE
ntoskrnl/fstub/fstubex.c
ntoskrnl/io/iomgr/iofunc.c
ntoskrnl/io/iomgr/irp.c
win32ss/gdi/eng/engbrush.c
win32ss/gdi/eng/engmisc.c
win32ss/gdi/eng/gradient.c
win32ss/gdi/eng/pdevobj.c
win32ss/gdi/eng/perfcnt.c
win32ss/gdi/eng/semaphor.c
win32ss/gdi/eng/sort.c
win32ss/gdi/eng/string.c
win32ss/gdi/eng/stubs.c
win32ss/gdi/eng/transblt.c
win32ss/gdi/ntgdi/dcutil.c
win32ss/gdi/ntgdi/path.c
win32ss/include/ntuser.h
win32ss/reactx/ntddraw/ddraw.c
win32ss/user/ntuser/accelerator.c
win32ss/user/ntuser/menu.c
win32ss/user/ntuser/menu.h
win32ss/user/ntuser/misc/copy.c
win32ss/user/ntuser/mmcopy.h
win32ss/user/ntuser/object.c
win32ss/user/ntuser/simplecall.c
win32ss/user/ntuser/userfuncs.h
win32ss/user/ntuser/window.c
win32ss/user/ntuser/winsta.c
win32ss/user/user32/windows/menu.c
win32ss/user/winsrv/consrv/condrv/coninput.c
win32ss/user/winsrv/consrv/condrv/console.c
win32ss/user/winsrv/consrv/condrv/dummyfrontend.c
win32ss/user/winsrv/consrv/condrv/text.c
win32ss/user/winsrv/consrv/console.c
win32ss/user/winsrv/consrv/frontendctl.c
win32ss/user/winsrv/consrv/frontends/gui/conwnd.c
win32ss/user/winsrv/consrv/frontends/gui/conwnd.h
win32ss/user/winsrv/consrv/frontends/gui/graphics.c
win32ss/user/winsrv/consrv/frontends/gui/guisettings.c
win32ss/user/winsrv/consrv/frontends/gui/guisettings.h
win32ss/user/winsrv/consrv/frontends/gui/guiterm.c
win32ss/user/winsrv/consrv/frontends/gui/text.c
win32ss/user/winsrv/consrv/frontends/tui/tuiterm.c
win32ss/user/winsrv/consrv/handle.c
win32ss/user/winsrv/consrv/include/conio.h
win32ss/user/winsrv/consrv/include/term.h
win32ss/user/winsrv/consrv/settings.c
win32ss/user/winsrv/consrv_new/settings.c
win32ss/w32ksvc.db
win32ss/w32ksvc.h

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc configure.cmd
Simple merge
diff --cc configure.sh
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 8a94a6e,ee5891c..ee5891c
Binary files differ
index 0000000,9e0ef21..9e0ef21
mode 000000,100644..100644
Binary files differ
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 0000000,def51b0..def51b0
mode 000000,100644..100644
--- /dev/null
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 0000000,039a3d6..039a3d6
mode 000000,100644..100644
--- /dev/null
index 0000000,b6ea3d4..b6ea3d4
mode 000000,100644..100644
--- /dev/null
Simple merge
index 0000000,75f1e41..75f1e41
mode 000000,100644..100644
--- /dev/null
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 0000000,42c1a80..42c1a80
mode 000000,100644..100644
--- /dev/null
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 2e45185,4198698..4198698
Binary files differ
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 0000000,cdfd3be..cdfd3be
mode 000000,100644..100644
--- /dev/null
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 8bd45b1,0000000..debe783
mode 100644,000000..100644
--- /dev/null
@@@ -1,61 -1,0 +1,61 @@@
- struct NBCmdQueue *NBCmdQueueCreate(HANDLE heap);
 +/* Copyright (c) 2003 Juan Lang
 + *
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; either
 + * version 2.1 of the License, or (at your option) any later version.
 + *
 + * This library is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 + */
 +#ifndef __NBCMDQUEUE_H__
 +#define __NBCMDQUEUE_H__
 +
 +/* This file defines a queue of pending NetBIOS commands.  The queue operations
 + * are thread safe, with the exception of NBCmdQueueDestroy:  ensure no other
 + * threads are manipulating the queue when calling NBCmdQueueDestroy.
 + */
 +
 +struct NBCmdQueue;
 +
 +/* Allocates a new command queue from heap. */
- UCHAR NBCmdQueueAdd(struct NBCmdQueue *queue, PNCB ncb);
++struct NBCmdQueue *NBCmdQueueCreate(HANDLE heap) DECLSPEC_HIDDEN;
 +
 +/* Adds ncb to queue.  Assumes queue is not NULL, and ncb is not already in the
 + * queue.  If ncb is already in the queue, returns NRC_TOOMANY.
 + */
- UCHAR NBCmdQueueCancel(struct NBCmdQueue *queue, PNCB ncb);
++UCHAR NBCmdQueueAdd(struct NBCmdQueue *queue, PNCB ncb) DECLSPEC_HIDDEN;
 +
 +/* Cancels the given ncb.  Blocks until the command completes.  Implicitly
 + * removes ncb from the queue.  Assumes queue and ncb are not NULL, and that
 + * ncb has been added to queue previously.
 + * Returns NRC_CMDCAN on a successful cancellation, NRC_CMDOCCR if the command
 + * completed before it could be cancelled, and various other return values for
 + * different failures.
 + */
- UCHAR NBCmdQueueComplete(struct NBCmdQueue *queue, PNCB ncb, UCHAR retcode);
++UCHAR NBCmdQueueCancel(struct NBCmdQueue *queue, PNCB ncb) DECLSPEC_HIDDEN;
 +
 +/* Sets the return code of the given ncb, and implicitly removes the command
 + * from the queue.  Assumes queue and ncb are not NULL, and that ncb has been
 + * added to queue previously.
 + * Returns NRC_GOODRET on success.
 + */
- UCHAR NBCmdQueueCancelAll(struct NBCmdQueue *queue);
++UCHAR NBCmdQueueComplete(struct NBCmdQueue *queue, PNCB ncb, UCHAR retcode) DECLSPEC_HIDDEN;
 +
 +/* Cancels all pending commands in the queue (useful for a RESET or a shutdown).
 + * Returns when all commands have been completed.
 + */
- void NBCmdQueueDestroy(struct NBCmdQueue *queue);
++UCHAR NBCmdQueueCancelAll(struct NBCmdQueue *queue) DECLSPEC_HIDDEN;
 +
 +/* Frees all memory associated with the queue.  Blocks until all commands
 + * pending in the queue have been completed.
 + */
++void NBCmdQueueDestroy(struct NBCmdQueue *queue) DECLSPEC_HIDDEN;
 +
 +#endif /* __NBCMDQUEUE_H__ */
index bfdbb33,0000000..3a36953
mode 100644,000000..100644
--- /dev/null
@@@ -1,67 -1,0 +1,67 @@@
- struct NBNameCache *NBNameCacheCreate(HANDLE heap, DWORD entryExpireTimeMS);
 +/* Copyright (c) 2003 Juan Lang
 + *
 + * This library is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; either
 + * version 2.1 of the License, or (at your option) any later version.
 + *
 + * This library is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with this library; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 + */
 +#ifndef __WINE_NBNAMECACHE_H
 +#define __WINE_NBNAMECACHE_H
 +
 +struct NBNameCache;
 +
 +/* Represents an entry in the name cache.  If the NetBIOS name is known, it's
 + * in nbname.  Otherwise, nbname begins with '*'.  numAddresses defines the
 + * number of addresses in addresses.
 + * Notice that it allows multiple addresses per name, but doesn't explicitly
 + * allow group names.  That's because all names so far are unique; if a use for
 + * group names comes up, adding a flag here is simple enough.
 + * Also, only the first NCBNAMSZ - 1 bytes are considered significant.  This is
 + * because a name may have been resolved using DNS, and the suffix byte is
 + * always truncated for DNS lookups.
 + */
 +typedef struct _NBNameCacheEntry
 +{
 +    UCHAR name[NCBNAMSZ];
 +    UCHAR nbname[NCBNAMSZ];
 +    DWORD numAddresses;
 +    DWORD addresses[1];
 +} NBNameCacheEntry;
 +
 +/* Functions that create, manipulate, and destroy a name cache.  Thread-safe,
 + * with the exception of NBNameCacheDestroy--ensure that no other threads are
 + * manipulating the cache before destroying it.
 + */
 +
 +/* Allocates a new name cache from heap, and sets the expire time on new
 + * entries to entryExpireTimeMS after a cache entry is added.
 + */
- BOOL NBNameCacheAddEntry(struct NBNameCache *cache, NBNameCacheEntry *entry);
++struct NBNameCache *NBNameCacheCreate(HANDLE heap, DWORD entryExpireTimeMS) DECLSPEC_HIDDEN;
 +
 +/* Adds an entry to the cache.  The entry is assumed to have been allocated
 + * from the same heap as the name cache; the name cache will own the entry
 + * from now on.  The entry's expire time is initialized at this time to
 + * entryExpireTimeMS + the current time in MS.  If an existing entry with the
 + * same name was in the cache, the entry is replaced.  Returns TRUE on success
 + * or FALSE on failure.
 + */
-  const UCHAR name[NCBNAMSZ]);
++BOOL NBNameCacheAddEntry(struct NBNameCache *cache, NBNameCacheEntry *entry) DECLSPEC_HIDDEN;
 +
 +/* Finds the entry with name name in the cache and returns a pointer to it, or
 + * NULL if it isn't found.
 + */
 +const NBNameCacheEntry *NBNameCacheFindEntry(struct NBNameCache *cache,
- void NBNameCacheDestroy(struct NBNameCache *cache);
++ const UCHAR name[NCBNAMSZ]) DECLSPEC_HIDDEN;
 +
++void NBNameCacheDestroy(struct NBNameCache *cache) DECLSPEC_HIDDEN;
 +
 +#endif /* ndef __WINE_NBNAMECACHE_H */
index d0ae285,0000000..ba68e72
mode 100644,000000..100644
--- /dev/null
@@@ -1,1544 -1,0 +1,1546 @@@
-     while (!found && ret == NRC_GOODRET && (now = GetTickCount()) < waitUntil)
 +/* Copyright (c) 2003 Juan Lang
 + *
 + * 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
 + *
 + * I am heavily indebted to Chris Hertel's excellent Implementing CIFS,
 + * http://ubiqx.org/cifs/ , for whatever understanding I have of NBT.
 + * I also stole from Mike McCormack's smb.c and netapi32.c, although little of
 + * that code remains.
 + * Lack of understanding and bugs are my fault.
 + *
 + * FIXME:
 + * - Of the NetBIOS session functions, only client functions are supported, and
 + *   it's likely they'll be the only functions supported.  NBT requires session
 + *   servers to listen on TCP/139.  This requires root privilege, and Samba is
 + *   likely to be listening here already.  This further restricts NetBIOS
 + *   applications, both explicit users and implicit ones:  CreateNamedPipe
 + *   won't actually create a listening pipe, for example, so applications can't
 + *   act as RPC servers using a named pipe protocol binding, DCOM won't be able
 + *   to support callbacks or servers over the named pipe protocol, etc.
 + *
 + * - Datagram support is omitted for the same reason.  To send a NetBIOS
 + *   datagram, you must include the NetBIOS name by which your application is
 + *   known.  This requires you to have registered the name previously, and be
 + *   able to act as a NetBIOS datagram server (listening on UDP/138).
 + *
 + * - Name registration functions are omitted for the same reason--registering a
 + *   name requires you to be able to defend it, and this means listening on
 + *   UDP/137.
 + *   Win98 requires you either use your computer's NetBIOS name (with the NULL
 + *   suffix byte) as the calling name when creating a session, or to register
 + *   a new name before creating one:  it disallows '*' as the calling name.
 + *   Win2K initially starts with an empty name table, and doesn't allow you to
 + *   use the machine's NetBIOS name (with the NULL suffix byte) as the calling
 + *   name.  Although it allows sessions to be created with '*' as the calling
 + *   name, doing so results in timeouts for all receives, because the
 + *   application never gets them.
 + *   So, a well-behaved NetBIOS application will typically want to register a
 + *   name.  I should probably support a do-nothing name list that allows
 + *   NCBADDNAME to add to it, but doesn't actually register the name, or does
 + *   attempt to register it without being able to defend it.
 + *
 + * - Name lookups may not behave quite as you'd expect/like if you have
 + *   multiple LANAs.  If a name is resolvable through DNS, or if you're using
 + *   WINS, it'll resolve on _any_ LANA.  So, a Call will succeed on any LANA as
 + *   well.
 + *   I'm not sure how Windows behaves in this case.  I could try to force
 + *   lookups to the correct adapter by using one of the GetPreferred*
 + *   functions, but with the possibility of multiple adapters in the same
 + *   same subnet, there's no guarantee that what IpHlpApi thinks is the
 + *   preferred adapter will actually be a LANA.  (It's highly probable because
 + *   this is an unusual configuration, but not guaranteed.)
 + *
 + * See also other FIXMEs in the code.
 + */
 +
 +#include "netapi32.h"
 +
 +#include <winsock2.h>
 +#include <winreg.h>
 +
 +WINE_DEFAULT_DEBUG_CHANNEL(netbios);
 +
 +#define PORT_NBNS 137
 +#define PORT_NBDG 138
 +#define PORT_NBSS 139
 +
 +#ifndef INADDR_NONE
 +#define INADDR_NONE ~0UL
 +#endif
 +
 +#define NBR_ADDWORD(p,word) (*(WORD *)(p)) = htons(word)
 +#define NBR_GETWORD(p) ntohs(*(WORD *)(p))
 +
 +#define MIN_QUERIES         1
 +#define MAX_QUERIES         0xffff
 +#define MIN_QUERY_TIMEOUT   100
 +#define MAX_QUERY_TIMEOUT   0xffffffff
 +#define BCAST_QUERIES       3
 +#define BCAST_QUERY_TIMEOUT 750
 +#define WINS_QUERIES        3
 +#define WINS_QUERY_TIMEOUT  750
 +#define MAX_WINS_SERVERS    2
 +#define MIN_CACHE_TIMEOUT   60000
 +#define CACHE_TIMEOUT       360000
 +
 +#define MAX_NBT_NAME_SZ            255
 +#define SIMPLE_NAME_QUERY_PKT_SIZE 16 + MAX_NBT_NAME_SZ
 +
 +#define NBNS_TYPE_NB             0x0020
 +#define NBNS_TYPE_NBSTAT         0x0021
 +#define NBNS_CLASS_INTERNET      0x00001
 +#define NBNS_HEADER_SIZE         (sizeof(WORD) * 6)
 +#define NBNS_RESPONSE_AND_OPCODE 0xf800
 +#define NBNS_RESPONSE_AND_QUERY  0x8000
 +#define NBNS_REPLYCODE           0x0f
 +
 +#define NBSS_HDRSIZE 4
 +
 +#define NBSS_MSG       0x00
 +#define NBSS_REQ       0x81
 +#define NBSS_ACK       0x82
 +#define NBSS_NACK      0x83
 +#define NBSS_RETARGET  0x84
 +#define NBSS_KEEPALIVE 0x85
 +
 +#define NBSS_ERR_NOT_LISTENING_ON_NAME    0x80
 +#define NBSS_ERR_NOT_LISTENING_FOR_CALLER 0x81
 +#define NBSS_ERR_BAD_NAME                 0x82
 +#define NBSS_ERR_INSUFFICIENT_RESOURCES   0x83
 +
 +#define NBSS_EXTENSION 0x01
 +
 +typedef struct _NetBTSession
 +{
 +    CRITICAL_SECTION cs;
 +    SOCKET           fd;
 +    DWORD            bytesPending;
 +} NetBTSession;
 +
 +typedef struct _NetBTAdapter
 +{
 +    MIB_IPADDRROW       ipr;
 +    WORD                nameQueryXID;
 +    struct NBNameCache *nameCache;
 +    DWORD               xmit_success;
 +    DWORD               recv_success;
 +} NetBTAdapter;
 +
 +static ULONG gTransportID;
 +static BOOL  gEnableDNS;
 +static DWORD gBCastQueries;
 +static DWORD gBCastQueryTimeout;
 +static DWORD gWINSQueries;
 +static DWORD gWINSQueryTimeout;
 +static DWORD gWINSServers[MAX_WINS_SERVERS];
 +static int   gNumWINSServers;
 +static char  gScopeID[MAX_SCOPE_ID_LEN];
 +static DWORD gCacheTimeout;
 +static struct NBNameCache *gNameCache;
 +
 +/* Converts from a NetBIOS name into a Second Level Encoding-formatted name.
 + * Assumes p is not NULL and is either NULL terminated or has at most NCBNAMSZ
 + * bytes, and buffer has at least MAX_NBT_NAME_SZ bytes.  Pads with space bytes
 + * if p is NULL-terminated.  Returns the number of bytes stored in buffer.
 + */
 +static int NetBTNameEncode(const UCHAR *p, UCHAR *buffer)
 +{
 +    int i,len=0;
 +
 +    if (!p) return 0;
 +    if (!buffer) return 0;
 +
 +    buffer[len++] = NCBNAMSZ * 2;
 +    for (i = 0; p[i] && i < NCBNAMSZ; i++)
 +    {
 +        buffer[len++] = ((p[i] & 0xf0) >> 4) + 'A';
 +        buffer[len++] =  (p[i] & 0x0f) + 'A';
 +    }
 +    while (len < NCBNAMSZ * 2)
 +    {
 +        buffer[len++] = 'C';
 +        buffer[len++] = 'A';
 +    }
 +    if (*gScopeID)
 +    {
 +        int scopeIDLen = strlen(gScopeID);
 +
 +        memcpy(buffer + len, gScopeID, scopeIDLen);
 +        len += scopeIDLen;
 +    }
 +    buffer[len++] = 0;     /* add second terminator */
 +    return len;
 +}
 +
 +/* Creates a NBT name request packet for name in buffer.  If broadcast is true,
 + * creates a broadcast request, otherwise creates a unicast request.
 + * Returns the number of bytes stored in buffer.
 + */
 +static DWORD NetBTNameReq(const UCHAR name[NCBNAMSZ], WORD xid, WORD qtype,
 + BOOL broadcast, UCHAR *buffer, int len)
 +{
 +    int i = 0;
 +
 +    if (len < SIMPLE_NAME_QUERY_PKT_SIZE) return 0;
 +
 +    NBR_ADDWORD(&buffer[i],xid);    i+=2; /* transaction */
 +    if (broadcast)
 +    {
 +        NBR_ADDWORD(&buffer[i],0x0110); /* flags: r=req,op=query,rd=1,b=1 */
 +        i+=2;
 +    }
 +    else
 +    {
 +        NBR_ADDWORD(&buffer[i],0x0100); /* flags: r=req,op=query,rd=1,b=0 */
 +        i+=2;
 +    }
 +    NBR_ADDWORD(&buffer[i],0x0001); i+=2; /* one name query */
 +    NBR_ADDWORD(&buffer[i],0x0000); i+=2; /* zero answers */
 +    NBR_ADDWORD(&buffer[i],0x0000); i+=2; /* zero authorities */
 +    NBR_ADDWORD(&buffer[i],0x0000); i+=2; /* zero additional */
 +
 +    i += NetBTNameEncode(name, &buffer[i]);
 +
 +    NBR_ADDWORD(&buffer[i],qtype); i+=2;
 +    NBR_ADDWORD(&buffer[i],NBNS_CLASS_INTERNET); i+=2;
 +
 +    return i;
 +}
 +
 +/* Sends a name query request for name on fd to destAddr.  Sets SO_BROADCAST on
 + * fd if broadcast is TRUE.  Assumes fd is not INVALID_SOCKET, and name is not
 + * NULL.
 + * Returns 0 on success, -1 on failure.
 + */
 +static int NetBTSendNameQuery(SOCKET fd, const UCHAR name[NCBNAMSZ], WORD xid,
 + WORD qtype, DWORD destAddr, BOOL broadcast)
 +{
 +    int ret = 0, on = 1;
 +    struct in_addr addr;
 +
 +    addr.s_addr = destAddr;
 +    TRACE("name %s, dest addr %s\n", name, inet_ntoa(addr));
 +
 +    if (broadcast)
 +        ret = setsockopt(fd, SOL_SOCKET, SO_BROADCAST, (const char*)&on, sizeof(on));
 +    if(ret == 0)
 +    {
 +        WSABUF wsaBuf;
 +        UCHAR buf[SIMPLE_NAME_QUERY_PKT_SIZE];
 +        struct sockaddr_in sin;
 +
 +        memset(&sin, 0, sizeof(sin));
 +        sin.sin_addr.s_addr = destAddr;
 +        sin.sin_family      = AF_INET;
 +        sin.sin_port        = htons(PORT_NBNS);
 +
 +        wsaBuf.buf = (CHAR*)buf;
 +        wsaBuf.len = NetBTNameReq(name, xid, qtype, broadcast, buf,
 +         sizeof(buf));
 +        if (wsaBuf.len > 0)
 +        {
 +            DWORD bytesSent;
 +
 +            ret = WSASendTo(fd, &wsaBuf, 1, &bytesSent, 0,
 +             (struct sockaddr*)&sin, sizeof(sin), NULL, NULL);
 +            if (ret < 0 || bytesSent < wsaBuf.len)
 +                ret = -1;
 +            else
 +                ret = 0;
 +        }
 +        else
 +            ret = -1;
 +    }
 +    return ret;
 +}
 +
 +typedef BOOL (*NetBTAnswerCallback)(void *data, WORD answerCount,
 + WORD answerIndex, PUCHAR rData, WORD rdLength);
 +
 +/* Waits on fd until GetTickCount() returns a value greater than or equal to
 + * waitUntil for a name service response.  If a name response matching xid
 + * is received, calls answerCallback once for each answer resource record in
 + * the response.  (The callback's answerCount will be the total number of
 + * answers to expect, and answerIndex will be the 0-based index that's being
 + * sent this time.)  Quits parsing if answerCallback returns FALSE.
 + * Returns NRC_GOODRET on timeout or a valid response received, something else
 + * on error.
 + */
 +static UCHAR NetBTWaitForNameResponse(const NetBTAdapter *adapter, SOCKET fd,
 + DWORD waitUntil, NetBTAnswerCallback answerCallback, void *data)
 +{
 +    BOOL found = FALSE;
 +    DWORD now;
 +    UCHAR ret = NRC_GOODRET;
 +
 +    if (!adapter) return NRC_BADDR;
 +    if (fd == INVALID_SOCKET) return NRC_BADDR;
 +    if (!answerCallback) return NRC_BADDR;
 +
-             queryData->cacheEntry = HeapAlloc(
-              GetProcessHeap(), 0, sizeof(NBNameCacheEntry) +
-              (answerCount - 1) * sizeof(DWORD));
++    while (!found && ret == NRC_GOODRET && (int)((now = GetTickCount()) - waitUntil) < 0)
 +    {
 +        DWORD msToWait = waitUntil - now;
 +        struct fd_set fds;
 +        struct timeval timeout = { msToWait / 1000, msToWait % 1000 };
 +        int r;
 +
 +        FD_ZERO(&fds);
 +        FD_SET(fd, &fds);
 +        r = select(fd + 1, &fds, NULL, NULL, &timeout);
 +        if (r < 0)
 +            ret = NRC_SYSTEM;
 +        else if (r == 1)
 +        {
 +            /* FIXME: magic #, is this always enough? */
 +            UCHAR buffer[256];
 +            int fromsize;
 +            struct sockaddr_in fromaddr;
 +            WORD respXID, flags, queryCount, answerCount;
 +            WSABUF wsaBuf = { sizeof(buffer), (CHAR*)buffer };
 +            DWORD bytesReceived, recvFlags = 0;
 +
 +            fromsize = sizeof(fromaddr);
 +            r = WSARecvFrom(fd, &wsaBuf, 1, &bytesReceived, &recvFlags,
 +             (struct sockaddr*)&fromaddr, &fromsize, NULL, NULL);
 +            if(r < 0)
 +            {
 +                ret = NRC_SYSTEM;
 +                break;
 +            }
 +
 +            if (bytesReceived < NBNS_HEADER_SIZE)
 +                continue;
 +
 +            respXID = NBR_GETWORD(buffer);
 +            if (adapter->nameQueryXID != respXID)
 +                continue;
 +
 +            flags = NBR_GETWORD(buffer + 2);
 +            queryCount = NBR_GETWORD(buffer + 4);
 +            answerCount = NBR_GETWORD(buffer + 6);
 +
 +            /* a reply shouldn't contain a query, ignore bad packet */
 +            if (queryCount > 0)
 +                continue;
 +
 +            if ((flags & NBNS_RESPONSE_AND_OPCODE) == NBNS_RESPONSE_AND_QUERY)
 +            {
 +                if ((flags & NBNS_REPLYCODE) != 0)
 +                    ret = NRC_NAMERR;
 +                else if ((flags & NBNS_REPLYCODE) == 0 && answerCount > 0)
 +                {
 +                    PUCHAR ptr = buffer + NBNS_HEADER_SIZE;
 +                    BOOL shouldContinue = TRUE;
 +                    WORD answerIndex = 0;
 +
 +                    found = TRUE;
 +                    /* decode one answer at a time */
 +                    while (ret == NRC_GOODRET && answerIndex < answerCount &&
 +                     ptr - buffer < bytesReceived && shouldContinue)
 +                    {
 +                        WORD rLen;
 +
 +                        /* scan past name */
 +                        for (; ptr[0] && ptr - buffer < bytesReceived; )
 +                            ptr += ptr[0] + 1;
 +                        ptr++;
 +                        ptr += 2; /* scan past type */
 +                        if (ptr - buffer < bytesReceived && ret == NRC_GOODRET
 +                         && NBR_GETWORD(ptr) == NBNS_CLASS_INTERNET)
 +                            ptr += sizeof(WORD);
 +                        else
 +                            ret = NRC_SYSTEM; /* parse error */
 +                        ptr += sizeof(DWORD); /* TTL */
 +                        rLen = NBR_GETWORD(ptr);
 +                        rLen = min(rLen, bytesReceived - (ptr - buffer));
 +                        ptr += sizeof(WORD);
 +                        shouldContinue = answerCallback(data, answerCount,
 +                         answerIndex, ptr, rLen);
 +                        ptr += rLen;
 +                        answerIndex++;
 +                    }
 +                }
 +            }
 +        }
 +    }
 +    TRACE("returning 0x%02x\n", ret);
 +    return ret;
 +}
 +
 +typedef struct _NetBTNameQueryData {
 +    NBNameCacheEntry *cacheEntry;
 +    UCHAR ret;
 +} NetBTNameQueryData;
 +
 +/* Name query callback function for NetBTWaitForNameResponse, creates a cache
 + * entry on the first answer, adds each address as it's called again (as long
 + * as there's space).  If there's an error that should be propagated as the
 + * NetBIOS error, modifies queryData's ret member to the proper return code.
 + */
 +static BOOL NetBTFindNameAnswerCallback(void *pVoid, WORD answerCount,
 + WORD answerIndex, PUCHAR rData, WORD rLen)
 +{
 +    NetBTNameQueryData *queryData = pVoid;
 +    BOOL ret;
 +
 +    if (queryData)
 +    {
 +        if (queryData->cacheEntry == NULL)
 +        {
-                 *cacheEntry = HeapAlloc(GetProcessHeap(),
-                  0, sizeof(NBNameCacheEntry));
++            queryData->cacheEntry = HeapAlloc(GetProcessHeap(), 0,
++             FIELD_OFFSET(NBNameCacheEntry, addresses[answerCount]));
 +            if (queryData->cacheEntry)
 +                queryData->cacheEntry->numAddresses = 0;
 +            else
 +                queryData->ret = NRC_OSRESNOTAV;
 +        }
 +        if (rLen == 6 && queryData->cacheEntry &&
 +         queryData->cacheEntry->numAddresses < answerCount)
 +        {
 +            queryData->cacheEntry->addresses[queryData->cacheEntry->
 +             numAddresses++] = *(const DWORD *)(rData + 2);
 +            ret = queryData->cacheEntry->numAddresses < answerCount;
 +        }
 +        else
 +            ret = FALSE;
 +    }
 +    else
 +        ret = FALSE;
 +    return ret;
 +}
 +
 +/* Workhorse NetBT name lookup function.  Sends a name lookup query for
 + * ncb->ncb_callname to sendTo, as a broadcast if broadcast is TRUE, using
 + * adapter->nameQueryXID as the transaction ID.  Waits up to timeout
 + * milliseconds, and retries up to maxQueries times, waiting for a reply.
 + * If a valid response is received, stores the looked up addresses as a
 + * NBNameCacheEntry in *cacheEntry.
 + * Returns NRC_GOODRET on success, though this may not mean the name was
 + * resolved--check whether *cacheEntry is NULL.
 + */
 +static UCHAR NetBTNameWaitLoop(const NetBTAdapter *adapter, SOCKET fd, const NCB *ncb,
 + DWORD sendTo, BOOL broadcast, DWORD timeout, DWORD maxQueries,
 + NBNameCacheEntry **cacheEntry)
 +{
 +    unsigned int queries;
 +    NetBTNameQueryData queryData;
 +
 +    if (!adapter) return NRC_BADDR;
 +    if (fd == INVALID_SOCKET) return NRC_BADDR;
 +    if (!ncb) return NRC_BADDR;
 +    if (!cacheEntry) return NRC_BADDR;
 +
 +    queryData.cacheEntry = NULL;
 +    queryData.ret = NRC_GOODRET;
 +    for (queries = 0; queryData.cacheEntry == NULL && queries < maxQueries;
 +     queries++)
 +    {
 +        if (!NCB_CANCELLED(ncb))
 +        {
 +            int r = NetBTSendNameQuery(fd, ncb->ncb_callname,
 +             adapter->nameQueryXID, NBNS_TYPE_NB, sendTo, broadcast);
 +
 +            if (r == 0)
 +                queryData.ret = NetBTWaitForNameResponse(adapter, fd,
 +                 GetTickCount() + timeout, NetBTFindNameAnswerCallback,
 +                 &queryData);
 +            else
 +                queryData.ret = NRC_SYSTEM;
 +        }
 +        else
 +            queryData.ret = NRC_CMDCAN;
 +    }
 +    if (queryData.cacheEntry)
 +    {
 +        memcpy(queryData.cacheEntry->name, ncb->ncb_callname, NCBNAMSZ);
 +        memcpy(queryData.cacheEntry->nbname, ncb->ncb_callname, NCBNAMSZ);
 +    }
 +    *cacheEntry = queryData.cacheEntry;
 +    return queryData.ret;
 +}
 +
 +/* Attempts to add cacheEntry to the name cache in *nameCache; if *nameCache
 + * has not yet been created, creates it, using gCacheTimeout as the cache
 + * entry timeout.  If memory allocation fails, or if NBNameCacheAddEntry fails,
 + * frees cacheEntry.
 + * Returns NRC_GOODRET on success, and something else on failure.
 + */
 +static UCHAR NetBTStoreCacheEntry(struct NBNameCache **nameCache,
 + NBNameCacheEntry *cacheEntry)
 +{
 +    UCHAR ret;
 +
 +    if (!nameCache) return NRC_BADDR;
 +    if (!cacheEntry) return NRC_BADDR;
 +
 +    if (!*nameCache)
 +        *nameCache = NBNameCacheCreate(GetProcessHeap(), gCacheTimeout);
 +    if (*nameCache)
 +        ret = NBNameCacheAddEntry(*nameCache, cacheEntry)
 +         ?  NRC_GOODRET : NRC_OSRESNOTAV;
 +    else
 +    {
 +        HeapFree(GetProcessHeap(), 0, cacheEntry);
 +        ret = NRC_OSRESNOTAV;
 +    }
 +    return ret;
 +}
 +
 +/* Attempts to resolve name using inet_addr(), then gethostbyname() if
 + * gEnableDNS is TRUE, if the suffix byte is either <00> or <20>.  If the name
 + * can be looked up, returns 0 and stores the looked up addresses as a
 + * NBNameCacheEntry in *cacheEntry.
 + * Returns NRC_GOODRET on success, though this may not mean the name was
 + * resolved--check whether *cacheEntry is NULL.  Returns something else on
 + * error.
 + */
 +static UCHAR NetBTinetResolve(const UCHAR name[NCBNAMSZ],
 + NBNameCacheEntry **cacheEntry)
 +{
 +    UCHAR ret = NRC_GOODRET;
 +
 +    TRACE("name %s, cacheEntry %p\n", name, cacheEntry);
 +
 +    if (!name) return NRC_BADDR;
 +    if (!cacheEntry) return NRC_BADDR;
 +
 +    if (isalnum(name[0]) && (name[NCBNAMSZ - 1] == 0 ||
 +     name[NCBNAMSZ - 1] == 0x20))
 +    {
 +        CHAR toLookup[NCBNAMSZ];
 +        unsigned int i;
 +
 +        for (i = 0; i < NCBNAMSZ - 1 && name[i] && name[i] != ' '; i++)
 +            toLookup[i] = name[i];
 +        toLookup[i] = '\0';
 +
 +        if (isdigit(toLookup[0]))
 +        {
 +            unsigned long addr = inet_addr(toLookup);
 +
 +            if (addr != INADDR_NONE)
 +            {
-                     *cacheEntry = HeapAlloc(
-                      GetProcessHeap(), 0, sizeof(NBNameCacheEntry) +
-                      (i - 1) * sizeof(DWORD));
++                *cacheEntry = HeapAlloc(GetProcessHeap(), 0,
++                 FIELD_OFFSET(NBNameCacheEntry, addresses[1]));
 +                if (*cacheEntry)
 +                {
 +                    memcpy((*cacheEntry)->name, name, NCBNAMSZ);
 +                    memset((*cacheEntry)->nbname, 0, NCBNAMSZ);
 +                    (*cacheEntry)->nbname[0] = '*';
 +                    (*cacheEntry)->numAddresses = 1;
 +                    (*cacheEntry)->addresses[0] = addr;
 +                }
 +                else
 +                    ret = NRC_OSRESNOTAV;
 +            }
 +        }
 +        if (gEnableDNS && ret == NRC_GOODRET && !*cacheEntry)
 +        {
 +            struct hostent *host;
 +
 +            if ((host = gethostbyname(toLookup)) != NULL)
 +            {
 +                for (i = 0; ret == NRC_GOODRET && host->h_addr_list &&
 +                 host->h_addr_list[i]; i++)
 +                    ;
 +                if (host->h_addr_list && host->h_addr_list[0])
 +                {
-                              (DWORD)host->h_addr_list[i];
++                    *cacheEntry = HeapAlloc(GetProcessHeap(), 0,
++                     FIELD_OFFSET(NBNameCacheEntry, addresses[i]));
 +                    if (*cacheEntry)
 +                    {
 +                        memcpy((*cacheEntry)->name, name, NCBNAMSZ);
 +                        memset((*cacheEntry)->nbname, 0, NCBNAMSZ);
 +                        (*cacheEntry)->nbname[0] = '*';
 +                        (*cacheEntry)->numAddresses = i;
 +                        for (i = 0; i < (*cacheEntry)->numAddresses; i++)
 +                            (*cacheEntry)->addresses[i] =
-                 if (ncb->ncb_rto > 0)
++                             *(DWORD*)host->h_addr_list[i];
 +                    }
 +                    else
 +                        ret = NRC_OSRESNOTAV;
 +                }
 +            }
 +        }
 +    }
 +
 +    TRACE("returning 0x%02x\n", ret);
 +    return ret;
 +}
 +
 +/* Looks up the name in ncb->ncb_callname, first in the name caches (global
 + * and this adapter's), then using gethostbyname(), next by WINS if configured,
 + * and finally using broadcast NetBT name resolution.  In NBT parlance, this
 + * makes this an "H-node".  Stores an entry in the appropriate name cache for a
 + * found node, and returns it as *cacheEntry.
 + * Assumes data, ncb, and cacheEntry are not NULL.
 + * Returns NRC_GOODRET on success--which doesn't mean the name was resolved,
 + * just that all name lookup operations completed successfully--and something
 + * else on failure.  *cacheEntry will be NULL if the name was not found.
 + */
 +static UCHAR NetBTInternalFindName(NetBTAdapter *adapter, PNCB ncb,
 + const NBNameCacheEntry **cacheEntry)
 +{
 +    UCHAR ret = NRC_GOODRET;
 +
 +    TRACE("adapter %p, ncb %p, cacheEntry %p\n", adapter, ncb, cacheEntry);
 +
 +    if (!cacheEntry) return NRC_BADDR;
 +    *cacheEntry = NULL;
 +
 +    if (!adapter) return NRC_BADDR;
 +    if (!ncb) return NRC_BADDR;
 +
 +    if (ncb->ncb_callname[0] == '*')
 +        ret = NRC_NOWILD;
 +    else
 +    {
 +        *cacheEntry = NBNameCacheFindEntry(gNameCache, ncb->ncb_callname);
 +        if (!*cacheEntry)
 +            *cacheEntry = NBNameCacheFindEntry(adapter->nameCache,
 +             ncb->ncb_callname);
 +        if (!*cacheEntry)
 +        {
 +            NBNameCacheEntry *newEntry = NULL;
 +
 +            ret = NetBTinetResolve(ncb->ncb_callname, &newEntry);
 +            if (ret == NRC_GOODRET && newEntry)
 +            {
 +                ret = NetBTStoreCacheEntry(&gNameCache, newEntry);
 +                if (ret != NRC_GOODRET)
 +                    newEntry = NULL;
 +            }
 +            else
 +            {
 +                SOCKET fd = WSASocketA(PF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL,
 +                 0, WSA_FLAG_OVERLAPPED);
 +
 +                if(fd == INVALID_SOCKET)
 +                    ret = NRC_OSRESNOTAV;
 +                else
 +                {
 +                    int winsNdx;
 +
 +                    adapter->nameQueryXID++;
 +                    for (winsNdx = 0; ret == NRC_GOODRET && *cacheEntry == NULL
 +                     && winsNdx < gNumWINSServers; winsNdx++)
 +                        ret = NetBTNameWaitLoop(adapter, fd, ncb,
 +                         gWINSServers[winsNdx], FALSE, gWINSQueryTimeout,
 +                         gWINSQueries, &newEntry);
 +                    if (ret == NRC_GOODRET && newEntry)
 +                    {
 +                        ret = NetBTStoreCacheEntry(&gNameCache, newEntry);
 +                        if (ret != NRC_GOODRET)
 +                            newEntry = NULL;
 +                    }
 +                    if (ret == NRC_GOODRET && *cacheEntry == NULL)
 +                    {
 +                        DWORD bcastAddr =
 +                         adapter->ipr.dwAddr & adapter->ipr.dwMask;
 +
 +                        if (adapter->ipr.dwBCastAddr)
 +                            bcastAddr |= ~adapter->ipr.dwMask;
 +                        ret = NetBTNameWaitLoop(adapter, fd, ncb, bcastAddr,
 +                         TRUE, gBCastQueryTimeout, gBCastQueries, &newEntry);
 +                        if (ret == NRC_GOODRET && newEntry)
 +                        {
 +                            ret = NetBTStoreCacheEntry(&adapter->nameCache,
 +                             newEntry);
 +                            if (ret != NRC_GOODRET)
 +                                newEntry = NULL;
 +                        }
 +                    }
 +                    closesocket(fd);
 +                }
 +            }
 +            *cacheEntry = newEntry;
 +        }
 +    }
 +    TRACE("returning 0x%02x\n", ret);
 +    return ret;
 +}
 +
 +typedef struct _NetBTNodeQueryData
 +{
 +    BOOL gotResponse;
 +    PADAPTER_STATUS astat;
 +    WORD astatLen;
 +} NetBTNodeQueryData;
 +
 +/* Callback function for NetBTAstatRemote, parses the rData for the node
 + * status and name list of the remote node.  Always returns FALSE, since
 + * there's never more than one answer we care about in a node status response.
 + */
 +static BOOL NetBTNodeStatusAnswerCallback(void *pVoid, WORD answerCount,
 + WORD answerIndex, PUCHAR rData, WORD rLen)
 +{
 +    NetBTNodeQueryData *data = pVoid;
 +
 +    if (data && !data->gotResponse && rData && rLen >= 1)
 +    {
 +        /* num names is first byte; each name is NCBNAMSZ + 2 bytes */
 +        if (rLen >= rData[0] * (NCBNAMSZ + 2))
 +        {
 +            WORD i;
 +            PUCHAR src;
 +            PNAME_BUFFER dst;
 +
 +            data->gotResponse = TRUE;
 +            data->astat->name_count = rData[0];
 +            for (i = 0, src = rData + 1,
 +             dst = (PNAME_BUFFER)((PUCHAR)data->astat +
 +              sizeof(ADAPTER_STATUS));
 +             i < data->astat->name_count && src - rData < rLen &&
 +             (PUCHAR)dst - (PUCHAR)data->astat < data->astatLen;
 +             i++, dst++, src += NCBNAMSZ + 2)
 +            {
 +                UCHAR flags = *(src + NCBNAMSZ);
 +
 +                memcpy(dst->name, src, NCBNAMSZ);
 +                /* we won't actually see a registering name in the returned
 +                 * response.  It's useful to see if no other flags are set; if
 +                 * none are, then the name is registered. */
 +                dst->name_flags = REGISTERING;
 +                if (flags & 0x80)
 +                    dst->name_flags |= GROUP_NAME;
 +                if (flags & 0x10)
 +                    dst->name_flags |= DEREGISTERED;
 +                if (flags & 0x08)
 +                    dst->name_flags |= DUPLICATE;
 +                if (dst->name_flags == REGISTERING)
 +                    dst->name_flags = REGISTERED;
 +            }
 +            /* arbitrarily set HW type to Ethernet */
 +            data->astat->adapter_type = 0xfe;
 +            if (src - rData < rLen)
 +                memcpy(data->astat->adapter_address, src,
 +                 min(rLen - (src - rData), 6));
 +        }
 +    }
 +    return FALSE;
 +}
 +
 +/* This uses the WINS timeout and query values, as they're the
 + * UCAST_REQ_RETRY_TIMEOUT and UCAST_REQ_RETRY_COUNT according to the RFCs.
 + */
 +static UCHAR NetBTAstatRemote(NetBTAdapter *adapter, PNCB ncb)
 +{
 +    UCHAR ret = NRC_GOODRET;
 +    const NBNameCacheEntry *cacheEntry = NULL;
 +
 +    TRACE("adapter %p, NCB %p\n", adapter, ncb);
 +
 +    if (!adapter) return NRC_BADDR;
 +    if (!ncb) return NRC_INVADDRESS;
 +
 +    ret = NetBTInternalFindName(adapter, ncb, &cacheEntry);
 +    if (ret == NRC_GOODRET && cacheEntry)
 +    {
 +        if (cacheEntry->numAddresses > 0)
 +        {
 +            SOCKET fd = WSASocketA(PF_INET, SOCK_DGRAM, IPPROTO_UDP, NULL, 0,
 +             WSA_FLAG_OVERLAPPED);
 +
 +            if(fd == INVALID_SOCKET)
 +                ret = NRC_OSRESNOTAV;
 +            else
 +            {
 +                NetBTNodeQueryData queryData;
 +                DWORD queries;
 +                PADAPTER_STATUS astat = (PADAPTER_STATUS)ncb->ncb_buffer;
 +
 +                adapter->nameQueryXID++;
 +                astat->name_count = 0;
 +                queryData.gotResponse = FALSE;
 +                queryData.astat = astat;
 +                queryData.astatLen = ncb->ncb_length;
 +                for (queries = 0; !queryData.gotResponse &&
 +                 queries < gWINSQueries; queries++)
 +                {
 +                    if (!NCB_CANCELLED(ncb))
 +                    {
 +                        int r = NetBTSendNameQuery(fd, ncb->ncb_callname,
 +                         adapter->nameQueryXID, NBNS_TYPE_NBSTAT,
 +                         cacheEntry->addresses[0], FALSE);
 +
 +                        if (r == 0)
 +                            ret = NetBTWaitForNameResponse(adapter, fd,
 +                             GetTickCount() + gWINSQueryTimeout,
 +                             NetBTNodeStatusAnswerCallback, &queryData);
 +                        else
 +                            ret = NRC_SYSTEM;
 +                    }
 +                    else
 +                        ret = NRC_CMDCAN;
 +                }
 +                closesocket(fd);
 +            }
 +        }
 +        else
 +            ret = NRC_CMDTMO;
 +    }
 +    else if (ret == NRC_CMDCAN)
 +        ; /* do nothing, we were cancelled */
 +    else
 +        ret = NRC_CMDTMO;
 +    TRACE("returning 0x%02x\n", ret);
 +    return ret;
 +}
 +
 +static UCHAR NetBTAstat(void *adapt, PNCB ncb)
 +{
 +    NetBTAdapter *adapter = adapt;
 +    UCHAR ret;
 +
 +    TRACE("adapt %p, NCB %p\n", adapt, ncb);
 +
 +    if (!adapter) return NRC_ENVNOTDEF;
 +    if (!ncb) return NRC_INVADDRESS;
 +    if (!ncb->ncb_buffer) return NRC_BADDR;
 +    if (ncb->ncb_length < sizeof(ADAPTER_STATUS)) return NRC_BUFLEN;
 +
 +    if (ncb->ncb_callname[0] == '*')
 +    {
 +        DWORD physAddrLen;
 +        MIB_IFROW ifRow;
 +        PADAPTER_STATUS astat = (PADAPTER_STATUS)ncb->ncb_buffer;
 +  
 +        memset(astat, 0, sizeof(ADAPTER_STATUS));
 +        astat->rev_major = 3;
 +        ifRow.dwIndex = adapter->ipr.dwIndex;
 +        if (GetIfEntry(&ifRow) != NO_ERROR)
 +            ret = NRC_BRIDGE;
 +        else
 +        {
 +            physAddrLen = min(ifRow.dwPhysAddrLen, 6);
 +            if (physAddrLen > 0)
 +                memcpy(astat->adapter_address, ifRow.bPhysAddr, physAddrLen);
 +            /* doubt anyone cares, but why not.. */
 +            if (ifRow.dwType == MIB_IF_TYPE_TOKENRING)
 +                astat->adapter_type = 0xff;
 +            else
 +                astat->adapter_type = 0xfe; /* for Ethernet */
 +            astat->max_sess_pkt_size = 0xffff;
 +            astat->xmit_success = adapter->xmit_success;
 +            astat->recv_success = adapter->recv_success;
 +            ret = NRC_GOODRET;
 +        }
 +    }
 +    else
 +        ret = NetBTAstatRemote(adapter, ncb);
 +    TRACE("returning 0x%02x\n", ret);
 +    return ret;
 +}
 +
 +static UCHAR NetBTFindName(void *adapt, PNCB ncb)
 +{
 +    NetBTAdapter *adapter = adapt;
 +    UCHAR ret;
 +    const NBNameCacheEntry *cacheEntry = NULL;
 +    PFIND_NAME_HEADER foundName;
 +
 +    TRACE("adapt %p, NCB %p\n", adapt, ncb);
 +
 +    if (!adapter) return NRC_ENVNOTDEF;
 +    if (!ncb) return NRC_INVADDRESS;
 +    if (!ncb->ncb_buffer) return NRC_BADDR;
 +    if (ncb->ncb_length < sizeof(FIND_NAME_HEADER)) return NRC_BUFLEN;
 +
 +    foundName = (PFIND_NAME_HEADER)ncb->ncb_buffer;
 +    memset(foundName, 0, sizeof(FIND_NAME_HEADER));
 +
 +    ret = NetBTInternalFindName(adapter, ncb, &cacheEntry);
 +    if (ret == NRC_GOODRET)
 +    {
 +        if (cacheEntry)
&nbs