]> git.saurik.com Git - apple/mdnsresponder.git/commitdiff
mDNSResponder-333.10.tar.gz v333.10
authorApple <opensource@apple.com>
Wed, 31 Aug 2011 01:44:17 +0000 (01:44 +0000)
committerApple <opensource@apple.com>
Wed, 31 Aug 2011 01:44:17 +0000 (01:44 +0000)
112 files changed:
Clients/DNS-SD.VisualStudio/dns-sd.vcxproj [new file with mode: 0755]
Clients/DNS-SD.VisualStudio/dns-sd.vcxproj.filters [new file with mode: 0755]
Clients/DNS-SD.VisualStudio/resource.h
Clients/DNSServiceBrowser.NET/AssemblyInfo.cs
Clients/DNSServiceBrowser.NET/DNSServiceBrowser.NET.csproj
Clients/DNSServiceBrowser.NET/DNSServiceBrowser.cs
Clients/DNSServiceBrowser.VB/DNSServiceBrowser.VB.vbproj
Clients/DNSServiceBrowser.VB/DNSServiceBrowser.vb
Clients/ExplorerPlugin/ExplorerPlugin.vcxproj [new file with mode: 0755]
Clients/ExplorerPlugin/ExplorerPlugin.vcxproj.filters [new file with mode: 0755]
Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj [new file with mode: 0755]
Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj.filters [new file with mode: 0755]
Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj [new file with mode: 0755]
Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj.filters [new file with mode: 0755]
Clients/ExplorerPlugin/resource_dll.h
Clients/ExplorerPlugin/resource_loc_res.h
Clients/ExplorerPlugin/resource_res.h
Clients/FirefoxExtension/FirefoxExtension.vcxproj [new file with mode: 0755]
Clients/FirefoxExtension/FirefoxExtension.vcxproj.filters [new file with mode: 0755]
Clients/FirefoxExtension/IDNSSDService.h
Clients/Java/JavaSamples.vcxproj [new file with mode: 0755]
Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj [new file with mode: 0755]
Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj.filters [new file with mode: 0755]
Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj [new file with mode: 0755]
Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj.filters [new file with mode: 0755]
Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj [new file with mode: 0755]
Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj.filters [new file with mode: 0755]
Clients/PrinterSetupWizard/PrinterSetupWizardSheet.cpp
Clients/PrinterSetupWizard/SecondPage.cpp
Clients/PrinterSetupWizard/ThirdPage.cpp
Clients/PrinterSetupWizard/resource.h
Clients/PrinterSetupWizard/resource_exe.h
Clients/PrinterSetupWizard/resource_loc_res.h
Clients/PrinterSetupWizard/resource_res.h
Clients/PrinterSetupWizard/tcpxcv.h [new file with mode: 0755]
Clients/SimpleChat.NET/AssemblyInfo.cs
Clients/SimpleChat.NET/SimpleChat.NET.csproj
Clients/SimpleChat.NET/SimpleChat.cs
Clients/SimpleChat.VB/My Project/Application.Designer.vb
Clients/SimpleChat.VB/My Project/Resources.Designer.vb
Clients/SimpleChat.VB/My Project/Settings.Designer.vb
Clients/SimpleChat.VB/SimpleChat.VB.vbproj
Clients/SimpleChat.VB/SimpleChat.vb
Clients/dns-sd.c
Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj [new file with mode: 0755]
Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj.filters [new file with mode: 0755]
Clients/mDNSNetMonitor.VisualStudio/resource.h
Makefile
mDNSCore/DNSDigest.c
mDNSCore/mDNS.c
mDNSCore/mDNSEmbeddedAPI.h
mDNSCore/uDNS.c
mDNSCore/uDNS.h
mDNSMacOSX/BonjourEvents-Info.plist
mDNSMacOSX/BonjourEvents.c
mDNSMacOSX/PreferencePane/DNSServiceDiscoveryPref.m
mDNSMacOSX/daemon.c
mDNSMacOSX/mDNSMacOSX.c
mDNSMacOSX/mDNSResponder.sb
mDNSMacOSX/mDNSResponder.xcodeproj/project.pbxproj
mDNSPosix/Makefile
mDNSPosix/NetMonitor.c
mDNSPosix/mDNSPosix.c
mDNSResponder.sln
mDNSShared/Java/JNISupport.c
mDNSShared/dns_sd.h
mDNSShared/dnsextd.c
mDNSShared/dnsextd_lexer.l
mDNSShared/dnssd_clientstub.c
mDNSShared/dnssd_ipc.h
mDNSShared/uds_daemon.c
mDNSWindows/ControlPanel/BrowsingPage.cpp
mDNSWindows/ControlPanel/ControlPanel.vcxproj [new file with mode: 0755]
mDNSWindows/ControlPanel/ControlPanel.vcxproj.filters [new file with mode: 0755]
mDNSWindows/ControlPanel/ControlPanelExe.h
mDNSWindows/ControlPanel/ControlPanelLocRes.vcxproj [new file with mode: 0755]
mDNSWindows/ControlPanel/ControlPanelLocRes.vcxproj.filters [new file with mode: 0755]
mDNSWindows/ControlPanel/ControlPanelRes.vcxproj [new file with mode: 0755]
mDNSWindows/ControlPanel/ControlPanelRes.vcxproj.filters [new file with mode: 0755]
mDNSWindows/ControlPanel/FourthPage.cpp
mDNSWindows/ControlPanel/RegistrationPage.cpp
mDNSWindows/ControlPanel/SecondPage.cpp
mDNSWindows/ControlPanel/ServicesPage.cpp
mDNSWindows/DLL.NET/resource.h
mDNSWindows/DLL/dllmain.c
mDNSWindows/DLL/dnssd.vcxproj [new file with mode: 0755]
mDNSWindows/DLL/dnssd.vcxproj.filters [new file with mode: 0755]
mDNSWindows/DLLStub/DLLStub.cpp
mDNSWindows/DLLStub/DLLStub.vcxproj [new file with mode: 0755]
mDNSWindows/DLLStub/DLLStub.vcxproj.filters [new file with mode: 0755]
mDNSWindows/DLLX/DLLX.vcxproj [new file with mode: 0755]
mDNSWindows/DLLX/DLLX.vcxproj.filters [new file with mode: 0755]
mDNSWindows/DLLX/DNSSD.cpp
mDNSWindows/DLLX/StringServices.cpp
mDNSWindows/DLLX/TXTRecord.cpp
mDNSWindows/DLLX/_IDNSSDEvents_CP.h
mDNSWindows/DLLX/resource.h
mDNSWindows/Java/Java.vcxproj [new file with mode: 0755]
mDNSWindows/NSPTool/NSPTool.vcxproj [new file with mode: 0755]
mDNSWindows/NSPTool/NSPTool.vcxproj.filters [new file with mode: 0755]
mDNSWindows/Poll.c [new file with mode: 0755]
mDNSWindows/Poll.h [new file with mode: 0755]
mDNSWindows/PosixCompat.c
mDNSWindows/SystemService/Service.c
mDNSWindows/SystemService/Service.vcproj
mDNSWindows/SystemService/Service.vcxproj [new file with mode: 0755]
mDNSWindows/SystemService/Service.vcxproj.filters [new file with mode: 0755]
mDNSWindows/WinVersRes.h
mDNSWindows/mDNSWin32.c
mDNSWindows/mDNSWin32.h
mDNSWindows/mdnsNSP/mdnsNSP.vcxproj [new file with mode: 0755]
mDNSWindows/mdnsNSP/mdnsNSP.vcxproj.filters [new file with mode: 0755]

diff --git a/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj b/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj
new file mode 100755 (executable)
index 0000000..8ed154a
--- /dev/null
@@ -0,0 +1,272 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{AA230639-E115-4A44-AA5A-44A61235BA50}</ProjectGuid>\r
+    <Keyword>Win32Proj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WIN32;_DEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../../mDNSWindows/DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)dns-sd.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)dns-sd.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>DNS-SD.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WIN32;_DEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../../mDNSWindows/DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)dns-sd.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)dns-sd.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>DNS-SD64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WIN32;NDEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../../mDNSWindows/DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)dns-sd.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Console</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>DNS-SD.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\WINDOWS\system32\$(Platform)"            mkdir "$(DSTROOT)\WINDOWS\system32\$(Platform)"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"               mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS"           mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat"               mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB"             mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser\My Project" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser\My Project"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\SimpleChat"               mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\SimpleChat"\r
+xcopy /I/Y "$(TargetPath)"                                                                           "$(DSTROOT)\WINDOWS\system32\$(Platform)"\r
+xcopy /I/Y "$(ProjectDir)..\dns-sd.c"                                                            "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"\r
+xcopy /I/Y "$(ProjectDir)..\ClientCommon.c"                                             "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"\r
+xcopy /I/Y "$(ProjectDir)..\ClientCommon.h"                                             "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"\r
+xcopy /I/Y "$(ProjectDir)resource.h"                                                             "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"\r
+xcopy /I/Y "$(ProjectDir)DNS-SD.manifest"                                                 "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"\r
+xcopy /I/Y "$(ProjectDir)DNS-SD64.manifest"                                             "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"\r
+xcopy /I/Y "$(ProjectDir)dns-sd.sdk.rc"                                                        "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"\r
+move /Y "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.sdk.rc" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.rc"\r
+xcopy /I/Y "$(ProjectDir)dns-sd.sdk.vcproj"                                                "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"\r
+move /Y "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.sdk.vcproj" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.vcproj"\r
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\App.ico"                  "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser"\r
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\AssemblyInfo.cs"                  "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser"\r
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\DNSServiceBrowser.NET.csproj"                  "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser"\r
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\DNSServiceBrowser.cs"                  "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser"\r
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\DNSServiceBrowser.resx"                  "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser"\r
+xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\App.ico"                  "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat"\r
+xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\AssemblyInfo.cs"                  "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat"\r
+xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\SimpleChat.NET.csproj"                  "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat"\r
+xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\SimpleChat.cs"                  "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat"\r
+xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\SimpleChat.resx"                  "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat"\r
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.Designer.vb"  "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser"\r
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.VB.vbproj"   "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser"\r
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.resx"   "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser"\r
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.vb"   "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser"\r
+xcopy /E/Y "$(ProjectDir)..\DNSServiceBrowser.VB\My Project"                      "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser\My Project"\r
+xcopy /E/Y "$(ProjectDir)..\SimpleChat.VB"                                               "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\SimpleChat"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WIN32;NDEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../../mDNSWindows/DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)dns-sd.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Console</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>DNS-SD64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\WINDOWS\system32\$(Platform)"            mkdir "$(DSTROOT)\WINDOWS\system32\$(Platform)"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"               mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"\r
+xcopy /I/Y "$(TargetPath)"                                                                           "$(DSTROOT)\WINDOWS\system32\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\ClientCommon.c" />\r
+    <ClCompile Include="..\dns-sd.c" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\ClientCommon.h" />\r
+    <ClInclude Include="resource.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="dns-sd.rc" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj.filters b/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj.filters
new file mode 100755 (executable)
index 0000000..78299c0
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{663cbcf4-ce8e-49eb-9826-0676fba94350}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{f5fcca0d-918b-46ba-bb91-2f2f9d9ddbba}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{a7d985ec-3f36-4554-a707-5256b2e719b6}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\ClientCommon.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\dns-sd.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\ClientCommon.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="resource.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="dns-sd.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
index 7a925263aae198c2db6fa59bf87569b7c6fba566..f51112e7dca238f26f1e3d8075bfaa53b21d7b19 100755 (executable)
@@ -1,14 +1,14 @@
-//{{NO_DEPENDENCIES}}\r
-// Microsoft Visual C++ generated include file.\r
-// Used by dns-sd.rc\r
-\r
-// Next default values for new objects\r
-// \r
-#ifdef APSTUDIO_INVOKED\r
-#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE        101\r
-#define _APS_NEXT_COMMAND_VALUE         40001\r
-#define _APS_NEXT_CONTROL_VALUE         1001\r
-#define _APS_NEXT_SYMED_VALUE           101\r
-#endif\r
-#endif\r
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by dns-sd.rc
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1001
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
index 1b3661cc89cf2bd7949e97c752711502f97a2278..da6a08c9a620b376dafe70c3225ca69e75437e47 100755 (executable)
@@ -1,75 +1,75 @@
-/* -*- Mode: C; tab-width: 4 -*-\r
- *\r
- * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-\r
-//\r
-// General Information about an assembly is controlled through the following \r
-// set of attributes. Change these attribute values to modify the information\r
-// associated with an assembly.\r
-//\r
-[assembly: AssemblyTitle("")]\r
-[assembly: AssemblyDescription("")]\r
-[assembly: AssemblyConfiguration("")]\r
-[assembly: AssemblyCompany("")]\r
-[assembly: AssemblyProduct("")]\r
-[assembly: AssemblyCopyright("")]\r
-[assembly: AssemblyTrademark("")]\r
-[assembly: AssemblyCulture("")]                \r
-\r
-//\r
-// Version information for an assembly consists of the following four values:\r
-//\r
-//      Major Version\r
-//      Minor Version \r
-//      Build Number\r
-//      Revision\r
-//\r
-// You can specify all the values or you can default the Revision and Build Numbers \r
-// by using the '*' as shown below:\r
-\r
-[assembly: AssemblyVersion("1.0.*")]\r
-\r
-//\r
-// In order to sign your assembly you must specify a key to use. Refer to the \r
-// Microsoft .NET Framework documentation for more information on assembly signing.\r
-//\r
-// Use the attributes below to control which key is used for signing. \r
-//\r
-// Notes: \r
-//   (*) If no key is specified, the assembly is not signed.\r
-//   (*) KeyName refers to a key that has been installed in the Crypto Service\r
-//       Provider (CSP) on your machine. KeyFile refers to a file which contains\r
-//       a key.\r
-//   (*) If the KeyFile and the KeyName values are both specified, the \r
-//       following processing occurs:\r
-//       (1) If the KeyName can be found in the CSP, that key is used.\r
-//       (2) If the KeyName does not exist and the KeyFile does exist, the key \r
-//           in the KeyFile is installed into the CSP and used.\r
-//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.\r
-//       When specifying the KeyFile, the location of the KeyFile should be\r
-//       relative to the project output directory which is\r
-//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is\r
-//       located in the project directory, you would specify the AssemblyKeyFile \r
-//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]\r
-//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework\r
-//       documentation for more information on this.\r
-//\r
-[assembly: AssemblyDelaySign(false)]\r
-[assembly: AssemblyKeyFile("")]\r
-[assembly: AssemblyKeyName("")]\r
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]                
+
+//
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the 
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing. 
+//
+// Notes: 
+//   (*) If no key is specified, the assembly is not signed.
+//   (*) KeyName refers to a key that has been installed in the Crypto Service
+//       Provider (CSP) on your machine. KeyFile refers to a file which contains
+//       a key.
+//   (*) If the KeyFile and the KeyName values are both specified, the 
+//       following processing occurs:
+//       (1) If the KeyName can be found in the CSP, that key is used.
+//       (2) If the KeyName does not exist and the KeyFile does exist, the key 
+//           in the KeyFile is installed into the CSP and used.
+//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+//       When specifying the KeyFile, the location of the KeyFile should be
+//       relative to the project output directory which is
+//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+//       located in the project directory, you would specify the AssemblyKeyFile 
+//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+//       documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
index cbb7c30bddb091a325831768759887a1bb692ac2..c78e314aecd779105d5b0ff12428230b88566225 100755 (executable)
@@ -1,4 +1,5 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">\r
   <PropertyGroup>\r
     <ProjectType>Local</ProjectType>\r
     <ProductVersion>8.0.50727</ProductVersion>\r
@@ -25,6 +26,8 @@
     </FileUpgradeFlags>\r
     <UpgradeBackupLocation>\r
     </UpgradeBackupLocation>\r
+    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\r
+    <OldToolsVersion>2.0</OldToolsVersion>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <OutputPath>bin\Debug\</OutputPath>\r
index 18aa3e71280c0d6623722d77d7dd5928dcccad9a..df88084441adfdbe5588946a502a66ebf61f1516 100755 (executable)
@@ -63,6 +63,14 @@ namespace DNSServiceBrowser_NET
 
                        this.Load += new System.EventHandler(this.Form1_Load);
 
+                       //
+                       // Create the DNSSDEventManager. You can then associate event handlers
+                       // with the instance that will be invoked when the event occurs
+                       //
+                       // In this example, we're associating ServiceFound, ServiceLost,
+                       // ServiceResolved, and OperationFailed event handlers with the
+                       // event manager instance.
+                       //
             eventManager                    =  new DNSSDEventManager();
             eventManager.ServiceFound       += new _IDNSSDEvents_ServiceFoundEventHandler(this.ServiceFound);
             eventManager.ServiceLost        += new _IDNSSDEvents_ServiceLostEventHandler(this.ServiceLost);
@@ -90,6 +98,9 @@ namespace DNSServiceBrowser_NET
                     components.Dispose();
                 }
 
+                               // 
+                               // Clean up
+                               //
                 if (resolver != null)
                 {
                     resolver.Stop();
@@ -449,6 +460,7 @@ namespace DNSServiceBrowser_NET
                        public String   Name;
                        public String   Type;
                        public String   Domain;
+            public int      Refs;
 
                        public override String
                        ToString()
@@ -463,16 +475,7 @@ namespace DNSServiceBrowser_NET
 
                                if (other != null)
                                {
-                                       if ((object) this == other)
-                                       {
-                                               result = true;
-                                       }
-                                       else if (other is BrowseData)
-                                       {
-                                               BrowseData otherBrowseData = (BrowseData) other;
-
-                                               result = (this.Name == otherBrowseData.Name);
-                                       }
+                                       result = (this.Name == other.ToString());
                                }
 
                                return result;
@@ -524,6 +527,10 @@ namespace DNSServiceBrowser_NET
 
                        serviceTextField.Items.Clear();
             
+                       //
+                       // When we print the text record, we're going to assume that every value
+                       // is a string.
+                       //
             if (resolveData.TxtRecord != null)
             {
                 for (uint idx = 0; idx < resolveData.TxtRecord.GetCount(); idx++)
@@ -556,6 +563,9 @@ namespace DNSServiceBrowser_NET
                {
                        browseList.Items.Clear();
 
+                       //
+                       // Stop the current browse operation
+                       //
                        if (browser != null)
                        {
                                browser.Stop();
@@ -570,6 +580,9 @@ namespace DNSServiceBrowser_NET
 
                        try
                        {
+                               //
+                               // Selecting a service type will start a new browse operation.
+                               //
                                browser = service.Browse( 0, 0, typeBox.SelectedItem.ToString(), null, eventManager );
                        }
                        catch
@@ -593,6 +606,10 @@ namespace DNSServiceBrowser_NET
                 {
                     BrowseData data = (BrowseData) browseList.SelectedItem;
 
+                                       //
+                                       // Clicking on a service instance results in starting a resolve operation
+                                       // that will call us back with information about the service
+                                       //
                     resolver = service.Resolve(0, data.InterfaceIndex, data.Name, data.Type, data.Domain, eventManager);
                 }
                 catch
@@ -610,47 +627,72 @@ namespace DNSServiceBrowser_NET
         // a BrowseData object and invoked the appropriate method
         // in the GUI thread so we can update the UI
                //
-               public void ServiceFound
-                                               (
-                                               DNSSDService    sref,
-                                               DNSSDFlags      flags,
-                                               uint                    ifIndex,
-                        String          serviceName,
-                        String          regType,
-                        String          domain
-                                               )
-               {
-                       BrowseData data = new BrowseData();
+        public void ServiceFound
+                        (
+                        DNSSDService sref,
+                        DNSSDFlags flags,
+                        uint ifIndex,
+                        String serviceName,
+                        String regType,
+                        String domain
+                        )
+        {
+            int index = browseList.Items.IndexOf(serviceName);
 
-                       data.InterfaceIndex = ifIndex;
-                       data.Name           = serviceName;
-                       data.Type           = regType;
-                       data.Domain         = domain;
+                       //
+                       // Check to see if we've seen this service before. If the machine has multiple
+                       // interfaces, we could potentially get called back multiple times for the
+                       // same service. Implementing a simple reference counting scheme will address
+                       // the problem of the same service showing up more than once in the browse list.
+                       //
+            if (index == -1)
+            {
+                BrowseData data = new BrowseData();
 
-            browseList.Items.Add(data);
-            browseList.Invalidate();
-               }
+                data.InterfaceIndex = ifIndex;
+                data.Name = serviceName;
+                data.Type = regType;
+                data.Domain = domain;
+                data.Refs = 1;
+
+                browseList.Items.Add(data);
+                browseList.Invalidate();
+            }
+            else
+            {
+                BrowseData data = (BrowseData) browseList.Items[index];
+                data.Refs++;
+            }
+        }
 
         public void ServiceLost
                         (
-                        DNSSDService    sref,
-                        DNSSDFlags      flags,
-                        uint            ifIndex,
-                        String          serviceName,
-                        String          regType,
-                        String          domain
+                        DNSSDService sref,
+                        DNSSDFlags flags,
+                        uint ifIndex,
+                        String serviceName,
+                        String regType,
+                        String domain
                         )
         {
-            BrowseData data = new BrowseData();
+            int index = browseList.Items.IndexOf(serviceName);
 
-                       data.InterfaceIndex = ifIndex;
-                       data.Name           = serviceName;
-                       data.Type           = regType;
-                       data.Domain         = domain;
+                       //
+                       // See above comment in ServiceFound about reference counting
+                       //
+            if (index != -1)
+            {
+                BrowseData data = (BrowseData) browseList.Items[index];
 
-            browseList.Items.Remove(data);
-                       browseList.Invalidate();
-        }             
+                data.Refs--;
+
+                if (data.Refs == 0)
+                {
+                    browseList.Items.Remove(data);
+                    browseList.Invalidate();
+                }
+            }
+        }
 
                public void ServiceResolved
                                                (
@@ -671,6 +713,9 @@ namespace DNSServiceBrowser_NET
                        data.Port                       = port;
                        data.TxtRecord          = txtRecord;
 
+                       //
+                       // Don't forget to stop the resolver. This eases the burden on the network
+                       //
             resolver.Stop();
                        resolver = null;
 
index d4e59eb352856bdf123e0e636c2698f2df564d19..52beedd43d0e3ee4a1029ca3711cde7463a822ac 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
     <RootNamespace>DNSServiceBrowser.VB</RootNamespace>\r
     <AssemblyName>DNSServiceBrowser.VB</AssemblyName>\r
     <MyType>WindowsForms</MyType>\r
+    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\r
+    <FileUpgradeFlags>\r
+    </FileUpgradeFlags>\r
+    <OldToolsVersion>2.0</OldToolsVersion>\r
+    <UpgradeBackupLocation />\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
@@ -19,7 +24,7 @@
     <DefineTrace>true</DefineTrace>\r
     <OutputPath>bin\Debug\</OutputPath>\r
     <DocumentationFile>DNSServiceBrowser.VB.xml</DocumentationFile>\r
-    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>\r
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
     <DebugType>pdbonly</DebugType>\r
@@ -28,7 +33,7 @@
     <Optimize>true</Optimize>\r
     <OutputPath>bin\Release\</OutputPath>\r
     <DocumentationFile>DNSServiceBrowser.VB.xml</DocumentationFile>\r
-    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>\r
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn>\r
   </PropertyGroup>\r
   <ItemGroup>\r
     <Reference Include="System" />\r
index dbbced9d436d8ceaaa38a7580535f58b8151006b..bb67adab654a2d15118b624f445ead7018f58d54 100644 (file)
@@ -29,17 +29,53 @@ Public Class DNSServiceBrowser
 \r
         ComboBox1.SelectedIndex = 0\r
     End Sub\r
+\r
+       'Called when a service is found as a result of a browse operation\r
     Public Sub MyEventManager_ServiceFound(ByVal browser As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal serviceName As String, ByVal regtype As String, ByVal domain As String) Handles MyEventManager.ServiceFound\r
-        Dim browseData As New BrowseData\r
-        browseData.ServiceName = serviceName\r
-        browseData.RegType = regtype\r
-        browseData.Domain = domain\r
-        ServiceNames.Items.Add(browseData)\r
+        Dim index As Integer\r
+        index = ServiceNames.Items.IndexOf(serviceName)\r
+               '\r
+               ' A simple reference counting scheme is implemented so that the same service\r
+               ' does not show up more than once in the browse list.  This can happen\r
+               ' if the machine has more than one network interface.\r
+               '\r
+               ' If we have not seen this service before, then it is added to the browse list\r
+               ' Otherwise it's reference count is bumped up.\r
+               '\r
+        If index = -1 Then\r
+            Dim browseData As New BrowseData\r
+            browseData.ServiceName = serviceName\r
+            browseData.RegType = regtype\r
+            browseData.Domain = domain\r
+            browseData.Refs = 1\r
+            ServiceNames.Items.Add(browseData)\r
+        Else\r
+            Dim browseData As BrowseData\r
+            browseData = ServiceNames.Items([index])\r
+            browseData.Refs += 1\r
+        End If\r
     End Sub\r
+\r
     Public Sub MyEventManager_ServiceLost(ByVal browser As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal serviceName As String, ByVal regtype As String, ByVal domain As String) Handles MyEventManager.ServiceLost\r
-        ServiceNames.Items.Remove(serviceName)\r
+        Dim index As Integer\r
+               '\r
+               ' See the above about reference counting\r
+               '\r
+        index = ServiceNames.Items.IndexOf(serviceName)\r
+        If index <> -1 Then\r
+            Dim browseData As BrowseData\r
+            browseData = ServiceNames.Items([index])\r
+            browseData.Refs -= 1\r
+            If browseData.Refs = 0 Then\r
+                ServiceNames.Items.Remove(serviceName)\r
+            End If\r
+        End If\r
     End Sub\r
+\r
     Public Sub MyEventManager_ServiceResolved(ByVal resolver As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal fullname As String, ByVal hostname As String, ByVal port As UShort, ByVal record As Bonjour.TXTRecord) Handles MyEventManager.ServiceResolved\r
+               '\r
+               ' Once the service is resolved, the resolve operation is stopped. This reduces the burdne on the network\r
+               '\r
         m_resolver.Stop()\r
         m_resolver = Nothing\r
         Dim browseData As BrowseData = ServiceNames.Items.Item(ServiceNames.SelectedIndex)\r
@@ -49,6 +85,9 @@ Public Class DNSServiceBrowser
         HostField.Text = hostname\r
         PortField.Text = port\r
 \r
+               '\r
+               ' The values found in the text record are assumed to be human readable strings.\r
+               '\r
         If record IsNot Nothing Then\r
             For i As UInteger = 0 To record.GetCount() - 1\r
                 Dim key As String = record.GetKeyAtIndex(i)\r
@@ -58,6 +97,7 @@ Public Class DNSServiceBrowser
             Next i\r
         End If\r
     End Sub\r
+\r
     Private Sub ClearServiceInfo()\r
         TextRecord.Items.Clear()\r
         NameField.Text = ""\r
@@ -66,14 +106,20 @@ Public Class DNSServiceBrowser
         HostField.Text = ""\r
         PortField.Text = ""\r
     End Sub\r
+\r
     Private Sub ServiceNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ServiceNames.SelectedIndexChanged\r
         If m_resolver IsNot Nothing Then\r
             m_resolver.Stop()\r
         End If\r
         Me.ClearServiceInfo()\r
         Dim browseData As BrowseData = ServiceNames.Items.Item(ServiceNames.SelectedIndex)\r
+\r
+               '\r
+               ' Selecting a service instance starts a new resolve operation\r
+               '\r
         m_resolver = m_service.Resolve(0, 0, browseData.ServiceName, browseData.RegType, browseData.Domain, MyEventManager)\r
     End Sub\r
+\r
     Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged\r
         If m_browser IsNot Nothing Then\r
             m_browser.Stop()\r
@@ -81,6 +127,11 @@ Public Class DNSServiceBrowser
 \r
         ServiceNames.Items.Clear()\r
         Me.ClearServiceInfo()\r
+\r
+               '\r
+               ' Selecting a service type start a new browse operation\r
+               '\r
+\r
         m_browser = m_service.Browse(0, 0, ComboBox1.Items.Item(ComboBox1.SelectedIndex), "", MyEventManager)\r
     End Sub\r
 \r
@@ -92,6 +143,7 @@ Public Class BrowseData
     Private m_serviceName As String\r
     Private m_regType As String\r
     Private m_domain As String\r
+    Private m_refs As Integer\r
 \r
     Property ServiceName() As String\r
         Get\r
@@ -120,6 +172,23 @@ Public Class BrowseData
         End Set\r
     End Property\r
 \r
+    Property Refs As Integer\r
+        Get\r
+            Return m_refs\r
+        End Get\r
+        Set(ByVal Value As Integer)\r
+            m_refs = Value\r
+        End Set\r
+    End Property\r
+\r
+    Public Overrides Function Equals(obj As Object) As Boolean\r
+        If obj Is Nothing Then\r
+            Return False\r
+        Else\r
+            Return m_serviceName.Equals(obj.ToString)\r
+        End If\r
+    End Function\r
+\r
     Public Overrides Function ToString() As String\r
         Return m_serviceName\r
     End Function\r
diff --git a/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj b/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj
new file mode 100755 (executable)
index 0000000..810c90e
--- /dev/null
@@ -0,0 +1,402 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|Win32">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|x64">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{BB8AC1B5-6587-4163-BDC6-788B157705CA}</ProjectGuid>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <CustomBuildStep>\r
+      <Message>\r
+      </Message>\r
+      <Command>\r
+      </Command>\r
+      <Outputs>%(Outputs)</Outputs>\r
+    </CustomBuildStep>\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_USRDLL;WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ObjectFileName>$(IntDir)</ObjectFileName>\r
+      <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 /NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;uafxcwd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ExplorerPlugin.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>uafxcwd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>./$(ProjectName).def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\ExplorerPlugin.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <CustomBuildStep>\r
+      <Message>\r
+      </Message>\r
+      <Command>\r
+      </Command>\r
+      <Outputs>%(Outputs)</Outputs>\r
+    </CustomBuildStep>\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_USRDLL;WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ObjectFileName>$(IntDir)</ObjectFileName>\r
+      <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/IGNORE:4089 /NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;uafxcwd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ExplorerPlugin.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>uafxcwd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>./$(ProjectName).def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\ExplorerPlugin64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <CustomBuildStep>\r
+      <Message>\r
+      </Message>\r
+    </CustomBuildStep>\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_USRDLL;WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <FunctionLevelLinking>false</FunctionLevelLinking>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ObjectFileName>$(IntDir)</ObjectFileName>\r
+      <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 /NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;uafxcw.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>uafxcw.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>./$(ProjectName).def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\ExplorerPlugin.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"   mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                                  "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <CustomBuildStep>\r
+      <Message>\r
+      </Message>\r
+    </CustomBuildStep>\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>_USRDLL;WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <FunctionLevelLinking>false</FunctionLevelLinking>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ObjectFileName>$(IntDir)</ObjectFileName>\r
+      <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/IGNORE:4089 /NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;uafxcw.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>uafxcw.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>./$(ProjectName).def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\ExplorerPlugin64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"   mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                                  "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h" />\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h" />\r
+    <ClInclude Include="..\..\mDNSWindows\isocode.h" />\r
+    <ClInclude Include="..\..\mDNSWindows\loclibrary.h" />\r
+    <ClInclude Include="..\..\mDNSWindows\WinServices.h" />\r
+    <ClInclude Include="About.h" />\r
+    <ClInclude Include="ClassFactory.h" />\r
+    <ClInclude Include="ExplorerBar.h" />\r
+    <ClInclude Include="ExplorerBarWindow.h" />\r
+    <ClInclude Include="ExplorerPlugin.h" />\r
+    <ClInclude Include="LoginDialog.h" />\r
+    <ClInclude Include="Resource.h" />\r
+    <ClInclude Include="resource_dll.h" />\r
+    <ClInclude Include="StdAfx.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c" />\r
+    <ClCompile Include="..\..\mDNSWindows\loclibrary.c" />\r
+    <ClCompile Include="..\..\mDNSWindows\WinServices.cpp" />\r
+    <ClCompile Include="About.cpp" />\r
+    <ClCompile Include="ClassFactory.cpp" />\r
+    <ClCompile Include="ExplorerBar.cpp" />\r
+    <ClCompile Include="ExplorerBarWindow.cpp" />\r
+    <ClCompile Include="ExplorerPlugin.cpp" />\r
+    <ClCompile Include="LoginDialog.cpp" />\r
+    <ClCompile Include="StdAfx.cpp" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="ExplorerPlugin.def" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="ExplorerPlugin.rc" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\..\mDNSWindows\DLLStub\DLLStub.vcxproj">\r
+      <Project>{3a2b6325-3053-4236-84bd-aa9be2e323e5}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+  <ProjectExtensions>\r
+    <VisualStudio>\r
+      <UserProperties RESOURCE_FILE="ExplorerPlugin.rc" />\r
+    </VisualStudio>\r
+  </ProjectExtensions>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj.filters b/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj.filters
new file mode 100755 (executable)
index 0000000..f86a9f5
--- /dev/null
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Support">\r
+      <UniqueIdentifier>{b3978812-899a-4e8b-9f75-9458141da3b4}</UniqueIdentifier>\r
+    </Filter>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{62896a08-c5fd-4a48-8f8b-33f3fc2f8b1f}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{8aded36a-5c99-4074-8892-31cb394d0eed}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{31823db1-cc70-4c1b-990d-ad0e8f840b66}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSWindows\isocode.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSWindows\loclibrary.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSWindows\WinServices.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="About.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="ClassFactory.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="ExplorerBar.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="ExplorerBarWindow.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="ExplorerPlugin.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="LoginDialog.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="Resource.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="resource_dll.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="StdAfx.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c">\r
+      <Filter>Support</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSWindows\loclibrary.c">\r
+      <Filter>Support</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSWindows\WinServices.cpp">\r
+      <Filter>Support</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="About.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="ClassFactory.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="ExplorerBar.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="ExplorerBarWindow.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="ExplorerPlugin.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="LoginDialog.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="StdAfx.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="ExplorerPlugin.def">\r
+      <Filter>Source Files</Filter>\r
+    </None>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="ExplorerPlugin.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj b/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj
new file mode 100755 (executable)
index 0000000..fb96fd3
--- /dev/null
@@ -0,0 +1,397 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|Win32">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|x64">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{1643427B-F226-4AD6-B413-97DA64D5C6B4}</ProjectGuid>\r
+    <RootNamespace>ExplorerPluginLocRes</RootNamespace>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ExplorerPluginLocalized</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ExplorerPluginLocalized</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">ExplorerPluginLocalized</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ExplorerPluginLocalized</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ExplorerPluginLocalized</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|x64'">ExplorerPluginLocalized</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|x64'">.dll</TargetExt>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Debug/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)ExplorerPlugin.Resources mkdir $(OutDir)ExplorerPlugin.Resources\r
+if not exist $(OutDir)ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)ExplorerPlugin.Resources\en.lproj\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ExplorerPluginLocalized.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Debug/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)ExplorerPlugin.Resources mkdir $(OutDir)ExplorerPlugin.Resources\r
+if not exist $(OutDir)ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)ExplorerPlugin.Resources\en.lproj\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ExplorerPluginLocalized.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+      <FunctionLevelLinking>false</FunctionLevelLinking>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Release/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)ExplorerPlugin.Resources mkdir $(OutDir)ExplorerPlugin.Resources\r
+if not exist $(OutDir)ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)ExplorerPlugin.Resources\en.lproj\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ExplorerPluginLocalized.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <ProgramDatabaseFile>\r
+      </ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj"   mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj"\r
+xcopy /I/Y "$(TargetPath)"                                                                                                                          "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+      <FunctionLevelLinking>false</FunctionLevelLinking>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Release/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)ExplorerPlugin.Resources mkdir $(OutDir)ExplorerPlugin.Resources\r
+if not exist $(OutDir)ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)ExplorerPlugin.Resources\en.lproj\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ExplorerPluginLocalized.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <ProgramDatabaseFile>\r
+      </ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj"   mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj"\r
+xcopy /I/Y "$(TargetPath)"                                                                                                                          "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">\r
+    <Link>\r
+      <OutputFile>$(OutDir)ExplorerPluginLocalized.dll</OutputFile>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'">\r
+    <Link>\r
+      <OutputFile>$(OutDir)ExplorerPluginLocalized.dll</OutputFile>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="resource_loc_res.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="ExplorerPluginLocRes.rc" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\..\mDNSWindows\DLL\dnssd.vcxproj">\r
+      <Project>{ab581101-18f0-46f6-b56a-83a6b1ea657e}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+  <ProjectExtensions>\r
+    <VisualStudio>\r
+      <UserProperties RESOURCE_FILE="ExplorerPluginLocRes.rc" />\r
+    </VisualStudio>\r
+  </ProjectExtensions>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj.filters b/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj.filters
new file mode 100755 (executable)
index 0000000..c2dd2ad
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{fdb2f45e-acf9-4bf2-87a1-fb0df2aca928}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{ee265e77-1d8e-4a0c-8c10-27b123ab1232}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="resource_loc_res.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="ExplorerPluginLocRes.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj b/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj
new file mode 100755 (executable)
index 0000000..4fb6490
--- /dev/null
@@ -0,0 +1,399 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|Win32">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|x64">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{871B1492-B4A4-4B57-9237-FA798484D7D7}</ProjectGuid>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ExplorerPluginResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ExplorerPluginResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.dll</TargetExt>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">ExplorerPluginResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ExplorerPluginResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ExplorerPluginResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.dll</TargetExt>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|x64'">ExplorerPluginResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|x64'">.dll</TargetExt>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Debug/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist Debug\ExplorerPlugin.Resources mkdir Debug\ExplorerPlugin.Resources</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <OutputFile>$(OutDir)ExplorerPluginResources.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Debug/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist Debug\ExplorerPlugin.Resources mkdir Debug\ExplorerPlugin.Resources</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <OutputFile>$(OutDir)ExplorerPluginResources.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+      <FunctionLevelLinking>false</FunctionLevelLinking>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Release/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist Release mkdir Release\r
+if not exist "Release\ExplorerPlugin.Resources" mkdir "Release\ExplorerPlugin.Resources"\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <OutputFile>$(OutDir)ExplorerPluginResources.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <ProgramDatabaseFile>\r
+      </ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources"   mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources"\r
+xcopy /I/Y "$(TargetPath)"                                                                                                            "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+      <FunctionLevelLinking>false</FunctionLevelLinking>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Release/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist Release mkdir Release\r
+if not exist "Release\ExplorerPlugin.Resources" mkdir "Release\ExplorerPlugin.Resources"\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <OutputFile>$(OutDir)ExplorerPluginResources.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <ProgramDatabaseFile>\r
+      </ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources"   mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources"\r
+xcopy /I/Y "$(TargetPath)"                                                                                                            "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">\r
+    <Link>\r
+      <OutputFile>$(OutDir)ExplorerPluginResources.dll</OutputFile>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'">\r
+    <Link>\r
+      <OutputFile>$(OutDir)ExplorerPluginResources.dll</OutputFile>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="resource_res.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="about.bmp" />\r
+    <None Include="res\about.bmp" />\r
+    <None Include="res\button-2k.ico" />\r
+    <None Include="res\button-xp.ico" />\r
+    <None Include="res\cold.ico" />\r
+    <None Include="hot.ico" />\r
+    <None Include="logo.bmp" />\r
+    <None Include="res\logo.bmp" />\r
+    <None Include="Web.ico" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="ExplorerPluginRes.rc" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\..\mDNSWindows\DLL\dnssd.vcxproj">\r
+      <Project>{ab581101-18f0-46f6-b56a-83a6b1ea657e}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+  <ProjectExtensions>\r
+    <VisualStudio>\r
+      <UserProperties RESOURCE_FILE="ExplorerPluginRes.rc" />\r
+    </VisualStudio>\r
+  </ProjectExtensions>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj.filters b/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj.filters
new file mode 100755 (executable)
index 0000000..72a0998
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{89aee21a-a42b-4f10-87db-f6d3b27eb612}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{27ad7c9e-deb4-4963-8cf0-adf004ed2437}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="resource_res.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="about.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\about.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\button-2k.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\button-xp.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\cold.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="hot.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="logo.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\logo.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="Web.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="ExplorerPluginRes.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
index 0fd2c902403ce9fb589dd28c5907223de5683b15..952254f949a61223837d45c0224284d450dc4685 100755 (executable)
@@ -1,26 +1,26 @@
-//{{NO_DEPENDENCIES}}\r
-// Microsoft Visual C++ generated include file.\r
-// Used by ExplorerPlugin.rc\r
-//\r
-#define IDS_NAME                        106\r
-#define IDS_WEB_SITES                   107\r
-#define IDS_PRINTERS                    109\r
-#define IDS_MDNSRESPONDER_NOT_AVAILABLE 110\r
-#define IDS_FIREWALL                    111\r
-#define IDC_COMPONENT                   1001\r
-#define IDC_LEGAL                       1002\r
-#define IDC_COMPONENT_VERSION           1003\r
-#define IDC_LOGIN_USERNAME_TEXT         1182\r
-#define IDC_LOGIN_PASSWORD_TEXT         1183\r
-#define ID_Menu                         40001\r
-\r
-// Next default values for new objects\r
-// \r
-#ifdef APSTUDIO_INVOKED\r
-#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE        119\r
-#define _APS_NEXT_COMMAND_VALUE         40001\r
-#define _APS_NEXT_CONTROL_VALUE         1001\r
-#define _APS_NEXT_SYMED_VALUE           101\r
-#endif\r
-#endif\r
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by ExplorerPlugin.rc
+//
+#define IDS_NAME                        106
+#define IDS_WEB_SITES                   107
+#define IDS_PRINTERS                    109
+#define IDS_MDNSRESPONDER_NOT_AVAILABLE 110
+#define IDS_FIREWALL                    111
+#define IDC_COMPONENT                   1001
+#define IDC_LEGAL                       1002
+#define IDC_COMPONENT_VERSION           1003
+#define IDC_LOGIN_USERNAME_TEXT         1182
+#define IDC_LOGIN_PASSWORD_TEXT         1183
+#define ID_Menu                         40001
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        119
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1001
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
index f2e86cdd410370934635a72b2f6a2e6871297291..a94b51c18400d1ea4eaec27c237fb76cd387a82a 100755 (executable)
@@ -1,32 +1,32 @@
-//{{NO_DEPENDENCIES}}\r
-// Microsoft Visual C++ generated include file.\r
-// Used by ExplorerPluginLocRes.rc\r
-//\r
-#define IDS_NAME                        106\r
-#define IDS_WEB_SITES                   107\r
-#define IDS_PRINTERS                    109\r
-#define IDS_MDNSRESPONDER_NOT_AVAILABLE 110\r
-#define IDS_FIREWALL                    111\r
-#define IDD_ABOUT                       118\r
-#define IDR_CONTEXT_MENU                120\r
-#define IDD_LOGIN                       145\r
-#define IDC_ABOUT_BACKGROUND                           146\r
-#define IDS_ABOUT                       147\r
-#define IDS_ABOUT_URL                   148\r
-#define IDC_COMPONENT                   1001\r
-#define IDC_LEGAL                       1002\r
-#define IDC_COMPONENT_VERSION           1003\r
-#define IDC_LOGIN_USERNAME_TEXT         1182\r
-#define IDC_LOGIN_PASSWORD_TEXT         1183\r
-#define ID_Menu                         40001\r
-\r
-// Next default values for new objects\r
-// \r
-#ifdef APSTUDIO_INVOKED\r
-#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE        119\r
-#define _APS_NEXT_COMMAND_VALUE         40001\r
-#define _APS_NEXT_CONTROL_VALUE         1001\r
-#define _APS_NEXT_SYMED_VALUE           101\r
-#endif\r
-#endif\r
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by ExplorerPluginLocRes.rc
+//
+#define IDS_NAME                        106
+#define IDS_WEB_SITES                   107
+#define IDS_PRINTERS                    109
+#define IDS_MDNSRESPONDER_NOT_AVAILABLE 110
+#define IDS_FIREWALL                    111
+#define IDD_ABOUT                       118
+#define IDR_CONTEXT_MENU                120
+#define IDD_LOGIN                       145
+#define IDC_ABOUT_BACKGROUND                           146
+#define IDS_ABOUT                       147
+#define IDS_ABOUT_URL                   148
+#define IDC_COMPONENT                   1001
+#define IDC_LEGAL                       1002
+#define IDC_COMPONENT_VERSION           1003
+#define IDC_LOGIN_USERNAME_TEXT         1182
+#define IDC_LOGIN_PASSWORD_TEXT         1183
+#define ID_Menu                         40001
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        119
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1001
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
index 44062be7e0c3589e055cb78ac1d2becec3781b97..0fcb36f57d7dbe23479674dafdd6cee8dee4c9ce 100755 (executable)
@@ -1,30 +1,30 @@
-//{{NO_DEPENDENCIES}}\r
-// Microsoft Visual C++ generated include file.\r
-// Used by ExplorerPluginRes.rc\r
-//\r
-#define IDS_NAME                        106\r
-#define IDS_WEB_SITES                   107\r
-#define IDS_PRINTERS                    109\r
-#define IDS_MDNSRESPONDER_NOT_AVAILABLE 110\r
-#define IDS_FIREWALL                    111\r
-#define IDB_LOGO                        115\r
-#define IDI_BUTTON_2K                   115\r
-#define IDI_BUTTON_XP                   118\r
-#define IDB_ABOUT                       119\r
-#define IDC_COMPONENT                   1001\r
-#define IDC_LEGAL                       1002\r
-#define IDC_COMPONENT_VERSION           1003\r
-#define IDC_LOGIN_USERNAME_TEXT         1182\r
-#define IDC_LOGIN_PASSWORD_TEXT         1183\r
-#define ID_Menu                         40001\r
-\r
-// Next default values for new objects\r
-// \r
-#ifdef APSTUDIO_INVOKED\r
-#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE        119\r
-#define _APS_NEXT_COMMAND_VALUE         40001\r
-#define _APS_NEXT_CONTROL_VALUE         1001\r
-#define _APS_NEXT_SYMED_VALUE           101\r
-#endif\r
-#endif\r
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by ExplorerPluginRes.rc
+//
+#define IDS_NAME                        106
+#define IDS_WEB_SITES                   107
+#define IDS_PRINTERS                    109
+#define IDS_MDNSRESPONDER_NOT_AVAILABLE 110
+#define IDS_FIREWALL                    111
+#define IDB_LOGO                        115
+#define IDI_BUTTON_2K                   115
+#define IDI_BUTTON_XP                   118
+#define IDB_ABOUT                       119
+#define IDC_COMPONENT                   1001
+#define IDC_LEGAL                       1002
+#define IDC_COMPONENT_VERSION           1003
+#define IDC_LOGIN_USERNAME_TEXT         1182
+#define IDC_LOGIN_PASSWORD_TEXT         1183
+#define ID_Menu                         40001
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        119
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1001
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/Clients/FirefoxExtension/FirefoxExtension.vcxproj b/Clients/FirefoxExtension/FirefoxExtension.vcxproj
new file mode 100755 (executable)
index 0000000..1d02a4e
--- /dev/null
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{7826EA27-D4CC-4FAA-AD23-DF813823227B}</ProjectGuid>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">DNSSDService</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">DNSSDService</TargetName>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <TypeLibraryName>.\$(OutDir)DNSSDService.tlb</TypeLibraryName>\r
+      <HeaderFileName>\r
+      </HeaderFileName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;$(SRCROOT)\AppleInternal\XULRunner\include\xpcom;$(SRCROOT)\AppleInternal\XULRunner\include\nspr;$(SRCROOT)\AppleInternal\XULRunner\include\string;$(SRCROOT)\AppleInternal\XULRunner\include\pref;$(SRCROOT)\AppleInternal\XULRunner\sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;_USRDLL;DNSSDSERVICE_EXPORTS;XP_WIN;XP_WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ObjectFileName>$(IntDir)</ObjectFileName>\r
+      <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>$(SRCROOT)\AppleInternal\XULRunner\lib\nspr4.lib;$(SRCROOT)\AppleInternal\XULRunner\lib\xpcom.lib;$(SRCROOT)\AppleInternal\XULRunner\lib\xpcomglue_s.lib;ws2_32.lib;../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)DNSSDService.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <ProgramDatabaseFile>.\$(OutDir)DNSSDService.pdb</ProgramDatabaseFile>\r
+      <ImportLibrary>.\$(OutDir)DNSSDService.lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+    <Bscmake>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <OutputFile>.\$(OutDir)DNSSDService.bsc</OutputFile>\r
+    </Bscmake>\r
+    <PostBuildEvent>\r
+      <Command>xcopy /I/Y $(Platform)\$(Configuration)\DNSSDService.dll extension\platform\WINNT\components\r
+if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\FirefoxExtension"                      mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\FirefoxExtension"\r
+xcopy /E/I/Y "extension"                                 "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\FirefoxExtension"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <TypeLibraryName>.\$(OutDir)DNSSDService.tlb</TypeLibraryName>\r
+      <HeaderFileName>\r
+      </HeaderFileName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;$(SRCROOT)\AppleInternal\XULRunner\include\xpcom;$(SRCROOT)\AppleInternal\XULRunner\include\nspr;$(SRCROOT)\AppleInternal\XULRunner\include\string;$(SRCROOT)\AppleInternal\XULRunner\include\pref;$(SRCROOT)\AppleInternal\XULRunner\sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;DNSSDSERVICE_EXPORTS;XP_WIN;XP_WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ObjectFileName>$(IntDir)</ObjectFileName>\r
+      <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>$(SRCROOT)\AppleInternal\XULRunner\lib\nspr4.lib;$(SRCROOT)\AppleInternal\XULRunner\lib\xpcom.lib;$(SRCROOT)\AppleInternal\XULRunner\lib\xpcomglue_s.lib;ws2_32.lib;../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)DNSSDService.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>.\$(OutDir)DNSSDService.pdb</ProgramDatabaseFile>\r
+      <ImportLibrary>.\$(OutDir)DNSSDService.lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+    <Bscmake>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <OutputFile>.\$(OutDir)DNSSDService.bsc</OutputFile>\r
+    </Bscmake>\r
+    <PostBuildEvent>\r
+      <Command>xcopy /I/Y $(Platform)\$(Configuration)\DNSSDService.dll extension\platform\WINNT\components</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="CDNSSDService.cpp" />\r
+    <ClCompile Include="CDNSSDServiceModule.cpp" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="CDNSSDService.h" />\r
+    <ClInclude Include="IDNSSDService.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <CustomBuildStep Include="IDNSSDService.idl" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="FirefoxExtension.rc" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\..\mDNSWindows\DLLStub\DLLStub.vcxproj">\r
+      <Project>{3a2b6325-3053-4236-84bd-aa9be2e323e5}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/FirefoxExtension/FirefoxExtension.vcxproj.filters b/Clients/FirefoxExtension/FirefoxExtension.vcxproj.filters
new file mode 100755 (executable)
index 0000000..02c1c55
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{89e57cc2-d6b1-4e68-ad57-71223df12d28}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{4d103fe8-9737-47c7-9190-6f7b5666ecf5}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl</Extensions>\r
+    </Filter>\r
+    <Filter Include="IDL">\r
+      <UniqueIdentifier>{4dae44a8-3da8-43c0-a749-2d1e0610c66f}</UniqueIdentifier>\r
+      <Extensions>idl</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{ac7dbdd1-2fe3-416d-9cab-2d663c05f252}</UniqueIdentifier>\r
+      <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="CDNSSDService.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="CDNSSDServiceModule.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="CDNSSDService.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="IDNSSDService.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="FirefoxExtension.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <CustomBuildStep Include="IDNSSDService.idl">\r
+      <Filter>IDL</Filter>\r
+    </CustomBuildStep>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
index fc7408f1e33f54aeff35ae495fd6cc67e466a392..0df0aec8e3639ffc1b73a7d24d16a38be35398dc 100755 (executable)
-/*\r
- * DO NOT EDIT.  THIS FILE IS GENERATED FROM IDNSSDService.idl\r
- */\r
-\r
-#ifndef __gen_IDNSSDService_h__\r
-#define __gen_IDNSSDService_h__\r
-\r
-\r
-#ifndef __gen_nsISupports_h__\r
-#include "nsISupports.h"\r
-#endif\r
-\r
-/* For IDL files that don't want to include root IDL files. */\r
-#ifndef NS_NO_VTABLE\r
-#define NS_NO_VTABLE\r
-#endif\r
-class IDNSSDService; /* forward declaration */\r
-\r
-\r
-/* starting interface:    IDNSSDBrowseListener */\r
-#define IDNSSDBROWSELISTENER_IID_STR "27346495-a1ed-458a-a5bc-587df9a26b4f"\r
-\r
-#define IDNSSDBROWSELISTENER_IID \\r
-  {0x27346495, 0xa1ed, 0x458a, \\r
-    { 0xa5, 0xbc, 0x58, 0x7d, 0xf9, 0xa2, 0x6b, 0x4f }}\r
-\r
-class NS_NO_VTABLE NS_SCRIPTABLE IDNSSDBrowseListener : public nsISupports {\r
- public: \r
-\r
-  NS_DECLARE_STATIC_IID_ACCESSOR(IDNSSDBROWSELISTENER_IID)\r
-\r
-  /* void onBrowse (in IDNSSDService service, in boolean add, in long interfaceIndex, in long error, in AString serviceName, in AString regtype, in AString domain); */\r
-  NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain) = 0;\r
-\r
-};\r
-\r
-  NS_DEFINE_STATIC_IID_ACCESSOR(IDNSSDBrowseListener, IDNSSDBROWSELISTENER_IID)\r
-\r
-/* Use this macro when declaring classes that implement this interface. */\r
-#define NS_DECL_IDNSSDBROWSELISTENER \\r
-  NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain); \r
-\r
-/* Use this macro to declare functions that forward the behavior of this interface to another object. */\r
-#define NS_FORWARD_IDNSSDBROWSELISTENER(_to) \\r
-  NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain) { return _to OnBrowse(service, add, interfaceIndex, error, serviceName, regtype, domain); } \r
-\r
-/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */\r
-#define NS_FORWARD_SAFE_IDNSSDBROWSELISTENER(_to) \\r
-  NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnBrowse(service, add, interfaceIndex, error, serviceName, regtype, domain); } \r
-\r
-#if 0\r
-/* Use the code below as a template for the implementation class for this interface. */\r
-\r
-/* Header file */\r
-class _MYCLASS_ : public IDNSSDBrowseListener\r
-{\r
-public:\r
-  NS_DECL_ISUPPORTS\r
-  NS_DECL_IDNSSDBROWSELISTENER\r
-\r
-  _MYCLASS_();\r
-\r
-private:\r
-  ~_MYCLASS_();\r
-\r
-protected:\r
-  /* additional members */\r
-};\r
-\r
-/* Implementation file */\r
-NS_IMPL_ISUPPORTS1(_MYCLASS_, IDNSSDBrowseListener)\r
-\r
-_MYCLASS_::_MYCLASS_()\r
-{\r
-  /* member initializers and constructor code */\r
-}\r
-\r
-_MYCLASS_::~_MYCLASS_()\r
-{\r
-  /* destructor code */\r
-}\r
-\r
-/* void onBrowse (in IDNSSDService service, in boolean add, in long interfaceIndex, in long error, in AString serviceName, in AString regtype, in AString domain); */\r
-NS_IMETHODIMP _MYCLASS_::OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain)\r
-{\r
-    return NS_ERROR_NOT_IMPLEMENTED;\r
-}\r
-\r
-/* End of implementation class template. */\r
-#endif\r
-\r
-\r
-/* starting interface:    IDNSSDResolveListener */\r
-#define IDNSSDRESOLVELISTENER_IID_STR "6620e18f-47f3-47c6-941f-126a5fd4fcf7"\r
-\r
-#define IDNSSDRESOLVELISTENER_IID \\r
-  {0x6620e18f, 0x47f3, 0x47c6, \\r
-    { 0x94, 0x1f, 0x12, 0x6a, 0x5f, 0xd4, 0xfc, 0xf7 }}\r
-\r
-class NS_NO_VTABLE NS_SCRIPTABLE IDNSSDResolveListener : public nsISupports {\r
- public: \r
-\r
-  NS_DECLARE_STATIC_IID_ACCESSOR(IDNSSDRESOLVELISTENER_IID)\r
-\r
-  /* void onResolve (in IDNSSDService service, in long interfaceIndex, in long error, in AString fullname, in AString host, in short port, in AString path); */\r
-  NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path) = 0;\r
-\r
-};\r
-\r
-  NS_DEFINE_STATIC_IID_ACCESSOR(IDNSSDResolveListener, IDNSSDRESOLVELISTENER_IID)\r
-\r
-/* Use this macro when declaring classes that implement this interface. */\r
-#define NS_DECL_IDNSSDRESOLVELISTENER \\r
-  NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path); \r
-\r
-/* Use this macro to declare functions that forward the behavior of this interface to another object. */\r
-#define NS_FORWARD_IDNSSDRESOLVELISTENER(_to) \\r
-  NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path) { return _to OnResolve(service, interfaceIndex, error, fullname, host, port, path); } \r
-\r
-/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */\r
-#define NS_FORWARD_SAFE_IDNSSDRESOLVELISTENER(_to) \\r
-  NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnResolve(service, interfaceIndex, error, fullname, host, port, path); } \r
-\r
-#if 0\r
-/* Use the code below as a template for the implementation class for this interface. */\r
-\r
-/* Header file */\r
-class _MYCLASS_ : public IDNSSDResolveListener\r
-{\r
-public:\r
-  NS_DECL_ISUPPORTS\r
-  NS_DECL_IDNSSDRESOLVELISTENER\r
-\r
-  _MYCLASS_();\r
-\r
-private:\r
-  ~_MYCLASS_();\r
-\r
-protected:\r
-  /* additional members */\r
-};\r
-\r
-/* Implementation file */\r
-NS_IMPL_ISUPPORTS1(_MYCLASS_, IDNSSDResolveListener)\r
-\r
-_MYCLASS_::_MYCLASS_()\r
-{\r
-  /* member initializers and constructor code */\r
-}\r
-\r
-_MYCLASS_::~_MYCLASS_()\r
-{\r
-  /* destructor code */\r
-}\r
-\r
-/* void onResolve (in IDNSSDService service, in long interfaceIndex, in long error, in AString fullname, in AString host, in short port, in AString path); */\r
-NS_IMETHODIMP _MYCLASS_::OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path)\r
-{\r
-    return NS_ERROR_NOT_IMPLEMENTED;\r
-}\r
-\r
-/* End of implementation class template. */\r
-#endif\r
-\r
-\r
-/* starting interface:    IDNSSDService */\r
-#define IDNSSDSERVICE_IID_STR "3a3539ff-f8d8-40b4-8d02-5ea73c51fa12"\r
-\r
-#define IDNSSDSERVICE_IID \\r
-  {0x3a3539ff, 0xf8d8, 0x40b4, \\r
-    { 0x8d, 0x02, 0x5e, 0xa7, 0x3c, 0x51, 0xfa, 0x12 }}\r
-\r
-class NS_NO_VTABLE NS_SCRIPTABLE IDNSSDService : public nsISupports {\r
- public: \r
-\r
-  NS_DECLARE_STATIC_IID_ACCESSOR(IDNSSDSERVICE_IID)\r
-\r
-  /* IDNSSDService browse (in long interfaceIndex, in AString regtype, in AString domain, in IDNSSDBrowseListener listener); */\r
-  NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) = 0;\r
-\r
-  /* IDNSSDService resolve (in long interfaceIndex, in AString name, in AString regtype, in AString domain, in IDNSSDResolveListener listener); */\r
-  NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) = 0;\r
-\r
-  /* void stop (); */\r
-  NS_SCRIPTABLE NS_IMETHOD Stop(void) = 0;\r
-\r
-};\r
-\r
-  NS_DEFINE_STATIC_IID_ACCESSOR(IDNSSDService, IDNSSDSERVICE_IID)\r
-\r
-/* Use this macro when declaring classes that implement this interface. */\r
-#define NS_DECL_IDNSSDSERVICE \\r
-  NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM); \\r
-  NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM); \\r
-  NS_SCRIPTABLE NS_IMETHOD Stop(void); \r
-\r
-/* Use this macro to declare functions that forward the behavior of this interface to another object. */\r
-#define NS_FORWARD_IDNSSDSERVICE(_to) \\r
-  NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return _to Browse(interfaceIndex, regtype, domain, listener, _retval); } \\r
-  NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return _to Resolve(interfaceIndex, name, regtype, domain, listener, _retval); } \\r
-  NS_SCRIPTABLE NS_IMETHOD Stop(void) { return _to Stop(); } \r
-\r
-/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */\r
-#define NS_FORWARD_SAFE_IDNSSDSERVICE(_to) \\r
-  NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Browse(interfaceIndex, regtype, domain, listener, _retval); } \\r
-  NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Resolve(interfaceIndex, name, regtype, domain, listener, _retval); } \\r
-  NS_SCRIPTABLE NS_IMETHOD Stop(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Stop(); } \r
-\r
-#if 0\r
-/* Use the code below as a template for the implementation class for this interface. */\r
-\r
-/* Header file */\r
-class _MYCLASS_ : public IDNSSDService\r
-{\r
-public:\r
-  NS_DECL_ISUPPORTS\r
-  NS_DECL_IDNSSDSERVICE\r
-\r
-  _MYCLASS_();\r
-\r
-private:\r
-  ~_MYCLASS_();\r
-\r
-protected:\r
-  /* additional members */\r
-};\r
-\r
-/* Implementation file */\r
-NS_IMPL_ISUPPORTS1(_MYCLASS_, IDNSSDService)\r
-\r
-_MYCLASS_::_MYCLASS_()\r
-{\r
-  /* member initializers and constructor code */\r
-}\r
-\r
-_MYCLASS_::~_MYCLASS_()\r
-{\r
-  /* destructor code */\r
-}\r
-\r
-/* IDNSSDService browse (in long interfaceIndex, in AString regtype, in AString domain, in IDNSSDBrowseListener listener); */\r
-NS_IMETHODIMP _MYCLASS_::Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM)\r
-{\r
-    return NS_ERROR_NOT_IMPLEMENTED;\r
-}\r
-\r
-/* IDNSSDService resolve (in long interfaceIndex, in AString name, in AString regtype, in AString domain, in IDNSSDResolveListener listener); */\r
-NS_IMETHODIMP _MYCLASS_::Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM)\r
-{\r
-    return NS_ERROR_NOT_IMPLEMENTED;\r
-}\r
-\r
-/* void stop (); */\r
-NS_IMETHODIMP _MYCLASS_::Stop()\r
-{\r
-    return NS_ERROR_NOT_IMPLEMENTED;\r
-}\r
-\r
-/* End of implementation class template. */\r
-#endif\r
-\r
-\r
-#endif /* __gen_IDNSSDService_h__ */\r
+/*
+ * DO NOT EDIT.  THIS FILE IS GENERATED FROM IDNSSDService.idl
+ */
+
+#ifndef __gen_IDNSSDService_h__
+#define __gen_IDNSSDService_h__
+
+
+#ifndef __gen_nsISupports_h__
+#include "nsISupports.h"
+#endif
+
+/* For IDL files that don't want to include root IDL files. */
+#ifndef NS_NO_VTABLE
+#define NS_NO_VTABLE
+#endif
+class IDNSSDService; /* forward declaration */
+
+
+/* starting interface:    IDNSSDBrowseListener */
+#define IDNSSDBROWSELISTENER_IID_STR "27346495-a1ed-458a-a5bc-587df9a26b4f"
+
+#define IDNSSDBROWSELISTENER_IID \
+  {0x27346495, 0xa1ed, 0x458a, \
+    { 0xa5, 0xbc, 0x58, 0x7d, 0xf9, 0xa2, 0x6b, 0x4f }}
+
+class NS_NO_VTABLE NS_SCRIPTABLE IDNSSDBrowseListener : public nsISupports {
+ public: 
+
+  NS_DECLARE_STATIC_IID_ACCESSOR(IDNSSDBROWSELISTENER_IID)
+
+  /* void onBrowse (in IDNSSDService service, in boolean add, in long interfaceIndex, in long error, in AString serviceName, in AString regtype, in AString domain); */
+  NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain) = 0;
+
+};
+
+  NS_DEFINE_STATIC_IID_ACCESSOR(IDNSSDBrowseListener, IDNSSDBROWSELISTENER_IID)
+
+/* Use this macro when declaring classes that implement this interface. */
+#define NS_DECL_IDNSSDBROWSELISTENER \
+  NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain); 
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object. */
+#define NS_FORWARD_IDNSSDBROWSELISTENER(_to) \
+  NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain) { return _to OnBrowse(service, add, interfaceIndex, error, serviceName, regtype, domain); } 
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
+#define NS_FORWARD_SAFE_IDNSSDBROWSELISTENER(_to) \
+  NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnBrowse(service, add, interfaceIndex, error, serviceName, regtype, domain); } 
+
+#if 0
+/* Use the code below as a template for the implementation class for this interface. */
+
+/* Header file */
+class _MYCLASS_ : public IDNSSDBrowseListener
+{
+public:
+  NS_DECL_ISUPPORTS
+  NS_DECL_IDNSSDBROWSELISTENER
+
+  _MYCLASS_();
+
+private:
+  ~_MYCLASS_();
+
+protected:
+  /* additional members */
+};
+
+/* Implementation file */
+NS_IMPL_ISUPPORTS1(_MYCLASS_, IDNSSDBrowseListener)
+
+_MYCLASS_::_MYCLASS_()
+{
+  /* member initializers and constructor code */
+}
+
+_MYCLASS_::~_MYCLASS_()
+{
+  /* destructor code */
+}
+
+/* void onBrowse (in IDNSSDService service, in boolean add, in long interfaceIndex, in long error, in AString serviceName, in AString regtype, in AString domain); */
+NS_IMETHODIMP _MYCLASS_::OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* End of implementation class template. */
+#endif
+
+
+/* starting interface:    IDNSSDResolveListener */
+#define IDNSSDRESOLVELISTENER_IID_STR "6620e18f-47f3-47c6-941f-126a5fd4fcf7"
+
+#define IDNSSDRESOLVELISTENER_IID \
+  {0x6620e18f, 0x47f3, 0x47c6, \
+    { 0x94, 0x1f, 0x12, 0x6a, 0x5f, 0xd4, 0xfc, 0xf7 }}
+
+class NS_NO_VTABLE NS_SCRIPTABLE IDNSSDResolveListener : public nsISupports {
+ public: 
+
+  NS_DECLARE_STATIC_IID_ACCESSOR(IDNSSDRESOLVELISTENER_IID)
+
+  /* void onResolve (in IDNSSDService service, in long interfaceIndex, in long error, in AString fullname, in AString host, in short port, in AString path); */
+  NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path) = 0;
+
+};
+
+  NS_DEFINE_STATIC_IID_ACCESSOR(IDNSSDResolveListener, IDNSSDRESOLVELISTENER_IID)
+
+/* Use this macro when declaring classes that implement this interface. */
+#define NS_DECL_IDNSSDRESOLVELISTENER \
+  NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path); 
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object. */
+#define NS_FORWARD_IDNSSDRESOLVELISTENER(_to) \
+  NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path) { return _to OnResolve(service, interfaceIndex, error, fullname, host, port, path); } 
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
+#define NS_FORWARD_SAFE_IDNSSDRESOLVELISTENER(_to) \
+  NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnResolve(service, interfaceIndex, error, fullname, host, port, path); } 
+
+#if 0
+/* Use the code below as a template for the implementation class for this interface. */
+
+/* Header file */
+class _MYCLASS_ : public IDNSSDResolveListener
+{
+public:
+  NS_DECL_ISUPPORTS
+  NS_DECL_IDNSSDRESOLVELISTENER
+
+  _MYCLASS_();
+
+private:
+  ~_MYCLASS_();
+
+protected:
+  /* additional members */
+};
+
+/* Implementation file */
+NS_IMPL_ISUPPORTS1(_MYCLASS_, IDNSSDResolveListener)
+
+_MYCLASS_::_MYCLASS_()
+{
+  /* member initializers and constructor code */
+}
+
+_MYCLASS_::~_MYCLASS_()
+{
+  /* destructor code */
+}
+
+/* void onResolve (in IDNSSDService service, in long interfaceIndex, in long error, in AString fullname, in AString host, in short port, in AString path); */
+NS_IMETHODIMP _MYCLASS_::OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* End of implementation class template. */
+#endif
+
+
+/* starting interface:    IDNSSDService */
+#define IDNSSDSERVICE_IID_STR "3a3539ff-f8d8-40b4-8d02-5ea73c51fa12"
+
+#define IDNSSDSERVICE_IID \
+  {0x3a3539ff, 0xf8d8, 0x40b4, \
+    { 0x8d, 0x02, 0x5e, 0xa7, 0x3c, 0x51, 0xfa, 0x12 }}
+
+class NS_NO_VTABLE NS_SCRIPTABLE IDNSSDService : public nsISupports {
+ public: 
+
+  NS_DECLARE_STATIC_IID_ACCESSOR(IDNSSDSERVICE_IID)
+
+  /* IDNSSDService browse (in long interfaceIndex, in AString regtype, in AString domain, in IDNSSDBrowseListener listener); */
+  NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) = 0;
+
+  /* IDNSSDService resolve (in long interfaceIndex, in AString name, in AString regtype, in AString domain, in IDNSSDResolveListener listener); */
+  NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) = 0;
+
+  /* void stop (); */
+  NS_SCRIPTABLE NS_IMETHOD Stop(void) = 0;
+
+};
+
+  NS_DEFINE_STATIC_IID_ACCESSOR(IDNSSDService, IDNSSDSERVICE_IID)
+
+/* Use this macro when declaring classes that implement this interface. */
+#define NS_DECL_IDNSSDSERVICE \
+  NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM); \
+  NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM); \
+  NS_SCRIPTABLE NS_IMETHOD Stop(void); 
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object. */
+#define NS_FORWARD_IDNSSDSERVICE(_to) \
+  NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return _to Browse(interfaceIndex, regtype, domain, listener, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return _to Resolve(interfaceIndex, name, regtype, domain, listener, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD Stop(void) { return _to Stop(); } 
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
+#define NS_FORWARD_SAFE_IDNSSDSERVICE(_to) \
+  NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Browse(interfaceIndex, regtype, domain, listener, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Resolve(interfaceIndex, name, regtype, domain, listener, _retval); } \
+  NS_SCRIPTABLE NS_IMETHOD Stop(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Stop(); } 
+
+#if 0
+/* Use the code below as a template for the implementation class for this interface. */
+
+/* Header file */
+class _MYCLASS_ : public IDNSSDService
+{
+public:
+  NS_DECL_ISUPPORTS
+  NS_DECL_IDNSSDSERVICE
+
+  _MYCLASS_();
+
+private:
+  ~_MYCLASS_();
+
+protected:
+  /* additional members */
+};
+
+/* Implementation file */
+NS_IMPL_ISUPPORTS1(_MYCLASS_, IDNSSDService)
+
+_MYCLASS_::_MYCLASS_()
+{
+  /* member initializers and constructor code */
+}
+
+_MYCLASS_::~_MYCLASS_()
+{
+  /* destructor code */
+}
+
+/* IDNSSDService browse (in long interfaceIndex, in AString regtype, in AString domain, in IDNSSDBrowseListener listener); */
+NS_IMETHODIMP _MYCLASS_::Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* IDNSSDService resolve (in long interfaceIndex, in AString name, in AString regtype, in AString domain, in IDNSSDResolveListener listener); */
+NS_IMETHODIMP _MYCLASS_::Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM)
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* void stop (); */
+NS_IMETHODIMP _MYCLASS_::Stop()
+{
+    return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* End of implementation class template. */
+#endif
+
+
+#endif /* __gen_IDNSSDService_h__ */
diff --git a/Clients/Java/JavaSamples.vcxproj b/Clients/Java/JavaSamples.vcxproj
new file mode 100755 (executable)
index 0000000..046cbd5
--- /dev/null
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{A987A0C1-344F-475C-869C-F082EB11EEBA}</ProjectGuid>\r
+    <Keyword>MakeFileProj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>Makefile</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>Makefile</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>Makefile</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>Makefile</ConfigurationType>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>\r
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nmake /f nmakefile DEBUG=1 DNS_SD=..\..\mDNSWindows\Java\build\debug\dns_sd.jar</NMakeBuildCommandLine>\r
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nmake /f nmakefile DEBUG=1 DNS_SD=..\..\mDNSWindows\Java\build\debug\dns_sd.jar</NMakeReBuildCommandLine>\r
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nmake /f nmakefile DEBUG=1 CLEAN</NMakeCleanCommandLine>\r
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>\r
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>\r
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>\r
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>\r
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>\r
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nmake /f nmakefile DNS_SD=..\..\mDNSWindows\Java\build\prod\dns_sd.jar</NMakeBuildCommandLine>\r
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nmake /f nmakefile DNS_SD=..\..\mDNSWindows\Java\build\prod\dns_sd.jar</NMakeReBuildCommandLine>\r
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nmake /f nmakefile CLEAN</NMakeCleanCommandLine>\r
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>\r
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>\r
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>\r
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>\r
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">nmake /f nmakefile DEBUG=1 DNS_SD=..\..\mDNSWindows\Java\build\debug\dns_sd.jar</NMakeBuildCommandLine>\r
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">nmake /f nmakefile DEBUG=1 DNS_SD=..\..\mDNSWindows\Java\build\debug\dns_sd.jar</NMakeReBuildCommandLine>\r
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">nmake /f nmakefile DEBUG=1 CLEAN</NMakeCleanCommandLine>\r
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>\r
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>\r
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeForcedIncludes)</NMakeForcedIncludes>\r
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>\r
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">nmake /f nmakefile DNS_SD=..\..\mDNSWindows\Java\build\prod\dns_sd.jar</NMakeBuildCommandLine>\r
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">nmake /f nmakefile DNS_SD=..\..\mDNSWindows\Java\build\prod\dns_sd.jar</NMakeReBuildCommandLine>\r
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">nmake /f nmakefile CLEAN</NMakeCleanCommandLine>\r
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>\r
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>\r
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeForcedIncludes)</NMakeForcedIncludes>\r
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>\r
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\..\mDNSWindows\Java\Java.vcxproj">\r
+      <Project>{9ce2568a-3170-41c6-9f20-a0188a9ec114}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj b/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj
new file mode 100755 (executable)
index 0000000..563597e
--- /dev/null
@@ -0,0 +1,365 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|Win32">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|x64">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}</ProjectGuid>\r
+    <Keyword>MFCProj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+    <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IncludePath)</IncludePath>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">PrinterWizard</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PrinterWizard</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">PrinterWizard</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">PrinterWizard</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">PrinterWizard</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|x64'">PrinterWizard</TargetName>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>.;../../mDNSWindows;../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0501;_WIN32_WINNT=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>Cdecl</CallingConvention>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;iphlpapi.lib;winspool.lib;setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)PrinterWizard.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\PrinterSetupWizard.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>.;../../mDNSWindows;../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0501;_WIN32_WINNT=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>Cdecl</CallingConvention>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;iphlpapi.lib;winspool.lib;setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)PrinterWizard.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\PrinterSetupWizard64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>.;../../mDNSWindows;../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WINVER=0x0501;_WIN32_WINNT=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>false</MinimalRebuild>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;iphlpapi.lib;winspool.lib;setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)PrinterWizard.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\PrinterSetupWizard.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)"   mkdir "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                                  "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>.;../../mDNSWindows;../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WINVER=0x0501;_WIN32_WINNT=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>false</MinimalRebuild>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;iphlpapi.lib;winspool.lib;setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)PrinterWizard.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\PrinterSetupWizard64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)"   mkdir "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                                  "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="About.cpp" />\r
+    <ClCompile Include="FirstPage.cpp" />\r
+    <ClCompile Include="FourthPage.cpp" />\r
+    <ClCompile Include="PrinterSetupWizardApp.cpp" />\r
+    <ClCompile Include="PrinterSetupWizardSheet.cpp" />\r
+    <ClCompile Include="SecondPage.cpp" />\r
+    <ClCompile Include="stdafx.cpp" />\r
+    <ClCompile Include="ThirdPage.cpp" />\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c" />\r
+    <ClCompile Include="..\..\mDNSWindows\loclibrary.c">\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4201;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+      <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4201;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ClCompile Include="Logger.cpp" />\r
+    <ClCompile Include="..\..\mDNSWindows\WinServices.cpp" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="About.h" />\r
+    <ClInclude Include="FirstPage.h" />\r
+    <ClInclude Include="FourthPage.h" />\r
+    <ClInclude Include="PrinterSetupWizardApp.h" />\r
+    <ClInclude Include="PrinterSetupWizardSheet.h" />\r
+    <ClInclude Include="resource.h" />\r
+    <ClInclude Include="resource_exe.h" />\r
+    <ClInclude Include="SecondPage.h" />\r
+    <ClInclude Include="stdafx.h" />\r
+    <ClInclude Include="tcpxcv.h" />\r
+    <ClInclude Include="ThirdPage.h" />\r
+    <ClInclude Include="UtilTypes.h" />\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h" />\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h" />\r
+    <ClInclude Include="..\..\mDNSShared\dns_sd.h" />\r
+    <ClInclude Include="..\..\mDNSWindows\isocode.h" />\r
+    <ClInclude Include="..\..\mDNSWindows\loclibrary.h" />\r
+    <ClInclude Include="Logger.h" />\r
+    <ClInclude Include="..\..\mDNSWindows\WinServices.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="res\about.bmp" />\r
+    <None Include="res\banner_icon.bmp" />\r
+    <None Include="res\Info.ico" />\r
+    <None Include="res\NetworkPrinter.ico" />\r
+    <None Include="res\watermark.bmp" />\r
+    <None Include="ReadMe.txt" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <CustomBuildStep Include="res\PrinterSetupWizard.manifest">\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>\r
+      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>\r
+    </CustomBuildStep>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="PrinterSetupWizard.rc" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\..\mDNSWindows\DLLStub\DLLStub.vcxproj">\r
+      <Project>{3a2b6325-3053-4236-84bd-aa9be2e323e5}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+  <ProjectExtensions>\r
+    <VisualStudio>\r
+      <UserProperties RESOURCE_FILE="PrinterSetupWizard.rc" />\r
+    </VisualStudio>\r
+  </ProjectExtensions>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj.filters b/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj.filters
new file mode 100755 (executable)
index 0000000..d210279
--- /dev/null
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{2a6fb856-bfd6-4cf1-bd97-b1c798cadff4}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{cc2ba15e-c8ac-4990-9bf2-a27b18361b12}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{18aa6a23-2325-46e6-a1e2-45d743d9ff32}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>\r
+    </Filter>\r
+    <Filter Include="Support">\r
+      <UniqueIdentifier>{5c8be428-d955-40e2-bbb6-349f5867d422}</UniqueIdentifier>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="About.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="FirstPage.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="FourthPage.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="PrinterSetupWizardApp.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="PrinterSetupWizardSheet.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="SecondPage.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="stdafx.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="ThirdPage.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c">\r
+      <Filter>Support</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSWindows\loclibrary.c">\r
+      <Filter>Support</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="Logger.cpp">\r
+      <Filter>Support</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSWindows\WinServices.cpp">\r
+      <Filter>Support</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="About.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="FirstPage.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="FourthPage.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="PrinterSetupWizardApp.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="PrinterSetupWizardSheet.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="resource.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="resource_exe.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="SecondPage.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="stdafx.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="ThirdPage.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="UtilTypes.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\dns_sd.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSWindows\isocode.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSWindows\loclibrary.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="Logger.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSWindows\WinServices.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="tcpxcv.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="res\about.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\banner_icon.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\Info.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\NetworkPrinter.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\watermark.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="ReadMe.txt" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="PrinterSetupWizard.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <CustomBuildStep Include="res\PrinterSetupWizard.manifest">\r
+      <Filter>Resource Files</Filter>\r
+    </CustomBuildStep>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj b/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj
new file mode 100755 (executable)
index 0000000..86affb8
--- /dev/null
@@ -0,0 +1,345 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|Win32">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|x64">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{967F5375-0176-43D3-ADA3-22EE25551C37}</ProjectGuid>\r
+    <Keyword>MFCProj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\PrinterWizard.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\PrinterWizard.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\PrinterWizard.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\PrinterWizard.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\PrinterWizard.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\PrinterWizard.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">PrinterWizardLocalized</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PrinterWizardLocalized</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">PrinterWizardLocalized</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">PrinterWizardLocalized</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">PrinterWizardLocalized</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|x64'">PrinterWizardLocalized</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|x64'">.dll</TargetExt>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+      <CallingConvention>Cdecl</CallingConvention>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)PrinterWizard.Resources mkdir $(OutDir)PrinterWizard.Resources\r
+if not exist $(OutDir)PrinterWizard.Resources\en.lproj mkdir $(OutDir)PrinterWizard.Resources\en.lproj\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <OutputFile>$(OutDir)PrinterWizardLocalized.dll</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <EntryPointSymbol>\r
+      </EntryPointSymbol>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(OutDir)Localized.lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>Cdecl</CallingConvention>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)PrinterWizard.Resources mkdir $(OutDir)PrinterWizard.Resources\r
+if not exist $(OutDir)PrinterWizard.Resources\en.lproj mkdir $(OutDir)PrinterWizard.Resources\en.lproj\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <OutputFile>$(OutDir)PrinterWizardLocalized.dll</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <EntryPointSymbol>\r
+      </EntryPointSymbol>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(OutDir)Localized.lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>false</MinimalRebuild>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)PrinterWizard.Resources mkdir $(OutDir)PrinterWizard.Resources\r
+if not exist $(OutDir)PrinterWizard.Resources\en.lproj mkdir $(OutDir)PrinterWizard.Resources\en.lproj\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <OutputFile>$(OutDir)PrinterWizardLocalized.dll</OutputFile>\r
+      <GenerateDebugInformation>false</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <EntryPointSymbol>\r
+      </EntryPointSymbol>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources\en.lproj"   mkdir "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources\en.lproj"\r
+xcopy /I/Y "$(TargetPath)"                                                                                                                         "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources\en.lproj"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>false</MinimalRebuild>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)PrinterWizard.Resources mkdir $(OutDir)PrinterWizard.Resources\r
+if not exist $(OutDir)PrinterWizard.Resources\en.lproj mkdir $(OutDir)PrinterWizard.Resources\en.lproj\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <OutputFile>$(OutDir)PrinterWizardLocalized.dll</OutputFile>\r
+      <GenerateDebugInformation>false</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <EntryPointSymbol>\r
+      </EntryPointSymbol>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources\en.lproj"   mkdir "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources\en.lproj"\r
+xcopy /I/Y "$(TargetPath)"                                                                                                                         "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources\en.lproj"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">\r
+    <Link>\r
+      <OutputFile>$(OutDir)PrinterWizardLocalized.dll</OutputFile>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'">\r
+    <Link>\r
+      <OutputFile>$(OutDir)PrinterWizardLocalized.dll</OutputFile>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="resource_loc_dll.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="PrinterSetupWizardLocRes.rc" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="res\PrinterSetupWizardLocRes.rc2" />\r
+    <None Include="ReadMe.txt" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\..\mDNSWindows\DLL\dnssd.vcxproj">\r
+      <Project>{ab581101-18f0-46f6-b56a-83a6b1ea657e}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+  <ProjectExtensions>\r
+    <VisualStudio>\r
+      <UserProperties RESOURCE_FILE="PrinterSetupWizardLocRes.rc" />\r
+    </VisualStudio>\r
+  </ProjectExtensions>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj.filters b/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj.filters
new file mode 100755 (executable)
index 0000000..b0c2900
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{7a783aeb-7735-4f37-9b8d-ae201c3bf118}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{e9d0d017-9740-4270-9ab9-b3b50c3bff30}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="resource_loc_dll.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="PrinterSetupWizardLocRes.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="res\PrinterSetupWizardLocRes.rc2">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="ReadMe.txt" />\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj b/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj
new file mode 100755 (executable)
index 0000000..16befa7
--- /dev/null
@@ -0,0 +1,347 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|Win32">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|x64">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{CFCCB176-6CAA-472B-B0A2-90511C8E2E52}</ProjectGuid>\r
+    <Keyword>MFCProj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\PrinterWizard.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\PrinterWizard.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\PrinterWizard.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\PrinterWizard.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">PrinterWizardResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PrinterWizardResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.dll</TargetExt>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\PrinterWizard.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">PrinterWizardResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">PrinterWizardResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">PrinterWizardResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.dll</TargetExt>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\PrinterWizard.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|x64'">PrinterWizardResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|x64'">.dll</TargetExt>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+      <CallingConvention>Cdecl</CallingConvention>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist Debug\PrinterWizard.Resources mkdir Debug\PrinterWizard.Resources</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <OutputFile>$(OutDir)PrinterWizardResources.dll</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <EntryPointSymbol>\r
+      </EntryPointSymbol>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(OutDir)Localized.lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>Cdecl</CallingConvention>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist Debug\PrinterWizard.Resources mkdir Debug\PrinterWizard.Resources</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <OutputFile>$(OutDir)PrinterWizardResources.dll</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <EntryPointSymbol>\r
+      </EntryPointSymbol>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(OutDir)Localized.lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>false</MinimalRebuild>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist Release mkdir Release\r
+if not exist "Release\PrinterWizard.Resources" mkdir "Release\PrinterWizard.Resources"\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <OutputFile>$(OutDir)PrinterWizardResources.dll</OutputFile>\r
+      <GenerateDebugInformation>false</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <EntryPointSymbol>\r
+      </EntryPointSymbol>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources"   mkdir "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources"\r
+xcopy /I/Y "$(TargetPath)"                                                                                                           "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>false</MinimalRebuild>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist Release mkdir Release\r
+if not exist "Release\PrinterWizard.Resources" mkdir "Release\PrinterWizard.Resources"\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <OutputFile>$(OutDir)PrinterWizardResources.dll</OutputFile>\r
+      <GenerateDebugInformation>false</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <EntryPointSymbol>\r
+      </EntryPointSymbol>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources"   mkdir "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources"\r
+xcopy /I/Y "$(TargetPath)"                                                                                                           "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">\r
+    <Link>\r
+      <OutputFile>$(OutDir)PrinterWizardResources.dll</OutputFile>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'">\r
+    <Link>\r
+      <OutputFile>$(OutDir)PrinterWizardResources.dll</OutputFile>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="resource_dll.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="res\about.bmp" />\r
+    <None Include="res\banner_icon.bmp" />\r
+    <None Include="res\Info.ico" />\r
+    <None Include="res\NetworkPrinter.ico" />\r
+    <None Include="res\Printer.bmp" />\r
+    <None Include="res\PrinterSetupWizardRes.rc2" />\r
+    <None Include="res\watermark.bmp" />\r
+    <None Include="ReadMe.txt" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="PrinterSetupWizardRes.rc" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\..\mDNSWindows\DLL\dnssd.vcxproj">\r
+      <Project>{ab581101-18f0-46f6-b56a-83a6b1ea657e}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+  <ProjectExtensions>\r
+    <VisualStudio>\r
+      <UserProperties RESOURCE_FILE="PrinterSetupWizardRes.rc" />\r
+    </VisualStudio>\r
+  </ProjectExtensions>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj.filters b/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj.filters
new file mode 100755 (executable)
index 0000000..e5b0f59
--- /dev/null
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{f366b81b-a033-4fe2-83f9-f249205c8f41}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{dd34ed24-7798-4514-b9b3-ecc1172409a0}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="resource_dll.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="res\about.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\banner_icon.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\Info.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\NetworkPrinter.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\Printer.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\PrinterSetupWizardRes.rc2">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\watermark.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="ReadMe.txt" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="PrinterSetupWizardRes.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
index 07e9ca061763889a06c68794934d87a048233318..47e5f9110bc0df459c61717c6aed17fb6bbf3ca7 100644 (file)
@@ -22,8 +22,8 @@
 #include "DebugServices.h"
 #include "WinServices.h"
 #include "About.h"
+#include "tcpxcv.h"
 #include <winspool.h>
-#include <tcpxcv.h>
 #include <string>
 #include <shlwapi.h>
 
@@ -60,35 +60,35 @@ g_printerDriverFiles[] =            // Printer driver files
 
 #define WM_SOCKET_EVENT                ( WM_USER + 0x100 )
 #define WM_PROCESS_EVENT       ( WM_USER + 0x101 )
-\r
-
-static BOOL\r
-Is64BitWindows()\r
-{\r
-#if defined(_WIN64)\r
-       return TRUE;  // 64-bit programs run only on Win64\r
-#else\r
-       typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS)( HANDLE, PBOOL );\r
-       LPFN_ISWOW64PROCESS fnIsWow64Process;\r
-       BOOL bIsWow64 = FALSE;\r
-\r
-    fnIsWow64Process = ( LPFN_ISWOW64PROCESS ) GetProcAddress( GetModuleHandle( TEXT( "kernel32" ) ), "IsWow64Process" );\r
-  \r
-    if ( fnIsWow64Process != NULL )\r
-    {\r
-               BOOL ok;\r
-\r
-        ok = fnIsWow64Process( GetCurrentProcess(), &bIsWow64 );\r
-\r
-               if ( !ok )\r
-               {\r
-                       bIsWow64 = FALSE;\r
-               }\r
-       }\r
-\r
-       return bIsWow64;\r
-#endif\r
-}\r
+
+
+static BOOL
+Is64BitWindows()
+{
+#if defined(_WIN64)
+       return TRUE;  // 64-bit programs run only on Win64
+#else
+       typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS)( HANDLE, PBOOL );
+       LPFN_ISWOW64PROCESS fnIsWow64Process;
+       BOOL bIsWow64 = FALSE;
+
+    fnIsWow64Process = ( LPFN_ISWOW64PROCESS ) GetProcAddress( GetModuleHandle( TEXT( "kernel32" ) ), "IsWow64Process" );
+  
+    if ( fnIsWow64Process != NULL )
+    {
+               BOOL ok;
+
+        ok = fnIsWow64Process( GetCurrentProcess(), &bIsWow64 );
+
+               if ( !ok )
+               {
+                       bIsWow64 = FALSE;
+               }
+       }
+
+       return bIsWow64;
+#endif
+}
 
 
 // CPrinterSetupWizardSheet
index 35bbefafa351dfbe5002eaf7ca2fd6780ea0f224..1521d0d917bb40ba7373fdb1aeae44fef068b762 100644 (file)
@@ -174,10 +174,10 @@ CSecondPage::OnSetActive()
        }
 
        // Hide the back button
-       pWnd = ((CPropertySheet*)GetParent())->GetDlgItem(ID_WIZBACK);\r
-       if ( pWnd != NULL )\r
-       {\r
-               pWnd->ShowWindow(SW_HIDE);\r
+       pWnd = ((CPropertySheet*)GetParent())->GetDlgItem(ID_WIZBACK);
+       if ( pWnd != NULL )
+       {
+               pWnd->ShowWindow(SW_HIDE);
        }
 
 exit:
@@ -198,10 +198,10 @@ CSecondPage::OnKillActive()
        psheet->SetLastPage(this);
 
        // Show the back button
-       pWnd = ((CPropertySheet*)GetParent())->GetDlgItem(ID_WIZBACK);\r
-       if ( pWnd != NULL )\r
-       {\r
-               pWnd->ShowWindow(SW_SHOW);\r
+       pWnd = ((CPropertySheet*)GetParent())->GetDlgItem(ID_WIZBACK);
+       if ( pWnd != NULL )
+       {
+               pWnd->ShowWindow(SW_SHOW);
        }
 
 exit:
index 4bd88e55462549a6d4f8f7f1e99b7a372fde7166..6caf55cb29207c46313c46ccd23c12a75ad476f0 100644 (file)
@@ -19,8 +19,8 @@
 #include "PrinterSetupWizardApp.h"
 #include "PrinterSetupWizardSheet.h"
 #include "ThirdPage.h"
+#include "tcpxcv.h"
 #include <dns_sd.h>
-#include <tcpxcv.h>
 #include <winspool.h>
 #include <setupapi.h>
 
index a76320495c099ba0242e52d7c04c8ce9f0b9724b..945edc25b3b15c85a1da9d6d66eea3c88562ebbc 100644 (file)
@@ -1,29 +1,29 @@
-/* -*- Mode: C; tab-width: 4 -*-\r
- *\r
- * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-    \r
-\r
-// Include resources for Wizard app\r
-\r
-#include "resource_exe.h"\r
-\r
-// Include resources for non-localizable resource DLL\r
-\r
-#include "resource_res.h"\r
-\r
-// Include resources for localizable resource DLL\r
-\r
-#include "resource_loc_res.h"\r
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+    
+
+// Include resources for Wizard app
+
+#include "resource_exe.h"
+
+// Include resources for non-localizable resource DLL
+
+#include "resource_res.h"
+
+// Include resources for localizable resource DLL
+
+#include "resource_loc_res.h"
index ac510b33336c6e7536daf9624090d145f9999d36..f04cadf86ce0c6766011e1f8f5dea66bd1ae72f1 100755 (executable)
@@ -1,94 +1,94 @@
-//{{NO_DEPENDENCIES}}\r
-// Microsoft Visual C++ generated include file.\r
-// Used by PrinterSetupWizard.rc\r
-//\r
-#define IDM_ABOUTBOX                    0x0010\r
-#define IDD_ABOUTBOX                    100\r
-#define IDS_ABOUTBOX                    101\r
-#define IDD_PRINTERSETUPWIZARD_DIALOG   102\r
-#define IDS_GOODBYE                     102\r
-#define IDS_GREETING                    103\r
-#define IDS_BROWSE_TITLE                104\r
-#define IDS_BROWSE_SUBTITLE             105\r
-#define IDS_CAPTION                     106\r
-#define IDD_FIRST_PAGE                  107\r
-#define IDS_GOODBYE_GOOD1               107\r
-#define IDS_SEARCHING                   108\r
-#define IDD_SECOND_PAGE                 109\r
-#define IDS_GOODBYTE_GOOD2              109\r
-#define IDS_INSTALL_TITLE               110\r
-#define IDS_INSTALL_SUBTITLE            111\r
-#define IDS_ERROR_SELECTING_PRINTER_TEXT 112\r
-#define IDS_ERROR_SELECTING_PRINTER_CAPTION 113\r
-#define IDS_INSTALL_ERROR_CAPTION       114\r
-#define IDS_INSTALL_ERROR_MESSAGE       115\r
-#define IDS_MANUFACTURER_HEADING        116\r
-#define IDS_MODEL_HEADING               117\r
-#define IDS_NO_PRINTERS                 118\r
-#define IDS_NO_MDNSRESPONDER_SERVICE_TEXT 119\r
-#define IDS_NO_MDNSRESPONDER_SERVICE_CAPTION 120\r
-#define IDS_PRINTER_MATCH_GOOD          121\r
-#define IDS_PRINTER_MATCH_BAD           122\r
-#define IDS_YES                         123\r
-#define IDS_NO                          124\r
-#define IDS_LARGE_FONT                  125\r
-#define IDS_FIREWALL                    126\r
-#define IDS_ERROR_CAPTION               127\r
-#define IDR_MAINFRAME                   128\r
-#define IDS_FIREWALL_CAPTION            128\r
-#define IDB_BANNER_ICON                 129\r
-#define IDD_THIRD_PAGE                  130\r
-#define IDB_WATERMARK                   131\r
-#define IDD_FOURTH_PAGE                 132\r
-#define IDI_INFO                        136\r
-#define IDB_ABOUT                       138\r
-#define IDD_DIALOG1                     139\r
-#define IDI_ICON2                       141\r
-#define IDI_PRINTER                     141\r
-#define IDS_REINSTALL                                  142\r
-#define IDS_REINSTALL_CAPTION                  143\r
-#define IDC_INFO                                               144\r
-#define IDS_PRINTER_UNAVAILABLE         145\r
-#define IDS_BAD_INF_FILE                               150\r
-#define IDS_BAD_INF_FILE_CAPTION               151\r
-#define IDS_NO_MATCH_INF_FILE                  152\r
-#define IDS_NO_MATCH_INF_FILE_CAPTION  153\r
-#define IDC_BUTTON1                     1000\r
-#define IDC_LIST1                       1000\r
-#define IDC_BROWSE_LIST                 1000\r
-#define IDC_RADIO1                      1001\r
-#define IDC_COMBO1                      1001\r
-#define IDC_RADIO2                      1002\r
-#define IDC_GREETING                    1003\r
-#define IDC_CHECK1                      1016\r
-#define IDC_DEFAULT_PRINTER             1016\r
-#define IDC_PRINTER_IMAGE               1017\r
-#define IDC_PRINTER_NAME                1018\r
-#define IDC_PRINTER_MANUFACTURER        1019\r
-#define IDC_PRINTER_MODEL               1020\r
-#define IDC_GOODBYE                     1021\r
-#define IDC_PRINTER_PORT                1022\r
-#define IDC_PRINTER_PROTOCOL            1022\r
-#define IDC_PRINTER_DEFAULT             1023\r
-#define IDC_PRINTER_SELECTION_TEXT      1024\r
-#define IDC_HAVE_DISK                   1025\r
-#define IDC_PRINTER_INFORMATION         1026\r
-#define IDC_LOCATION_LABEL              1029\r
-#define IDC_DESCRIPTION_FIELD           1030\r
-#define IDC_LOCATION_FIELD              1032\r
-#define IDC_DESCRIPTION_LABEL           1033\r
-#define IDC_COMPLETE1                                  1034\r
-#define IDC_COMPLETE2                                  1035\r
-#define IDC_INSTALLING                                 1036\r
-#define IDC_PROGRESS                                   1037\r
-\r
-// Next default values for new objects\r
-//\r
-#ifdef APSTUDIO_INVOKED\r
-#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE        142\r
-#define _APS_NEXT_COMMAND_VALUE         32771\r
-#define _APS_NEXT_CONTROL_VALUE         1034\r
-#define _APS_NEXT_SYMED_VALUE           101\r
-#endif\r
-#endif\r
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by PrinterSetupWizard.rc
+//
+#define IDM_ABOUTBOX                    0x0010
+#define IDD_ABOUTBOX                    100
+#define IDS_ABOUTBOX                    101
+#define IDD_PRINTERSETUPWIZARD_DIALOG   102
+#define IDS_GOODBYE                     102
+#define IDS_GREETING                    103
+#define IDS_BROWSE_TITLE                104
+#define IDS_BROWSE_SUBTITLE             105
+#define IDS_CAPTION                     106
+#define IDD_FIRST_PAGE                  107
+#define IDS_GOODBYE_GOOD1               107
+#define IDS_SEARCHING                   108
+#define IDD_SECOND_PAGE                 109
+#define IDS_GOODBYTE_GOOD2              109
+#define IDS_INSTALL_TITLE               110
+#define IDS_INSTALL_SUBTITLE            111
+#define IDS_ERROR_SELECTING_PRINTER_TEXT 112
+#define IDS_ERROR_SELECTING_PRINTER_CAPTION 113
+#define IDS_INSTALL_ERROR_CAPTION       114
+#define IDS_INSTALL_ERROR_MESSAGE       115
+#define IDS_MANUFACTURER_HEADING        116
+#define IDS_MODEL_HEADING               117
+#define IDS_NO_PRINTERS                 118
+#define IDS_NO_MDNSRESPONDER_SERVICE_TEXT 119
+#define IDS_NO_MDNSRESPONDER_SERVICE_CAPTION 120
+#define IDS_PRINTER_MATCH_GOOD          121
+#define IDS_PRINTER_MATCH_BAD           122
+#define IDS_YES                         123
+#define IDS_NO                          124
+#define IDS_LARGE_FONT                  125
+#define IDS_FIREWALL                    126
+#define IDS_ERROR_CAPTION               127
+#define IDR_MAINFRAME                   128
+#define IDS_FIREWALL_CAPTION            128
+#define IDB_BANNER_ICON                 129
+#define IDD_THIRD_PAGE                  130
+#define IDB_WATERMARK                   131
+#define IDD_FOURTH_PAGE                 132
+#define IDI_INFO                        136
+#define IDB_ABOUT                       138
+#define IDD_DIALOG1                     139
+#define IDI_ICON2                       141
+#define IDI_PRINTER                     141
+#define IDS_REINSTALL                                  142
+#define IDS_REINSTALL_CAPTION                  143
+#define IDC_INFO                                               144
+#define IDS_PRINTER_UNAVAILABLE         145
+#define IDS_BAD_INF_FILE                               150
+#define IDS_BAD_INF_FILE_CAPTION               151
+#define IDS_NO_MATCH_INF_FILE                  152
+#define IDS_NO_MATCH_INF_FILE_CAPTION  153
+#define IDC_BUTTON1                     1000
+#define IDC_LIST1                       1000
+#define IDC_BROWSE_LIST                 1000
+#define IDC_RADIO1                      1001
+#define IDC_COMBO1                      1001
+#define IDC_RADIO2                      1002
+#define IDC_GREETING                    1003
+#define IDC_CHECK1                      1016
+#define IDC_DEFAULT_PRINTER             1016
+#define IDC_PRINTER_IMAGE               1017
+#define IDC_PRINTER_NAME                1018
+#define IDC_PRINTER_MANUFACTURER        1019
+#define IDC_PRINTER_MODEL               1020
+#define IDC_GOODBYE                     1021
+#define IDC_PRINTER_PORT                1022
+#define IDC_PRINTER_PROTOCOL            1022
+#define IDC_PRINTER_DEFAULT             1023
+#define IDC_PRINTER_SELECTION_TEXT      1024
+#define IDC_HAVE_DISK                   1025
+#define IDC_PRINTER_INFORMATION         1026
+#define IDC_LOCATION_LABEL              1029
+#define IDC_DESCRIPTION_FIELD           1030
+#define IDC_LOCATION_FIELD              1032
+#define IDC_DESCRIPTION_LABEL           1033
+#define IDC_COMPLETE1                                  1034
+#define IDC_COMPLETE2                                  1035
+#define IDC_INSTALLING                                 1036
+#define IDC_PROGRESS                                   1037
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        142
+#define _APS_NEXT_COMMAND_VALUE         32771
+#define _APS_NEXT_CONTROL_VALUE         1034
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
index c6a2c81c576183d468cabe7c6fd4e45889c48ef3..f2437db05fedc7512f82e009e6f09d87717c60e2 100755 (executable)
@@ -1,95 +1,95 @@
-//{{NO_DEPENDENCIES}}\r
-// Microsoft Visual C++ generated include file.\r
-// Used by PrinterSetupWizardLocRes.rc\r
-//\r
-#define IDM_ABOUTBOX                    0x0010\r
-#define IDD_ABOUTBOX                    100\r
-#define IDS_ABOUTBOX                    101\r
-#define IDD_PRINTERSETUPWIZARD_DIALOG   102\r
-#define IDS_GOODBYE                     102\r
-#define IDS_GREETING                    103\r
-#define IDS_BROWSE_TITLE                104\r
-#define IDS_BROWSE_SUBTITLE             105\r
-#define IDS_CAPTION                     106\r
-#define IDD_FIRST_PAGE                  107\r
-#define IDS_GOODBYE_GOOD1               107\r
-#define IDS_SEARCHING                   108\r
-#define IDD_SECOND_PAGE                 109\r
-#define IDS_GOODBYTE_GOOD2              109\r
-#define IDS_INSTALL_TITLE               110\r
-#define IDS_INSTALL_SUBTITLE            111\r
-#define IDS_ERROR_SELECTING_PRINTER_TEXT 112\r
-#define IDS_ERROR_SELECTING_PRINTER_CAPTION 113\r
-#define IDS_INSTALL_ERROR_CAPTION       114\r
-#define IDS_INSTALL_ERROR_MESSAGE       115\r
-#define IDS_MANUFACTURER_HEADING        116\r
-#define IDS_MODEL_HEADING               117\r
-#define IDS_NO_PRINTERS                 118\r
-#define IDS_NO_MDNSRESPONDER_SERVICE_TEXT 119\r
-#define IDS_NO_MDNSRESPONDER_SERVICE_CAPTION 120\r
-#define IDS_PRINTER_MATCH_GOOD          121\r
-#define IDS_PRINTER_MATCH_BAD           122\r
-#define IDS_PRINTER_MATCH_MAYBE         146\r
-#define IDS_YES                         123\r
-#define IDS_NO                          124\r
-#define IDS_LARGE_FONT                  125\r
-#define IDS_FIREWALL                    126\r
-#define IDS_ERROR_CAPTION               127\r
-#define IDR_MAINFRAME                   128\r
-#define IDS_FIREWALL_CAPTION            128\r
-#define IDB_BANNER_ICON                 129\r
-#define IDD_THIRD_PAGE                  130\r
-#define IDB_WATERMARK                   131\r
-#define IDD_FOURTH_PAGE                 132\r
-#define IDI_INFO                        136\r
-#define IDB_ABOUT                       138\r
-#define IDD_DIALOG1                     139\r
-#define IDI_ICON2                       141\r
-#define IDI_PRINTER                     141\r
-#define IDS_REINSTALL                   142\r
-#define IDS_REINSTALL_CAPTION           143\r
-#define IDC_INFO                                                                144\r
-#define IDS_PRINTER_UNAVAILABLE         145\r
-#define IDS_BAD_INF_FILE                               150\r
-#define IDS_BAD_INF_FILE_CAPTION               151\r
-#define IDS_NO_MATCH_INF_FILE                  152\r
-#define IDS_NO_MATCH_INF_FILE_CAPTION  153\r
-#define IDC_BUTTON1                     1000\r
-#define IDC_LIST1                       1000\r
-#define IDC_BROWSE_LIST                 1000\r
-#define IDC_RADIO1                      1001\r
-#define IDC_COMBO1                      1001\r
-#define IDC_RADIO2                      1002\r
-#define IDC_GREETING                    1003\r
-#define IDC_CHECK1                      1016\r
-#define IDC_DEFAULT_PRINTER             1016\r
-#define IDC_PRINTER_IMAGE               1017\r
-#define IDC_PRINTER_NAME                1018\r
-#define IDC_PRINTER_MANUFACTURER        1019\r
-#define IDC_PRINTER_MODEL               1020\r
-#define IDC_GOODBYE                     1021\r
-#define IDC_PRINTER_PORT                1022\r
-#define IDC_PRINTER_PROTOCOL            1022\r
-#define IDC_PRINTER_DEFAULT             1023\r
-#define IDC_PRINTER_SELECTION_TEXT      1024\r
-#define IDC_HAVE_DISK                   1025\r
-#define IDC_PRINTER_INFORMATION         1026\r
-#define IDC_LOCATION_LABEL              1029\r
-#define IDC_DESCRIPTION_FIELD           1030\r
-#define IDC_LOCATION_FIELD              1032\r
-#define IDC_DESCRIPTION_LABEL           1033\r
-#define IDC_COMPLETE1                                  1034\r
-#define IDC_COMPLETE2                                  1035\r
-#define IDC_INSTALLING                                 1036\r
-#define IDC_PROGRESS                                   1037\r
-\r
-// Next default values for new objects\r
-// \r
-#ifdef APSTUDIO_INVOKED\r
-#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE        142\r
-#define _APS_NEXT_COMMAND_VALUE         32771\r
-#define _APS_NEXT_CONTROL_VALUE         1034\r
-#define _APS_NEXT_SYMED_VALUE           101\r
-#endif\r
-#endif\r
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by PrinterSetupWizardLocRes.rc
+//
+#define IDM_ABOUTBOX                    0x0010
+#define IDD_ABOUTBOX                    100
+#define IDS_ABOUTBOX                    101
+#define IDD_PRINTERSETUPWIZARD_DIALOG   102
+#define IDS_GOODBYE                     102
+#define IDS_GREETING                    103
+#define IDS_BROWSE_TITLE                104
+#define IDS_BROWSE_SUBTITLE             105
+#define IDS_CAPTION                     106
+#define IDD_FIRST_PAGE                  107
+#define IDS_GOODBYE_GOOD1               107
+#define IDS_SEARCHING                   108
+#define IDD_SECOND_PAGE                 109
+#define IDS_GOODBYTE_GOOD2              109
+#define IDS_INSTALL_TITLE               110
+#define IDS_INSTALL_SUBTITLE            111
+#define IDS_ERROR_SELECTING_PRINTER_TEXT 112
+#define IDS_ERROR_SELECTING_PRINTER_CAPTION 113
+#define IDS_INSTALL_ERROR_CAPTION       114
+#define IDS_INSTALL_ERROR_MESSAGE       115
+#define IDS_MANUFACTURER_HEADING        116
+#define IDS_MODEL_HEADING               117
+#define IDS_NO_PRINTERS                 118
+#define IDS_NO_MDNSRESPONDER_SERVICE_TEXT 119
+#define IDS_NO_MDNSRESPONDER_SERVICE_CAPTION 120
+#define IDS_PRINTER_MATCH_GOOD          121
+#define IDS_PRINTER_MATCH_BAD           122
+#define IDS_PRINTER_MATCH_MAYBE         146
+#define IDS_YES                         123
+#define IDS_NO                          124
+#define IDS_LARGE_FONT                  125
+#define IDS_FIREWALL                    126
+#define IDS_ERROR_CAPTION               127
+#define IDR_MAINFRAME                   128
+#define IDS_FIREWALL_CAPTION            128
+#define IDB_BANNER_ICON                 129
+#define IDD_THIRD_PAGE                  130
+#define IDB_WATERMARK                   131
+#define IDD_FOURTH_PAGE                 132
+#define IDI_INFO                        136
+#define IDB_ABOUT                       138
+#define IDD_DIALOG1                     139
+#define IDI_ICON2                       141
+#define IDI_PRINTER                     141
+#define IDS_REINSTALL                   142
+#define IDS_REINSTALL_CAPTION           143
+#define IDC_INFO                                                                144
+#define IDS_PRINTER_UNAVAILABLE         145
+#define IDS_BAD_INF_FILE                               150
+#define IDS_BAD_INF_FILE_CAPTION               151
+#define IDS_NO_MATCH_INF_FILE                  152
+#define IDS_NO_MATCH_INF_FILE_CAPTION  153
+#define IDC_BUTTON1                     1000
+#define IDC_LIST1                       1000
+#define IDC_BROWSE_LIST                 1000
+#define IDC_RADIO1                      1001
+#define IDC_COMBO1                      1001
+#define IDC_RADIO2                      1002
+#define IDC_GREETING                    1003
+#define IDC_CHECK1                      1016
+#define IDC_DEFAULT_PRINTER             1016
+#define IDC_PRINTER_IMAGE               1017
+#define IDC_PRINTER_NAME                1018
+#define IDC_PRINTER_MANUFACTURER        1019
+#define IDC_PRINTER_MODEL               1020
+#define IDC_GOODBYE                     1021
+#define IDC_PRINTER_PORT                1022
+#define IDC_PRINTER_PROTOCOL            1022
+#define IDC_PRINTER_DEFAULT             1023
+#define IDC_PRINTER_SELECTION_TEXT      1024
+#define IDC_HAVE_DISK                   1025
+#define IDC_PRINTER_INFORMATION         1026
+#define IDC_LOCATION_LABEL              1029
+#define IDC_DESCRIPTION_FIELD           1030
+#define IDC_LOCATION_FIELD              1032
+#define IDC_DESCRIPTION_LABEL           1033
+#define IDC_COMPLETE1                                  1034
+#define IDC_COMPLETE2                                  1035
+#define IDC_INSTALLING                                 1036
+#define IDC_PROGRESS                                   1037
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        142
+#define _APS_NEXT_COMMAND_VALUE         32771
+#define _APS_NEXT_CONTROL_VALUE         1034
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
index 1845b124542db793a55581a8e4d52f7bdbf8e493..fe3bb8e0f206997377d0461eaf86387fad22b07a 100755 (executable)
@@ -1,94 +1,94 @@
-//{{NO_DEPENDENCIES}}\r
-// Microsoft Visual C++ generated include file.\r
-// Used by PrinterSetupWizard.rc\r
-//\r
-#define IDM_ABOUTBOX                    0x0010\r
-#define IDD_ABOUTBOX                    100\r
-#define IDS_ABOUTBOX                    101\r
-#define IDD_PRINTERSETUPWIZARD_DIALOG   102\r
-#define IDS_GOODBYE                     102\r
-#define IDS_GREETING                    103\r
-#define IDS_BROWSE_TITLE                104\r
-#define IDS_BROWSE_SUBTITLE             105\r
-#define IDS_CAPTION                     106\r
-#define IDD_FIRST_PAGE                  107\r
-#define IDS_GOODBYE_GOOD1               107\r
-#define IDS_SEARCHING                   108\r
-#define IDD_SECOND_PAGE                 109\r
-#define IDS_GOODBYTE_GOOD2              109\r
-#define IDS_INSTALL_TITLE               110\r
-#define IDS_INSTALL_SUBTITLE            111\r
-#define IDS_ERROR_SELECTING_PRINTER_TEXT 112\r
-#define IDS_ERROR_SELECTING_PRINTER_CAPTION 113\r
-#define IDS_INSTALL_ERROR_CAPTION       114\r
-#define IDS_INSTALL_ERROR_MESSAGE       115\r
-#define IDS_MANUFACTURER_HEADING        116\r
-#define IDS_MODEL_HEADING               117\r
-#define IDS_NO_PRINTERS                 118\r
-#define IDS_NO_MDNSRESPONDER_SERVICE_TEXT 119\r
-#define IDS_NO_MDNSRESPONDER_SERVICE_CAPTION 120\r
-#define IDS_PRINTER_MATCH_GOOD          121\r
-#define IDS_PRINTER_MATCH_BAD           122\r
-#define IDS_YES                         123\r
-#define IDS_NO                          124\r
-#define IDS_LARGE_FONT                  125\r
-#define IDS_FIREWALL                    126\r
-#define IDS_ERROR_CAPTION               127\r
-#define IDR_MAINFRAME                   128\r
-#define IDS_FIREWALL_CAPTION            128\r
-#define IDB_BANNER_ICON                 129\r
-#define IDD_THIRD_PAGE                  130\r
-#define IDB_WATERMARK                   131\r
-#define IDD_FOURTH_PAGE                 132\r
-#define IDI_INFO                        136\r
-#define IDB_ABOUT                       138\r
-#define IDD_DIALOG1                     139\r
-#define IDI_ICON2                       141\r
-#define IDI_PRINTER                     141\r
-#define IDS_REINSTALL                                  142\r
-#define IDS_REINSTALL_CAPTION                  143\r
-#define IDC_INFO                                               144\r
-#define IDS_PRINTER_UNAVAILABLE         145\r
-#define IDS_BAD_INF_FILE                               150\r
-#define IDS_BAD_INF_FILE_CAPTION               151\r
-#define IDS_NO_MATCH_INF_FILE                  152\r
-#define IDS_NO_MATCH_INF_FILE_CAPTION  153\r
-#define IDC_BUTTON1                     1000\r
-#define IDC_LIST1                       1000\r
-#define IDC_BROWSE_LIST                 1000\r
-#define IDC_RADIO1                      1001\r
-#define IDC_COMBO1                      1001\r
-#define IDC_RADIO2                      1002\r
-#define IDC_GREETING                    1003\r
-#define IDC_CHECK1                      1016\r
-#define IDC_DEFAULT_PRINTER             1016\r
-#define IDC_PRINTER_IMAGE               1017\r
-#define IDC_PRINTER_NAME                1018\r
-#define IDC_PRINTER_MANUFACTURER        1019\r
-#define IDC_PRINTER_MODEL               1020\r
-#define IDC_GOODBYE                     1021\r
-#define IDC_PRINTER_PORT                1022\r
-#define IDC_PRINTER_PROTOCOL            1022\r
-#define IDC_PRINTER_DEFAULT             1023\r
-#define IDC_PRINTER_SELECTION_TEXT      1024\r
-#define IDC_HAVE_DISK                   1025\r
-#define IDC_PRINTER_INFORMATION         1026\r
-#define IDC_LOCATION_LABEL              1029\r
-#define IDC_DESCRIPTION_FIELD           1030\r
-#define IDC_LOCATION_FIELD              1032\r
-#define IDC_DESCRIPTION_LABEL           1033\r
-#define IDC_COMPLETE1                                  1034\r
-#define IDC_COMPLETE2                                  1035\r
-#define IDC_INSTALLING                                 1036\r
-#define IDC_PROGRESS                                   1037\r
-\r
-// Next default values for new objects\r
-// \r
-#ifdef APSTUDIO_INVOKED\r
-#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE        142\r
-#define _APS_NEXT_COMMAND_VALUE         32771\r
-#define _APS_NEXT_CONTROL_VALUE         1034\r
-#define _APS_NEXT_SYMED_VALUE           101\r
-#endif\r
-#endif\r
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by PrinterSetupWizard.rc
+//
+#define IDM_ABOUTBOX                    0x0010
+#define IDD_ABOUTBOX                    100
+#define IDS_ABOUTBOX                    101
+#define IDD_PRINTERSETUPWIZARD_DIALOG   102
+#define IDS_GOODBYE                     102
+#define IDS_GREETING                    103
+#define IDS_BROWSE_TITLE                104
+#define IDS_BROWSE_SUBTITLE             105
+#define IDS_CAPTION                     106
+#define IDD_FIRST_PAGE                  107
+#define IDS_GOODBYE_GOOD1               107
+#define IDS_SEARCHING                   108
+#define IDD_SECOND_PAGE                 109
+#define IDS_GOODBYTE_GOOD2              109
+#define IDS_INSTALL_TITLE               110
+#define IDS_INSTALL_SUBTITLE            111
+#define IDS_ERROR_SELECTING_PRINTER_TEXT 112
+#define IDS_ERROR_SELECTING_PRINTER_CAPTION 113
+#define IDS_INSTALL_ERROR_CAPTION       114
+#define IDS_INSTALL_ERROR_MESSAGE       115
+#define IDS_MANUFACTURER_HEADING        116
+#define IDS_MODEL_HEADING               117
+#define IDS_NO_PRINTERS                 118
+#define IDS_NO_MDNSRESPONDER_SERVICE_TEXT 119
+#define IDS_NO_MDNSRESPONDER_SERVICE_CAPTION 120
+#define IDS_PRINTER_MATCH_GOOD          121
+#define IDS_PRINTER_MATCH_BAD           122
+#define IDS_YES                         123
+#define IDS_NO                          124
+#define IDS_LARGE_FONT                  125
+#define IDS_FIREWALL                    126
+#define IDS_ERROR_CAPTION               127
+#define IDR_MAINFRAME                   128
+#define IDS_FIREWALL_CAPTION            128
+#define IDB_BANNER_ICON                 129
+#define IDD_THIRD_PAGE                  130
+#define IDB_WATERMARK                   131
+#define IDD_FOURTH_PAGE                 132
+#define IDI_INFO                        136
+#define IDB_ABOUT                       138
+#define IDD_DIALOG1                     139
+#define IDI_ICON2                       141
+#define IDI_PRINTER                     141
+#define IDS_REINSTALL                                  142
+#define IDS_REINSTALL_CAPTION                  143
+#define IDC_INFO                                               144
+#define IDS_PRINTER_UNAVAILABLE         145
+#define IDS_BAD_INF_FILE                               150
+#define IDS_BAD_INF_FILE_CAPTION               151
+#define IDS_NO_MATCH_INF_FILE                  152
+#define IDS_NO_MATCH_INF_FILE_CAPTION  153
+#define IDC_BUTTON1                     1000
+#define IDC_LIST1                       1000
+#define IDC_BROWSE_LIST                 1000
+#define IDC_RADIO1                      1001
+#define IDC_COMBO1                      1001
+#define IDC_RADIO2                      1002
+#define IDC_GREETING                    1003
+#define IDC_CHECK1                      1016
+#define IDC_DEFAULT_PRINTER             1016
+#define IDC_PRINTER_IMAGE               1017
+#define IDC_PRINTER_NAME                1018
+#define IDC_PRINTER_MANUFACTURER        1019
+#define IDC_PRINTER_MODEL               1020
+#define IDC_GOODBYE                     1021
+#define IDC_PRINTER_PORT                1022
+#define IDC_PRINTER_PROTOCOL            1022
+#define IDC_PRINTER_DEFAULT             1023
+#define IDC_PRINTER_SELECTION_TEXT      1024
+#define IDC_HAVE_DISK                   1025
+#define IDC_PRINTER_INFORMATION         1026
+#define IDC_LOCATION_LABEL              1029
+#define IDC_DESCRIPTION_FIELD           1030
+#define IDC_LOCATION_FIELD              1032
+#define IDC_DESCRIPTION_LABEL           1033
+#define IDC_COMPLETE1                                  1034
+#define IDC_COMPLETE2                                  1035
+#define IDC_INSTALLING                                 1036
+#define IDC_PROGRESS                                   1037
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        142
+#define _APS_NEXT_COMMAND_VALUE         32771
+#define _APS_NEXT_CONTROL_VALUE         1034
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/Clients/PrinterSetupWizard/tcpxcv.h b/Clients/PrinterSetupWizard/tcpxcv.h
new file mode 100755 (executable)
index 0000000..a28e34a
--- /dev/null
@@ -0,0 +1,107 @@
+/*++
+
+Copyright (c) 1997 - 1999  Hewlett-Packard Company.
+Copyright (c) 1997 - 1999  Microsoft Corporation
+All rights reserved
+
+Module Name:
+
+   tcpxcv.h
+
+--*/
+/*
+ * This file is contained in WinDDK 6001.18002
+ */
+
+#ifndef _TCPXCV_
+#define _TCPXCV_
+
+#if (!defined(UNKNOWN_PROTOCOL))
+    #define UNKNOWN_PROTOCOL        0
+    #define PROTOCOL_UNKNOWN_TYPE   UNKNOWN_PROTOCOL
+#endif
+
+#if (!defined(RAWTCP))
+#define RAWTCP                          1
+#define PROTOCOL_RAWTCP_TYPE            RAWTCP
+#endif
+
+#if (!defined(LPR))
+#define LPR                             2
+#define PROTOCOL_LPR_TYPE               LPR
+#endif
+
+#define MAX_PORTNAME_LEN                63 +1       // port name length
+#define MAX_NETWORKNAME_LEN             48 +1       // host name length
+#define MAX_NETWORKNAME2_LEN            128         // host name or IPv6 address
+#define MAX_SNMP_COMMUNITY_STR_LEN      32 +1       // SNMP Community String Name
+#define MAX_QUEUENAME_LEN               32 +1       // lpr print que name
+#define MAX_IPADDR_STR_LEN              15 +1       // ip address; string version
+#define MAX_ADDRESS_STR_LEN             12 +1       // hw address length
+#define MAX_DEVICEDESCRIPTION_STR_LEN   256+1
+
+
+
+typedef struct _PORT_DATA_1
+{
+    WCHAR  sztPortName[MAX_PORTNAME_LEN];
+    DWORD  dwVersion;
+    DWORD  dwProtocol;
+    DWORD  cbSize;
+    DWORD  dwReserved;
+    WCHAR  sztHostAddress[MAX_NETWORKNAME_LEN];
+    WCHAR  sztSNMPCommunity[MAX_SNMP_COMMUNITY_STR_LEN];
+    DWORD  dwDoubleSpool;
+    WCHAR  sztQueue[MAX_QUEUENAME_LEN];
+    WCHAR  sztIPAddress[MAX_IPADDR_STR_LEN];
+    BYTE   Reserved[540];
+    DWORD  dwPortNumber;
+    DWORD  dwSNMPEnabled;
+    DWORD  dwSNMPDevIndex;
+}   PORT_DATA_1, *PPORT_DATA_1;
+
+typedef struct _PORT_DATA_2
+{
+    WCHAR  sztPortName[MAX_PORTNAME_LEN];
+    DWORD  dwVersion;
+    DWORD  dwProtocol;
+    DWORD  cbSize;
+    DWORD  dwReserved;
+    WCHAR  sztHostAddress [MAX_NETWORKNAME2_LEN];
+    WCHAR  sztSNMPCommunity[MAX_SNMP_COMMUNITY_STR_LEN];
+    DWORD  dwDoubleSpool;
+    WCHAR  sztQueue[MAX_QUEUENAME_LEN];
+    BYTE   Reserved[514];
+    DWORD  dwPortNumber;
+    DWORD  dwSNMPEnabled;
+    DWORD  dwSNMPDevIndex;
+    DWORD  dwPortMonitorMibIndex;
+}   PORT_DATA_2, *PPORT_DATA_2;
+
+
+typedef struct _PORT_DATA_LIST_1
+{
+    DWORD dwVersion;
+    DWORD cPortData;
+    PORT_DATA_2 pPortData[1];
+}   PORT_DATA_LIST_1, *PPORT_DATA_LIST_1;
+
+
+typedef struct _DELETE_PORT_DATA_1
+{
+    WCHAR  psztPortName[MAX_PORTNAME_LEN];
+    BYTE   Reserved[98];
+    DWORD  dwVersion;
+    DWORD  dwReserved;
+}   DELETE_PORT_DATA_1, *PDELETE_PORT_DATA_1;
+
+
+typedef struct _CONFIG_INFO_DATA_1
+{
+    BYTE   Reserved[128];
+    DWORD  dwVersion;
+}   CONFIG_INFO_DATA_1, *PCONFIG_INFO_DATA_1;
+
+
+
+#endif
index 1b3661cc89cf2bd7949e97c752711502f97a2278..da6a08c9a620b376dafe70c3225ca69e75437e47 100755 (executable)
@@ -1,75 +1,75 @@
-/* -*- Mode: C; tab-width: 4 -*-\r
- *\r
- * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-using System.Reflection;\r
-using System.Runtime.CompilerServices;\r
-\r
-//\r
-// General Information about an assembly is controlled through the following \r
-// set of attributes. Change these attribute values to modify the information\r
-// associated with an assembly.\r
-//\r
-[assembly: AssemblyTitle("")]\r
-[assembly: AssemblyDescription("")]\r
-[assembly: AssemblyConfiguration("")]\r
-[assembly: AssemblyCompany("")]\r
-[assembly: AssemblyProduct("")]\r
-[assembly: AssemblyCopyright("")]\r
-[assembly: AssemblyTrademark("")]\r
-[assembly: AssemblyCulture("")]                \r
-\r
-//\r
-// Version information for an assembly consists of the following four values:\r
-//\r
-//      Major Version\r
-//      Minor Version \r
-//      Build Number\r
-//      Revision\r
-//\r
-// You can specify all the values or you can default the Revision and Build Numbers \r
-// by using the '*' as shown below:\r
-\r
-[assembly: AssemblyVersion("1.0.*")]\r
-\r
-//\r
-// In order to sign your assembly you must specify a key to use. Refer to the \r
-// Microsoft .NET Framework documentation for more information on assembly signing.\r
-//\r
-// Use the attributes below to control which key is used for signing. \r
-//\r
-// Notes: \r
-//   (*) If no key is specified, the assembly is not signed.\r
-//   (*) KeyName refers to a key that has been installed in the Crypto Service\r
-//       Provider (CSP) on your machine. KeyFile refers to a file which contains\r
-//       a key.\r
-//   (*) If the KeyFile and the KeyName values are both specified, the \r
-//       following processing occurs:\r
-//       (1) If the KeyName can be found in the CSP, that key is used.\r
-//       (2) If the KeyName does not exist and the KeyFile does exist, the key \r
-//           in the KeyFile is installed into the CSP and used.\r
-//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.\r
-//       When specifying the KeyFile, the location of the KeyFile should be\r
-//       relative to the project output directory which is\r
-//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is\r
-//       located in the project directory, you would specify the AssemblyKeyFile \r
-//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]\r
-//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework\r
-//       documentation for more information on this.\r
-//\r
-[assembly: AssemblyDelaySign(false)]\r
-[assembly: AssemblyKeyFile("")]\r
-[assembly: AssemblyKeyName("")]\r
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]                
+
+//
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the 
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing. 
+//
+// Notes: 
+//   (*) If no key is specified, the assembly is not signed.
+//   (*) KeyName refers to a key that has been installed in the Crypto Service
+//       Provider (CSP) on your machine. KeyFile refers to a file which contains
+//       a key.
+//   (*) If the KeyFile and the KeyName values are both specified, the 
+//       following processing occurs:
+//       (1) If the KeyName can be found in the CSP, that key is used.
+//       (2) If the KeyName does not exist and the KeyFile does exist, the key 
+//           in the KeyFile is installed into the CSP and used.
+//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+//       When specifying the KeyFile, the location of the KeyFile should be
+//       relative to the project output directory which is
+//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+//       located in the project directory, you would specify the AssemblyKeyFile 
+//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+//       documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
index a80011a4aec35a3a2af676b1d5b9fee6992e102a..e3887f3b1ca045cff69b5742d6db0c0ee10fb5bb 100755 (executable)
@@ -1,4 +1,5 @@
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">\r
   <PropertyGroup>\r
     <ProjectType>Local</ProjectType>\r
     <ProductVersion>8.0.50727</ProductVersion>\r
@@ -24,6 +25,8 @@
     </FileUpgradeFlags>\r
     <UpgradeBackupLocation>\r
     </UpgradeBackupLocation>\r
+    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\r
+    <OldToolsVersion>2.0</OldToolsVersion>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <OutputPath>bin\Debug\</OutputPath>\r
index 32191cbe819b009215150764eb410acf6967addc..338bdb78b0ac31da3bb29ffac5dac8b9cff48074 100755 (executable)
@@ -41,24 +41,15 @@ namespace SimpleChat.NET
                private System.Windows.Forms.Label      label1;
 
         private Bonjour.DNSSDEventManager       m_eventManager = null;
-
         private Bonjour.DNSSDService            m_service = null;
-
         private Bonjour.DNSSDService            m_registrar = null;
-
         private Bonjour.DNSSDService            m_browser = null;
-
         private Bonjour.DNSSDService            m_resolver = null;
                private String                                          m_name;
-
         private Socket                          m_socket = null;
-
         private const int                       BUFFER_SIZE = 1024;
-
         public byte[]                           m_buffer = new byte[BUFFER_SIZE];
-
         public bool                             m_complete = false;
-
         public StringBuilder                    m_sb = new StringBuilder();
 
         delegate void                           ReadMessageCallback(String data);
@@ -75,51 +66,30 @@ namespace SimpleChat.NET
                // Called by DNSServices core as a result of Register()
                // call
                //
-
-
-
         public void
-
         ServiceRegistered
-
                     (
-
                     DNSSDService service,
-
                     DNSSDFlags flags,
-
                     String name,
-
                     String regType,
-
                     String domain
-
                     )
-
         {
-
             m_name = name;
 
-
-
+                       //
+                       // Try to start browsing for other instances of this service
+                       //
             try
-
             {
-
                 m_browser = m_service.Browse(0, 0, "_p2pchat._udp", null, m_eventManager);
-
             }
-
             catch
-
             {
-
                 MessageBox.Show("Browse Failed", "Error");
-
                 Application.Exit();
-
             }
-
         }
 
                //
@@ -127,7 +97,6 @@ namespace SimpleChat.NET
                //
                // Called by DNSServices core as a result of a Browse call
                //
-
                public void
         ServiceFound
                                    (
@@ -139,96 +108,50 @@ namespace SimpleChat.NET
                     String          domain
                                    )
                {
-
             if (serviceName != m_name)
-
             {
-
                 PeerData peer = new PeerData();
 
-
-
                 peer.InterfaceIndex = ifIndex;
-
                 peer.Name = serviceName;
-
                 peer.Type = regType;
-
                 peer.Domain = domain;
-
                 peer.Address = null;
 
-
-
                 comboBox1.Items.Add(peer);
 
-
-
                 if (comboBox1.Items.Count == 1)
-
                 {
-
                     comboBox1.SelectedIndex = 0;
-
                 }
-
             }
                }
 
-
-
         //
-
         // ServiceLost
-
         //
-
         // Called by DNSServices core as a result of a Browse call
-
         //
-
-
-
         public void
-
         ServiceLost
-
                     (
-
                     DNSSDService sref,
-
                     DNSSDFlags flags,
-
                     uint ifIndex,
-
                     String serviceName,
-
                     String regType,
-
                     String domain
-
                     )
-
         {
-
             PeerData peer = new PeerData();
 
-
-
             peer.InterfaceIndex = ifIndex;
-
             peer.Name = serviceName;
-
             peer.Type = regType;
-
             peer.Domain = domain;
-
             peer.Address = null;
 
-
-
             comboBox1.Items.Remove(peer);
-
         }
 
                //
@@ -237,61 +160,36 @@ namespace SimpleChat.NET
                // Called by DNSServices core as a result of DNSService.Resolve()
                // call
                //
-
-
         public void
-
         ServiceResolved
-
                     (
-
                     DNSSDService sref,
-
                     DNSSDFlags flags,
-
                     uint ifIndex,
-
                     String fullName,
-
                     String hostName,
-
                     ushort port,
-
                     TXTRecord txtRecord
-
                     )
                {
-
             m_resolver.Stop();
-
             m_resolver = null;
 
-
-
             PeerData peer = (PeerData)comboBox1.SelectedItem;
 
-
-
             peer.Port = port;
 
-
-
+                       //
+                       // Query for the IP address associated with "hostName"
+                       //
             try
-
             {
-
                 m_resolver = m_service.QueryRecord(0, ifIndex, hostName, DNSSDRRType.kDNSSDType_A, DNSSDRRClass.kDNSSDClass_IN, m_eventManager );
-
             }
-
             catch
-
             {
-
                 MessageBox.Show("QueryRecord Failed", "Error");
-
                 Application.Exit();
-
             }
                }
 
@@ -301,7 +199,6 @@ namespace SimpleChat.NET
                // Called by DNSServices core as a result of DNSService.QueryRecord()
                // call
                //
-
                public void
                QueryAnswered
                        (
@@ -315,90 +212,54 @@ namespace SimpleChat.NET
             uint            ttl
             )
         {
-
+                       //
+                       // Stop the resolve to reduce the burden on the network
+                       //
             m_resolver.Stop();
-
             m_resolver = null;
 
-
-
             PeerData peer = (PeerData) comboBox1.SelectedItem;
-
-
                        uint bits = BitConverter.ToUInt32( (Byte[])rdata, 0);
                        System.Net.IPAddress address = new System.Net.IPAddress(bits);
 
             peer.Address = address;
                }
 
-
-
         public void
-
         OperationFailed
-
                     (
-
                     DNSSDService service,
-
                     DNSSDError error
-
                     )
-
         {
-
             MessageBox.Show("Operation returned an error code " + error, "Error");
-
         }
 
-
-
         //
-
         // OnReadMessage
-
         //
-
         // Called when there is data to be read on a socket
-
         //
-
         // This is called (indirectly) from OnReadSocket()
-
         //
-
         private void
-
         OnReadMessage
-
                 (
-
                 String msg
-
                 )
-
         {
-
             int rgb = 0;
 
-
-
             for (int i = 0; i < msg.Length && msg[i] != ':'; i++)
-
             {
-
                 rgb = rgb ^ ((int)msg[i] << (i % 3 + 2) * 8);
 
             }
 
-
-
             Color color = Color.FromArgb(rgb & 0x007F7FFF);
 
             richTextBox1.SelectionColor = color;
-
             richTextBox1.AppendText(msg + Environment.NewLine);
-
         }
 
                //
@@ -439,42 +300,30 @@ namespace SimpleChat.NET
                        //
                        InitializeComponent();
 
-
-
             try
-
             {
-
                 m_service = new DNSSDService();
-
             }
-
             catch
-
             {
-
                 MessageBox.Show("Bonjour Service is not available", "Error");
-
                 Application.Exit();
-
             }
 
-
-
+                       //
+                       // Associate event handlers with all the Bonjour events that the app is interested in.
+                       //
             m_eventManager = new DNSSDEventManager();
-
             m_eventManager.ServiceRegistered += new _IDNSSDEvents_ServiceRegisteredEventHandler(this.ServiceRegistered);
-
             m_eventManager.ServiceFound += new _IDNSSDEvents_ServiceFoundEventHandler(this.ServiceFound);
-
             m_eventManager.ServiceLost += new _IDNSSDEvents_ServiceLostEventHandler(this.ServiceLost);
-
             m_eventManager.ServiceResolved += new _IDNSSDEvents_ServiceResolvedEventHandler(this.ServiceResolved);
-
             m_eventManager.QueryRecordAnswered += new _IDNSSDEvents_QueryRecordAnsweredEventHandler(this.QueryAnswered);
-
             m_eventManager.OperationFailed += new _IDNSSDEvents_OperationFailedEventHandler(this.OperationFailed);
 
+                       //
+                       // Socket read handler
+                       //
                        m_readMessageCallback = new ReadMessageCallback(OnReadMessage);
 
                        this.Load += new System.EventHandler(this.Form1_Load);
@@ -505,26 +354,15 @@ namespace SimpleChat.NET
                                        m_browser.Stop();
                                }
 
-
-
                 if (m_resolver != null)
-
                 {
-
                     m_resolver.Stop();
-
                 }
 
-
-
                 m_eventManager.ServiceFound -= new _IDNSSDEvents_ServiceFoundEventHandler(this.ServiceFound);
-
                 m_eventManager.ServiceLost -= new _IDNSSDEvents_ServiceLostEventHandler(this.ServiceLost);
-
                 m_eventManager.ServiceResolved -= new _IDNSSDEvents_ServiceResolvedEventHandler(this.ServiceResolved);
-
                 m_eventManager.QueryRecordAnswered -= new _IDNSSDEvents_QueryRecordAnsweredEventHandler(this.QueryAnswered);
-
                 m_eventManager.OperationFailed -= new _IDNSSDEvents_OperationFailedEventHandler(this.OperationFailed);
                        }
                        base.Dispose( disposing );
@@ -711,101 +549,53 @@ namespace SimpleChat.NET
                }
        }
 
-
-
     //
-
     // PeerData
-
     //
-
     // Holds onto the information associated with a peer on the network
-
     //
-
     public class PeerData
-
     {
-
         public uint InterfaceIndex;
-
         public String Name;
-
         public String Type;
-
         public String Domain;
-
         public IPAddress Address;
-
         public int Port;
 
-
-
         public override String
-
         ToString()
-
         {
-
             return Name;
-
         }
 
-
-
         public override bool
-
         Equals(object other)
-
         {
-
             bool result = false;
 
-
-
             if (other != null)
-
             {
-
                 if ((object)this == other)
-
                 {
-
                     result = true;
-
                 }
-
                 else if (other is PeerData)
-
                 {
-
                     PeerData otherPeerData = (PeerData)other;
 
-
-
                     result = (this.Name == otherPeerData.Name);
-
                 }
-
             }
 
-
-
             return result;
-
         }
 
 
-
         public override int
-
         GetHashCode()
-
         {
-
             return Name.GetHashCode();
-
         }
-
     };
 }
index 8ec366675f3040589d6c90667ed5bef5e7d2ad88..9fc20193e9512d322a72911d69559a91bc13d439 100644 (file)
@@ -1,7 +1,7 @@
 '------------------------------------------------------------------------------\r
 ' <auto-generated>\r
 '     This code was generated by a tool.\r
-'     Runtime Version:2.0.50727.4918\r
+'     Runtime Version:4.0.30319.235\r
 '\r
 '     Changes to this file may cause incorrect behavior and will be lost if\r
 '     the code is regenerated.\r
index babd06fb44962db3e6e5d82711cf4e93e5d4ffbf..537826c17644c4dc2b17631e31adc832c01f43ef 100644 (file)
@@ -1,7 +1,7 @@
 '------------------------------------------------------------------------------\r
 ' <auto-generated>\r
 '     This code was generated by a tool.\r
-'     Runtime Version:2.0.50727.4918\r
+'     Runtime Version:4.0.30319.235\r
 '\r
 '     Changes to this file may cause incorrect behavior and will be lost if\r
 '     the code is regenerated.\r
@@ -11,6 +11,7 @@
 Option Strict On\r
 Option Explicit On\r
 \r
+Imports System\r
 \r
 Namespace My.Resources\r
     \r
@@ -18,10 +19,10 @@ Namespace My.Resources
     'class via a tool like ResGen or Visual Studio.\r
     'To add or remove a member, edit your .ResX file then rerun ResGen\r
     'with the /str option, or rebuild your VS project.\r
-    '<summary>\r
-    '  A strongly-typed resource class, for looking up localized strings, etc.\r
-    '</summary>\r
-    <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0"),  _\r
+    '''<summary>\r
+    '''  A strongly-typed resource class, for looking up localized strings, etc.\r
+    '''</summary>\r
+    <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"),  _\r
      Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _\r
      Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(),  _\r
      Global.Microsoft.VisualBasic.HideModuleNameAttribute()>  _\r
@@ -31,9 +32,9 @@ Namespace My.Resources
         \r
         Private resourceCulture As Global.System.Globalization.CultureInfo\r
         \r
-        '<summary>\r
-        '  Returns the cached ResourceManager instance used by this class.\r
-        '</summary>\r
+        '''<summary>\r
+        '''  Returns the cached ResourceManager instance used by this class.\r
+        '''</summary>\r
         <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)>  _\r
         Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager\r
             Get\r
@@ -45,16 +46,16 @@ Namespace My.Resources
             End Get\r
         End Property\r
         \r
-        '<summary>\r
-        '  Overrides the current thread's CurrentUICulture property for all\r
-        '  resource lookups using this strongly typed resource class.\r
-        '</summary>\r
+        '''<summary>\r
+        '''  Overrides the current thread's CurrentUICulture property for all\r
+        '''  resource lookups using this strongly typed resource class.\r
+        '''</summary>\r
         <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)>  _\r
         Friend Property Culture() As Global.System.Globalization.CultureInfo\r
             Get\r
                 Return resourceCulture\r
             End Get\r
-            Set(ByVal value As Global.System.Globalization.CultureInfo)\r
+            Set\r
                 resourceCulture = value\r
             End Set\r
         End Property\r
index 259ca35b8aec41f084bb5dc91ebe78864cadd9af..54768dd9d00110993efd36caec5719281aebe987 100644 (file)
@@ -1,7 +1,7 @@
 '------------------------------------------------------------------------------\r
 ' <auto-generated>\r
 '     This code was generated by a tool.\r
-'     Runtime Version:2.0.50727.4918\r
+'     Runtime Version:4.0.30319.235\r
 '\r
 '     Changes to this file may cause incorrect behavior and will be lost if\r
 '     the code is regenerated.\r
@@ -13,27 +13,27 @@ Option Explicit On
 \r
 \r
 Namespace My\r
-\r
+    \r
     <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(),  _\r
-     Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0"),  _\r
+     Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0"),  _\r
      Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)>  _\r
     Partial Friend NotInheritable Class MySettings\r
         Inherits Global.System.Configuration.ApplicationSettingsBase\r
         \r
-        Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)\r
+        Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)\r
         \r
 #Region "My.Settings Auto-Save Functionality"\r
 #If _MyType = "WindowsForms" Then\r
-        Private Shared addedHandler As Boolean\r
+    Private Shared addedHandler As Boolean\r
 \r
-        Private Shared addedHandlerLockObject As New Object\r
+    Private Shared addedHandlerLockObject As New Object\r
 \r
-        <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _\r
-        Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)\r
-            If My.Application.SaveMySettingsOnExit Then\r
-                My.Settings.Save()\r
-            End If\r
-        End Sub\r
+    <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _\r
+    Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)\r
+        If My.Application.SaveMySettingsOnExit Then\r
+            My.Settings.Save()\r
+        End If\r
+    End Sub\r
 #End If\r
 #End Region\r
         \r
@@ -41,14 +41,14 @@ Namespace My
             Get\r
                 \r
 #If _MyType = "WindowsForms" Then\r
-                   If Not addedHandler Then\r
-                        SyncLock addedHandlerLockObject\r
-                            If Not addedHandler Then\r
-                                AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings\r
-                                addedHandler = True\r
-                            End If\r
-                        End SyncLock\r
-                    End If\r
+               If Not addedHandler Then\r
+                    SyncLock addedHandlerLockObject\r
+                        If Not addedHandler Then\r
+                            AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings\r
+                            addedHandler = True\r
+                        End If\r
+                    End SyncLock\r
+                End If\r
 #End If\r
                 Return defaultInstance\r
             End Get\r
index 1c1643dd8b3a9dfa7e3996709326d505fff32c7a..ee6267c5a7ad930d04bc13de490579d10328842d 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">\r
   <PropertyGroup>\r
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
     <RootNamespace>SimpleChat.VB</RootNamespace>\r
     <AssemblyName>SimpleChat.VB</AssemblyName>\r
     <MyType>WindowsForms</MyType>\r
+    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\r
+    <FileUpgradeFlags>\r
+    </FileUpgradeFlags>\r
+    <OldToolsVersion>2.0</OldToolsVersion>\r
+    <UpgradeBackupLocation />\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">\r
     <DebugSymbols>true</DebugSymbols>\r
@@ -19,7 +24,7 @@
     <DefineTrace>true</DefineTrace>\r
     <OutputPath>bin\Debug\</OutputPath>\r
     <DocumentationFile>SimpleChat.VB.xml</DocumentationFile>\r
-    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>\r
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn>\r
   </PropertyGroup>\r
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">\r
     <DebugType>pdbonly</DebugType>\r
@@ -28,7 +33,7 @@
     <Optimize>true</Optimize>\r
     <OutputPath>bin\Release\</OutputPath>\r
     <DocumentationFile>SimpleChat.VB.xml</DocumentationFile>\r
-    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>\r
+    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn>\r
   </PropertyGroup>\r
   <ItemGroup>\r
     <Reference Include="System" />\r
index 04a7d806131e27eb4b155e9c39afb29289a0edd6..dae62f381ef4635d9e63e3f99c00abc00944acb1 100644 (file)
-'\r
-' Copyright (c) 2010 Apple Inc. All rights reserved.\r
-'\r
-' Licensed under the Apache License, Version 2.0 (the "License");\r
-' you may not use this file except in compliance with the License.\r
-' You may obtain a copy of the License at\r
-' \r
-'     http://www.apache.org/licenses/LICENSE-2.0\r
-' \r
-' Unless required by applicable law or agreed to in writing, software\r
-' distributed under the License is distributed on an "AS IS" BASIS,\r
-' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-' See the License for the specific language governing permissions and\r
-' limitations under the License.\r
-'\r
-\r
-Imports System.Net\r
-Imports System.Net.Sockets\r
-Imports System.Data\r
-Imports System.Text\r
-\r
-Public Class SimpleChat\r
-    Public WithEvents MyEventManager As New Bonjour.DNSSDEventManager\r
-    Private m_service As New Bonjour.DNSSDService\r
-    Private m_registrar As Bonjour.DNSSDService\r
-    Private m_browser As Bonjour.DNSSDService\r
-    Private m_resolver As Bonjour.DNSSDService\r
-    Private m_socket As New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)\r
-    Private m_port As Integer\r
-    Private m_buffer(1024 * 32) As Byte\r
-    Private m_async As IAsyncResult\r
-    Public Delegate Sub SocketDelegate(ByVal msg As String)\r
-    Private m_socketDelegate As SocketDelegate\r
-    Private m_name As String\r
-\r
-    Public Sub New()\r
-        MyBase.New()\r
-\r
-        'This call is required by the Windows Form Designer.\r
-        InitializeComponent()\r
-\r
-        Button1.Enabled = False\r
-\r
-        m_socketDelegate = New SocketDelegate(AddressOf MessageReceived)\r
-\r
-        Dim endPoint As New IPEndPoint(IPAddress.Any, 0)\r
-        m_socket.Bind(endPoint)\r
-        endPoint = m_socket.LocalEndPoint\r
-        m_port = endPoint.Port\r
-\r
-        Dim txtRecord As Bonjour.TXTRecord\r
-        m_async = m_socket.BeginReceive(m_buffer, 0, m_buffer.Length, SocketFlags.Partial, New AsyncCallback(AddressOf OnReceive), Me)\r
-        m_registrar = m_service.Register(0, 0, Environment.UserName, "_p2pchat._udp", vbNullString, vbNullString, m_port, txtRecord, MyEventManager)\r
-    End Sub\r
-    Public Sub MyEventManager_ServiceRegistered(ByVal registrar As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal name As String, ByVal regType As String, ByVal domain As String) Handles MyEventManager.ServiceRegistered\r
-        m_name = name\r
-        m_browser = m_service.Browse(0, 0, regType, vbNullString, MyEventManager)\r
-    End Sub\r
-    Public Sub MyEventManager_ServiceFound(ByVal browser As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal serviceName As String, ByVal regtype As String, ByVal domain As String) Handles MyEventManager.ServiceFound\r
-        If (serviceName <> m_name) Then\r
-            Dim peer As PeerData = New PeerData\r
-            peer.InterfaceIndex = ifIndex\r
-            peer.Name = serviceName\r
-            peer.Type = regtype\r
-            peer.Domain = domain\r
-            ComboBox1.Items.Add(peer)\r
-            ComboBox1.SelectedIndex = 0\r
-        End If\r
-    End Sub\r
-    Public Sub MyEventManager_ServiceLost(ByVal browser As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal serviceName As String, ByVal regtype As String, ByVal domain As String) Handles MyEventManager.ServiceLost\r
-        ComboBox1.Items.Remove(serviceName)\r
-    End Sub\r
-    Public Sub MyEventManager_ServiceResolved(ByVal resolver As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal fullname As String, ByVal hostname As String, ByVal port As UShort, ByVal record As Bonjour.TXTRecord) Handles MyEventManager.ServiceResolved\r
-        m_resolver.Stop()\r
-        Dim peer As PeerData = ComboBox1.SelectedItem\r
-        peer.Port = port\r
-        m_resolver = m_service.QueryRecord(0, ifIndex, hostname, Bonjour.DNSSDRRType.kDNSSDType_A, Bonjour.DNSSDRRClass.kDNSSDClass_IN, MyEventManager)\r
-    End Sub\r
-    Public Sub MyEventManager_QueryAnswered(ByVal resolver As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal fullName As String, ByVal rrtype As Bonjour.DNSSDRRType, ByVal rrclass As Bonjour.DNSSDRRClass, ByVal rdata As Object, ByVal ttl As UInteger) Handles MyEventManager.QueryRecordAnswered\r
-        m_resolver.Stop()\r
+'
+' Copyright (c) 2010 Apple Inc. All rights reserved.
+'
+' Licensed under the Apache License, Version 2.0 (the "License");
+' you may not use this file except in compliance with the License.
+' You may obtain a copy of the License at
+' 
+'     http://www.apache.org/licenses/LICENSE-2.0
+' 
+' Unless required by applicable law or agreed to in writing, software
+' distributed under the License is distributed on an "AS IS" BASIS,
+' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+' See the License for the specific language governing permissions and
+' limitations under the License.
+'
+
+Imports System.Net
+Imports System.Net.Sockets
+Imports System.Data
+Imports System.Text
+
+Public Class SimpleChat
+       '
+       ' Associate Bonjour events with event handlers
+       '
+    Public WithEvents MyEventManager As New Bonjour.DNSSDEventManager
+    Private m_service As New Bonjour.DNSSDService
+    Private m_registrar As Bonjour.DNSSDService
+    Private m_browser As Bonjour.DNSSDService
+    Private m_resolver As Bonjour.DNSSDService
+    Private m_socket As New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
+    Private m_port As Integer
+    Private m_buffer(1024 * 32) As Byte
+    Private m_async As IAsyncResult
+    Public Delegate Sub SocketDelegate(ByVal msg As String)
+    Private m_socketDelegate As SocketDelegate
+    Private m_name As String
+
+    Public Sub New()
+        MyBase.New()
+
+        'This call is required by the Windows Form Designer.
+        InitializeComponent()
+
+        Button1.Enabled = False
+
+        m_socketDelegate = New SocketDelegate(AddressOf MessageReceived)
+
+        Dim endPoint As New IPEndPoint(IPAddress.Any, 0)
+        m_socket.Bind(endPoint)
+        endPoint = m_socket.LocalEndPoint
+        m_port = endPoint.Port
+
+        Dim txtRecord As Bonjour.TXTRecord
+        m_async = m_socket.BeginReceive(m_buffer, 0, m_buffer.Length, SocketFlags.Partial, New AsyncCallback(AddressOf OnReceive), Me)
+        m_registrar = m_service.Register(0, 0, Environment.UserName, "_p2pchat._udp", vbNullString, vbNullString, m_port, txtRecord, MyEventManager)
+    End Sub
+
+       '
+       ' Called when Bonjour core finished registering a service successfully
+       '
+    Public Sub MyEventManager_ServiceRegistered(ByVal registrar As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal name As String, ByVal regType As String, ByVal domain As String) Handles MyEventManager.ServiceRegistered
+        m_name = name
+        m_browser = m_service.Browse(0, 0, regType, vbNullString, MyEventManager)
+    End Sub
+
+       '
+       ' Called when a service is found
+       '
+    Public Sub MyEventManager_ServiceFound(ByVal browser As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal serviceName As String, ByVal regtype As String, ByVal domain As String) Handles MyEventManager.ServiceFound
+        If (serviceName <> m_name) Then
+            Dim peer As PeerData = New PeerData
+            peer.InterfaceIndex = ifIndex
+            peer.Name = serviceName
+            peer.Type = regtype
+            peer.Domain = domain
+            ComboBox1.Items.Add(peer)
+            ComboBox1.SelectedIndex = 0
+        End If
+    End Sub
+
+       '
+       ' Called when a service is lost
+       '
+    Public Sub MyEventManager_ServiceLost(ByVal browser As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal serviceName As String, ByVal regtype As String, ByVal domain As String) Handles MyEventManager.ServiceLost
+        ComboBox1.Items.Remove(serviceName)
+    End Sub
+
+       '
+       ' Called when a service is resolved
+       '
+    Public Sub MyEventManager_ServiceResolved(ByVal resolver As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal fullname As String, ByVal hostname As String, ByVal port As UShort, ByVal record As Bonjour.TXTRecord) Handles MyEventManager.ServiceResolved
+        m_resolver.Stop()
+        Dim peer As PeerData = ComboBox1.SelectedItem
+        peer.Port = port
+        m_resolver = m_service.QueryRecord(0, ifIndex, hostname, Bonjour.DNSSDRRType.kDNSSDType_A, Bonjour.DNSSDRRClass.kDNSSDClass_IN, MyEventManager)
+    End Sub
+
+    Public Sub MyEventManager_QueryAnswered(ByVal resolver As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal fullName As String, ByVal rrtype As Bonjour.DNSSDRRType, ByVal rrclass As Bonjour.DNSSDRRClass, ByVal rdata As Object, ByVal ttl As UInteger) Handles MyEventManager.QueryRecordAnswered
+        m_resolver.Stop()
         Dim peer As PeerData = ComboBox1.SelectedItem
         Dim bits As UInteger = BitConverter.ToUInt32(rdata, 0)
         Dim address As IPAddress = New System.Net.IPAddress(bits)
-        peer.Address = address\r
-    End Sub\r
-    Public Sub MyEventManager_OperationFailed(ByVal registrar As Bonjour.DNSSDService, ByVal errorCode As Bonjour.DNSSDError) Handles MyEventManager.OperationFailed\r
-        MessageBox.Show("Operation failed error code: " + errorCode)\r
-    End Sub\r
-\r
-    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click\r
+        peer.Address = address
+    End Sub
+
+    Public Sub MyEventManager_OperationFailed(ByVal registrar As Bonjour.DNSSDService, ByVal errorCode As Bonjour.DNSSDError) Handles MyEventManager.OperationFailed
+        MessageBox.Show("Operation failed error code: " + errorCode)
+    End Sub
+
+    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
         Dim peer As PeerData = ComboBox1.SelectedItem
         Dim message As String = m_name + ": " + TextBox2.Text
         Dim bytes As Byte() = Encoding.UTF8.GetBytes(message)
         Dim endPoint As IPEndPoint = New IPEndPoint(peer.Address, peer.Port)
         m_socket.SendTo(bytes, 0, bytes.Length, 0, endPoint)
         TextBox1.AppendText(TextBox2.Text + Environment.NewLine)
-        TextBox2.Text = ""\r
-    End Sub\r
-\r
-    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged\r
-        Dim peer As PeerData = ComboBox1.SelectedItem\r
-        m_resolver = m_service.Resolve(0, peer.InterfaceIndex, peer.Name, peer.Type, peer.Domain, MyEventManager)\r
-    End Sub\r
-    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged\r
-        Dim peer As PeerData = ComboBox1.SelectedItem\r
-        If ((peer.Address IsNot Nothing) And TextBox2.Text.Length > 0) Then\r
-            Button1.Enabled = True\r
-        Else\r
-            Button1.Enabled = False\r
-        End If\r
-    End Sub\r
-    Public Sub MessageReceived(ByVal msg As System.String)\r
-        TextBox1.AppendText(msg)\r
-    End Sub\r
-    Private Sub OnReceive(ByVal ar As IAsyncResult)\r
-        Dim bytesReceived As Integer = m_socket.EndReceive(ar)\r
-        If (bytesReceived > 0) Then\r
-            Dim msg As String = Encoding.UTF8.GetString(m_buffer, 0, bytesReceived)\r
-            Me.Invoke(m_socketDelegate, msg)\r
-        End If\r
-        m_async = m_socket.BeginReceive(m_buffer, 0, m_buffer.Length, SocketFlags.Partial, New AsyncCallback(AddressOf OnReceive), Me)\r
-    End Sub\r
-End Class\r
-\r
-Public Class PeerData\r
-    Public InterfaceIndex As UInteger\r
-    Public Name As String\r
-    Public Type As String\r
-    Public Domain As String\r
-    Public Address As IPAddress\r
-    Public Port As UShort\r
-\r
-    Overrides Function ToString() As String\r
-        Return Name\r
-    End Function\r
-End Class\r
+        TextBox2.Text = ""
+    End Sub
+
+    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
+        Dim peer As PeerData = ComboBox1.SelectedItem
+        m_resolver = m_service.Resolve(0, peer.InterfaceIndex, peer.Name, peer.Type, peer.Domain, MyEventManager)
+    End Sub
+    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
+        Dim peer As PeerData = ComboBox1.SelectedItem
+        If ((peer.Address IsNot Nothing) And TextBox2.Text.Length > 0) Then
+            Button1.Enabled = True
+        Else
+            Button1.Enabled = False
+        End If
+    End Sub
+    Public Sub MessageReceived(ByVal msg As System.String)
+        TextBox1.AppendText(msg)
+    End Sub
+    Private Sub OnReceive(ByVal ar As IAsyncResult)
+        Dim bytesReceived As Integer = m_socket.EndReceive(ar)
+        If (bytesReceived > 0) Then
+            Dim msg As String = Encoding.UTF8.GetString(m_buffer, 0, bytesReceived)
+            Me.Invoke(m_socketDelegate, msg)
+        End If
+        m_async = m_socket.BeginReceive(m_buffer, 0, m_buffer.Length, SocketFlags.Partial, New AsyncCallback(AddressOf OnReceive), Me)
+    End Sub
+End Class
+
+Public Class PeerData
+    Public InterfaceIndex As UInteger
+    Public Name As String
+    Public Type As String
+    Public Domain As String
+    Public Address As IPAddress
+    Public Port As UShort
+
+    Overrides Function ToString() As String
+        Return Name
+    End Function
+End Class
index bf6cc1039057a7ba6a8f3e17f62a3b8971158e3a..c73c22160e3caa05ef69513036391cf65939b67c 100644 (file)
@@ -170,7 +170,11 @@ cl dns-sd.c -I../mDNSShared -DNOT_HAVE_GETOPT ws2_32.lib ..\mDNSWindows\DLL\Rele
        #include <arpa/inet.h>          // For inet_addr()
        #include <net/if.h>                     // For if_nametoindex()
        static const char kFilePathSep = '/';
-       #define SA_LEN(addr) ((addr)->sa_len)
+// #ifndef NOT_HAVE_SA_LEN
+//     #define SA_LEN(addr) ((addr)->sa_len)
+// #else
+    #define SA_LEN(addr) (((addr)->sa_family == AF_INET6)? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in))
+// #endif
 #endif
 
 #if (TEST_NEW_CLIENTSTUB && !defined(__APPLE_API_PRIVATE))
diff --git a/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj b/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj
new file mode 100755 (executable)
index 0000000..c714dea
--- /dev/null
@@ -0,0 +1,237 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{AF35C285-528D-46A1-8A0E-47B0733DC718}</ProjectGuid>\r
+    <RootNamespace>mDNSNetMonitor</RootNamespace>\r
+    <Keyword>Win32Proj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows/SystemService;../../mDNSWindows;../../mDNSShared;../../mDNSCore;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;MDNS_DEBUGMSGS=0;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE=;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;crypt32.lib;netapi32.lib;powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>mDNSNetMonitor.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows/SystemService;../../mDNSWindows;../../mDNSShared;../../mDNSCore;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;MDNS_DEBUGMSGS=0;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE=;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;crypt32.lib;netapi32.lib;powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Console</SubSystem>\r
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>mDNSNetMonitor.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ClCompile>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows/SystemService;../../mDNSWindows;../../mDNSShared;../../mDNSCore;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;MDNS_DEBUGMSGS=0;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE=;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;crypt32.lib;netapi32.lib;powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Console</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>mDNSNetMonitor.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                          "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <ClCompile>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows/SystemService;../../mDNSWindows;../../mDNSShared;../../mDNSCore;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;MDNS_DEBUGMSGS=0;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE=;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;crypt32.lib;netapi32.lib;powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Console</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>mDNSNetMonitor.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                          "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\mDNSCore\DNSCommon.c" />\r
+    <ClCompile Include="..\..\mDNSCore\DNSDigest.c" />\r
+    <ClCompile Include="..\..\mDNSShared\dnssd_ipc.c" />\r
+    <ClCompile Include="..\..\mDNSWindows\Poll.c" />\r
+    <ClCompile Include="..\..\mDNSWindows\SystemService\Firewall.cpp" />\r
+    <ClCompile Include="..\..\mDNSShared\GenLinkedList.c" />\r
+    <ClCompile Include="..\..\mDNSShared\mDNSDebug.c" />\r
+    <ClCompile Include="..\..\mDNSWindows\mDNSWin32.c" />\r
+    <ClCompile Include="..\..\mDNSPosix\NetMonitor.c" />\r
+    <ClCompile Include="..\..\mDNSWindows\PosixCompat.c" />\r
+    <ClCompile Include="..\..\mDNSWindows\Secret.c" />\r
+    <ClCompile Include="..\..\mDNSCore\uDNS.c" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\mDNSCore\DNSCommon.h" />\r
+    <ClInclude Include="..\..\mDNSShared\dnssd_ipc.h" />\r
+    <ClInclude Include="..\..\mDNSWindows\Poll.h" />\r
+    <ClInclude Include="..\..\mDNSWindows\SystemService\Firewall.h" />\r
+    <ClInclude Include="..\..\mDNSShared\GenLinkedList.h" />\r
+    <ClInclude Include="..\..\mDNSCore\mDNSDebug.h" />\r
+    <ClInclude Include="..\..\mDNSCore\mDNSEmbeddedAPI.h" />\r
+    <ClInclude Include="..\..\mDNSWindows\mDNSWin32.h" />\r
+    <ClInclude Include="..\..\mDNSWindows\PosixCompat.h" />\r
+    <ClInclude Include="..\..\mDNSWindows\RegNames.h" />\r
+    <ClInclude Include="..\..\mDNSWindows\Secret.h" />\r
+    <ClInclude Include="..\..\mDNSCore\uDNS.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="mDNSNetMonitor.rc" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\..\mDNSWindows\SystemService\Service.vcxproj">\r
+      <Project>{c1d98254-ba27-4427-a3be-a68ca2cc5f69}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj.filters b/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj.filters
new file mode 100755 (executable)
index 0000000..8a60f08
--- /dev/null
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\mDNSCore\DNSCommon.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSCore\DNSDigest.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\dnssd_ipc.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSWindows\SystemService\Firewall.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\GenLinkedList.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\mDNSDebug.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSWindows\mDNSWin32.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSPosix\NetMonitor.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSWindows\PosixCompat.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSWindows\Secret.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSCore\uDNS.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSWindows\Poll.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\mDNSCore\DNSCommon.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\dnssd_ipc.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSWindows\SystemService\Firewall.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\GenLinkedList.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSCore\mDNSDebug.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSCore\mDNSEmbeddedAPI.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSWindows\mDNSWin32.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSWindows\PosixCompat.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSWindows\RegNames.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSWindows\Secret.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSCore\uDNS.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSWindows\Poll.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="mDNSNetMonitor.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
index e978f9e6f4e216745a6e92fb62affc2ab0cc035f..a37efd217631034950974e212e691e1d01dc1bff 100644 (file)
@@ -1,14 +1,14 @@
-//{{NO_DEPENDENCIES}}\r
-// Microsoft Visual C++ generated include file.\r
-// Used by mDNSNetMonitor.rc\r
-\r
-// Next default values for new objects\r
-// \r
-#ifdef APSTUDIO_INVOKED\r
-#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE        101\r
-#define _APS_NEXT_COMMAND_VALUE         40001\r
-#define _APS_NEXT_CONTROL_VALUE         1001\r
-#define _APS_NEXT_SYMED_VALUE           101\r
-#endif\r
-#endif\r
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by mDNSNetMonitor.rc
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        101
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1001
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
index d592d6a2485adb60c677502349d12265cfe178dd..830157bc2811bf65904bb68ffb36d70250981987 100644 (file)
--- a/Makefile
+++ b/Makefile
 
 include /Developer/Makefiles/pb_makefiles/platform.make
 
-MVERS = "mDNSResponder-320.16"
+MVERS = "mDNSResponder-333.10"
 
 DDNSWRITECONFIG = "$(DSTROOT)/Library/Application Support/Bonjour/ddnswriteconfig"
 
 installSome:
-       cd "$(SRCROOT)/mDNSMacOSX"; xcodebuild install     OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) DSTROOT=$(DSTROOT) MVERS=$(MVERS) SDKROOT=$(SDKROOT) -target Build\ Some
+       cd "$(SRCROOT)/mDNSMacOSX"; xcodebuild install     OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) DSTROOT=$(DSTROOT) MVERS=$(MVERS) SDKROOT=$(SDKROOT) -target Build\ Some -- GCC_VERSION=$(GCC_VERSION)
 
 SystemLibraries:
-       cd "$(SRCROOT)/mDNSMacOSX"; xcodebuild install     OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) DSTROOT=$(DSTROOT) MVERS=$(MVERS) SDKROOT=$(SDKROOT) -target SystemLibraries
+       cd "$(SRCROOT)/mDNSMacOSX"; xcodebuild install     OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) DSTROOT=$(DSTROOT) MVERS=$(MVERS) SDKROOT=$(SDKROOT) -target SystemLibraries -- GCC_VERSION=$(GCC_VERSION)
 
 install:
-       cd "$(SRCROOT)/mDNSMacOSX"; xcodebuild install     OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) DSTROOT=$(DSTROOT) MVERS=$(MVERS) SDKROOT=$(SDKROOT)
+       cd "$(SRCROOT)/mDNSMacOSX"; xcodebuild install     OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) DSTROOT=$(DSTROOT) MVERS=$(MVERS) SDKROOT=$(SDKROOT) -- GCC_VERSION=$(GCC_VERSION)
        # Make sure ddnswriteconfig is owned by root:wheel, then make it setuid root executable
        if test -e $(DDNSWRITECONFIG) ; then chown 0:80 $(DDNSWRITECONFIG) ; chmod 4555 $(DDNSWRITECONFIG) ; fi
 
@@ -35,7 +35,7 @@ installsrc:
        ditto . "$(SRCROOT)"
 
 installhdrs::
-       cd "$(SRCROOT)/mDNSMacOSX"; xcodebuild installhdrs OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) DSTROOT=$(DSTROOT) MVERS=$(MVERS) SDKROOT=$(SDKROOT)  -target SystemLibraries
+       cd "$(SRCROOT)/mDNSMacOSX"; xcodebuild installhdrs OBJROOT=$(OBJROOT) SYMROOT=$(SYMROOT) DSTROOT=$(DSTROOT) MVERS=$(MVERS) SDKROOT=$(SDKROOT)  -target SystemLibraries -- GCC_VERSION=$(GCC_VERSION)
 
 clean::
        echo clean
index b4a0158cc336db45fd407698cbcc4366b0d2b74c..98d23dbdd1117b052beff35be969398580d852a5 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 4 -*-
  *
- * Copyright (c) 2002-2003 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2002-2011 Apple Computer, Inc. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -571,9 +571,16 @@ void md5_block_data_order (MD5_CTX *c, const void *p,int num);
 #endif
 #endif
 
+// None of the invocations of the following macros actually use the result,
+// so cast them to void to avoid any compiler warnings/errors about not using
+// the result (e.g. when using clang).
+// If the resultant values need to be used at some point, these must be changed.
+#define HOST_c2l(c,l) ((void)_HOST_c2l(c,l))
+#define HOST_l2c(l,c) ((void)_HOST_l2c(l,c))
+
 #if defined(DATA_ORDER_IS_BIG_ENDIAN)
 
-#define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))<<24),          \
+#define _HOST_c2l(c,l) (l =(((unsigned long)(*((c)++)))<<24),          \
                         l|=(((unsigned long)(*((c)++)))<<16),          \
                         l|=(((unsigned long)(*((c)++)))<< 8),          \
                         l|=(((unsigned long)(*((c)++)))    ),          \
@@ -601,7 +608,7 @@ void md5_block_data_order (MD5_CTX *c, const void *p,int num);
                        case 2: l|=((unsigned long)(*(--(c))))<<16;     \
                        case 1: l|=((unsigned long)(*(--(c))))<<24;     \
                                } }
-#define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
+#define _HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l)>>24)&0xff),      \
                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
                         *((c)++)=(unsigned char)(((l)    )&0xff),      \
@@ -609,7 +616,7 @@ void md5_block_data_order (MD5_CTX *c, const void *p,int num);
 
 #elif defined(DATA_ORDER_IS_LITTLE_ENDIAN)
 
-#define HOST_c2l(c,l)  (l =(((unsigned long)(*((c)++)))    ),          \
+#define _HOST_c2l(c,l) (l =(((unsigned long)(*((c)++)))    ),          \
                         l|=(((unsigned long)(*((c)++)))<< 8),          \
                         l|=(((unsigned long)(*((c)++)))<<16),          \
                         l|=(((unsigned long)(*((c)++)))<<24),          \
@@ -637,7 +644,7 @@ void md5_block_data_order (MD5_CTX *c, const void *p,int num);
                        case 2: l|=((unsigned long)(*(--(c))))<< 8;     \
                        case 1: l|=((unsigned long)(*(--(c))));         \
                                } }
-#define HOST_l2c(l,c)  (*((c)++)=(unsigned char)(((l)    )&0xff),      \
+#define _HOST_l2c(l,c) (*((c)++)=(unsigned char)(((l)    )&0xff),      \
                         *((c)++)=(unsigned char)(((l)>> 8)&0xff),      \
                         *((c)++)=(unsigned char)(((l)>>16)&0xff),      \
                         *((c)++)=(unsigned char)(((l)>>24)&0xff),      \
index 420b0a7532b6288c8a9a3806bdc435112b11211d..d8be49adcefea701b0f883a5098a86371744ba03 100755 (executable)
@@ -1663,7 +1663,6 @@ mDNSlocal void SendDelayedUnicastResponse(mDNS *const m, const mDNSAddr *const d
        AuthRecord *rr;
        AuthRecord  *ResponseRecords = mDNSNULL;
        AuthRecord **nrp             = &ResponseRecords;
-       NetworkInterfaceInfo *intf = FirstInterfaceForID(m, InterfaceID);
 
        // Make a list of all our records that need to be unicast to this destination
        for (rr = m->ResourceRecords; rr; rr=rr->next)
@@ -1675,7 +1674,6 @@ mDNSlocal void SendDelayedUnicastResponse(mDNS *const m, const mDNSAddr *const d
                        rr->ImmedUnicast = mDNSfalse;
 
                if (rr->ImmedUnicast && rr->ImmedAnswer == InterfaceID)
-                       {
                        if ((dest->type == mDNSAddrType_IPv4 && mDNSSameIPv4Address(rr->v4Requester, dest->ip.v4)) ||
                                (dest->type == mDNSAddrType_IPv6 && mDNSSameIPv6Address(rr->v6Requester, dest->ip.v6)))
                                {
@@ -1683,18 +1681,9 @@ mDNSlocal void SendDelayedUnicastResponse(mDNS *const m, const mDNSAddr *const d
                                rr->ImmedUnicast = mDNSfalse;
                                rr->v4Requester  = zerov4Addr;
                                rr->v6Requester  = zerov6Addr;
-
-                               // Only sent records registered for P2P over P2P interfaces
-                               if (intf && !mDNSPlatformValidRecordForInterface(rr, intf))
-                                       {
-                                       LogInfo("SendDelayedUnicastResponse: Not sending %s, on %s", ARDisplayString(m, rr), InterfaceNameForID(m, InterfaceID));
-                                       continue;
-                                       }
-
                                if (rr->NextResponse == mDNSNULL && nrp != &rr->NextResponse)   // rr->NR_AnswerTo
                                        { rr->NR_AnswerTo = (mDNSu8*)~0; *nrp = rr; nrp = &rr->NextResponse; }
                                }
-                       }
                }
 
        AddAdditionalsToResponseList(m, ResponseRecords, &nrp, InterfaceID);
@@ -2251,7 +2240,7 @@ mDNSlocal void SendResponses(mDNS *const m)
                        if ((rr->SendRNow == intf->InterfaceID) &&
                                ((rr->resrec.InterfaceID == mDNSInterface_Any) && !mDNSPlatformValidRecordForInterface(rr, intf)))
                                {
-                                       LogInfo("SendResponses: Not sending %s, on %s", ARDisplayString(m, rr), InterfaceNameForID(m, rr->SendRNow));
+                                       LogInfo("SendResponses: Not Sending %s, on %s", ARDisplayString(m, rr), InterfaceNameForID(m, rr->SendRNow));
                                        rr->SendRNow = GetNextActiveInterfaceID(intf);
                                }
                        else if (rr->SendRNow == intf->InterfaceID)
@@ -3296,6 +3285,22 @@ mDNSlocal void SendWakeup(mDNS *const m, mDNSInterfaceID InterfaceID, mDNSEthAdd
 #pragma mark - RR List Management & Task Management
 #endif
 
+// Whenever a question is answered, reset its state so that we don't query
+// the network repeatedly. This happens first time when we answer the question and
+// and later when we refresh the cache.
+mDNSlocal void ResetQuestionState(mDNS *const m, DNSQuestion *q)
+       {
+       q->LastQTime        = m->timenow;
+       q->LastQTxTime      = m->timenow;
+       q->RecentAnswerPkts = 0;
+       q->ThisQInterval    = MaxQuestionInterval;
+       q->RequestUnicast   = mDNSfalse;
+       // Reset unansweredQueries so that we don't penalize this server later when we
+       // start sending queries when the cache expires.
+       q->unansweredQueries = 0;
+       debugf("ResetQuestionState: Set MaxQuestionInterval for %##s (%s)", q->qname.c, DNSTypeName(q->qtype));
+       }
+
 // Note: AnswerCurrentQuestionWithResourceRecord can call a user callback, which may change the record list and/or question list.
 // Any code walking either list must use the m->CurrentQuestion (and possibly m->CurrentRecord) mechanism to protect against this.
 // In fact, to enforce this, the routine will *only* answer the question currently pointed to by m->CurrentQuestion,
@@ -3354,12 +3359,7 @@ mDNSexport void AnswerCurrentQuestionWithResourceRecord(mDNS *const m, CacheReco
                (AddRecord == QC_add && (q->ExpectUnique || (rr->resrec.RecordType & kDNSRecordTypePacketUniqueMask))))
                if (ActiveQuestion(q) && (mDNSOpaque16IsZero(q->TargetQID) || !q->LongLived))
                        {
-                       q->LastQTime        = m->timenow;
-                       q->LastQTxTime      = m->timenow;
-                       q->RecentAnswerPkts = 0;
-                       q->ThisQInterval    = MaxQuestionInterval;
-                       q->RequestUnicast   = mDNSfalse;
-                       debugf("AnswerCurrentQuestionWithResourceRecord: Set MaxQuestionInterval for %##s (%s)", q->qname.c, DNSTypeName(q->qtype));
+                       ResetQuestionState(m, q);
                        }
 
        if (rr->DelayDelivery) return;          // We'll come back later when CacheRecordDeferredAdd() calls us
@@ -4286,24 +4286,6 @@ mDNSlocal void TimeoutQuestions(mDNS *const m)
        m->CurrentQuestion = mDNSNULL;
        }
 
-mDNSlocal void mDNSCoreFreeProxyRR(mDNS *const m)
-       {
-       NetworkInterfaceInfo *intf  = m->HostInterfaces;
-       AuthRecord *rrPtr = mDNSNULL, *rrNext = mDNSNULL;
-       while (intf)
-               {
-               rrPtr  = intf->SPSRRSet;
-               while (rrPtr)
-                       {
-                       rrNext = rrPtr->next;
-                       mDNSPlatformMemFree(rrPtr);
-                       rrPtr  = rrNext;
-                       }
-               intf->SPSRRSet = mDNSNULL;
-               intf = intf->next;
-               }
-       }
-
 mDNSexport mDNSs32 mDNS_Execute(mDNS *const m)
        {
        mDNS_Lock(m);   // Must grab lock before trying to read m->timenow
@@ -4368,12 +4350,7 @@ mDNSexport mDNSs32 mDNS_Execute(mDNS *const m)
                SetSPSProxyListChanged(mDNSNULL);               // Perform any deferred BPF reconfiguration now
 
                // Clear AnnounceOwner if necessary. (Do this *before* SendQueries() and SendResponses().)
-               if (m->AnnounceOwner && m->timenow - m->AnnounceOwner >= 0)
-                       {
-                       m->AnnounceOwner = 0;
-                       // Also free the stored records that we had registered with the sleep proxy
-                       mDNSCoreFreeProxyRR(m);
-                       }
+               if (m->AnnounceOwner && m->timenow - m->AnnounceOwner >= 0) m->AnnounceOwner = 0;
 
                if (m->DelaySleep && m->timenow - m->DelaySleep >= 0)
                        {
@@ -4960,7 +4937,6 @@ mDNSlocal mDNSBool RecordIsFirstOccurrenceOfOwner(mDNS *const m, const AuthRecor
        return mDNStrue;
        }
 
-
 mDNSlocal void SendSPSRegistration(mDNS *const m, NetworkInterfaceInfo *const intf, const mDNSOpaque16 id)
        {
        AuthRecord *ar;
@@ -4978,55 +4954,6 @@ mDNSlocal void SendSPSRegistration(mDNS *const m, NetworkInterfaceInfo *const in
                }
        }
 
-mDNSlocal void mDNSCoreStoreProxyRR(mDNS *const m, const mDNSInterfaceID InterfaceID, AuthRecord *const rr)
-       {
-       NetworkInterfaceInfo *intf  = FirstInterfaceForID(m, InterfaceID);
-       AuthRecord           *newRR = mDNSPlatformMemAllocate(sizeof(AuthRecord));
-
-       if ((intf == mDNSNULL) || (newRR == mDNSNULL))
-               return;
-       mDNSPlatformMemZero(newRR, sizeof(AuthRecord));
-       mDNS_SetupResourceRecord(newRR, mDNSNULL, InterfaceID, rr->resrec.rrtype,
-                                                        rr->resrec.rroriginalttl, rr->resrec.RecordType,
-                                                        rr->ARType, mDNSNULL, mDNSNULL);
-       AssignDomainName(&newRR->namestorage, &rr->namestorage);
-       newRR->resrec.rdlength           = DomainNameLength(rr->resrec.name);
-       newRR->resrec.rdata->u.name.c[0] = 0;
-       AssignDomainName(&newRR->resrec.rdata->u.name, rr->resrec.name);
-       newRR->resrec.namehash           = DomainNameHashValue(newRR->resrec.name);
-       newRR->resrec.rrclass            = rr->resrec.rrclass;
-       if (intf->ip.type == mDNSAddrType_IPv4)
-               newRR->resrec.rdata->u.ipv4 =  rr->resrec.rdata->u.ipv4;
-       else
-               newRR->resrec.rdata->u.ipv6 = rr->resrec.rdata->u.ipv6;
-       SetNewRData(&newRR->resrec, mDNSNULL, 0);
-       // Insert the new node at the head of the list.
-       newRR->next    = intf->SPSRRSet;
-       intf->SPSRRSet = newRR;
-       }
-
-mDNSlocal void SPSInitRecordsBeforeUpdate(mDNS *const m, mDNSOpaque64 updateIntID)
-       {
-       AuthRecord *ar;
-       LogSPS("SPSInitRecordsBeforeUpdate: UpdateIntID 0x%x 0x%x", updateIntID.l[1], updateIntID.l[0]);
-
-       // Before we store the A and AAAA records that we are going to register with the sleep proxy,
-       // make sure that the old sleep proxy records are removed.
-       mDNSCoreFreeProxyRR(m);
-
-       for (ar = m->ResourceRecords; ar; ar=ar->next)
-               {
-               if (AuthRecord_uDNS(ar))
-                       continue;
-               // Store the A and AAAA records that we registered with the sleep proxy.
-               // We will use this to prevent spurious name conflicts that may occur when we wake up
-               if (ar->resrec.rrtype == kDNSType_A || ar->resrec.rrtype == kDNSType_AAAA)
-                       {
-                       mDNSCoreStoreProxyRR(m, ar->resrec.InterfaceID, ar);
-                       }
-               }
-       }
-
 // RetrySPSRegistrations is called from SendResponses, with the lock held
 mDNSlocal void RetrySPSRegistrations(mDNS *const m)
        {
@@ -5137,7 +5064,6 @@ mDNSlocal void BeginSleepProcessing(mDNS *const m)
        {
        mDNSBool SendGoodbyes = mDNStrue;
        const CacheRecord *sps[3] = { mDNSNULL };
-       mDNSOpaque64 updateIntID = zeroOpaque64;
 
        m->NextScheduledSPRetry = m->timenow;
 
@@ -5167,15 +5093,9 @@ mDNSlocal void BeginSleepProcessing(mDNS *const m)
                                else
                                        {
                                        int i;
-                                       mDNSu32 scopeid;
                                        SendGoodbyes = mDNSfalse;
                                        intf->NextSPSAttempt = 0;
                                        intf->NextSPSAttemptTime = m->timenow + mDNSPlatformOneSecond;
-                                       
-                                       scopeid = mDNSPlatformInterfaceIndexfromInterfaceID(m, intf->InterfaceID, mDNStrue);
-                                       // Now we know for sure that we have to wait for registration to complete on this interface.
-                                       if (scopeid < (sizeof(updateIntID) * mDNSNBBY))
-                                               bit_set_opaque64(updateIntID, scopeid);
                                        // Don't need to set m->NextScheduledSPRetry here because we already set "m->NextScheduledSPRetry = m->timenow" above
                                        for (i=0; i<3; i++)
                                                {
@@ -5200,9 +5120,7 @@ mDNSlocal void BeginSleepProcessing(mDNS *const m)
                                }
                        }
                }
-       // If we have at least one interface on which we are registering with an external sleep proxy,
-       // initialize all the records appropriately.
-       if (!mDNSOpaque64IsZero(&updateIntID)) SPSInitRecordsBeforeUpdate(m, updateIntID);
+
        if (SendGoodbyes)       // If we didn't find even one Sleep Proxy
                {
                LogSPS("BeginSleepProcessing: Not registering with Sleep Proxy Server");
@@ -6542,28 +6460,6 @@ mDNSlocal mDNSu32 GetEffectiveTTL(const uDNS_LLQType LLQType, mDNSu32 ttl)               // T
        return ttl;
        }
 
-mDNSlocal mDNSBool mDNSCoreRegisteredProxyRecord(mDNS *const m, AuthRecord *rr)
-       {
-       NetworkInterfaceInfo *intf  = m->HostInterfaces;
-       AuthRecord           *rrPtr = mDNSNULL;
-
-       while (intf)
-               {
-               rrPtr = intf->SPSRRSet;
-               while (rrPtr)
-                       {
-                       if (SameResourceRecordSignature(rrPtr, rr))
-                               {
-                               LogSPS("mDNSCoreRegisteredProxyRecord: Ignoring packet registered with sleep proxy : %s ", ARDisplayString(m, rr));
-                               return mDNStrue;
-                               }
-                       rrPtr = rrPtr->next;
-                       }
-               intf = intf->next;
-               }
-       return mDNSfalse;
-}
-
 // Note: mDNSCoreReceiveResponse calls mDNS_Deregister_internal which can call a user callback, which may change
 // the record list and/or question list.
 // Any code walking either list must use the CurrentQuestion and/or CurrentRecord mechanism to protect against this.
@@ -6858,12 +6754,8 @@ mDNSlocal void mDNSCoreReceiveResponse(mDNS *const m,
                                                        // If we're probing for this record, we just failed
                                                        else if (rr->resrec.RecordType == kDNSRecordTypeUnique)
                                                                {
-                                                               // Before we call deregister, check if this is a packet we registered with the sleep proxy.
-                                                               if (!mDNSCoreRegisteredProxyRecord(m, rr))
-                                                                       {
-                                                                       LogMsg("mDNSCoreReceiveResponse: ProbeCount %d; will deregister %s", rr->ProbeCount, ARDisplayString(m, rr));
-                                                                       mDNS_Deregister_internal(m, rr, mDNS_Dereg_conflict);
-                                                                       }
+                                                               LogMsg("mDNSCoreReceiveResponse: ProbeCount %d; will deregister %s", rr->ProbeCount, ARDisplayString(m, rr));
+                                                               mDNS_Deregister_internal(m, rr, mDNS_Dereg_conflict);
                                                                }
                                                        // We assumed this record must be unique, but we were wrong. (e.g. There are two mDNSResponders on the
                                                        // same machine giving different answers for the reverse mapping record, or there are two machines on the
@@ -6985,12 +6877,7 @@ mDNSlocal void mDNSCoreReceiveResponse(mDNS *const m,
                                                                if (!q->DuplicateOf && !q->LongLived &&
                                                                        ActiveQuestion(q) && ResourceRecordAnswersQuestion(&rr->resrec, q))
                                                                        {
-                                                                       q->LastQTime        = m->timenow;
-                                                                       q->LastQTxTime      = m->timenow;
-                                                                       q->RecentAnswerPkts = 0;
-                                                                       q->ThisQInterval    = MaxQuestionInterval;
-                                                                       q->RequestUnicast   = mDNSfalse;
-                                                                       q->unansweredQueries = 0;
+                                                                       ResetQuestionState(m, q);
                                                                        debugf("mDNSCoreReceiveResponse: Set MaxQuestionInterval for %p %##s (%s)", q, q->qname.c, DNSTypeName(q->qtype));
                                                                        break;          // Why break here? Aren't there other questions we might want to look at?-- SC July 2010
                                                                        }
@@ -7182,15 +7069,11 @@ exit:
                        // *not* on a Microsoft Active Directory network, and there is no authoritative server for "local". Note that this is not
                        // in conflict with the mDNS spec, because that spec says, "Multicast DNS Zones have no SOA record," so it's okay to cache
                        // negative answers for "local. SOA" from a uDNS server, because the mDNS spec already says that such records do not exist :-)
-                       //
-                       // By suppressing negative responses, it might take longer to timeout a .local question as it might be expecting a
-                       // response e.g., we deliver a positive "A" response and suppress negative "AAAA" response and the upper layer may
-                       // be waiting longer to get the AAAA response before returning the "A" response to the application. To handle this
-                       // case without creating the negative cache entries, we generate a negative response and let the layer above us
-                       // do the appropriate thing. This negative response is also needed for appending new search domains.
                        if (!InterfaceID && q.qtype != kDNSType_SOA && IsLocalDomain(&q.qname))
                                {
-                               if (!rr)
+                               // If we did not find a positive answer and we can append search domains to this question,
+                               // generate a negative response (without creating a cache entry) to append search domains.
+                               if (qptr->AppendSearchDomains && !rr)
                                        {
                                        LogInfo("mDNSCoreReceiveResponse: Generate negative response for %##s (%s)", q.qname.c, DNSTypeName(q.qtype));
                                        m->CurrentQuestion = qptr;
@@ -7268,8 +7151,14 @@ exit:
                                        // If we already had a negative cache entry just update it, else make one or more new negative cache entries
                                        if (neg)
                                                {
-                                               debugf("Renewing negative TTL from %d to %d %s", neg->resrec.rroriginalttl, negttl, CRDisplayString(m, neg));
+                                               debugf("mDNSCoreReceiveResponse: Renewing negative TTL from %d to %d %s", neg->resrec.rroriginalttl, negttl, CRDisplayString(m, neg));
                                                RefreshCacheRecord(m, neg, negttl);
+                                               // When we created the cache for the first time and answered the question, the question's
+                                               // interval was set to MaxQuestionInterval. If the cache is about to expire and we are resending
+                                               // the queries, the interval should still be at MaxQuestionInterval. If the query is being
+                                               // restarted (setting it to InitialQuestionInterval) for other reasons e.g., wakeup,
+                                               // we should reset its question interval here to MaxQuestionInterval.
+                                               ResetQuestionState(m, qptr);
                                                }
                                        else while (1)
                                                {
@@ -7939,6 +7828,55 @@ mDNSlocal mDNSu32 GetTimeoutForMcastQuestion(mDNS *m, DNSQuestion *question)
        return ( curmatch ? curmatch->timeout : DEFAULT_MCAST_TIMEOUT);
        }
 
+// Returns true if it is a Domain Enumeration Query
+mDNSexport mDNSBool DomainEnumQuery(const domainname *qname)
+       {
+       const mDNSu8 *mDNS_DEQLabels[] = { (const mDNSu8 *)"\001b", (const mDNSu8 *)"\002db", (const mDNSu8 *)"\002lb",
+               (const mDNSu8 *)"\001r", (const mDNSu8 *)"\002dr", (const mDNSu8 *)mDNSNULL, };
+       const domainname *d = qname;
+       const mDNSu8 *label;
+       int i = 0;
+
+       // We need at least 3 labels (DEQ prefix) + one more label to make a meaningful DE query
+       if (CountLabels(qname) < 4) { debugf("DomainEnumQuery: question %##s, not enough labels", qname->c); return mDNSfalse; }
+
+       label = (const mDNSu8 *)d;
+       while (mDNS_DEQLabels[i] != (const mDNSu8 *)mDNSNULL)
+               {
+               if (SameDomainLabel(mDNS_DEQLabels[i], label)) {debugf("DomainEnumQuery: DEQ %##s, label1 match", qname->c); break;}
+               i++;
+               }
+       if (mDNS_DEQLabels[i] == (const mDNSu8 *)mDNSNULL)
+               {
+               debugf("DomainEnumQuery: Not a DEQ %##s, label1 mismatch", qname->c);
+               return mDNSfalse;
+               }
+       debugf("DomainEnumQuery: DEQ %##s, label1 match", qname->c);
+
+       // CountLabels already verified the number of labels 
+       d = (const domainname *)(d->c + 1 + d->c[0]);   // Second Label
+       label = (const mDNSu8 *)d;
+       if (!SameDomainLabel(label, (const mDNSu8 *)"\007_dns-sd"))
+               {
+               debugf("DomainEnumQuery: Not a DEQ %##s, label2 mismatch", qname->c);
+               return(mDNSfalse);
+               }
+       debugf("DomainEnumQuery: DEQ %##s, label2 match", qname->c);
+
+       d = (const domainname *)(d->c + 1 + d->c[0]);   // Third Label
+       label = (const mDNSu8 *)d;
+       if (!SameDomainLabel(label, (const mDNSu8 *)"\004_udp"))
+               {
+               debugf("DomainEnumQuery: Not a DEQ %##s, label3 mismatch", qname->c);
+               return(mDNSfalse);
+               }
+       debugf("DomainEnumQuery: DEQ %##s, label3 match", qname->c);
+
+       debugf("DomainEnumQuery: Question %##s is a Domain Enumeration query", qname->c);
+
+       return mDNStrue;
+       }
+
 // Sets all the Valid DNS servers for a question
 mDNSexport mDNSu32 SetValidDNSServers(mDNS *m, DNSQuestion *question)
        {
@@ -7948,8 +7886,10 @@ mDNSexport mDNSu32 SetValidDNSServers(mDNS *m, DNSQuestion *question)
        int bettermatch, currcount;
        int index = 0;
        mDNSu32 timeout = 0;
+       mDNSBool DEQuery;
 
        question->validDNSServers = zeroOpaque64;
+       DEQuery = DomainEnumQuery(&question->qname);
        for (curr = m->DNSServers; curr; curr = curr->next)
                {
                debugf("SetValidDNSServers: Parsing DNS server Address %#a (Domain %##s), Scope: %d", &curr->addr, curr->domain.c, curr->scoped);
@@ -7969,7 +7909,9 @@ mDNSexport mDNSu32 SetValidDNSServers(mDNS *m, DNSQuestion *question)
                        { debugf("SetValidDNSServers: Scoped DNS server %#a (Domain %##s) with Interface Any", &curr->addr, curr->domain.c); continue; }
 
                currcount = CountLabels(&curr->domain);
-               if ((!curr->scoped && (!question->InterfaceID || (question->InterfaceID == mDNSInterface_Unicast))) || (curr->interface == question->InterfaceID))
+               if ((!DEQuery || !curr->cellIntf) &&
+                       ((!curr->scoped && (!question->InterfaceID || (question->InterfaceID == mDNSInterface_Unicast))) ||
+                       (curr->interface == question->InterfaceID)))
                        {
                        bettermatch = BetterMatchForName(&question->qname, namecount, &curr->domain, currcount, bestmatchlen);
 
@@ -7986,6 +7928,7 @@ mDNSexport mDNSu32 SetValidDNSServers(mDNS *m, DNSQuestion *question)
                                        " Timeout %d, interface %p", question->qname.c, &curr->addr, curr->domain.c, curr->scoped, index, curr->timeout,
                                        curr->interface);
                                timeout += curr->timeout;
+                               if (DEQuery) debugf("DomainEnumQuery: Question %##s, DNSServer %#a, cell %d", question->qname.c, &curr->addr, curr->cellIntf);
                                bit_set_opaque64(question->validDNSServers, index);
                                }
                        }
@@ -8186,8 +8129,6 @@ mDNSlocal mDNSBool ShouldSuppressQuery(mDNS *const m, domainname *qname, mDNSu16
                                {
                                LogInfo("ShouldSuppressQuery: Query not suppressed for %##s, qtype %s, Local Address %.4a found", qname, DNSTypeName(qtype),
                                        &i->ip.ip.v4);
-                               if (m->SleepState == SleepState_Sleeping)
-                                       LogInfo("ShouldSuppressQuery: Would have returned true earlier");
                                return mDNSfalse;
                                }
                        else if (iptype == mDNSAddrType_IPv6 &&
@@ -8198,8 +8139,6 @@ mDNSlocal mDNSBool ShouldSuppressQuery(mDNS *const m, domainname *qname, mDNSu16
                                {
                                LogInfo("ShouldSuppressQuery: Query not suppressed for %##s, qtype %s, Local Address %.16a found", qname, DNSTypeName(qtype),
                                        &i->ip.ip.v6);
-                               if (m->SleepState == SleepState_Sleeping)
-                                       LogInfo("ShouldSuppressQuery: Would have returned true earlier");
                                return mDNSfalse;
                                }
                        }
@@ -10975,30 +10914,6 @@ mDNSlocal void mDNS_PurgeBeforeResolve(mDNS *const m, DNSQuestion *q)
                }
        }
 
-// Check for a positive unicast response to the question but with qtype
-mDNSexport mDNSBool mDNS_CheckForCacheRecord(mDNS *const m, DNSQuestion *q, mDNSu16 qtype)
-       {
-       DNSQuestion question;
-       const mDNSu32 slot = HashSlot(&q->qname);
-       CacheGroup *const cg = CacheGroupForName(m, slot, q->qnamehash, &q->qname);
-       CacheRecord *rp;
-
-       // Create an identical question but with qtype
-       mDNS_SetupQuestion(&question, q->InterfaceID, &q->qname, qtype, mDNSNULL, mDNSNULL);
-       question.qDNSServer = q->qDNSServer;
-
-       for (rp = cg ? cg->members : mDNSNULL; rp; rp = rp->next)
-               {
-               if (!rp->resrec.InterfaceID && rp->resrec.RecordType != kDNSRecordTypePacketNegative && 
-                       SameNameRecordAnswersQuestion(&rp->resrec, &question))
-                       {
-                       LogInfo("mDNS_CheckForCacheRecord: Found %s", CRDisplayString(m, rp));
-                       return mDNStrue;
-                       }
-               }
-       return mDNSfalse;
-       }
-
 mDNSlocal void CacheRecordResetDNSServer(mDNS *const m, DNSQuestion *q, DNSServer *new)
        {
        const mDNSu32 slot = HashSlot(&q->qname);
index c9d5310566e5af6b6c352ed5f194db1e69a436c7..7310dc56e3d263e04cb7edbec81b7c0c97d50af9 100755 (executable)
@@ -1075,6 +1075,7 @@ typedef struct DNSServer
        mDNSBool                scoped;         // interface should be matched against question only
                                                                // if scoped is set
        mDNSu32                 timeout;        // timeout value for questions
+       mDNSBool        cellIntf;   // Resolver from Cellular Interface ?
        } DNSServer;
 
 typedef struct                                                 // Size is 36 bytes when compiling for 32-bit; 48 when compiling for 64-bit
@@ -1466,11 +1467,10 @@ enum { NoAnswer_Normal = 0, NoAnswer_Suspended = 1, NoAnswer_Fail = 2 };
 #define MD5_LEN     16
 
 #define AutoTunnelUnregistered(X) (                                              \
-       (X)->AutoTunnelHostRecord. resrec.RecordType == kDNSRecordTypeUnregistered && \
-       (X)->AutoTunnelDeviceInfo. resrec.RecordType == kDNSRecordTypeUnregistered && \
-       (X)->AutoTunnelService.    resrec.RecordType == kDNSRecordTypeUnregistered && \
-       (X)->AutoTunnel6Record.    resrec.RecordType == kDNSRecordTypeUnregistered && \
-       (X)->AutoTunnel6MetaRecord.resrec.RecordType == kDNSRecordTypeUnregistered    )
+       (X)->AutoTunnelHostRecord.resrec.RecordType == kDNSRecordTypeUnregistered && \
+       (X)->AutoTunnelDeviceInfo.resrec.RecordType == kDNSRecordTypeUnregistered && \
+       (X)->AutoTunnelService.   resrec.RecordType == kDNSRecordTypeUnregistered && \
+       (X)->AutoTunnel6Record.   resrec.RecordType == kDNSRecordTypeUnregistered    )
 
 // Internal data structure to maintain authentication information
 typedef struct DomainAuthInfo
@@ -1482,8 +1482,7 @@ typedef struct DomainAuthInfo
        AuthRecord       AutoTunnelTarget;              // Opaque hostname of tunnel endpoint; used as SRV target for AutoTunnelService record
        AuthRecord       AutoTunnelDeviceInfo;  // Device info of tunnel endpoint
        AuthRecord       AutoTunnelService;             // Service record (possibly NAT-Mapped) of IKE daemon implementing tunnel endpoint
-       AuthRecord       AutoTunnel6Record;     // AutoTunnel AAAA record obtained from awacsd
-       AuthRecord       AutoTunnel6MetaRecord; // Notify remote peers to connect to the relay servers for potential outbound connections from this host
+       AuthRecord       AutoTunnel6Record;     // AutoTunnel AAAA Record obtained from Connectivityd
        NATTraversalInfo AutoTunnelNAT;
        domainname       domain;
        domainname       keyname;
@@ -1727,7 +1726,6 @@ struct NetworkInterfaceInfo_struct
        mDNSu8          McastTxRx;                      // Send/Receive multicast on this { InterfaceID, address family } ?
        mDNSu8          NetWake;                        // Set if Wake-On-Magic-Packet is enabled on this interface
        mDNSu8          Loopback;                       // Set if this is the loopback interface
-       AuthRecord     *SPSRRSet;                       // To help the client keep track of the records registered with the sleep proxy
        };
 
 #define SLE_DELETE              0x00000001
@@ -2471,7 +2469,7 @@ extern void RecreateNATMappings(mDNS *const m);
 extern void mDNS_AddDynDNSHostName(mDNS *m, const domainname *fqdn, mDNSRecordCallback *StatusCallback, const void *StatusContext);
 extern void mDNS_RemoveDynDNSHostName(mDNS *m, const domainname *fqdn);
 extern void mDNS_SetPrimaryInterfaceInfo(mDNS *m, const mDNSAddr *v4addr,  const mDNSAddr *v6addr, const mDNSAddr *router);
-extern DNSServer *mDNS_AddDNSServer(mDNS *const m, const domainname *d, const mDNSInterfaceID interface, const mDNSAddr *addr, const mDNSIPPort port, mDNSBool scoped, mDNSu32 timeout);
+extern DNSServer *mDNS_AddDNSServer(mDNS *const m, const domainname *d, const mDNSInterfaceID interface, const mDNSAddr *addr, const mDNSIPPort port, mDNSBool scoped, mDNSu32 timeout, mDNSBool cellIntf);
 extern void PenalizeDNSServer(mDNS *const m, DNSQuestion *q);
 extern void mDNS_AddSearchDomain(const domainname *const domain, mDNSInterfaceID InterfaceID);
 
@@ -2656,8 +2654,8 @@ extern mDNSBool   mDNSPlatformValidRecordForInterface(AuthRecord *rr, const Netw
 extern void     LNT_SendDiscoveryMsg(mDNS *m);
 extern void     LNT_ConfigureRouterInfo(mDNS *m, const mDNSInterfaceID InterfaceID, const mDNSu8 *const data, const mDNSu16 len);
 extern mStatus  LNT_GetExternalAddress(mDNS *m);
-extern mStatus  LNT_MapPort(mDNS *m, NATTraversalInfo *n);
-extern mStatus  LNT_UnmapPort(mDNS *m, NATTraversalInfo *n);
+extern mStatus  LNT_MapPort(mDNS *m, NATTraversalInfo *const n);
+extern mStatus  LNT_UnmapPort(mDNS *m, NATTraversalInfo *const n);
 extern void     LNT_ClearState(mDNS *const m);
 #endif // _LEGACY_NAT_TRAVERSAL_
 
@@ -2732,6 +2730,7 @@ extern void DNSServerChangeForQuestion(mDNS *const m, DNSQuestion *q, DNSServer
 extern void ActivateUnicastRegistration(mDNS *const m, AuthRecord *const rr);
 extern void CheckSuppressUnusableQuestions(mDNS *const m);
 extern void RetrySearchDomainQuestions(mDNS *const m);
+extern mDNSBool DomainEnumQuery(const domainname *qname);
 
 // Used only in logging to restrict the number of /etc/hosts entries printed
 extern void FreeEtcHosts(mDNS *const m, AuthRecord *const rr, mStatus result);
@@ -2740,7 +2739,6 @@ extern AuthGroup *AuthGroupForName(AuthHash *r, const mDNSu32 slot, const mDNSu3
 extern AuthGroup *AuthGroupForRecord(AuthHash *r, const mDNSu32 slot, const ResourceRecord *const rr);
 extern AuthGroup *InsertAuthRecord(mDNS *const m, AuthHash *r, AuthRecord *rr);
 extern AuthGroup *RemoveAuthRecord(mDNS *const m, AuthHash *r, AuthRecord *rr);
-extern mDNSBool mDNS_CheckForCacheRecord(mDNS *const m, DNSQuestion *q, mDNSu16 qtype);
 
 // For now this AutoTunnel stuff is specific to Mac OS X.
 // In the future, if there's demand, we may see if we can abstract it out cleanly into the platform layer
@@ -2947,10 +2945,10 @@ struct CompileTimeAssertionChecks_mDNS
        char sizecheck_ZoneData            [(sizeof(ZoneData)             <=  1624) ? 1 : -1];
        char sizecheck_NATTraversalInfo    [(sizeof(NATTraversalInfo)     <=   192) ? 1 : -1];
        char sizecheck_HostnameInfo        [(sizeof(HostnameInfo)         <=  3050) ? 1 : -1];
-       char sizecheck_DNSServer           [(sizeof(DNSServer)            <=   320) ? 1 : -1];
+       char sizecheck_DNSServer           [(sizeof(DNSServer)            <=   328) ? 1 : -1];
        char sizecheck_NetworkInterfaceInfo[(sizeof(NetworkInterfaceInfo) <=  6850) ? 1 : -1];
        char sizecheck_ServiceRecordSet    [(sizeof(ServiceRecordSet)     <=  5500) ? 1 : -1];
-       char sizecheck_DomainAuthInfo      [(sizeof(DomainAuthInfo)       <=  7968) ? 1 : -1];
+       char sizecheck_DomainAuthInfo      [(sizeof(DomainAuthInfo)       <=  7808) ? 1 : -1];
        char sizecheck_ServiceInfoQuery    [(sizeof(ServiceInfoQuery)     <=  3200) ? 1 : -1];
 #if APPLE_OSX_mDNSResponder
        char sizecheck_ClientTunnel        [(sizeof(ClientTunnel)         <=  1148) ? 1 : -1];
index 5c4e3a1748463f44c91bf8e37071dc16b79ef18a..57cfc1a689e65361c568fd2c88a5e792ea92f469 100755 (executable)
@@ -101,7 +101,7 @@ mDNSlocal void SetRecordRetry(mDNS *const m, AuthRecord *rr, mDNSu32 random)
 #pragma mark - Name Server List Management
 #endif
 
-mDNSexport DNSServer *mDNS_AddDNSServer(mDNS *const m, const domainname *d, const mDNSInterfaceID interface, const mDNSAddr *addr, const mDNSIPPort port, mDNSBool scoped, mDNSu32 timeout)
+mDNSexport DNSServer *mDNS_AddDNSServer(mDNS *const m, const domainname *d, const mDNSInterfaceID interface, const mDNSAddr *addr, const mDNSIPPort port, mDNSBool scoped, mDNSu32 timeout, mDNSBool cellIntf)
        {
        DNSServer **p = &m->DNSServers;
        DNSServer *tmp = mDNSNULL;
@@ -150,6 +150,7 @@ mDNSexport DNSServer *mDNS_AddDNSServer(mDNS *const m, const domainname *d, cons
                        (*p)->teststate = /* DNSServer_Untested */ DNSServer_Passed;
                        (*p)->lasttest  = m->timenow - INIT_UCAST_POLL_INTERVAL;
                        (*p)->timeout   = timeout;
+                       (*p)->cellIntf  = cellIntf;
                        AssignDomainName(&(*p)->domain, d);
                        (*p)->next = mDNSNULL;
                        }
@@ -384,13 +385,12 @@ mDNSexport mStatus mDNS_SetSecretForDomain(mDNS *m, DomainAuthInfo *info,
 
        // Caution: Only zero AutoTunnelHostRecord.namestorage and AutoTunnelNAT.clientContext AFTER we've determined that this is a NEW DomainAuthInfo
        // being added to the list. Otherwise we risk smashing our AutoTunnel host records and NATOperation that are already active and in use.
-       info->AutoTunnelHostRecord .resrec.RecordType = kDNSRecordTypeUnregistered;
-       info->AutoTunnelHostRecord .namestorage.c[0] = 0;
-       info->AutoTunnelTarget     .resrec.RecordType = kDNSRecordTypeUnregistered;
-       info->AutoTunnelDeviceInfo .resrec.RecordType = kDNSRecordTypeUnregistered;
-       info->AutoTunnelService    .resrec.RecordType = kDNSRecordTypeUnregistered;
-       info->AutoTunnel6Record    .resrec.RecordType = kDNSRecordTypeUnregistered;
-       info->AutoTunnel6MetaRecord.resrec.RecordType = kDNSRecordTypeUnregistered;
+       info->AutoTunnelHostRecord.resrec.RecordType = kDNSRecordTypeUnregistered;
+       info->AutoTunnelHostRecord.namestorage.c[0] = 0;
+       info->AutoTunnelTarget    .resrec.RecordType = kDNSRecordTypeUnregistered;
+       info->AutoTunnelDeviceInfo.resrec.RecordType = kDNSRecordTypeUnregistered;
+       info->AutoTunnelService   .resrec.RecordType = kDNSRecordTypeUnregistered;
+       info->AutoTunnel6Record   .resrec.RecordType = kDNSRecordTypeUnregistered;
        info->AutoTunnelNAT.clientContext = mDNSNULL;
        info->next = mDNSNULL;
        *p = info;
@@ -3157,7 +3157,7 @@ mDNSlocal void hndlRecordUpdateReply(mDNS *m, AuthRecord *rr, mStatus err, mDNSu
 
        rr->updateError = err;
 #if APPLE_OSX_mDNSResponder
-       if (err == mStatus_BadSig || err == mStatus_BadKey) UpdateAutoTunnelDomainStatuses(m);
+       if (err == mStatus_BadSig) UpdateAutoTunnelDomainStatuses(m);
 #endif
 
        SetRecordRetry(m, rr, random);
@@ -4109,56 +4109,6 @@ mDNSexport mStatus uDNS_UpdateRecord(mDNS *m, AuthRecord *rr)
 #pragma mark - Periodic Execution Routines
 #endif
 
-mDNSlocal const mDNSu8 *mDNS_WABLabels[] =
-       {
-       (const mDNSu8 *)"\001b",
-       (const mDNSu8 *)"\002db",
-       (const mDNSu8 *)"\002lb",
-       (const mDNSu8 *)"\001r",
-       (const mDNSu8 *)"\002dr",
-       (const mDNSu8 *)mDNSNULL,
-       };
-
-// Returns true if it is a WAB question
-mDNSlocal mDNSBool WABQuestion(const domainname *qname)
-       {
-       const mDNSu8 *sd = (const mDNSu8 *)"\007_dns-sd";
-       const mDNSu8 *prot = (const mDNSu8 *)"\004_udp";
-       const domainname *d = qname;
-       const mDNSu8 *label;
-       int i = 0;
-
-       // We need at least 3 labels (WAB prefix) + one more label to make
-       // a meaningful WAB query
-       if (CountLabels(qname) < 4) { debugf("WABQuestion: question %##s, not enough labels", qname->c); return mDNSfalse; }
-
-       label = (const mDNSu8 *)d;
-       while (mDNS_WABLabels[i] != (const mDNSu8 *)mDNSNULL)
-               {
-               if (SameDomainLabel(mDNS_WABLabels[i], label)) {debugf("WABquestion: WAB question %##s, label1 match", qname->c); break;}
-               i++;
-               }
-       if (mDNS_WABLabels[i] == (const mDNSu8 *)mDNSNULL)
-               {
-               debugf("WABquestion: Not a WAB question %##s, label1 mismatch", qname->c);
-               return mDNSfalse;
-               }
-       // CountLabels already verified the number of labels 
-       d = (const domainname *)(d->c + 1 + d->c[0]);   // Second Label
-       label = (const mDNSu8 *)d;
-       if (!SameDomainLabel(label, sd)){ debugf("WABquestion: Not a WAB question %##s, label2 mismatch", qname->c);return(mDNSfalse); }
-       debugf("WABquestion: WAB question %##s, label2 match", qname->c);
-
-       d = (const domainname *)(d->c + 1 + d->c[0]);   // Third Label
-       label = (const mDNSu8 *)d;
-       if (!SameDomainLabel(label, prot)){ debugf("WABquestion: Not a WAB question %##s, label3 mismatch", qname->c);return(mDNSfalse); }
-       debugf("WABquestion: WAB question %##s, label3 match", qname->c);
-
-       LogInfo("WABquestion: Question %##s is a WAB question", qname->c);
-
-       return mDNStrue;
-       }
-
 // The question to be checked is not passed in as an explicit parameter;
 // instead it is implicit that the question to be checked is m->CurrentQuestion.
 mDNSexport void uDNS_CheckCurrentQuestion(mDNS *const m)
@@ -4286,7 +4236,14 @@ mDNSexport void uDNS_CheckCurrentQuestion(mDNS *const m)
                                                q->ThisQInterval = LLQ_POLL_INTERVAL;
                                        LogInfo("uDNS_CheckCurrentQuestion: private non polling question for %##s (%s) will be retried in %d ms", q->qname.c, DNSTypeName(q->qtype), q->ThisQInterval);
                                        }
-                               debugf("Increased ThisQInterval to %d for %##s (%s)", q->ThisQInterval, q->qname.c, DNSTypeName(q->qtype));
+                               if (q->qDNSServer->cellIntf)
+                                       {
+                                       // We don't want to retransmit too soon. Schedule our first retransmisson at
+                                       // MIN_UCAST_RETRANS_TIMEOUT seconds.
+                                       if (q->ThisQInterval < MIN_UCAST_RETRANS_TIMEOUT)
+                                               q->ThisQInterval = MIN_UCAST_RETRANS_TIMEOUT;
+                                       }
+                               debugf("uDNS_CheckCurrentQuestion: Increased ThisQInterval to %d for %##s (%s), cell %d", q->ThisQInterval, q->qname.c, DNSTypeName(q->qtype), q->qDNSServer->cellIntf);
                                }
                        q->LastQTime = m->timenow;
                        SetNextQueryTime(m, q);
@@ -4352,7 +4309,7 @@ mDNSexport void uDNS_CheckCurrentQuestion(mDNS *const m)
                        // For some of the WAB queries that we generate form within the mDNSResponder, most of the home routers
                        // don't understand and return ServFail/NXDomain. In those cases, we don't want to try too often. We try
                        // every fifteen minutes in that case
-                       MakeNegativeCacheRecord(m, &m->rec.r, &q->qname, q->qnamehash, q->qtype, q->qclass, (WABQuestion(&q->qname) ? 60 * 15 : 60), mDNSInterface_Any, q->qDNSServer);
+                       MakeNegativeCacheRecord(m, &m->rec.r, &q->qname, q->qnamehash, q->qtype, q->qclass, (DomainEnumQuery(&q->qname) ? 60 * 15 : 60), mDNSInterface_Any, q->qDNSServer);
                        q->unansweredQueries = 0;
                        // We're already using the m->CurrentQuestion pointer, so CacheRecordAdd can't use it to walk the question list.
                        // To solve this problem we set rr->DelayDelivery to a nonzero value (which happens to be 'now') so that we
index 2dfaf51ec8c99208b0db823a97a8b0c3fd562d33..8e46ffa77d4e7ec3fe8c86fa01d8a4104c1f1a48 100755 (executable)
 #define MAX_UCAST_UNANSWERED_QUERIES 2                       // the number of unanswered queries from any one uDNS server before trying another server
 #define DNSSERVER_PENALTY_TIME (60 * mDNSPlatformOneSecond) // number of seconds for which new questions don't pick this server
 
+// On some interfaces, we want to delay the first retransmission to a minimum of 2 seconds
+// rather than the default (1 second).
+#define MIN_UCAST_RETRANS_TIMEOUT (2 * mDNSPlatformOneSecond)
+
 #define DEFAULT_UPDATE_LEASE 7200
 
 #define QuestionIntervalStep 3
index 6748eaa098e070bb4b951903770caf8d1e8d85dc..473d4143ff458d0ee24fc9342752ac4463a01528 100644 (file)
@@ -11,7 +11,7 @@
        <key>CFBundleIconFile</key>
        <string></string>
        <key>CFBundleIdentifier</key>
-       <string>com.apple.${PRODUCT_NAME:rfc1034Identifier}</string>
+       <string>com.apple.${PRODUCT_NAME:rfc1034identifier}</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundlePackageType</key>
index 6c5d700e80806eca7aec44f328d30c347b0d07f6..b055a5f960351f329879c9c57a00293035e96b65 100644 (file)
  */
 
 #include <CoreFoundation/CoreFoundation.h>
+#include <CoreFoundation/CFXPCBridge.h>
 #include <dns_sd.h>
 #include <UserEventAgentInterface.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <asl.h>
+#include <xpc/xpc.h>
 
 
 #pragma mark -
@@ -34,11 +37,9 @@ static const CFStringRef     sServiceDomainKey               = CFSTR("ServiceDomain");
 
 static const CFStringRef       sOnServiceAddKey                = CFSTR("OnServiceAdd");
 static const CFStringRef       sOnServiceRemoveKey             = CFSTR("OnServiceRemove");
-static const CFStringRef    sWhileServiceExistsKey     = CFSTR("WhileServiceExists");
 
 static const CFStringRef       sLaunchdTokenKey                = CFSTR("LaunchdToken");
-
-static const CFStringRef       sPluginTimersKey                = CFSTR("PluginTimers");
+static const CFStringRef       sLaunchdDictKey                 = CFSTR("LaunchdDict");
 
 
 /************************************************
@@ -82,25 +83,11 @@ typedef struct {
        void*                                                           _pluginContext;
        
        CFMutableDictionaryRef                          _tokenToBrowserMap;             // Maps a token to a browser that can be used to scan the remaining dictionaries.
-       CFMutableDictionaryRef                          _browsers;                              // A Dictionary of "Browser Dictionarys" where the resposible browser is the key.
-       CFMutableDictionaryRef                          _onAddEvents;                   // A Dictionary of "Event Dictionarys" that describe events to trigger on a service appearing.
-       CFMutableDictionaryRef                          _onRemoveEvents;                // A Dictionary of "Event Dictionarys" that describe events to trigger on a service disappearing.
-       CFMutableDictionaryRef                          _whileServiceExist;             // A Dictionary of "Event Dictionarys" that describe events to trigger on a service disappearing.
-
-       
-       CFMutableArrayRef                                       _timers;
-
+       CFMutableDictionaryRef                          _browsers;                              // A Dictionary of Browser Dictionaries where the resposible browser is the key.
+       CFMutableDictionaryRef                          _onAddEvents;                   // A Dictionary of Event Dictionaries that describe events to trigger on a service appearing.
+       CFMutableDictionaryRef                          _onRemoveEvents;                // A Dictionary of Event Dictionaries that describe events to trigger on a service disappearing.
 } BonjourUserEventsPlugin;
 
-
-typedef struct {
-       
-       CFIndex  refCount;
-       BonjourUserEventsPlugin* plugin;
-       CFNumberRef token;
-       
-} TimerContextInfo;
-
 typedef struct {
        CFIndex refCount;
        DNSServiceRef browserRef;
@@ -132,7 +119,7 @@ static void ManageEventsCallback(
 void AddEventToPlugin(BonjourUserEventsPlugin* plugin, CFNumberRef launchdToken, CFDictionaryRef eventParameters);
 void RemoveEventFromPlugin(BonjourUserEventsPlugin* plugin, CFNumberRef        launchToken);
 
-NetBrowserInfo* CreateBrowserForTypeAndDomain(BonjourUserEventsPlugin* plugin, CFStringRef type, CFStringRef domain);
+NetBrowserInfo* CreateBrowser(BonjourUserEventsPlugin* plugin, CFStringRef type, CFStringRef domain);
 NetBrowserInfo* BrowserForSDRef(BonjourUserEventsPlugin* plugin, DNSServiceRef sdRef);
 void AddEventDictionary(CFDictionaryRef eventDict, CFMutableDictionaryRef allEventsDictionary, NetBrowserInfo* key);
 void RemoveEventFromArray(CFMutableArrayRef array, CFNumberRef launchdToken);
@@ -140,19 +127,10 @@ void RemoveEventFromArray(CFMutableArrayRef array, CFNumberRef launchdToken);
 // Net Service Browser Stuff
 void ServiceBrowserCallback (DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char* serviceName, const char* regtype, const char* replyDomain, void* context);
 void HandleTemporaryEventsForService(BonjourUserEventsPlugin* plugin, NetBrowserInfo* browser, CFStringRef serviceName, CFMutableDictionaryRef eventsDictionary);
-void HandleStateEventsForService(BonjourUserEventsPlugin* plugin, NetBrowserInfo* browser,  CFStringRef serviceName, Boolean didAppear);
-void TemporaryEventTimerCallout ( CFRunLoopTimerRef timer, void *info );
 
 // Convence Stuff
 const char* CStringFromCFString(CFStringRef string);
 
-
-// TimerContextInfo "Object"
-TimerContextInfo* TimerContextInfoCreate(BonjourUserEventsPlugin* plugin, CFNumberRef token);
-const void* TimerContextInfoRetain(const void* info);
-void TimerContextInfoRelease(const void* info);
-CFStringRef TimerContextInfoCopyDescription(const void* info);
-
 // NetBrowserInfo "Object"
 NetBrowserInfo* NetBrowserInfoCreate(CFStringRef serviceType, CFStringRef domain, void* context);
 const void* NetBrowserInfoRetain(CFAllocatorRef allocator, const void* info);
@@ -161,7 +139,6 @@ Boolean     NetBrowserInfoEqual(const void *value1, const void *value2);
 CFHashCode     NetBrowserInfoHash(const void *value);
 CFStringRef    NetBrowserInfoCopyDescription(const void *value);
 
-
 static const CFDictionaryKeyCallBacks kNetBrowserInfoDictionaryKeyCallbacks = { 
        0, 
        NetBrowserInfoRetain, 
@@ -271,9 +248,6 @@ static BonjourUserEventsPlugin* Alloc(CFUUIDRef factoryID)
        plugin->_browsers = CFDictionaryCreateMutable(NULL, 0, &kNetBrowserInfoDictionaryKeyCallbacks, &kCFTypeDictionaryValueCallBacks);
        plugin->_onAddEvents = CFDictionaryCreateMutable(NULL, 0, &kNetBrowserInfoDictionaryKeyCallbacks, &kCFTypeDictionaryValueCallBacks);
        plugin->_onRemoveEvents = CFDictionaryCreateMutable(NULL, 0, &kNetBrowserInfoDictionaryKeyCallbacks, &kCFTypeDictionaryValueCallBacks);
-       plugin->_whileServiceExist = CFDictionaryCreateMutable(NULL, 0, &kNetBrowserInfoDictionaryKeyCallbacks, &kCFTypeDictionaryValueCallBacks);
-       
-       plugin->_timers = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
        
        return plugin;
 }
@@ -307,24 +281,6 @@ static void Dealloc(BonjourUserEventsPlugin* plugin)
        if (plugin->_onRemoveEvents)
                CFRelease(plugin->_onRemoveEvents);
        
-       if (plugin->_whileServiceExist)
-               CFRelease(plugin->_whileServiceExist);
-       
-       if (plugin->_timers)
-       {
-               CFIndex i;
-               CFIndex count = CFArrayGetCount(plugin->_timers);
-               CFRunLoopRef crl = CFRunLoopGetCurrent();
-               
-               for (i = 0; i < count; ++i)
-               {
-                       CFRunLoopTimerRef timer = (CFRunLoopTimerRef)CFArrayGetValueAtIndex(plugin->_timers, i);
-                       CFRunLoopRemoveTimer(crl, timer, kCFRunLoopCommonModes);
-               }
-               
-               CFRelease(plugin->_timers);
-       }
-       
        free(plugin);
 }
 
@@ -360,7 +316,7 @@ static void Install(void *instance)
        
        if (!plugin->_pluginContext)
        {
-               fprintf(stderr, "%s: failed to register for launch events.\n", sPluginIdentifier);
+               fprintf(stderr, "%s:%s failed to register for launch events.\n", sPluginIdentifier, __FUNCTION__);
                return;
        }
        
@@ -375,25 +331,32 @@ static void Install(void *instance)
 static void ManageEventsCallback(UserEventAgentLaunchdAction action, CFNumberRef token, CFTypeRef eventMatchDict, void* vContext)
 {
        
-       if (!eventMatchDict || CFGetTypeID(eventMatchDict) != CFDictionaryGetTypeID())
+       if (!eventMatchDict)
        {
-               fprintf(stderr, "%s given non-dictionary for event dictionary\n", sPluginIdentifier);
+               fprintf(stderr, "%s:%s empty dictionary\n", sPluginIdentifier, __FUNCTION__);
+               return;
+       }
+       if (CFGetTypeID(eventMatchDict) != CFDictionaryGetTypeID())
+       {
+               fprintf(stderr, "%s:%s given non-dict for event dictionary, action %d\n", sPluginIdentifier, __FUNCTION__, action);
                return;
        }
        
        if (action == kUserEventAgentLaunchdAdd)
        {
                // Launchd wants us to add a launch event for this token and matching dictionary.
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s calling AddEventToPlugin", sPluginIdentifier, __FUNCTION__);
                AddEventToPlugin((BonjourUserEventsPlugin*)vContext, token, (CFDictionaryRef)eventMatchDict);
        }
        else if (action == kUserEventAgentLaunchdRemove)
        {
                // Launchd wants us to remove the event hook we setup for this token / matching dictionary.
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s calling RemoveEventToPlugin", sPluginIdentifier, __FUNCTION__);
                RemoveEventFromPlugin((BonjourUserEventsPlugin*)vContext, token);
        }
        else
        {
-               fprintf(stderr, "%s got unknown UserEventAction: %d\n", sPluginIdentifier, action);
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s unknown callback event\n", sPluginIdentifier, __FUNCTION__);
        }
 }
 
@@ -415,32 +378,27 @@ void AddEventToPlugin(BonjourUserEventsPlugin* plugin, CFNumberRef launchdToken,
        CFStringRef             name = CFDictionaryGetValue(eventParameters, sServiceNameKey);
        CFBooleanRef    cfOnAdd = CFDictionaryGetValue(eventParameters, sOnServiceAddKey);
        CFBooleanRef    cfOnRemove = CFDictionaryGetValue(eventParameters, sOnServiceRemoveKey);
-       CFBooleanRef    cfWhileSericeExists = CFDictionaryGetValue(eventParameters, sWhileServiceExistsKey);
        
        Boolean                 onAdd = false;
        Boolean                 onRemove = false;
-       Boolean                 whileExists = false;
        
-       if (cfOnAdd && CFGetTypeID(cfOnRemove) == CFBooleanGetTypeID() && CFBooleanGetValue(cfOnAdd))
+       if (cfOnAdd && CFGetTypeID(cfOnAdd) == CFBooleanGetTypeID() && CFBooleanGetValue(cfOnAdd))
                onAdd = true;
        
        if (cfOnRemove && CFGetTypeID(cfOnRemove) == CFBooleanGetTypeID() && CFBooleanGetValue(cfOnRemove))
                onRemove = true;
        
-       if (cfWhileSericeExists && CFGetTypeID(cfWhileSericeExists) == CFBooleanGetTypeID() && CFBooleanGetValue(cfWhileSericeExists))
-               whileExists = true;
-       
        // A type is required. If none is specified, BAIL
        if (!type || CFGetTypeID(type) != CFStringGetTypeID()) 
        {
-               fprintf(stderr, "%s, a LaunchEvent is missing a service type.\n", sPluginIdentifier);
+               fprintf(stderr, "%s:%s: a LaunchEvent is missing a service type.\n", sPluginIdentifier, __FUNCTION__);
                return;
        }
-       
+
        // If we aren't suppose to launch on services appearing or disappearing, this service does nothing. Ignore.
-       if ((!onAdd && !onRemove && !whileExists) || (onAdd && onRemove && whileExists))
+       if (!onAdd && !onRemove)
        {
-               fprintf(stderr, "%s, a LaunchEvent is missing both onAdd/onRemove/existance or has both.\n", sPluginIdentifier);
+               fprintf(stderr, "%s:%s a LaunchEvent is missing both onAdd and onRemove events\n", sPluginIdentifier, __FUNCTION__);
                return;
        }
 
@@ -449,59 +407,59 @@ void AddEventToPlugin(BonjourUserEventsPlugin* plugin, CFNumberRef launchdToken,
        {
                domain = CFSTR("local"); 
        }
-       else if (CFGetTypeID(domain) != CFStringGetTypeID() ) // If the domain is not a string, fai;
+       else if (CFGetTypeID(domain) != CFStringGetTypeID() ) // If the domain is not a string, fail
        {
-               fprintf(stderr, "%s, a LaunchEvent has a domain that is not a string.\n", sPluginIdentifier);
+               fprintf(stderr, "%s:%s a LaunchEvent has a domain that is not a string.\n", sPluginIdentifier, __FUNCTION__);
                return;
        }
 
-       
-       // If we have a name filter, but it's not a string. This event it broken, bail.
+       // If we have a name filter, but it's not a string. This event is broken, bail.
        if (name && CFGetTypeID(name) != CFStringGetTypeID())
        {
-               fprintf(stderr, "%s, a LaunchEvent has a domain that is not a string.\n", sPluginIdentifier);
+               fprintf(stderr, "%s:%s a LaunchEvent has a domain that is not a string.\n", sPluginIdentifier, __FUNCTION__);
                return;
        }
-       
+
        // Get us a browser
-       NetBrowserInfo* browser = CreateBrowserForTypeAndDomain(plugin, type, domain);
+       NetBrowserInfo* browser = CreateBrowser(plugin, type, domain);
        
        if (!browser)
        {
-               fprintf(stderr, "%s, a LaunchEvent has a domain that is not a string.\n", sPluginIdentifier);
+               fprintf(stderr, "%s:%s cannot create browser\n", sPluginIdentifier, __FUNCTION__);
                return;
        }
        
        // Create Event Dictionary
        CFMutableDictionaryRef eventDictionary = CFDictionaryCreateMutable(NULL, 4, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
        
-       
+       // We store both the Token and the Dictionary. UserEventAgentSetLaunchEventState needs
+       // the token and UserEventAgentSetFireEvent needs both the token and the dictionary
        CFDictionarySetValue(eventDictionary, sLaunchdTokenKey, launchdToken);
+       CFDictionarySetValue(eventDictionary, sLaunchdDictKey, eventParameters);
        
        if (name)
                CFDictionarySetValue(eventDictionary, sServiceNameKey, name);
        
        // Add to the correct dictionary.
        if (onAdd)
+       {
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s: Adding browser to AddEvents", sPluginIdentifier, __FUNCTION__);
                AddEventDictionary(eventDictionary, plugin->_onAddEvents, browser);
+       }
        
        if (onRemove)
+       {
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s: Adding browser to RemoveEvents", sPluginIdentifier, __FUNCTION__);
                AddEventDictionary(eventDictionary, plugin->_onRemoveEvents, browser);
-       
-       if (whileExists)
-               AddEventDictionary(eventDictionary, plugin->_whileServiceExist, browser);
+       }
        
        // Add Token Mapping
        CFDictionarySetValue(plugin->_tokenToBrowserMap, launchdToken, browser);
        
        // Release Memory
        CFRelease(eventDictionary);
-       NetBrowserInfoRelease(NULL, browser);
-       
 }
 
-
-
 /*****************************************************************************
  * RemoveEventFromPlugin
  * - 
@@ -517,7 +475,7 @@ void RemoveEventFromPlugin(BonjourUserEventsPlugin* plugin, CFNumberRef     launchdT
        {
                long long value = 0;
                CFNumberGetValue(launchdToken, kCFNumberLongLongType, &value);
-               fprintf(stderr, "%s, Launchd asked us to remove a token we did not register!\nToken:%lld\n", sPluginIdentifier, value);
+               fprintf(stderr, "%s:%s Launchd asked us to remove a token we did not register! ==Token:%lld== \n", sPluginIdentifier, __FUNCTION__, value);
                return;
        }
        
@@ -526,22 +484,30 @@ void RemoveEventFromPlugin(BonjourUserEventsPlugin* plugin, CFNumberRef   launchdT
        
        if (onAddEvents)
        {
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s: Calling RemoveEventFromArray for OnAddEvents", sPluginIdentifier, __FUNCTION__);
                RemoveEventFromArray(onAddEvents, launchdToken);
                                
                // Is the array now empty, clean up 
                if (CFArrayGetCount(onAddEvents) == 0)
+               {
+                       asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s: Removing the browser from AddEvents", sPluginIdentifier, __FUNCTION__);
                        CFDictionaryRemoveValue(plugin->_onAddEvents, browser);
+               }
        }
 
        if (onRemoveEvents)
        {
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s: Calling RemoveEventFromArray for OnRemoveEvents", sPluginIdentifier, __FUNCTION__);
                RemoveEventFromArray(onRemoveEvents, launchdToken);
                
                // Is the array now empty, clean up 
                if (CFArrayGetCount(onRemoveEvents) == 0)
+               {
+                       asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s: Removing the browser from RemoveEvents", sPluginIdentifier, __FUNCTION__);
                        CFDictionaryRemoveValue(plugin->_onRemoveEvents, browser);
+               }
        }
-       
+
        // Remove ourselves from the token dictionary.
        CFDictionaryRemoveValue(plugin->_tokenToBrowserMap, launchdToken);
        
@@ -565,7 +531,14 @@ void RemoveEventFromPlugin(BonjourUserEventsPlugin* plugin, CFNumberRef    launchdT
        // If no one else is useing our browser, clean up!
        if (!othersUsingBrowser)
        {
-               CFDictionaryRemoveValue(plugin->_tokenToBrowserMap, launchdToken); // This triggers release and dealloc of the browser
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s: Removing browser %p from _browsers", sPluginIdentifier, __FUNCTION__, browser);
+               CFDictionaryRemoveValue(plugin->_browsers, browser); // This triggers release and dealloc of the browser
+       }
+       else
+       {
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s: Decrementing browsers %p count", sPluginIdentifier, __FUNCTION__, browser);
+               // Decrement my reference count (it was incremented when it was added to _browsers in CreateBrowser)
+               NetBrowserInfoRelease(NULL, browser);
        }
        
        free(browsers);
@@ -573,12 +546,12 @@ void RemoveEventFromPlugin(BonjourUserEventsPlugin* plugin, CFNumberRef   launchdT
 
 
 /*****************************************************************************
- * CreateBrowserForTypeAndDomain
+ * CreateBrowser
  * - 
  * This method returns a NetBrowserInfo that is looking for a type of 
  * service in a domain. If no browser exists, it will create one and return it.
  *****************************************************************************/
-NetBrowserInfo* CreateBrowserForTypeAndDomain(BonjourUserEventsPlugin* plugin, CFStringRef type, CFStringRef domain)
+NetBrowserInfo* CreateBrowser(BonjourUserEventsPlugin* plugin, CFStringRef type, CFStringRef domain)
 {
        CFIndex i;
        CFIndex count = CFDictionaryGetCount(plugin->_browsers);
@@ -589,6 +562,7 @@ NetBrowserInfo* CreateBrowserForTypeAndDomain(BonjourUserEventsPlugin* plugin, C
        // Fetch the values of the browser dictionary
        CFDictionaryGetKeysAndValues(plugin->_browsers, (const void**)browsers, (const void**)dicts);
        
+       
        // Loop thru the browsers list and see if we can find a matching one.
        for (i = 0; i < count; ++i)
        {
@@ -598,9 +572,10 @@ NetBrowserInfo* CreateBrowserForTypeAndDomain(BonjourUserEventsPlugin* plugin, C
                CFStringRef browserDomain = CFDictionaryGetValue(browserDict, sServiceDomainKey);
                
                // If we have a matching browser, break
-               if (CFStringCompare(browserType, type, kCFCompareCaseInsensitive) &&
-                       CFStringCompare(browserDomain, domain, kCFCompareCaseInsensitive))
+               if ((CFStringCompare(browserType, type, kCFCompareCaseInsensitive) == kCFCompareEqualTo) &&
+                       (CFStringCompare(browserDomain, domain, kCFCompareCaseInsensitive) == kCFCompareEqualTo))
                {
+                       asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s: found a duplicate browser\n", sPluginIdentifier, __FUNCTION__);
                        browser = browsers[i];
                        NetBrowserInfoRetain(NULL, browser);
                        break;
@@ -615,7 +590,7 @@ NetBrowserInfo* CreateBrowserForTypeAndDomain(BonjourUserEventsPlugin* plugin, C
                
                if (!browser)
                {                       
-                       fprintf(stderr, "%s, failed to search for %s.%s", sPluginIdentifier, CStringFromCFString(type) , CStringFromCFString(domain));
+                       fprintf(stderr, "%s:%s failed to search for %s.%s", sPluginIdentifier, __FUNCTION__, CStringFromCFString(type) , CStringFromCFString(domain));
                        free(dicts);
                        free(browsers);
                        return NULL;
@@ -629,6 +604,8 @@ NetBrowserInfo* CreateBrowserForTypeAndDomain(BonjourUserEventsPlugin* plugin, C
                
                // Add the dictionary to the browsers dictionary.
                CFDictionarySetValue(plugin->_browsers, browser, browserDict);
+
+               NetBrowserInfoRelease(NULL, browser);
                
                // Release Memory
                CFRelease(browserDict);
@@ -688,9 +665,11 @@ void AddEventDictionary(CFDictionaryRef eventDict, CFMutableDictionaryRef allEve
        {
                eventsForBrowser = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks);
                CFDictionarySetValue(allEventsDictionary, key, eventsForBrowser); 
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s creating a new array", sPluginIdentifier, __FUNCTION__);
        }
        else 
        {
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s Incrementing refcount", sPluginIdentifier, __FUNCTION__);
                CFRetain(eventsForBrowser);
        }
 
@@ -709,6 +688,7 @@ void RemoveEventFromArray(CFMutableArrayRef array, CFNumberRef launchdToken)
 {
        CFIndex i;
        CFIndex count = CFArrayGetCount(array);
+
        // Loop thru looking for us.
        for (i = 0; i < count; )
        {
@@ -717,14 +697,16 @@ void RemoveEventFromArray(CFMutableArrayRef array, CFNumberRef launchdToken)
                
                if (CFEqual(token, launchdToken)) // This is the same event?
                {
+                       asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s found token", sPluginIdentifier, __FUNCTION__);
                        CFArrayRemoveValueAtIndex(array, i);    // Remove the event,
-                       break; // The token should only exist once, so it make no sense to continue.
+                       break; // The token should only exist once, so it makes no sense to continue.
                }
                else
                {
                        ++i; // If it's not us, advance.
                }
-       }       
+       }
+       if (i == count) asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s did not find token", sPluginIdentifier, __FUNCTION__);
 }
 
 #pragma mark -
@@ -754,22 +736,28 @@ void ServiceBrowserCallback (DNSServiceRef                                sdRef,
        NetBrowserInfo* browser = BrowserForSDRef(plugin, sdRef);
        
        if (!browser) // Missing browser?
+       {
+               fprintf(stderr, "%s:%s ServiceBrowserCallback: missing browser\n", sPluginIdentifier, __FUNCTION__);
                return;
+       }
        
        if (errorCode != kDNSServiceErr_NoError)
+       {
+               fprintf(stderr, "%s:%s ServiceBrowserCallback: errcode set %d\n", sPluginIdentifier, __FUNCTION__, errorCode);
                return;
+       }
        
        CFStringRef cfServiceName = CFStringCreateWithCString(NULL, serviceName, kCFStringEncodingUTF8);
        
        if (flags & kDNSServiceFlagsAdd)
        {
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s calling HandleTemporaryEventsForService Add\n", sPluginIdentifier, __FUNCTION__);
                HandleTemporaryEventsForService(plugin, browser, cfServiceName, plugin->_onAddEvents);
-               HandleStateEventsForService(plugin, browser, cfServiceName, true);
        }
        else 
        {
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s calling HandleTemporaryEventsForService Remove\n", sPluginIdentifier, __FUNCTION__);
                HandleTemporaryEventsForService(plugin, browser, cfServiceName, plugin->_onRemoveEvents);
-               HandleStateEventsForService(plugin, browser, cfServiceName, false);
        }
 
        CFRelease(cfServiceName);
@@ -799,96 +787,28 @@ void HandleTemporaryEventsForService(BonjourUserEventsPlugin* plugin, NetBrowser
                CFDictionaryRef eventDict = (CFDictionaryRef)CFArrayGetValueAtIndex(events, i);
                CFStringRef eventServiceName = (CFStringRef)CFDictionaryGetValue(eventDict, sServiceNameKey);
                CFNumberRef token = (CFNumberRef) CFDictionaryGetValue(eventDict, sLaunchdTokenKey);
+               CFDictionaryRef dict = (CFDictionaryRef) CFDictionaryGetValue(eventDict, sLaunchdDictKey);
                                
                // Currently we only filter on service name, that makes this as simple as... 
                if (!eventServiceName || CFEqual(serviceName, eventServiceName))
                {
-                       // Create Context Info
-                       CFRunLoopTimerContext context; 
-                       TimerContextInfo* info = TimerContextInfoCreate(plugin, token);
-
-                       context.version = 0;
-                       context.info = info;
-                       context.retain = TimerContextInfoRetain;
-                       context.release = TimerContextInfoRelease;
-                       context.copyDescription = TimerContextInfoCopyDescription;
-                       
-                       // Create and add one shot timer to flip the event off after a second
-                       CFRunLoopTimerRef timer = CFRunLoopTimerCreate(NULL, CFAbsoluteTimeGetCurrent() + 1.0, 0, 0, 0, TemporaryEventTimerCallout, &context);
-                       CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopCommonModes);
-                       
-                       // Signal Event
-                       UserEventAgentSetLaunchEventState(plugin->_pluginContext, token, true);
-                       
-                       // Clean Up
-                       TimerContextInfoRelease(info);
-                       CFRelease(timer);
-                       
-               }
-       }
-       
-}
+                       uint64_t tokenUint64;
+                       // Signal Event: This is edge trigger. When the action has been taken, it will not
+                       // be remembered anymore.
 
-/*****************************************************************************
- * HandleStateEventsForService
- * - 
- * This method handles the toggling the state of a while exists event to 
- * reflect the network. 
- *****************************************************************************/
-void HandleStateEventsForService(BonjourUserEventsPlugin* plugin, NetBrowserInfo* browser, CFStringRef serviceName, Boolean didAppear)
-{
-       CFArrayRef events = (CFArrayRef)CFDictionaryGetValue(plugin->_whileServiceExist, browser); // Get the _whileServiceExist events that are interested in this browser.
-       CFIndex i;
-       CFIndex count;
-       
-       if (!events)  // Somehow we have a orphan browser...
-               return;
-       
-       count = CFArrayGetCount(events);
-       
-       // Go thru the events and run filters, notifity if they pass.
-       for (i = 0; i < count; ++i)
-       {
-               CFDictionaryRef eventDict = (CFDictionaryRef)CFArrayGetValueAtIndex(events, i);
-               CFStringRef eventServiceName = (CFStringRef)CFDictionaryGetValue(eventDict, sServiceNameKey);
-               CFNumberRef token = (CFNumberRef) CFDictionaryGetValue(eventDict, sLaunchdTokenKey);
-               
-               // Currently we only filter on service name, that makes this as simple as... 
-               if (!eventServiceName || CFEqual(serviceName, eventServiceName))
-                       UserEventAgentSetLaunchEventState(plugin->_pluginContext, token, didAppear);
-       }
-}
+                       asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s HandleTemporaryEventsForService signal\n", sPluginIdentifier, __FUNCTION__);
+               CFNumberGetValue(token, kCFNumberLongLongType, &tokenUint64);
 
-/*****************************************************************************
- * TemporaryEventTimerCallout
- * - 
- * This method is invoked a second after a watched service appears / disappears
- * to toggle the state of the launch event back to false.
- *****************************************************************************/
-void TemporaryEventTimerCallout ( CFRunLoopTimerRef timer, void *info )
-{
-       TimerContextInfo* contextInfo = (TimerContextInfo*)info;
+               xpc_object_t jobRequest = _CFXPCCreateXPCObjectFromCFObject(dict);
 
-       UserEventAgentSetLaunchEventState(contextInfo->plugin->_pluginContext, contextInfo->token, false);
-       
-       // Remove from pending timers array.
-       CFIndex i;
-       CFIndex count = CFArrayGetCount(contextInfo->plugin->_timers);
-       
-       for (i = 0; i < count; ++i)
-       {
-               CFRunLoopTimerRef item = (CFRunLoopTimerRef)CFArrayGetValueAtIndex(contextInfo->plugin->_timers, i);
-               
-               if (item == timer)
-                       break;
+                       UserEventAgentFireEvent(plugin->_pluginContext, tokenUint64, jobRequest);
+                       xpc_release(jobRequest);
+               }
        }
-       
-       if (i != count)
-               CFArrayRemoveValueAtIndex(contextInfo->plugin->_timers, i);
 }
 
 #pragma mark -
-#pragma mark Convenence
+#pragma mark Convenience
 #pragma mark -
 
 /*****************************************************************************
@@ -912,79 +832,6 @@ const char* CStringFromCFString(CFStringRef string)
        
 }
 
-#pragma mark -
-#pragma mark TimerContextInfo "Object"
-#pragma mark -
-
-/*****************************************************************************
- * TimerContextInfoCreate
- * - 
- * Convenence for creating TimerContextInfo pseudo-objects
- *****************************************************************************/
-TimerContextInfo* TimerContextInfoCreate(BonjourUserEventsPlugin* plugin, CFNumberRef token)
-{
-       TimerContextInfo* info = malloc(sizeof(TimerContextInfo));
-       
-       info->refCount = 1;
-       info->plugin = plugin;
-       info->token = (CFNumberRef)CFRetain(token);
-       
-       return info;
-}
-
-/*****************************************************************************
- * TimerContextInfoRetain
- * - 
- * Convenence for retaining TimerContextInfo pseudo-objects
- *****************************************************************************/
-const void* TimerContextInfoRetain(const void* info)
-{
-       TimerContextInfo* context = (TimerContextInfo*)info;
-       
-       if (!context)
-               return NULL;
-       
-       ++context->refCount;
-       
-       return context;
-}
-
-/*****************************************************************************
- * TimerContextInfoRelease
- * - 
- * Convenence for releasing TimerContextInfo pseudo-objects
- *****************************************************************************/
-void TimerContextInfoRelease(const void* info)
-{
-       TimerContextInfo* context = (TimerContextInfo*)info;
-       
-       if (!context)
-               return;
-       
-       if (context->refCount == 1)
-       {
-               CFRelease(context->token);
-               free(context);
-               return;
-       }
-       else 
-       {
-               --context->refCount;
-       }
-}
-
-/*****************************************************************************
- * TimerContextInfoCopyDescription
- * - 
- * This method actually does nothing, but is just a stub so CF is happy.
- *****************************************************************************/
-CFStringRef TimerContextInfoCopyDescription(const void* info)
-{
-       (void)info;
-       return CFStringCreateWithCString(NULL, "TimerContextInfo: No useful description", kCFStringEncodingUTF8);
-}
-
-
 #pragma mark -
 #pragma mark NetBrowserInfo "Object"
 #pragma mark -
@@ -1004,6 +851,7 @@ NetBrowserInfo* NetBrowserInfoCreate(CFStringRef serviceType, CFStringRef domain
        CFIndex serviceSize = CFStringGetMaximumSizeForEncoding(CFStringGetLength(serviceType), kCFStringEncodingUTF8);
        cServiceType = calloc(serviceSize, 1);
        success = CFStringGetCString(serviceType, cServiceType, serviceSize, kCFStringEncodingUTF8);
+
        
        if (domain)
        {
@@ -1014,7 +862,7 @@ NetBrowserInfo* NetBrowserInfoCreate(CFStringRef serviceType, CFStringRef domain
        
        if (!success)
        {
-               fprintf(stderr, "LaunchEvent has badly encoded service type or domain.\n");
+               fprintf(stderr, "%s:%s LaunchEvent has badly encoded service type or domain.\n", sPluginIdentifier, __FUNCTION__);
                free(cServiceType);
 
                if (cDomain)
@@ -1027,7 +875,7 @@ NetBrowserInfo* NetBrowserInfoCreate(CFStringRef serviceType, CFStringRef domain
 
        if (err != kDNSServiceErr_NoError)
        {
-               fprintf(stderr, "Failed to create browser for %s, %s\n", cServiceType, cDomain);
+               fprintf(stderr, "%s:%s Failed to create browser for %s, %s\n", sPluginIdentifier, __FUNCTION__, cServiceType, cDomain);
                free(cServiceType);
                
                if (cDomain)
@@ -1044,6 +892,8 @@ NetBrowserInfo* NetBrowserInfoCreate(CFStringRef serviceType, CFStringRef domain
        outObj->refCount = 1;
        outObj->browserRef = browserRef;
 
+       asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s: created new object %p", sPluginIdentifier, __FUNCTION__, outObj);
+
        free(cServiceType);
                                                                  
        if (cDomain)
@@ -1066,6 +916,7 @@ const void* NetBrowserInfoRetain(CFAllocatorRef allocator, const void* info)
                return NULL;
        
        ++obj->refCount;
+       asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s: Incremented ref count on %p, count %d", sPluginIdentifier, __FUNCTION__, obj->browserRef, (int)obj->refCount);
        
        return obj;
 }
@@ -1085,12 +936,14 @@ void NetBrowserInfoRelease(CFAllocatorRef allocator, const void* info)
        
        if (obj->refCount == 1)
        {
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s: DNSServiceRefDeallocate %p", sPluginIdentifier, __FUNCTION__, obj->browserRef);
                DNSServiceRefDeallocate(obj->browserRef);
                free(obj);
        }
        else 
        {
                --obj->refCount;
+               asl_log(NULL, NULL, ASL_LEVEL_INFO, "%s:%s: Decremented ref count on %p, count %d", sPluginIdentifier, __FUNCTION__, obj->browserRef, (int)obj->refCount);
        }
 
 }
@@ -1132,4 +985,5 @@ CFStringRef        NetBrowserInfoCopyDescription(const void *value)
 {
        (void)value;
        return CFStringCreateWithCString(NULL, "NetBrowserInfo: No useful description", kCFStringEncodingUTF8);
-}
\ No newline at end of file
+}
+
index c1d16b114a9cbd4a0b8bdaff4c35bec88a2f0cdf..6e5db8097bd244c381c817b6a7e93e371ab26788 100644 (file)
@@ -3,7 +3,7 @@
 
     Abstract: System Preference Pane for Dynamic DNS and Wide-Area DNS Service Discovery
 
-    Copyright: (c) Copyright 2005 Apple Computer, Inc. All rights reserved.
+    Copyright: (c) Copyright 2005-2011 Apple Computer, Inc. All rights reserved.
 
     Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
     ("Apple") in consideration of your agreement to the following terms, and your
@@ -340,13 +340,13 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
 }
 
 
-- (void)tableViewSelectionDidChange:(NSNotification *)notification;
+- (void)tableViewSelectionDidChange:(NSNotification *)notification
 {
        [removeBrowseDomainButton setEnabled:[[notification object] numberOfSelectedRows]];
 }
 
 
-- (void)setBrowseDomainsComboBox;
+- (void)setBrowseDomainsComboBox
 {
        NSString * domain = nil;
        
@@ -361,7 +361,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
 }
 
 
-- (IBAction)addBrowseDomainClicked:(id)sender;
+- (IBAction)addBrowseDomainClicked:(id)sender
 {
        [self setBrowseDomainsComboBox];
 
@@ -373,7 +373,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
 }
 
 
-- (IBAction)removeBrowseDomainClicked:(id)sender;
+- (IBAction)removeBrowseDomainClicked:(id)sender
 {
        (void)sender; // Unused
        int selectedBrowseDomain = [browseDomainList selectedRow];
@@ -383,7 +383,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
 }
 
 
-- (IBAction)enableBrowseDomainClicked:(id)sender;
+- (IBAction)enableBrowseDomainClicked:(id)sender
 {
        NSTableView *tableView = sender;
     NSMutableDictionary *browseDomainDict;
@@ -399,7 +399,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
 
 
 
-- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView;
+- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
 {
        (void)tableView; // Unused
        int numberOfRows = 0;
@@ -411,7 +411,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
 }
 
 
-- (void)tabView:(NSTabView *)xtabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem;
+- (void)tabView:(NSTabView *)xtabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem
 {
        (void)xtabView; // Unused
        (void)tabViewItem; // Unused
@@ -420,7 +420,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
 }
  
 
-- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row;
+- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row
 {
        (void)tableView; // Unused
        NSDictionary *browseDomainDict;
@@ -460,7 +460,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
                        [browseDomainsArray sortUsingFunction:MyDomainArrayCompareFunction context:nil];
                        if ([browseDomainsArray isEqualToArray:currentBrowseDomainsArray] == NO) {
                                OSStatus err = WriteBrowseDomain((CFDataRef)[self dataForDomainArray:browseDomainsArray]);
-                               if (err != noErr) NSLog(@"WriteBrowseDomain returned %d\n", err);
+                               if (err != noErr) NSLog(@"WriteBrowseDomain returned %d\n", (int32_t)err);
                                [currentBrowseDomainsArray release];
                                currentBrowseDomainsArray = [browseDomainsArray copy];
                        }
@@ -703,7 +703,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
 
 
 
-- (void)controlTextDidChange:(NSNotification *)notification;
+- (void)controlTextDidChange:(NSNotification *)notification
 {
        (void)notification; // Unused
     [self updateApplyButtonState];
@@ -711,7 +711,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
 
 
 
-- (IBAction)comboAction:(id)sender;
+- (IBAction)comboAction:(id)sender
 {
        (void)sender; // Unused
     [self updateApplyButtonState];
@@ -859,7 +859,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
 }
 
 
-- (IBAction)revertClicked:(id)sender;
+- (IBAction)revertClicked:(id)sender
 {
     [self restorePreferences];
        [browseDomainList deselectAll:sender];
@@ -1042,7 +1042,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
     // Save hostname.
     if ((currentHostName == NULL) || [currentHostName compare:hostNameString] != NSOrderedSame) {
                err = WriteHostname((CFDataRef)[self dataForDomain:hostNameString isEnabled:YES]);
-               if (err != noErr) NSLog(@"WriteHostname returned %d\n", err);
+               if (err != noErr) NSLog(@"WriteHostname returned %d\n", (int32_t)err);
         currentHostName = [hostNameString copy];
     } else if (hostSecretWasSet) {
                WriteHostname((CFDataRef)[self dataForDomain:@"" isEnabled:NO]);
@@ -1054,7 +1054,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
        if (browseDomainsArray && [browseDomainsArray isEqualToArray:currentBrowseDomainsArray] == NO) {
                browseDomainData = [self dataForDomainArray:browseDomainsArray];
                err = WriteBrowseDomain((CFDataRef)browseDomainData);
-               if (err != noErr) NSLog(@"WriteBrowseDomain returned %d\n", err);
+               if (err != noErr) NSLog(@"WriteBrowseDomain returned %d\n", (int32_t)err);
                currentBrowseDomainsArray = [browseDomainsArray copy];
     }
        
@@ -1062,7 +1062,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
     if ((currentRegDomain == NULL) || ([currentRegDomain compare:regDomainString] != NSOrderedSame) || (currentWideAreaState != [wideAreaCheckBox state])) {
 
                err = WriteRegistrationDomain((CFDataRef)[self dataForDomain:regDomainString isEnabled:[wideAreaCheckBox state]]);
-               if (err != noErr) NSLog(@"WriteRegistrationDomain returned %d\n", err);
+               if (err != noErr) NSLog(@"WriteRegistrationDomain returned %d\n", (int32_t)err);
         
                if (currentRegDomain) CFRelease(currentRegDomain);
         currentRegDomain = [regDomainString copy];
@@ -1133,7 +1133,7 @@ MyDNSServiceAddServiceToRunLoop(MyDNSServiceState * query)
 }
 
 
-- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row;
+- (BOOL)tableView:(NSTableView *)tableView shouldSelectRow:(NSInteger)row
 {
        (void)row; // Unused
        (void)tableView; // Unused
index 529a90c09b8e0b7830c25bc863bd45f6346b6747..767ad5eae21b4ec6d3b9aad26f99964386b21e12 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 4 -*-
  *
- * Copyright (c) 2002-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2002-2011 Apple Computer, Inc. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -2928,7 +2928,7 @@ mDNSexport int main(int argc, char **argv)
                if (sandbox_err) { LogMsg("WARNING: sandbox_init error %s", sandbox_msg); sandbox_free_error(sandbox_msg); }
                else LogInfo("Now running under Apple Sandbox restrictions");
                }
-#endif MDNS_NO_SANDBOX
+#endif // MDNS_NO_SANDBOX
 
        status = mDNSDaemonInitialize();
        if (status) { LogMsg("Daemon start: mDNSDaemonInitialize failed"); goto exit; }
index deb2c43891a962182d4fb15d0f63a572b4c2f8d5..fa4a8338ade2a4c7b7d12f2e27f32bbc5cd1eddc 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 4 -*-
  *
- * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2002-2011 Apple Computer, Inc. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -204,8 +204,6 @@ static mDNSu8 SPMetricTotalPower    = 99;
 mDNSexport domainname ActiveDirectoryPrimaryDomain;
 mDNSexport int        ActiveDirectoryPrimaryDomainLabelCount;
 mDNSexport mDNSAddr   ActiveDirectoryPrimaryDomainServer;
-
-static mDNSBool AWACSDConnected = mDNSfalse;
 #endif // APPLE_OSX_mDNSResponder
 
 // Used by AutoTunnel
@@ -812,7 +810,6 @@ mDNSexport void NotifyOfElusiveBug(const char *title, const char *msg)      // Both s
        #if !ForceAlerts
                {
                // Determine if we're at Apple (17.*.*.*)
-               extern mDNS mDNSStorage;
                NetworkInterfaceInfoOSX *i;
                for (i = mDNSStorage.p->InterfaceList; i; i = i->next)
                        if (i->ifinfo.ip.type == mDNSAddrType_IPv4 && i->ifinfo.ip.ip.v4.b[0] == 17)
@@ -1931,7 +1928,6 @@ mDNSexport mStatus mDNSPlatformTCPConnect(TCPSocket *sock, const mDNSAddr *dst,
        // UDP). mDNSInterface_Unicast indicates this case and not a valid interface.
        if (InterfaceID && InterfaceID != mDNSInterface_Unicast)
                {
-               extern mDNS mDNSStorage;
                NetworkInterfaceInfoOSX *info = IfindexToInterfaceInfoOSX(&mDNSStorage, InterfaceID);
                if (dst->type == mDNSAddrType_IPv4)
                        {
@@ -2352,7 +2348,6 @@ mDNSexport void mDNSPlatformSendRawPacket(const void *const msg, const mDNSu8 *c
        if (!InterfaceID) { LogMsg("mDNSPlatformSendRawPacket: No InterfaceID specified"); return; }
        NetworkInterfaceInfoOSX *info;
 
-       extern mDNS mDNSStorage;
        info = IfindexToInterfaceInfoOSX(&mDNSStorage, InterfaceID);
        if (info == NULL)
                {
@@ -3172,7 +3167,7 @@ mDNSlocal mStatus UpdateRRStatus(const mDNS *const m, char *buffer, int bufsz, c
                        for (ptr = m->AuthInfoList; ptr; ptr = ptr->next)
                                if (SameDomainName(&ptr->domain, n))
                                        {
-                                       if (ptr == info && (r->updateError == mStatus_BadSig || r->updateError == mStatus_BadKey))
+                                       if (ptr == info && r->updateError == mStatus_BadSig)
                                                {
                                                mDNS_snprintf(buffer, bufsz, "Resource record update failed for %##s", r->resrec.name);
                                                return r->updateError;
@@ -3701,41 +3696,6 @@ mDNSlocal void DeregisterAutoTunnelDevInfoRecord(mDNS *m, DomainAuthInfo *info)
        }
 #endif
 
-// pre-declaration
-mDNSlocal void AutoTunnelRecordCallback(mDNS *const m, AuthRecord *const rr, mStatus result);
-
-// Notify remote peers to connect to the relay servers for potential outbound connections from this host.
-// Caller should hold the lock. We don't call mDNS_Register (which acquires the lock) in this function because
-// sometimes the caller may already be holding the lock e.g., SetupLocalAutoTunnelInterface_internal and sometimes
-// not e.g., AutoTunnelHostNameChanged
-mDNSlocal void RegisterAutoTunnel6MetaRecord(mDNS *m, DomainAuthInfo *info)
-       {
-       mStatus err;
-
-       if (!m->mDNS_busy) LogMsg("RegisterAutoTunnel6MetaRecord: ERROR!! Lock not held");
-       
-       if (!AWACSDConnected)
-               {
-               LogInfo("RegisterAutoTunnel6MetaRecord no need to register");
-               return;
-               }
-
-       if (info->AutoTunnel6MetaRecord.resrec.RecordType == kDNSRecordTypeUnregistered)
-               {
-               mDNS_SetupResourceRecord(&info->AutoTunnel6MetaRecord, mDNSNULL, mDNSInterface_Any, kDNSType_PTR, kStandardTTL, kDNSRecordTypeUnregistered, AuthRecordAny, AutoTunnelRecordCallback, info);
-               AssignDomainName (&info->AutoTunnel6MetaRecord.namestorage, (const domainname*) "\x0C" "_autotunnel6");
-               AppendDomainName (&info->AutoTunnel6MetaRecord.namestorage, &info->domain);
-
-               info->AutoTunnel6MetaRecord.resrec.rdata->u.name.c[0] = 0;
-               AppendDomainLabel(&info->AutoTunnel6MetaRecord.resrec.rdata->u.name, &m->hostlabel);
-               AppendDomainName (&info->AutoTunnel6MetaRecord.resrec.rdata->u.name, &info->domain);
-               info->AutoTunnel6MetaRecord.resrec.RecordType = kDNSRecordTypeShared;
-
-               err = mDNS_Register_internal(m, &info->AutoTunnel6MetaRecord);
-               if (err) LogMsg("RegisterAutoTunnel6MetaRecord error %d registering %##s", err, info->AutoTunnel6MetaRecord.namestorage.c);
-               else LogInfo("RegisterAutoTunnel6MetaRecord registering %##s %##s", info->AutoTunnel6MetaRecord.namestorage.c, info->AutoTunnel6MetaRecord.resrec.rdata->u.name.c);
-               }
-       }
 
 // Caller should hold the lock. We don't call mDNS_Register (which acquires the lock) in this function because
 // sometimes the caller may already be holding the lock e.g., SetupLocalAutoTunnelInterface_internal and sometimes
@@ -3823,24 +3783,6 @@ mDNSlocal void RegisterAutoTunnel6Record(mDNS *m, DomainAuthInfo *info)
        UpdateAutoTunnelDomainStatus(m, info);
        }
 
-mDNSlocal void DeregisterAutoTunnel6MetaRecord(mDNS *m, DomainAuthInfo *info)
-       {
-       LogInfo("DeregisterAutoTunnel6MetaRecord %##s", info->domain.c);
-
-       if (info->AutoTunnel6MetaRecord.resrec.RecordType > kDNSRecordTypeDeregistering)
-               {
-               mStatus err = mDNS_Deregister(m, &info->AutoTunnel6MetaRecord);
-               if (err)
-                       {
-                       info->AutoTunnel6MetaRecord.resrec.RecordType = kDNSRecordTypeUnregistered;
-                       info->AutoTunnel6MetaRecord.resrec.rdata->u.name.c[0] = 0;
-                       LogMsg("DeregisterAutoTunnel6MetaRecord error %d deregistering %##s", err, info->AutoTunnel6MetaRecord.namestorage.c);
-                       }
-               else LogInfo("DeregisterAutoTunnel6MetaRecord: Deregistered record");
-               }
-       else LogInfo("DeregisterAutoTunnel6MetaRecord: Not deregistering record state:%d", info->AutoTunnel6MetaRecord.resrec.RecordType);
-       }
-
 mDNSlocal void DeregisterAutoTunnel6Record(mDNS *m, DomainAuthInfo *info)
        {
        LogInfo("DeregisterAutoTunnel6Record %##s", info->domain.c);
@@ -3901,12 +3843,6 @@ mDNSlocal void AutoTunnelRecordCallback(mDNS *const m, AuthRecord *const rr, mSt
                        info->AutoTunnel6Record.resrec.rdata->u.ipv6 = zerov6Addr;
                        RegisterAutoTunnel6Record(m,info);
                        }
-               else if (rr == &info->AutoTunnel6MetaRecord)
-                       {
-                       LogInfo("AutoTunnelRecordCallback: Calling RegisterAutoTunnel6MetaRecord");
-                       info->AutoTunnel6MetaRecord.resrec.rdata->u.name.c[0] = 0;
-                       RegisterAutoTunnel6MetaRecord(m,info);
-                       }
                }
        }
 
@@ -3919,7 +3855,6 @@ mDNSlocal void AutoTunnelDeleteAuthInfoState(mDNS *m, DomainAuthInfo *info)
        DeregisterAutoTunnelDevInfoRecord(m, info);
        DeregisterAutoTunnelServiceRecords(m, info);
        DeregisterAutoTunnel6Record(m, info);
-       DeregisterAutoTunnel6MetaRecord(m, info);
        UpdateAnonymousRacoonConfig(m);         // Determine whether we need racoon to accept incoming connections
        UpdateAutoTunnelDomainStatus(m, info);
        }
@@ -3962,13 +3897,11 @@ mDNSlocal void AutoTunnelHostNameChanged(mDNS *m, DomainAuthInfo *info)
 #endif
        DeregisterAutoTunnelServiceRecords(m, info);
        DeregisterAutoTunnel6Record(m, info);
-       DeregisterAutoTunnel6MetaRecord(m, info);
        RegisterAutoTunnelServiceRecords(m, info);
 
        mDNS_Lock(m);
        RegisterAutoTunnelDevInfoRecord(m, info);
        RegisterAutoTunnel6Record(m, info);
-       RegisterAutoTunnel6MetaRecord(m, info);
        m->NextSRVUpdate = NonZeroTime(m->timenow);
        mDNS_Unlock(m);
        }
@@ -4488,6 +4421,13 @@ mDNSlocal mStatus UpdateInterfaceList(mDNS *const m, mDNSs32 utc)
        if (InfoSocket < 3 && errno != EAFNOSUPPORT) LogMsg("UpdateInterfaceList: InfoSocket error %d errno %d (%s)", InfoSocket, errno, strerror(errno));
 #endif
 
+       // During wakeup, we may get a network change notification e.g., new addresses, before we get
+       // a wake notification. This means that we have not set AnnounceOwner. Registering interfaces with
+       // core would cause us to probe again which will conflict with the sleep proxy server, if we had
+       // registered with it when going to sleep. Hence, need to delay until we get the wake notification
+
+       if (m->SleepState == SleepState_Sleeping) ifa = NULL;
+
        while (ifa)
                {
 #if LIST_ALL_INTERFACES
@@ -5120,6 +5060,7 @@ mDNSlocal void ConfigResolvers(mDNS *const m, dns_config_t *config, mDNSBool sco
                                if (SetupAddr(&saddr, r->nameserver[n])) LogMsg("RegisterSplitDNS: bad IP address");
                                else
                                        {
+                                       mDNSBool cellIntf = mDNSfalse;
                                        mDNSBool scopedDNS = mDNSfalse;
                                        DNSServer *s;
 #if DNSINFO_VERSION >= 20091104
@@ -5130,6 +5071,9 @@ mDNSlocal void ConfigResolvers(mDNS *const m, dns_config_t *config, mDNSBool sco
                                                        r->if_index, &saddr, mDNSVal16(r->port ? mDNSOpaque16fromIntVal(r->port) : UnicastDNSPort));
                                        else
                                                scopedDNS = (scope && (r->flags & DNS_RESOLVER_FLAGS_SCOPED)) ? mDNStrue : mDNSfalse;
+#endif
+#if DNSINFO_VERSION >= 20110420
+                                       cellIntf = r->reach_flags & kSCNetworkReachabilityFlagsIsWWAN;
 #endif
                                        // The timeout value is for all the DNS servers in a given resolver, hence we pass
                                        // the timeout value only for the first DNSServer. If we don't have a value in the
@@ -5139,7 +5083,7 @@ mDNSlocal void ConfigResolvers(mDNS *const m, dns_config_t *config, mDNSBool sco
                                        // it takes the sum of all the timeout values for all DNS servers. By doing this, it
                                        // tries all the DNS servers in a specified timeout
                                        s = mDNS_AddDNSServer(m, &d, interface, &saddr, r->port ? mDNSOpaque16fromIntVal(r->port) : UnicastDNSPort, scopedDNS,
-                                               (n == 0 ? (r->timeout ? r->timeout : DEFAULT_UDNS_TIMEOUT) : 0));
+                                               (n == 0 ? (r->timeout ? r->timeout : DEFAULT_UDNS_TIMEOUT) : 0), cellIntf);
                                        if (s)
                                                {
                                                if (disabled) s->teststate = DNSServer_Disabled;
@@ -5387,7 +5331,7 @@ mDNSexport void mDNSPlatformSetDNSConfig(mDNS *const m, mDNSBool setservers, mDN
                                                                inet_aton(buf, (struct in_addr *) &addr.ip.v4))
                                                                {
                                                                LogInfo("Adding DNS server from dict: %s", buf);
-                                                               mDNS_AddDNSServer(m, mDNSNULL, mDNSInterface_Any, &addr, UnicastDNSPort, mDNSfalse, 0);
+                                                               mDNS_AddDNSServer(m, mDNSNULL, mDNSInterface_Any, &addr, UnicastDNSPort, mDNSfalse, 0, mDNSfalse);
                                                                }
                                                        }
                                                }
@@ -5653,6 +5597,7 @@ mDNSlocal void UpdateBTMMRelayConnection(mDNS *const m)
        {
        DomainAuthInfo *BTMMDomain = mDNSNULL;
        DomainAuthInfo *FoundInList;
+       static mDNSBool AWACSDConnected = mDNSfalse;
        char AllUsers[1024];    // maximum size of mach message
        char AllPass[1024];     // maximum size of mach message
        char username[MAX_DOMAIN_LABEL + 1];
@@ -5691,14 +5636,6 @@ mDNSlocal void UpdateBTMMRelayConnection(mDNS *const m)
                LogInfo("UpdateBTMMRelayConnection: AWS_Connect for user %s", AllUsers);
                AWACS_Connect(AllUsers, AllPass, "hello.connectivity.me.com");
                AWACSDConnected = mDNStrue;
-               
-               // We have to do this after AWACSDConnected is true
-               for (FoundInList = m->AuthInfoList; FoundInList; FoundInList = FoundInList->next)
-                       if (!FoundInList->deltime && FoundInList->AutoTunnel && IsBTMMDomain(&FoundInList->domain))
-                               {
-                               LogInfo("UpdateBTMMRelayConnection RegisterAutoTunnel6MetaRecord: %##s", FoundInList->domain.c);
-                               RegisterAutoTunnel6MetaRecord(m, FoundInList);
-                               }
                }
        else
                {
@@ -6537,7 +6474,7 @@ mDNSexport mDNSBool RecordReadyForSleep(mDNS *const m, AuthRecord *rr)
        {
        if (!AuthRecord_uDNS(rr)) return mDNStrue;
 
-       if ((rr->resrec.rrtype == kDNSType_AAAA) && SameDomainLabel(rr->namestorage.c, (const mDNSu8 *)"\x0c_autotunnel6"))
+       if (SameDomainLabel(rr->namestorage.c, (const mDNSu8 *)"\x0c_autotunnel6"))
                {
                LogInfo("RecordReadyForSleep: %s not ready for sleep", ARDisplayString(m, rr));
                return mDNSfalse;
@@ -6697,9 +6634,7 @@ mDNSlocal void AddAutoTunnel6Record(mDNS *const m, char *ifname, CFDictionaryRef
                // this case as though the dictionary does not have the value
                RemoveAutoTunnel6Record(m);
                // If awacsd crashes or exits for some reason, restart the relay connection
-               mDNS_Lock(m);
                UpdateBTMMRelayConnection(m);
-               mDNS_Unlock(m);
                return;
                }
        
@@ -6763,9 +6698,7 @@ mDNSlocal void ParseBackToMyMac(mDNS *const m, CFDictionaryRef connd)
                RemoveAutoTunnel6Record(m);
                m->AutoTunnelRelayAddrOut = zerov6Addr;
                // We don't have a utun interface, start the relay connection if possible
-               mDNS_Lock(m);
                UpdateBTMMRelayConnection(m);
-               mDNS_Unlock(m);
                }
        else
                {
@@ -7636,11 +7569,6 @@ mDNSlocal void SnowLeopardPowerChanged(void *refcon, IOPMConnection connection,
                        m->SleepLimit = 0;
                        }
                LogSPS("SnowLeopardPowerChanged: Waking up, Acking Wakeup, SleepLimit %d SleepState %d", m->SleepLimit, m->SleepState);
-               // If the network notifications have already come before we got the wakeup, we ignored them and
-               // in case we get no more, we need to trigger one.
-               mDNS_Lock(m);
-               SetNetworkChanged(m, 2 * mDNSPlatformOneSecond);
-               mDNS_Unlock(m);
                // CPU Waking. Note: Can get this message repeatedly, as other subsystems power up or down.
                if (m->SleepState != SleepState_Awake) PowerOn(m);
                IOPMConnectionAcknowledgeEvent(connection, token);
@@ -7684,8 +7612,6 @@ mDNSlocal void SnowLeopardPowerChanged(void *refcon, IOPMConnection connection,
 // "hash" function to solve this, the others are hard to solve. Hence, we share the hash (AuthHash) implementation
 // of the core layer which does all of the above very efficiently
 
-#define ETCHOSTS_BUFSIZE       1024    // Buffer size to parse a single line in /etc/hosts
-
 mDNSexport void FreeEtcHosts(mDNS *const m, AuthRecord *const rr, mStatus result)
     {
     (void)m;  // unused
@@ -7827,8 +7753,6 @@ mDNSlocal int EtcHostsParseOneName(int start, int length, char *buffer, char **n
        *name = NULL;
        for (i = start; i < length; i++)
                {
-               if (buffer[i] == '#')
-                       return -1;
                if (buffer[i] != ' ' && buffer[i] != ',' && buffer[i] != '\t')
                        {
                        *name = &buffer[i];
@@ -8007,55 +7931,58 @@ mDNSlocal void mDNSMacOSXParseEtcHostsLine(mDNS *const m, char *buffer, ssize_t
 
 mDNSlocal void mDNSMacOSXParseEtcHosts(mDNS *const m, int fd, AuthHash *auth)
        {
-       mDNSBool good;
-       char    buf[ETCHOSTS_BUFSIZE];
-       int len;
-       FILE *fp;
-
        if (fd == -1) { LogInfo("mDNSMacOSXParseEtcHosts: fd is -1"); return; }
+       
+       LogInfo("mDNSMacOSXParseEtcHosts: Parsing etc hosts");
 
-       fp = fopen("/etc/hosts", "r");
-       if (!fp) { LogInfo("mDNSMacOSXParseEtcHosts: fp is NULL"); return; }
-
-       while (1)
+       // Read through the file
+       char    readBuf[1024]; // support a maximum line of 1024 bytes including newline
+       off_t   offset = 0;
+       int     comment = 0;
+       ssize_t i = 0;
+       ssize_t length;
+       ssize_t linestart;
+       while ((length = pread(fd, &readBuf[i], sizeof(readBuf) - i, offset) + i) >= i)
                {
-               good = (fgets(buf, ETCHOSTS_BUFSIZE, fp) != NULL);
-               if (!good) break;
-
-               // skip comment and empty lines
-               if (buf[0] == '#' || buf[0] == '\r' || buf[0] == '\n')
-                       continue;
-
-               len = strlen(buf);
-               if (!len) break;        // sanity check
-               //Check for end of line code(mostly only \n but pre-OS X Macs could have only \r)  
-               if (buf[len - 1] == '\r' || buf[len - 1] == '\n')
+               if (length == i)
                        {
-                       buf[len - 1] = '\0';
-                       len = len - 1;
+                       // end of file
+                       if (length != 0) mDNSMacOSXParseEtcHostsLine(m, readBuf, length, auth);
+                       break;
                        }
-               // fgets always null terminates and hence even if we have no
-                // newline at the end, it is null terminated. The callee                                                                                                          
-                // (mDNSMacOSXParseEtcHostsLine) expects the length to be such that
-                // buf[length] is zero and hence we decrement len to reflect that.
-               if (len)
+               
+               // increment our offset by the number of bytes we read
+               offset += length - i;
+               
+               // loop through the buffer looking for end of lines
+               for (linestart = 0; i < length; i++)
                        {
-                       //Additional check when end of line code is 2 chars ie\r\n(DOS, other old OSes)
-                       //here we need to check for just \r but taking extra caution.
-                       if (buf[len - 1] == '\r' || buf[len - 1] == '\n')
+                       if (readBuf[i] == '#' || readBuf[i] == '\r' || readBuf[i] == '\n')
                                {
-                               buf[len - 1] = '\0';
-                               len = len - 1;
+                               int parseline = i - linestart > 0 && comment == 0;
+                               comment = readBuf[i] == '#';
+                               if (parseline)
+                                       {
+                                       readBuf[i] = 0;
+                                       mDNSMacOSXParseEtcHostsLine(m, &readBuf[linestart], i - linestart, auth);
+                                       }
+                               linestart = i + 1;
                                }
                        }
-               if (!len) //Sanity Check: len should never be zero
+               
+               // prepare to read the next chunk of the file
+               if (linestart == 0)
                        {
-                       LogMsg("mDNSMacOSXParseEtcHosts: Length is zero!");
-                       continue;
+                       // single line was larger than our buffer, we're going to ignore it
+                       comment = 1; // treat remainder of line as comment
+                       i = 0;
+                       }
+               else
+                       {
+                       i = length - linestart;
+                       if (i) memmove(readBuf, &readBuf[linestart], i);
                        }
-               mDNSMacOSXParseEtcHostsLine(m, buf, len, auth);
                }
-       fclose(fp);
        }
 
 mDNSlocal void mDNSMacOSXUpdateEtcHosts(mDNS *const m);
@@ -8176,7 +8103,7 @@ mDNSlocal int mDNSMacOSXGetEtcHostsFD(mDNS *const m)
 #else
        (void)m;
        return fd;
-#endif;
+#endif
        }
 
 // When /etc/hosts is modified, flush all the cache records as there may be local
@@ -8492,6 +8419,68 @@ mDNSlocal mDNSBool mDNSPlatformInit_CanReceiveUnicast(void)
        return(err == 0);
        }
 
+mDNSlocal void CreatePTRRecord(mDNS *const m, const domainname *domain)
+       {
+       AuthRecord *rr;
+       const domainname *pname = (domainname *)"\x9""localhost";
+
+       rr= mallocL("localhosts", sizeof(*rr));
+       if (rr == NULL) return;
+       mDNSPlatformMemZero(rr, sizeof(*rr));
+
+       mDNS_SetupResourceRecord(rr, mDNSNULL, mDNSInterface_LocalOnly, kDNSType_PTR, kHostNameTTL, kDNSRecordTypeKnownUnique, AuthRecordLocalOnly, mDNSNULL, mDNSNULL);
+       AssignDomainName(&rr->namestorage, domain);
+
+       rr->resrec.rdlength = DomainNameLength(pname);
+       rr->resrec.rdata->u.name.c[0] = 0;
+       AssignDomainName(&rr->resrec.rdata->u.name, pname);
+
+       rr->resrec.namehash = DomainNameHashValue(rr->resrec.name);
+       SetNewRData(&rr->resrec, mDNSNULL, 0);  // Sets rr->rdatahash for us
+       mDNS_Register(m, rr);
+       }
+
+// Setup PTR records for 127.0.0.1 and ::1. This helps answering them locally rather than relying
+// on the external DNS server to answer this. Sometimes, the DNS servers don't respond in a timely
+// fashion and applications depending on this e.g., telnetd, times out after 30 seconds creating
+// a bad user experience. For now, we specifically create only localhosts to handle radar://9354225
+//
+// Note: We could have set this up while parsing the entries in /etc/hosts. But this is kept separate
+// intentionally to avoid adding to the complexity of code handling /etc/hosts.
+mDNSlocal void SetupLocalHostRecords(mDNS *const m)
+       {
+       char buffer[MAX_REVERSE_MAPPING_NAME];
+       domainname name;
+       int i;
+       struct in6_addr addr;
+       mDNSu8 *ptr = addr.__u6_addr.__u6_addr8;
+
+       if (inet_pton(AF_INET, "127.0.0.1", &addr) == 1)
+               {
+               mDNS_snprintf(buffer, sizeof(buffer), "%d.%d.%d.%d.in-addr.arpa.",
+                       ptr[3], ptr[2], ptr[1], ptr[0]);
+               MakeDomainNameFromDNSNameString(&name, buffer);
+               CreatePTRRecord(m, &name);
+               }
+       else LogMsg("SetupLocalHostRecords: ERROR!! inet_pton AF_INET failed");
+
+       if (inet_pton(AF_INET6, "::1", &addr) == 1)
+               {
+               for (i = 0; i < 16; i++)
+                       {
+                       static const char hexValues[] = "0123456789ABCDEF";
+                       buffer[i * 4    ] = hexValues[ptr[15 - i] & 0x0F];
+                       buffer[i * 4 + 1] = '.';
+                       buffer[i * 4 + 2] = hexValues[ptr[15 - i] >> 4];
+                       buffer[i * 4 + 3] = '.';
+                       }
+               mDNS_snprintf(&buffer[64], sizeof(buffer)-64, "ip6.arpa.");
+               MakeDomainNameFromDNSNameString(&name, buffer);
+               CreatePTRRecord(m, &name);
+               }
+       else LogMsg("SetupLocalHostRecords: ERROR!! inet_pton AF_INET6 failed");
+       }
+
 // Construction of Default Browse domain list (i.e. when clients pass NULL) is as follows:
 // 1) query for b._dns-sd._udp.local on LocalOnly interface
 //    (.local manually generated via explicit callback)
@@ -8713,6 +8702,7 @@ mDNSlocal mStatus mDNSPlatformInit_setup(mDNS *const m)
        if (SSLqueue == mDNSNULL) LogMsg("dispatch_queue_create: SSL queue NULL");
 #endif
        mDNSMacOSXUpdateEtcHosts(m);
+       SetupLocalHostRecords(m);
        return(mStatus_NoError);
        }
 
index 4a51b875bb8e7858ef88ace59b7c8250ccc6b0f2..fc46bac1dbc90a4a2d227759b8fece20fbcf91da 100644 (file)
@@ -65,6 +65,7 @@
                                        "com.apple.mDNSResponderHelper"
                                        "com.apple.SecurityServer"
                                        "com.apple.SystemConfiguration.configd"
+                                       "com.apple.SystemConfiguration.SCNetworkReachability"
                                        "com.apple.system.DirectoryService.libinfo_v1"
                                        "com.apple.system.DirectoryService.membership_v1"
                                        "com.apple.system.notification_center"
index 3362c8a51bf6ab62d4bd432f2fa5ebb97622e5f3..ba9cbb3f0f4345e3556093446936b12ccc451cf7 100644 (file)
@@ -19,7 +19,6 @@
                                D284BF300ADD81630027CCDF /* PBXTargetDependency */,
                                D284BF260ADD814F0027CCDF /* PBXTargetDependency */,
                                D284BF2A0ADD81530027CCDF /* PBXTargetDependency */,
-                               216EF8EC120295AA004917D2 /* PBXTargetDependency */,
                        );
                        name = "Build More";
                        productName = "Build All";
@@ -31,6 +30,7 @@
                                FF045B6A0C7E4AA600448140 /* ShellScript */,
                        );
                        dependencies = (
+                               217A4C49138EE14C000A5BA8 /* PBXTargetDependency */,
                                03067D680C83A3830022BE1F /* PBXTargetDependency */,
                                03067D6A0C83A3890022BE1F /* PBXTargetDependency */,
                                03067D6C0C83A3920022BE1F /* PBXTargetDependency */,
                        fileType = sourcecode.yacc;
                        isEditable = 1;
                        outputFiles = (
-                               "$(DERIVED_FILE_DIR)/$(INPUT_FILE_BASE).h",
-                               "$(DERIVED_FILE_DIR)/$(INPUT_FILE_BASE).c",
+                               "$(DERIVED_FILE_DIR)/dnsextd_parser.h",
+                               "$(DERIVED_FILE_DIR)/dnsextd_parser.c",
                        );
-                       script = "echo NOOP yacc ${INPUT_FILE_PATH}";
+                       script = "/usr/bin/bison -o ${DERIVED_FILE_DIR}/${INPUT_FILE_BASE}.c -d ${INPUT_FILE_PATH}";
                };
                D284BFB80ADD8E510027CCDF /* PBXBuildRule */ = {
                        isa = PBXBuildRule;
                        fileType = sourcecode.lex;
                        isEditable = 1;
                        outputFiles = (
-                               "$(DERIVED_FILE_DIR)/$(INPUT_FILE_BASE).c",
+                               "$(DERIVED_FILE_DIR)/dnsextd_lexer.c",
                        );
                        script = "/usr/bin/flex -i -o${DERIVED_FILE_DIR}/${INPUT_FILE_BASE}.c ${INPUT_FILE_PATH}";
                };
                        remoteGlobalIDString = 2141DD29123FFD2C0086D23E;
                        remoteInfo = libdns_sd_profile_static;
                };
-               216EF8EB120295AA004917D2 /* PBXContainerItemProxy */ = {
+               217A4C48138EE14C000A5BA8 /* PBXContainerItemProxy */ = {
                        isa = PBXContainerItemProxy;
                        containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
                        proxyType = 1;
                        buildConfigurationList = D284BED60ADD80A20027CCDF /* Build configuration list for PBXNativeTarget "dnsextd" */;
                        buildPhases = (
                                D284BEC20ADD80A20027CCDF /* Headers */,
-                               4A4EE3A413CB8E82005C624B /* Build yacc file into derived source files */,
                                D284BEC40ADD80A20027CCDF /* Sources */,
                                D284BECE0ADD80A20027CCDF /* Frameworks */,
+                               D284BED30ADD80A20027CCDF /* Rez */,
                                D284BED40ADD80A20027CCDF /* CopyFiles */,
                                FFFF8F770C32F0FD00722979 /* CopyFiles */,
                                FF37FAAD0BC581780044A5CF /* ShellScript */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
+               D284BED30ADD80A20027CCDF /* Rez */ = {
+                       isa = PBXRezBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
                D284BEE40ADD80A70027CCDF /* Rez */ = {
                        isa = PBXRezBuildPhase;
                        buildActionMask = 2147483647;
                        shellPath = /bin/sh;
                        shellScript = "#if we are building for simulator, change the installation path\nif [ \"${RC_ProjectName%_Sim}\" != \"${RC_ProjectName}\" ] ; then\n\tDSTROOT=${DSTROOT}${SDKROOT}\nfi\nmkdir -p \"$DSTROOT/usr/include/DNSServiceDiscovery\"\ncp $SRCROOT/DNSServiceDiscovery.h $DSTROOT/usr/include/DNSServiceDiscovery\nsed 's/\\(^#define _DNS_SD_LIBDISPATCH \\)0$/\\1 1/' \"$SRCROOT/../mDNSShared/dns_sd.h\" > \"$DSTROOT/usr/include/dns_sd.h\"";
                };
-               4A4EE3A413CB8E82005C624B /* Build yacc file into derived source files */ = {
-                       isa = PBXShellScriptBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       inputPaths = (
-                               "$(SRCROOT)/../mDNSShared/dnsextd_parser.y",
-                       );
-                       name = "Build yacc file into derived source files";
-                       outputPaths = (
-                               "$(DERIVED_FILE_DIR)/dnsextd_parser.c",
-                               "$(DERIVED_FILE_DIR)/dnsextd_parser.h",
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = "/usr/bin/bison -o ${SCRIPT_OUTPUT_FILE_0} -d ${SCRIPT_INPUT_FILE_0}";
-               };
                D284BE510ADD80740027CCDF /* ShellScript */ = {
                        isa = PBXShellScriptBuildPhase;
                        buildActionMask = 2147483647;
                        target = 2141DD29123FFD2C0086D23E /* libdns_sd_profile_static */;
                        targetProxy = 215FFB1C124002CC00470DE1 /* PBXContainerItemProxy */;
                };
-               216EF8EC120295AA004917D2 /* PBXTargetDependency */ = {
+               217A4C49138EE14C000A5BA8 /* PBXTargetDependency */ = {
                        isa = PBXTargetDependency;
                        target = 213FB21712028A7A002B3A08 /* BonjourEvents */;
-                       targetProxy = 216EF8EB120295AA004917D2 /* PBXContainerItemProxy */;
+                       targetProxy = 217A4C48138EE14C000A5BA8 /* PBXContainerItemProxy */;
                };
                4AE4716A0EAFF83800A6C5AD /* PBXTargetDependency */ = {
                        isa = PBXTargetDependency;
                                COPY_PHASE_STRIP = NO;
                                GCC_DYNAMIC_NO_PIC = NO;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
-                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_OPTIMIZATION_LEVEL = s;
                                PRODUCT_NAME = "Build Some";
                        };
                        name = Development;
                        buildSettings = {
                                COPY_PHASE_STRIP = NO;
                                GCC_DYNAMIC_NO_PIC = NO;
-                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_OPTIMIZATION_LEVEL = s;
                                PRODUCT_NAME = SystemLibrariesStatic;
                        };
                        name = Development;
                                );
                                GCC_DYNAMIC_NO_PIC = NO;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
-                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_OPTIMIZATION_LEVEL = s;
                                GCC_PREPROCESSOR_DEFINITIONS = (
                                        "$(inherited)",
                                        "MDNS_DEBUGMSGS=1",
                                        "${CONFIGURATION_TEMP_DIR}",
                                );
                                INSTALL_PATH = /usr/sbin;
+                               LEX = /usr/bin/flex;
+                               LEXFLAGS = "";
+                               LEX_CASE_INSENSITIVE_SCANNER = YES;
                                LIBRARY_SEARCH_PATHS = "\"${CONFIGURATION_TEMP_DIR}\"";
                                MACOSX_DEPLOYMENT_TARGET = 10.5;
                                OTHER_CFLAGS = (
                                );
                                OTHER_LDFLAGS = "";
                                "OTHER_LDFLAGS[sdk=macosx10.7][arch=*]" = "-Wl,-pie";
+                               OTHER_REZFLAGS = "";
                                PRODUCT_NAME = dnsextd;
+                               REZ_EXECUTABLE = YES;
                                SECTORDER_FLAGS = "";
+                               YACC = "/usr/bin/bison -y";
                        };
                        name = Development;
                };
index 6ca90136778e9bba9dee9cbe1c8e670d61d639b6..2e8ff688e6a5b61ffbf458625d98e592bc55f584 100755 (executable)
@@ -100,7 +100,8 @@ endif
 else
 
 ifeq ($(os),linux)
-CFLAGS_OS = -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX
+CFLAGS_OS = -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DHAVE_LINUX -DTARGET_OS_LINUX -fno-strict-aliasing
+LD = gcc -shared
 FLEXFLAGS_OS = -l
 JAVACFLAGS_OS += -I$(JDK)/include/linux
 OPTIONALTARG = nss_mdns
@@ -140,7 +141,8 @@ ifeq ($(os),x)
 # We have to define __MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_10_4 or on Leopard
 # we get build failures: ‘daemon’ is deprecated (declared at /usr/include/stdlib.h:283)
 CFLAGS_OS = -DHAVE_IPV6 -no-cpp-precomp -Werror -Wdeclaration-after-statement \
-       -D__MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_10_4 #-Wunreachable-code
+       -D__MAC_OS_X_VERSION_MIN_REQUIRED=__MAC_OS_X_VERSION_10_4 \
+       -D__APPLE_USE_RFC_2292 #-Wunreachable-code
 CC = gcc
 LD = $(CC) -dynamiclib
 LINKOPTS = -lSystem
index a10a4d7754ac71ea0177078d9545227e9f422f53..de7c9884c61d6787733cb2f3d5c538346beddf8e 100644 (file)
 #      include <mDNSEmbeddedAPI.h>
 #      include <mDNSWin32.h>
 #      include <PosixCompat.h>
+#      include <Poll.h>
 #      define IFNAMSIZ 256
 static HANDLE gStopEvent = INVALID_HANDLE_VALUE;
+static mDNSBool gRunning;
+static void CALLBACK StopNotification( HANDLE event, void *context ) { gRunning = mDNSfalse; }
 static BOOL WINAPI ConsoleControlHandler( DWORD inControlEvent ) { SetEvent( gStopEvent ); return TRUE; }
 void setlinebuf( FILE * fp ) {}
 #else
@@ -840,9 +843,9 @@ mDNSlocal mStatus mDNSNetMonitor(void)
        if (status) return(status);
        gStopEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
        if (gStopEvent == INVALID_HANDLE_VALUE) return mStatus_UnknownErr;
+       mDNSPollRegisterEvent( gStopEvent, StopNotification, NULL );
        if (!SetConsoleCtrlHandler(ConsoleControlHandler, TRUE)) return mStatus_UnknownErr;
-       while (WaitForSingleObjectEx(gStopEvent, INFINITE, TRUE) == WAIT_IO_COMPLETION)
-               DispatchSocketEvents(&mDNSStorage);
+       gRunning = mDNStrue; while (gRunning) mDNSPoll( INFINITE );
        if (!SetConsoleCtrlHandler(ConsoleControlHandler, FALSE)) return mStatus_UnknownErr;
        CloseHandle(gStopEvent);
 #else
index 3db5266ff217d9d060f4a451d2e7e7cc5ddbcffc..8ff29787661f4b1c3e0232c97df9de1b4b6bcfef 100755 (executable)
@@ -159,8 +159,12 @@ mDNSexport mStatus mDNSPlatformSendUDP(const mDNS *const m, const void *const ms
        assert(msg != NULL);
        assert(end != NULL);
        assert((((char *) end) - ((char *) msg)) > 0);
-       assert(dstPort.NotAnInteger != 0);
 
+       if (dstPort.NotAnInteger == 0) 
+               {
+               LogMsg("mDNSPlatformSendUDP: Invalid argument -dstPort is set to 0");
+               return PosixErrorToStatus(EINVAL);
+               }
        if (dst->type == mDNSAddrType_IPv4)
                {
                struct sockaddr_in *sin = (struct sockaddr_in*)&to;
@@ -502,7 +506,7 @@ mDNSexport int ParseDNSServers(mDNS *m, const char *filePath)
                        mDNSAddr DNSAddr;
                        DNSAddr.type = mDNSAddrType_IPv4;
                        DNSAddr.ip.v4.NotAnInteger = ina.s_addr;
-                       mDNS_AddDNSServer(m, NULL, mDNSInterface_Any, &DNSAddr, UnicastDNSPort, mDNSfalse, 0);
+                       mDNS_AddDNSServer(m, NULL, mDNSInterface_Any, &DNSAddr, UnicastDNSPort, mDNSfalse, 0, mDNSfalse);
                        numOfServers++;
                        }
                }  
index ed965014943d0f54f27b60a9351516b4bc77148d..8cd5bf740e6b4a5ac80751752009fc4397811729 100755 (executable)
@@ -1,87 +1,48 @@
-Microsoft Visual Studio Solution File, Format Version 9.00\r
-# Visual Studio 2005\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DLL", "mDNSWindows\DLL\dnssd.vcproj", "{AB581101-18F0-46F6-B56A-83A6B1EA657E}"\r
+Microsoft Visual Studio Solution File, Format Version 11.00\r
+# Visual Studio 2010\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DLL", "mDNSWindows\DLL\dnssd.vcxproj", "{AB581101-18F0-46F6-B56A-83A6B1EA657E}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mDNSResponder", "mDNSWindows\SystemService\Service.vcproj", "{C1D98254-BA27-4427-A3BE-A68CA2CC5F69}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mDNSResponder", "mDNSWindows\SystemService\Service.vcxproj", "{C1D98254-BA27-4427-A3BE-A68CA2CC5F69}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NSPTool", "mDNSWindows\NSPTool\NSPTool.vcproj", "{208B3A9F-1CA0-4D1D-9D6C-C61616F94705}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NSPTool", "mDNSWindows\NSPTool\NSPTool.vcxproj", "{208B3A9F-1CA0-4D1D-9D6C-C61616F94705}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mdnsNSP", "mDNSWindows\mdnsNSP\mdnsNSP.vcproj", "{F4F15529-F0EB-402F-8662-73C5797EE557}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {AB581101-18F0-46F6-B56A-83A6B1EA657E} = {AB581101-18F0-46F6-B56A-83A6B1EA657E}\r
-       EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mdnsNSP", "mDNSWindows\mdnsNSP\mdnsNSP.vcxproj", "{F4F15529-F0EB-402F-8662-73C5797EE557}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExplorerPlugin", "Clients\ExplorerPlugin\ExplorerPlugin.vcproj", "{BB8AC1B5-6587-4163-BDC6-788B157705CA}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {3A2B6325-3053-4236-84BD-AA9BE2E323E5} = {3A2B6325-3053-4236-84BD-AA9BE2E323E5}\r
-       EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExplorerPlugin", "Clients\ExplorerPlugin\ExplorerPlugin.vcxproj", "{BB8AC1B5-6587-4163-BDC6-788B157705CA}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PrinterSetupWizard", "Clients\PrinterSetupWizard\PrinterSetupWizard.vcproj", "{B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {3A2B6325-3053-4236-84BD-AA9BE2E323E5} = {3A2B6325-3053-4236-84BD-AA9BE2E323E5}\r
-       EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PrinterSetupWizard", "Clients\PrinterSetupWizard\PrinterSetupWizard.vcxproj", "{B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PrinterSetupWizardLocRes", "Clients\PrinterSetupWizard\PrinterSetupWizardLocRes.vcproj", "{967F5375-0176-43D3-ADA3-22EE25551C37}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {AB581101-18F0-46F6-B56A-83A6B1EA657E} = {AB581101-18F0-46F6-B56A-83A6B1EA657E}\r
-       EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PrinterSetupWizardLocRes", "Clients\PrinterSetupWizard\PrinterSetupWizardLocRes.vcxproj", "{967F5375-0176-43D3-ADA3-22EE25551C37}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PrinterSetupWizardRes", "Clients\PrinterSetupWizard\PrinterSetupWizardRes.vcproj", "{CFCCB176-6CAA-472B-B0A2-90511C8E2E52}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {AB581101-18F0-46F6-B56A-83A6B1EA657E} = {AB581101-18F0-46F6-B56A-83A6B1EA657E}\r
-       EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PrinterSetupWizardRes", "Clients\PrinterSetupWizard\PrinterSetupWizardRes.vcxproj", "{CFCCB176-6CAA-472B-B0A2-90511C8E2E52}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExplorerPluginLocRes", "Clients\ExplorerPlugin\ExplorerPluginLocRes.vcproj", "{1643427B-F226-4AD6-B413-97DA64D5C6B4}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {AB581101-18F0-46F6-B56A-83A6B1EA657E} = {AB581101-18F0-46F6-B56A-83A6B1EA657E}\r
-       EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExplorerPluginLocRes", "Clients\ExplorerPlugin\ExplorerPluginLocRes.vcxproj", "{1643427B-F226-4AD6-B413-97DA64D5C6B4}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExplorerPluginRes", "Clients\ExplorerPlugin\ExplorerPluginRes.vcproj", "{871B1492-B4A4-4B57-9237-FA798484D7D7}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {AB581101-18F0-46F6-B56A-83A6B1EA657E} = {AB581101-18F0-46F6-B56A-83A6B1EA657E}\r
-       EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ExplorerPluginRes", "Clients\ExplorerPlugin\ExplorerPluginRes.vcxproj", "{871B1492-B4A4-4B57-9237-FA798484D7D7}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dns-sd", "Clients\DNS-SD.VisualStudio\dns-sd.vcproj", "{AA230639-E115-4A44-AA5A-44A61235BA50}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dns-sd", "Clients\DNS-SD.VisualStudio\dns-sd.vcxproj", "{AA230639-E115-4A44-AA5A-44A61235BA50}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Java", "mDNSWindows\Java\Java.vcproj", "{9CE2568A-3170-41C6-9F20-A0188A9EC114}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {AB581101-18F0-46F6-B56A-83A6B1EA657E} = {AB581101-18F0-46F6-B56A-83A6B1EA657E}\r
-       EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Java", "mDNSWindows\Java\Java.vcxproj", "{9CE2568A-3170-41C6-9F20-A0188A9EC114}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JavaSamples", "Clients\Java\JavaSamples.vcproj", "{A987A0C1-344F-475C-869C-F082EB11EEBA}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {9CE2568A-3170-41C6-9F20-A0188A9EC114} = {9CE2568A-3170-41C6-9F20-A0188A9EC114}\r
-       EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JavaSamples", "Clients\Java\JavaSamples.vcxproj", "{A987A0C1-344F-475C-869C-F082EB11EEBA}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DLLStub", "mDNSWindows\DLLStub\DLLStub.vcproj", "{3A2B6325-3053-4236-84BD-AA9BE2E323E5}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {AB581101-18F0-46F6-B56A-83A6B1EA657E} = {AB581101-18F0-46F6-B56A-83A6B1EA657E}\r
-       EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DLLStub", "mDNSWindows\DLLStub\DLLStub.vcxproj", "{3A2B6325-3053-4236-84BD-AA9BE2E323E5}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DLLX", "mDNSWindows\DLLX\DLLX.vcproj", "{78FBFCC5-2873-4AE2-9114-A08082F71124}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DLLX", "mDNSWindows\DLLX\DLLX.vcxproj", "{78FBFCC5-2873-4AE2-9114-A08082F71124}"\r
 EndProject\r
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DNSServiceBrowser.NET", "Clients\DNSServiceBrowser.NET\DNSServiceBrowser.NET.csproj", "{DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}"\r
 EndProject\r
 Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "DNSServiceBrowser.VB", "Clients\DNSServiceBrowser.VB\DNSServiceBrowser.VB.vbproj", "{FB79E297-5703-435C-A829-51AA51CD71C2}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mDNSNetMonitor", "Clients\mDNSNetMonitor.VisualStudio\mDNSNetMonitor.vcproj", "{AF35C285-528D-46A1-8A0E-47B0733DC718}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {C1D98254-BA27-4427-A3BE-A68CA2CC5F69} = {C1D98254-BA27-4427-A3BE-A68CA2CC5F69}\r
-       EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mDNSNetMonitor", "Clients\mDNSNetMonitor.VisualStudio\mDNSNetMonitor.vcxproj", "{AF35C285-528D-46A1-8A0E-47B0733DC718}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ControlPanelLocRes", "mDNSWindows\ControlPanel\ControlPanelLocRes.vcproj", "{4490229E-025A-478F-A2CF-51154DA83E39}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ControlPanelLocRes", "mDNSWindows\ControlPanel\ControlPanelLocRes.vcxproj", "{4490229E-025A-478F-A2CF-51154DA83E39}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ControlPanelRes", "mDNSWindows\ControlPanel\ControlPanelRes.vcproj", "{5254AA9C-3D2E-4539-86D9-5EB0F4151215}"\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ControlPanelRes", "mDNSWindows\ControlPanel\ControlPanelRes.vcxproj", "{5254AA9C-3D2E-4539-86D9-5EB0F4151215}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ControlPanel", "mDNSWindows\ControlPanel\ControlPanel.vcproj", "{0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {3A2B6325-3053-4236-84BD-AA9BE2E323E5} = {3A2B6325-3053-4236-84BD-AA9BE2E323E5}\r
-       EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ControlPanel", "mDNSWindows\ControlPanel\ControlPanel.vcxproj", "{0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}"\r
 EndProject\r
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FirefoxExtension", "Clients\FirefoxExtension\FirefoxExtension.vcproj", "{7826EA27-D4CC-4FAA-AD23-DF813823227B}"\r
-       ProjectSection(ProjectDependencies) = postProject\r
-               {3A2B6325-3053-4236-84BD-AA9BE2E323E5} = {3A2B6325-3053-4236-84BD-AA9BE2E323E5}\r
-       EndProjectSection\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FirefoxExtension", "Clients\FirefoxExtension\FirefoxExtension.vcxproj", "{7826EA27-D4CC-4FAA-AD23-DF813823227B}"\r
 EndProject\r
 Global\r
        GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
@@ -332,7 +293,7 @@ Global
                {AF35C285-528D-46A1-8A0E-47B0733DC718}.Debug|Mixed Platforms.Build.0 = Debug|Win32\r
                {AF35C285-528D-46A1-8A0E-47B0733DC718}.Debug|Win32.ActiveCfg = Debug|Win32\r
                {AF35C285-528D-46A1-8A0E-47B0733DC718}.Debug|Win32.Build.0 = Debug|Win32\r
-               {AF35C285-528D-46A1-8A0E-47B0733DC718}.Debug|x64.ActiveCfg = Debug|Win32\r
+               {AF35C285-528D-46A1-8A0E-47B0733DC718}.Debug|x64.ActiveCfg = Debug|x64\r
                {AF35C285-528D-46A1-8A0E-47B0733DC718}.Release|Any CPU.ActiveCfg = Release|Win32\r
                {AF35C285-528D-46A1-8A0E-47B0733DC718}.Release|Mixed Platforms.ActiveCfg = Release|Win32\r
                {AF35C285-528D-46A1-8A0E-47B0733DC718}.Release|Mixed Platforms.Build.0 = Release|Win32\r
index fef5c981b2948928613c6febc04702957379e661..dbbedea91d0743862e7c73b73b460f70e746b200 100644 (file)
 #ifdef _WIN32
 #include <winsock2.h>
 #include <iphlpapi.h>
-static char    *       if_indextoname( DWORD ifIndex, char * nameBuff);
-static DWORD   if_nametoindex( const char * nameStr );
+static char    *       win32_if_indextoname( DWORD ifIndex, char * nameBuff);
+static DWORD   win32_if_nametoindex( const char * nameStr );
+#define if_indextoname win32_if_indextoname
+#define if_nametoindex win32_if_nametoindex
 #define IF_NAMESIZE MAX_ADAPTER_NAME_LENGTH
 #else // _WIN32
 #include <sys/socket.h>
@@ -950,7 +952,7 @@ JNIEXPORT jint JNICALL Java_com_apple_dnssd_AppleDNSSD_GetIfIndexForName( JNIEnv
 
 #if defined(_WIN32)
 static char*
-if_indextoname( DWORD ifIndex, char * nameBuff)
+win32_if_indextoname( DWORD ifIndex, char * nameBuff)
 {
        PIP_ADAPTER_INFO        pAdapterInfo = NULL;
        PIP_ADAPTER_INFO        pAdapter = NULL;
@@ -1007,7 +1009,7 @@ exit:
 
 
 static DWORD
-if_nametoindex( const char * nameStr )
+win32_if_nametoindex( const char * nameStr )
 {
        PIP_ADAPTER_INFO        pAdapterInfo = NULL;
        PIP_ADAPTER_INFO        pAdapter = NULL;
index e431486c5d7322fa91f8a848787b5328d9c80d4a..3caa6a85865e7cb5251135d53a24a5fe224790fa 100644 (file)
@@ -77,7 +77,7 @@
  */
 
 #ifndef _DNS_SD_H
-#define _DNS_SD_H 3201600
+#define _DNS_SD_H 3331000
 
 #ifdef  __cplusplus
     extern "C" {
index cba52d32bca0fe2908d81ee89820d398f8650960..63c9d1903381f4b4b2381aefb362e7ac84a16e43 100644 (file)
@@ -3104,8 +3104,8 @@ void mDNSCoreReceive(mDNS *const m, void *const msg, const mDNSu8 *const end,
                                 const mDNSAddr *const srcaddr, const mDNSIPPort srcport,
                                 const mDNSAddr *const dstaddr, const mDNSIPPort dstport, const mDNSInterfaceID iid)
        { ( void ) m; ( void ) msg; ( void ) end; ( void ) srcaddr; ( void ) srcport; ( void ) dstaddr; ( void ) dstport; ( void ) iid; }
-DNSServer *mDNS_AddDNSServer(mDNS *const m, const domainname *d, const mDNSInterfaceID interface, const mDNSAddr *addr, const mDNSIPPort port, mDNSBool scoped, mDNSu32 timeout)
-       { ( void ) m; ( void ) d; ( void ) interface; ( void ) addr; ( void ) port; ( void ) scoped; ( void ) timeout; return(NULL); }
+DNSServer *mDNS_AddDNSServer(mDNS *const m, const domainname *d, const mDNSInterfaceID interface, const mDNSAddr *addr, const mDNSIPPort port, mDNSBool scoped, mDNSu32 timeout, mDNSBool cellIntf)
+       { ( void ) m; ( void ) d; ( void ) interface; ( void ) addr; ( void ) port; ( void ) scoped; ( void ) timeout; (void) cellIntf; return(NULL); }
 void mDNS_AddSearchDomain(const domainname *const domain, mDNSInterfaceID InterfaceID) { (void)domain; (void) InterfaceID;}
 void mDNS_AddDynDNSHostName(mDNS *m, const domainname *fqdn, mDNSRecordCallback *StatusCallback, const void *StatusContext)
        { ( void ) m; ( void ) fqdn; ( void ) StatusCallback; ( void ) StatusContext; }
index 2f614e56fbf2ab048f91919e598028466bf2d597..5cac1060e875daec55f5fe8b63333a1bf2a17cc3 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 4 -*-
  *
- * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2006-2011 Apple Computer, Inc. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ extern YYSTYPE yylval;
 #if YY_FLEX_MAJOR_VERSION <= 2 && YY_FLEX_MINOR_VERSION <= 5 && YY_FLEX_SUBMINOR_VERSION <= 4
 int yylineno = 1;
 #endif
-
+#define YY_NO_INPUT 1
 int  yylex(void);
 
 static char*
index af182f7a4c9736adf28a20affaded60727d8808d..386575c29294b05987d700b9c5546cbe655f77ba 100644 (file)
 #include <errno.h>
 #include <stdlib.h>
 
+#if APPLE_OSX_mDNSResponder
+#include <mach-o/dyld.h>
+#endif
+
 #include "dnssd_ipc.h"
 
 static int gDaemonErr = kDNSServiceErr_NoError;
@@ -42,6 +46,7 @@ static int gDaemonErr = kDNSServiceErr_NoError;
        #include <ws2tcpip.h>
        #include <windows.h>
        #include <stdarg.h>
+       #include <stdio.h>
        
        #define sockaddr_mdns sockaddr_in
        #define AF_MDNS AF_INET
@@ -1122,6 +1127,34 @@ fail:
        syslog(LOG_WARNING, "dnssd_clientstub handle_resolve_response: error reading result from daemon");
        }
 
+#if APPLE_OSX_mDNSResponder
+
+static int32_t libSystemVersion = 0;
+
+// Return true if the application linked against a version of libsystem where P2P
+// interfaces were included by default when using kDNSServiceInterfaceIndexAny.
+// Using 160.0.0 == 0xa00000 as the version threshold.
+static int includeP2PWithIndexAny()
+       {
+       if (libSystemVersion == 0) 
+               libSystemVersion = NSVersionOfLinkTimeLibrary("System");
+
+       if (libSystemVersion < 0xa00000)
+               return 1;
+       else
+               return 0;
+       }
+
+#else  // APPLE_OSX_mDNSResponder
+
+// always return false for non Apple platforms
+static int includeP2PWithIndexAny()
+       {
+       return 0;
+       }
+
+#endif // APPLE_OSX_mDNSResponder
+
 DNSServiceErrorType DNSSD_API DNSServiceResolve
        (
        DNSServiceRef                 *sdRef,
@@ -1151,6 +1184,9 @@ DNSServiceErrorType DNSSD_API DNSServiceResolve
                return kDNSServiceErr_BadParam;
                }
                
+       if ((interfaceIndex == kDNSServiceInterfaceIndexAny) && includeP2PWithIndexAny())
+               flags |= kDNSServiceFlagsIncludeP2P;
+
        err = ConnectToServer(sdRef, flags, resolve_request, handle_resolve_response, callBack, context);
        if (err) return err;    // On error ConnectToServer leaves *sdRef set to NULL
 
@@ -1209,7 +1245,12 @@ DNSServiceErrorType DNSSD_API DNSServiceQueryRecord
        char *ptr;
        size_t len;
        ipc_msg_hdr *hdr;
-       DNSServiceErrorType err = ConnectToServer(sdRef, flags, query_request, handle_query_response, callBack, context);
+       DNSServiceErrorType err;
+
+       if ((interfaceIndex == kDNSServiceInterfaceIndexAny) && includeP2PWithIndexAny())
+               flags |= kDNSServiceFlagsIncludeP2P;
+
+       err = ConnectToServer(sdRef, flags, query_request, handle_query_response, callBack, context);
        if (err) return err;    // On error ConnectToServer leaves *sdRef set to NULL
 
        if (!name) name = "\0";
@@ -1354,7 +1395,12 @@ DNSServiceErrorType DNSSD_API DNSServiceBrowse
        char *ptr;
        size_t len;
        ipc_msg_hdr *hdr;
-       DNSServiceErrorType err = ConnectToServer(sdRef, flags, browse_request, handle_browse_response, callBack, context);
+       DNSServiceErrorType err;
+
+       if ((interfaceIndex == kDNSServiceInterfaceIndexAny) && includeP2PWithIndexAny())
+               flags |= kDNSServiceFlagsIncludeP2P;
+
+       err = ConnectToServer(sdRef, flags, browse_request, handle_browse_response, callBack, context);
        if (err) return err;    // On error ConnectToServer leaves *sdRef set to NULL
 
        if (!domain) domain = "";
@@ -1438,6 +1484,9 @@ DNSServiceErrorType DNSSD_API DNSServiceRegister
        // No callback must have auto-rename
        if (!callBack && (flags & kDNSServiceFlagsNoAutoRename)) return kDNSServiceErr_BadParam;
 
+       if ((interfaceIndex == kDNSServiceInterfaceIndexAny) && includeP2PWithIndexAny())
+               flags |= kDNSServiceFlagsIncludeP2P;
+
        err = ConnectToServer(sdRef, flags, reg_service_request, callBack ? handle_regservice_response : NULL, callBack, context);
        if (err) return err;    // On error ConnectToServer leaves *sdRef set to NULL
 
@@ -1583,6 +1632,9 @@ DNSServiceErrorType DNSSD_API DNSServiceRegisterRecord
        int f2 = (flags & kDNSServiceFlagsUnique) != 0;
        if (f1 + f2 != 1) return kDNSServiceErr_BadParam;
 
+       if ((interfaceIndex == kDNSServiceInterfaceIndexAny) && includeP2PWithIndexAny())
+               flags |= kDNSServiceFlagsIncludeP2P;
+
        if (!sdRef) { syslog(LOG_WARNING, "dnssd_clientstub DNSServiceRegisterRecord called with NULL DNSServiceRef"); return kDNSServiceErr_BadParam; }
 
        if (!DNSServiceRefValid(sdRef))
index d41edc8725257619f6a38475a6a3a1d739ede9fc..748bbdf2139f62ee170958254a07e374c423bb32 100644 (file)
@@ -152,7 +152,7 @@ typedef enum
     } reply_op_t;
 
 #if defined(_WIN64)
-#      pragma pack(4)
+#      pragma pack(push,4)
 #endif
 
 // Define context object big enough to hold a 64-bit pointer,
@@ -176,6 +176,10 @@ typedef packedstruct
     // index/socket pair uniquely identifies a record.  (Used to select records for removal by DNSServiceRemoveRecord())
     } ipc_msg_hdr;
 
+#if defined(_WIN64)
+#      pragma pack(pop)
+#endif
+
 // routines to write to and extract data from message buffers.
 // caller responsible for bounds checking.
 // ptr is the address of the pointer to the start of the field.
index c3673a7a940eb3810f69027048e629973db25cc3..ecc3eb103c2a21e4a7471cfe97312b596de0223f 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- Mode: C; tab-width: 4 -*-
  *
- * Copyright (c) 2003-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2003-2011 Apple Computer, Inc. All rights reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -282,9 +282,10 @@ mDNSexport DNameListElem *AutoBrowseDomains;               // List created from those local-o
 
 mDNSlocal void FatalError(char *errmsg)
        {
+       char* ptr = NULL;
        LogMsg("%s: %s", errmsg, dnssd_strerror(dnssd_errno));
-       *(long*)0 = 0;  // On OS X abort() doesn't generate a crash log, but writing to zero does
-       abort();                // On platforms where writing to zero doesn't generate an exception, abort instead
+       *ptr = 0;       // On OS X abort() doesn't generate a crash log, but writing to zero does
+       abort();    // On platforms where writing to zero doesn't generate an exception, abort instead
        }
 
 mDNSlocal mDNSu32 dnssd_htonl(mDNSu32 l)
@@ -2334,7 +2335,7 @@ mDNSlocal mStatus handle_resolve_request(request_state *request)
 #endif
 
        // ask the questions
-       LogOperation("%3d: DNSServiceResolve(%##s) START", request->sd, request->u.resolve.qsrv.qname.c);
+       LogOperation("%3d: DNSServiceResolve(%X %d %##s) START", request->sd, flags, interfaceIndex, request->u.resolve.qsrv.qname.c);
        err = mDNS_StartQuery(&mDNSStorage, &request->u.resolve.qsrv);
        if (!err)
                {
@@ -2504,9 +2505,6 @@ mDNSlocal mStatus SendAdditionalQuery(DNSQuestion *q, request_state *request, mS
                        *q2               = *q;
                        q2->InterfaceID   = mDNSInterface_Unicast;
                        q2->ExpectUnique  = mDNStrue;
-                       // Always set the QuestionContext to indicate that this question should be stopped
-                       // before freeing. Don't rely on "q".
-                       q2->QuestionContext = request;
                        // If the query starts as a single label e.g., somehost, and we have search domains with .local,
                        // queryrecord_result_callback calls this function when .local is appended to "somehost".
                        // At that time, the name in "q" is pointing at somehost.local and its qnameOrig pointing at
@@ -2730,26 +2728,8 @@ mDNSlocal void queryrecord_result_callback(mDNS *const m, DNSQuestion *question,
                        {
                        if (!answer->InterfaceID && IsLocalDomain(answer->name))
                                {
-                               mDNSu16 qtype;
-                               // Sanity check: "q" will be set only if "question" is the .local unicast query.
-                               if (!q)
-                                       {
-                                       LogMsg("queryrecord_result_callback: ERROR!! answering multicast question with unicast cache record");
-                                       return;
-                                       }
-                               // Deliver negative response for A/AAAA if there was a positive response for AAAA/A respectively.
-                               if (question->qtype != kDNSType_A && question->qtype != kDNSType_AAAA)
-                                       {
-                                       LogInfo("queryrecord_result_callback:Question %##s (%s) not answering local question with negative unicast response", question->qname.c, DNSTypeName(question->qtype));
-                                       return;
-                                       }
-                               qtype = (question->qtype == kDNSType_A ? kDNSType_AAAA : kDNSType_A);
-                               if (!mDNS_CheckForCacheRecord(m, question, qtype))
-                                       {
-                                       LogInfo("queryrecord_result_callback:Question %##s (%s) not answering local question with negative unicast response (can't find positive record)", question->qname.c, DNSTypeName(question->qtype));
-                                       return;
-                                       }
-                               LogInfo("queryrecord_result_callback:Question %##s (%s) answering local with negative unicast response (found positive record)", question->qname.c, DNSTypeName(question->qtype));
+                               LogInfo("queryrecord_result_callback:Question %##s (%s) answering local with unicast", question->qname.c, DNSTypeName(question->qtype));
+                               return;
                                }
                        error = kDNSServiceErr_NoSuchRecord;
                        }
@@ -4728,7 +4708,7 @@ struct CompileTimeAssertionChecks_uds_daemon
        // Check our structures are reasonable sizes. Including overly-large buffers, or embedding
        // other overly-large structures instead of having a pointer to them, can inadvertently
        // cause structure sizes (and therefore memory usage) to balloon unreasonably.
-       char sizecheck_request_state          [(sizeof(request_state)           <= 1784) ? 1 : -1];
+       char sizecheck_request_state          [(sizeof(request_state)           <= 2000) ? 1 : -1];
        char sizecheck_registered_record_entry[(sizeof(registered_record_entry) <=   60) ? 1 : -1];
        char sizecheck_service_instance       [(sizeof(service_instance)        <= 6552) ? 1 : -1];
        char sizecheck_browser_t              [(sizeof(browser_t)               <= 1050) ? 1 : -1];
index 20b5c6d23d3840ac12c848f104144f37daecac12..084cf1bc176dccee5c43c168ff7fe70643ab8c92 100755 (executable)
@@ -131,7 +131,7 @@ CBrowsingPage::OnSetActive()
        // Now populate the browse domain box
 
        err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, kServiceParametersNode L"\\DynDNS\\Setup\\" kServiceDynDNSBrowseDomains, 0,
-                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &key, NULL );
+                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &key, NULL );
        require_noerr( err, exit );
 
        // Get information about this node
@@ -217,7 +217,7 @@ CBrowsingPage::Commit()
        DWORD           err;
 
        err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, kServiceParametersNode L"\\DynDNS\\Setup\\" kServiceDynDNSBrowseDomains, 0,
-                             NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &key, NULL );
+                             NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &key, NULL );
        require_noerr( err, exit );
 
        // First, remove all the entries that are there
@@ -243,7 +243,7 @@ CBrowsingPage::Commit()
                DWORD enabled = (DWORD) m_browseListCtrl.GetCheck( i );
 
                err = RegCreateKeyEx( key, m_browseListCtrl.GetItemText( i, 1 ), 0,
-                                     NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &subKey, NULL );
+                                     NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &subKey, NULL );
                require_noerr( err, exit );
 
                err = RegSetValueEx( subKey, L"Enabled", NULL, REG_DWORD, (LPBYTE) &enabled, sizeof( enabled ) );
diff --git a/mDNSWindows/ControlPanel/ControlPanel.vcxproj b/mDNSWindows/ControlPanel/ControlPanel.vcxproj
new file mode 100755 (executable)
index 0000000..c341d42
--- /dev/null
@@ -0,0 +1,385 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}</ProjectGuid>\r
+    <RootNamespace>ControlPanel</RootNamespace>\r
+    <Keyword>MFCProj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..;../../mDNSCore;../../mDNSShared;../../Clients;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;DEBUG=1;UNICODE;_UNICODE;_WINDOWS;WINVER=0x0501;_WIN32_WINNT=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderFile>\r
+      </PrecompiledHeaderFile>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ObjectFileName>$(IntDir)</ObjectFileName>\r
+      <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>Cdecl</CallingConvention>\r
+      <DisableSpecificWarnings>4311;4312;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ControlPanel.exe</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)ControlPanel.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\ControlPanel.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..;../../mDNSCore;../../mDNSShared;../../Clients;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;DEBUG=1;UNICODE;_UNICODE;_WINDOWS;WINVER=0x0501;_WIN32_WINNT=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderFile>\r
+      </PrecompiledHeaderFile>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ObjectFileName>$(IntDir)</ObjectFileName>\r
+      <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>Cdecl</CallingConvention>\r
+      <DisableSpecificWarnings>4311;4312;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ControlPanel.exe</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)ControlPanel.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\ControlPanel64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <AdditionalIncludeDirectories>..;../../mDNSCore;../../mDNSShared;../../Clients;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;_WIN32_WINNT=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>false</MinimalRebuild>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ObjectFileName>$(IntDir)</ObjectFileName>\r
+      <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ControlPanel.exe</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <ProgramDatabaseFile>$(OutDir)ControlPanel.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\ControlPanel.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"   mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                                  "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>\r
+      <AdditionalIncludeDirectories>..;../../mDNSCore;../../mDNSShared;../../Clients;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;_WIN32_WINNT=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>false</MinimalRebuild>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ObjectFileName>$(IntDir)</ObjectFileName>\r
+      <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ControlPanel.exe</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <ProgramDatabaseFile>$(OutDir)ControlPanel.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\ControlPanel64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"   mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                                  "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="ConfigDialog.cpp">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="ConfigPropertySheet.cpp">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="ControlPanelExe.cpp" />\r
+    <ClCompile Include="ServicesPage.cpp" />\r
+    <ClCompile Include="RegistrationPage.cpp">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+    <ClCompile Include="..\loclibrary.c" />\r
+    <ClCompile Include="stdafx.cpp">\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+      </PrecompiledHeader>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Disabled</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+      </PrecompiledHeader>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+      </PrecompiledHeader>\r
+      <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">MaxSpeed</Optimization>\r
+      <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+      </PrecompiledHeader>\r
+    </ClCompile>\r
+    <ClCompile Include="BrowsingPage.cpp" />\r
+    <ClCompile Include="..\..\Clients\ClientCommon.c" />\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c" />\r
+    <ClCompile Include="..\Secret.c" />\r
+    <ClCompile Include="..\WinServices.cpp" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="ConfigDialog.h" />\r
+    <ClInclude Include="ConfigPropertySheet.h" />\r
+    <ClInclude Include="ControlPanelExe.h" />\r
+    <ClInclude Include="ServicesPage.h" />\r
+    <ClInclude Include="RegistrationPage.h" />\r
+    <ClInclude Include="..\loclibrary.h" />\r
+    <ClInclude Include="Resource.h" />\r
+    <ClInclude Include="stdafx.h" />\r
+    <ClInclude Include="BrowsingPage.h" />\r
+    <ClInclude Include="..\..\Clients\ClientCommon.h" />\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h" />\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h" />\r
+    <ClInclude Include="..\..\mDNSShared\dns_sd.h" />\r
+    <ClInclude Include="..\Secret.h" />\r
+    <ClInclude Include="..\WinServices.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="res\configurator.ico" />\r
+    <None Include="res\controlpanel.ico" />\r
+    <None Include="res\ControlPanel.rc2" />\r
+    <None Include="res\EnergySaver.ico" />\r
+    <None Include="res\failure.ico" />\r
+    <None Include="res\success.ico" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="ControlPanel.rc" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\DLLStub\DLLStub.vcxproj">\r
+      <Project>{3a2b6325-3053-4236-84bd-aa9be2e323e5}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/mDNSWindows/ControlPanel/ControlPanel.vcxproj.filters b/mDNSWindows/ControlPanel/ControlPanel.vcxproj.filters
new file mode 100755 (executable)
index 0000000..846d6a4
--- /dev/null
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{d534a12a-5d97-4d9e-87ba-898c97da20fb}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{e7514699-1b61-4910-a465-8950dd4c3fad}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{dad601b4-0fa4-4692-8c01-8cbb407b5a32}</UniqueIdentifier>\r
+      <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe</Extensions>\r
+    </Filter>\r
+    <Filter Include="Support">\r
+      <UniqueIdentifier>{ada5b5c6-cf44-4574-94a0-0e576fda469d}</UniqueIdentifier>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="ConfigDialog.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="ConfigPropertySheet.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="ControlPanelExe.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="ServicesPage.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="RegistrationPage.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\loclibrary.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="stdafx.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="BrowsingPage.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\Clients\ClientCommon.c">\r
+      <Filter>Support</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c">\r
+      <Filter>Support</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\Secret.c">\r
+      <Filter>Support</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\WinServices.cpp">\r
+      <Filter>Support</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="ConfigDialog.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="ConfigPropertySheet.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="ControlPanelExe.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="ServicesPage.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="RegistrationPage.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\loclibrary.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="Resource.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="stdafx.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="BrowsingPage.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\Clients\ClientCommon.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\dns_sd.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\Secret.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\WinServices.h">\r
+      <Filter>Support</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="res\configurator.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\controlpanel.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\ControlPanel.rc2">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\EnergySaver.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\failure.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\success.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="ControlPanel.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
index 079422bb2a237aef581028cc19cf0395be75e8be..865ebc1ac4f42267b9073101101d2bc229a74a5e 100644 (file)
@@ -18,7 +18,7 @@
     
 #pragma once
 
-#include "stdafx.h"\r
+#include "stdafx.h"
 
 extern HINSTANCE       GetNonLocalizedResources();
 extern HINSTANCE       GetLocalizedResources();
diff --git a/mDNSWindows/ControlPanel/ControlPanelLocRes.vcxproj b/mDNSWindows/ControlPanel/ControlPanelLocRes.vcxproj
new file mode 100755 (executable)
index 0000000..bc51708
--- /dev/null
@@ -0,0 +1,382 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|Win32">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|x64">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{4490229E-025A-478F-A2CF-51154DA83E39}</ProjectGuid>\r
+    <RootNamespace>ControlPanelLocRes</RootNamespace>\r
+    <ProjectName>ControlPanelLocRes</ProjectName>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\ControlPanel.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\ControlPanel.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\ControlPanel.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\ControlPanel.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\ControlPanel.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\ControlPanel.Resources\en.lproj\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ControlPanelLocalized</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ControlPanelLocalized</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">ControlPanelLocalized</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ControlPanelLocalized</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ControlPanelLocalized</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|x64'">ControlPanelLocalized</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.dll</TargetExt>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.dll</TargetExt>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">.dll</TargetExt>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.dll</TargetExt>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.dll</TargetExt>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|x64'">.dll</TargetExt>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Debug/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)ControlPanel.Resources mkdir $(OutDir)ControlPanel.Resources\r
+if not exist $(OutDir)ControlPanel.Resources\en.lproj mkdir $(OutDir)ControlPanel.Resources\en.lproj\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ControlPanelLocalized.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Debug/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)ControlPanel.Resources mkdir $(OutDir)ControlPanel.Resources\r
+if not exist $(OutDir)ControlPanel.Resources\en.lproj mkdir $(OutDir)ControlPanel.Resources\en.lproj\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ControlPanelLocalized.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+      <FunctionLevelLinking>false</FunctionLevelLinking>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Release/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)ControlPanel.Resources mkdir $(OutDir)ControlPanel.Resources\r
+if not exist $(OutDir)ControlPanel.Resources\en.lproj mkdir $(OutDir)ControlPanel.Resources\en.lproj\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ControlPanelLocalized.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <ProgramDatabaseFile>\r
+      </ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ControlPanel.Resources\en.lproj"   mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ControlPanel.Resources\en.lproj"\r
+xcopy /I/Y "$(TargetPath)"                                                                                                                          "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ControlPanel.Resources\en.lproj"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+      <FunctionLevelLinking>false</FunctionLevelLinking>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Release/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)ControlPanel.Resources mkdir $(OutDir)ControlPanel.Resources\r
+if not exist $(OutDir)ControlPanel.Resources\en.lproj mkdir $(OutDir)ControlPanel.Resources\en.lproj\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)ControlPanelLocalized.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <ProgramDatabaseFile>\r
+      </ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ControlPanel.Resources\en.lproj"   mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ControlPanel.Resources\en.lproj"\r
+xcopy /I/Y "$(TargetPath)"                                                                                                                          "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ControlPanel.Resources\en.lproj"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="resource_loc_res.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="ControlPanelLocRes.rc" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+  <ProjectExtensions>\r
+    <VisualStudio>\r
+      <UserProperties RESOURCE_FILE="ControlPanelLocRes.rc" />\r
+    </VisualStudio>\r
+  </ProjectExtensions>\r
+</Project>
\ No newline at end of file
diff --git a/mDNSWindows/ControlPanel/ControlPanelLocRes.vcxproj.filters b/mDNSWindows/ControlPanel/ControlPanelLocRes.vcxproj.filters
new file mode 100755 (executable)
index 0000000..7398ead
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{acc11657-b2ba-42ef-9f3e-c4c55cb6d9e9}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{7625f01d-dd41-4ede-9371-d3993f0779ac}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="resource_loc_res.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="ControlPanelLocRes.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
diff --git a/mDNSWindows/ControlPanel/ControlPanelRes.vcxproj b/mDNSWindows/ControlPanel/ControlPanelRes.vcxproj
new file mode 100755 (executable)
index 0000000..321e5ee
--- /dev/null
@@ -0,0 +1,393 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|Win32">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Template|x64">\r
+      <Configuration>Template</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{5254AA9C-3D2E-4539-86D9-5EB0F4151215}</ProjectGuid>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>Static</UseOfMfc>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\ControlPanel.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\ControlPanel.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\ControlPanel.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\ControlPanel.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ControlPanelResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ControlPanelResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.dll</TargetExt>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\ControlPanel.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">ControlPanelResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ControlPanelResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.dll</TargetExt>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ControlPanelResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.dll</TargetExt>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\ControlPanel.Resources\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|x64'">ControlPanelResources</TargetName>\r
+    <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|x64'">.dll</TargetExt>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Debug/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)ControlPanel.Resources mkdir $(OutDir)ControlPanel.Resources\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <OutputFile>$(OutDir)ControlPanelResources.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Debug/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)ControlPanel.Resources mkdir $(OutDir)ControlPanel.Resources\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <OutputFile>$(OutDir)ControlPanelResources.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+      <FunctionLevelLinking>false</FunctionLevelLinking>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Release/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)ControlPanel.Resources mkdir $(OutDir)ControlPanel.Resources\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <OutputFile>$(OutDir)ControlPanelResources.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <ProgramDatabaseFile>\r
+      </ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ControlPanel.Resources"   mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ControlPanel.Resources"\r
+xcopy /I/Y "$(TargetPath)"                                                                                                            "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ControlPanel.Resources"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>true</MkTypLibCompatible>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+      <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>\r
+      <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>\r
+      <OmitFramePointers>true</OmitFramePointers>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <BufferSecurityCheck>false</BufferSecurityCheck>\r
+      <FunctionLevelLinking>false</FunctionLevelLinking>\r
+      <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+      <AssemblerListingLocation>.\Release/</AssemblerListingLocation>\r
+      <ObjectFileName>.\Release/</ObjectFileName>\r
+      <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>\r
+      <BrowseInformation>true</BrowseInformation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <TreatWarningAsError>false</TreatWarningAsError>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <CompileAs>Default</CompileAs>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <PreLinkEvent>\r
+      <Message>Building Output Directories</Message>\r
+      <Command>if not exist $(OutDir)ControlPanel.Resources mkdir $(OutDir)ControlPanel.Resources\r
+</Command>\r
+    </PreLinkEvent>\r
+    <Link>\r
+      <AdditionalOptions>/MACHINE:I386 /IGNORE:4089  %(AdditionalOptions)</AdditionalOptions>\r
+      <OutputFile>$(OutDir)ControlPanelResources.dll</OutputFile>\r
+      <SuppressStartupBanner>true</SuppressStartupBanner>\r
+      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>\r
+      <ModuleDefinitionFile>\r
+      </ModuleDefinitionFile>\r
+      <ProgramDatabaseFile>\r
+      </ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <NoEntryPoint>true</NoEntryPoint>\r
+      <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ControlPanel.Resources"   mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ControlPanel.Resources"\r
+xcopy /I/Y "$(TargetPath)"                                                                                                            "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ControlPanel.Resources"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">\r
+    <Link>\r
+      <OutputFile>$(OutDir)ControlPanelResources.dll</OutputFile>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'">\r
+    <Link>\r
+      <OutputFile>$(OutDir)ControlPanelResources.dll</OutputFile>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="resource_res.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="res\about.bmp" />\r
+    <None Include="about.bmp" />\r
+    <None Include="res\button-2k.ico" />\r
+    <None Include="res\button-xp.ico" />\r
+    <None Include="res\cold.ico" />\r
+    <None Include="hot.ico" />\r
+    <None Include="res\logo.bmp" />\r
+    <None Include="logo.bmp" />\r
+    <None Include="Web.ico" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="ControlPanelRes.rc" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+  <ProjectExtensions>\r
+    <VisualStudio>\r
+      <UserProperties RESOURCE_FILE="ControlPanelRes.rc" />\r
+    </VisualStudio>\r
+  </ProjectExtensions>\r
+</Project>
\ No newline at end of file
diff --git a/mDNSWindows/ControlPanel/ControlPanelRes.vcxproj.filters b/mDNSWindows/ControlPanel/ControlPanelRes.vcxproj.filters
new file mode 100755 (executable)
index 0000000..42f1392
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{46e7bad9-15a3-43d9-ad60-c91ea9693b5d}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{6f549e07-210f-4cd6-96ae-8eda3aaae73b}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="resource_res.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="res\about.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="about.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\button-2k.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\button-xp.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\cold.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="hot.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="res\logo.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="logo.bmp">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="Web.ico">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="ControlPanelRes.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
index f748efd9ac92b47b490943bc4210ede999bfb8e8..b6c8d15d563b34c6f1149652e7b4bdda05bdb4bd 100755 (executable)
@@ -106,7 +106,7 @@ CFourthPage::OnSetActive()
        // Now populate the browse domain box
 
        err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, kServiceParametersNode L"\\Power Management", 0,
-                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &key, NULL );
+                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &key, NULL );
        require_noerr( err, exit );
 
        dwSize = sizeof( DWORD );
@@ -153,7 +153,7 @@ CFourthPage::Commit()
        DWORD           err;
 
        err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, kServiceParametersNode L"\\Power Management", 0,
-                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &key, NULL );
+                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &key, NULL );
        require_noerr( err, exit );
 
        enabled = m_checkBox.GetCheck();
index 9328a7543c886d540082d6b4397e87e91dc0e623..55755f011e6902c4d782910b752dce95b03c0735 100755 (executable)
@@ -49,15 +49,15 @@ CRegistrationPage::CRegistrationPage()
        OSStatus err;
 
        err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, kServiceParametersNode L"\\DynDNS\\Setup\\Hostnames", 0,
-                             NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &m_hostnameSetupKey, NULL );
+                             NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &m_hostnameSetupKey, NULL );
        check_noerr( err );
 
        err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, kServiceParametersNode L"\\DynDNS\\Setup\\" kServiceDynDNSRegistrationDomains, 0,
-                             NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &m_registrationSetupKey, NULL );
+                             NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &m_registrationSetupKey, NULL );
        check_noerr( err );
 
        err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, kServiceParametersNode L"\\DynDNS\\State\\Hostnames", 0,
-                             NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &m_statusKey, NULL );
+                             NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &m_statusKey, NULL );
        check_noerr( err );
 
        
@@ -364,7 +364,7 @@ CRegistrationPage::Commit()
                        domain          = domainUTF8;
 
                        err = RegCreateKeyEx( m_registrationSetupKey, domain, 0,
-                                                                        NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &subKey, NULL );
+                                                                        NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &subKey, NULL );
                        if ( !err )
                        {
                                err = RegSetValueEx( subKey, L"Enabled", 0, REG_DWORD, (LPBYTE) &enabled, sizeof( DWORD ) );
index d3bc1335d6197b9d91c2a857863a9f13cabd91d4..b6cf4ffc68c6e9a31d6a4e6c828bdfd4e2819a43 100755 (executable)
@@ -43,7 +43,7 @@ CSecondPage::CSecondPage()
        OSStatus err;
 
        err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, kServiceParametersNode L"\\DynDNS\\Setup\\" kServiceDynDNSRegistrationDomains, 0,
-                             NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &m_setupKey, NULL );
+                             NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &m_setupKey, NULL );
        check_noerr( err );
 }
 
@@ -230,7 +230,7 @@ CSecondPage::Commit( CComboBox & box, HKEY key, DWORD enabled )
        // DynDNS config again
 
        err = RegCreateKeyEx( key, selected, 0,
-                             NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &subKey, NULL );
+                             NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &subKey, NULL );
        require_noerr( err, exit );
 
        err = RegSetValueEx( subKey, L"Enabled", 0, REG_DWORD, (LPBYTE) &enabled, sizeof( DWORD ) );
@@ -481,7 +481,7 @@ CSecondPage::CreateKey( CString & name, DWORD enabled )
        OSStatus        err;
 
        err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, (LPCTSTR) name, 0,
-                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &key, NULL );
+                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &key, NULL );
        require_noerr( err, exit );
 
        err = RegSetValueEx( key, L"Enabled", 0, REG_DWORD, (LPBYTE) &enabled, sizeof( DWORD ) );
index e08715788a643e6341b4e99490ee80aebcc58ff5..4269fa63241525b2a0649d864b6ee67688e9c6f6 100755 (executable)
@@ -108,7 +108,7 @@ CServicesPage::OnSetActive()
        // Now populate the browse domain box
 
        err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, kServiceParametersNode L"\\Services\\SMB", 0,
-                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &key, NULL );
+                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &key, NULL );
        require_noerr( err, exit );
 
        dwSize = sizeof( DWORD );
@@ -125,7 +125,7 @@ CServicesPage::OnSetActive()
        // Now populate the browse domain box
 
        err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, kServiceParametersNode L"\\Power Management", 0,
-                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &key, NULL );
+                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &key, NULL );
        require_noerr( err, exit );
 
        dwSize = sizeof( DWORD );
@@ -172,7 +172,7 @@ CServicesPage::Commit()
        DWORD           err;
 
        err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, kServiceParametersNode L"\\Services\\SMB", 0,
-                               NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &key, NULL );
+                               NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &key, NULL );
        require_noerr( err, exit );
 
        enabled = m_SMBCheckBox.GetCheck();
@@ -183,7 +183,7 @@ CServicesPage::Commit()
        key = NULL;
 
        err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, kServiceParametersNode L"\\Power Management", 0,
-                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &key, NULL );
+                                 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE, NULL, &key, NULL );
        require_noerr( err, exit );
 
        enabled = m_powerManagementCheckBox.GetCheck();
index 29338aae3844e127123cfe302571f299752e09fb..9a14836a8b029f0f5e1d062d2946adee707cd1e3 100755 (executable)
@@ -1,3 +1,3 @@
-//{{NO_DEPENDENCIES}}\r
-// Microsoft Visual C++ generated include file.\r
-// Used by dnssd_NET.rc\r
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by dnssd_NET.rc
index 79f3bb78e2114fc6a17e6f97fbf618fad070196a..295e2edef0ec15b950b205d199f33674dd2eb72d 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <windows.h>
 #include <DebugServices.h>
+#include <stdlib.h>
 
 BOOL APIENTRY  DllMain( HANDLE inModule, DWORD inReason, LPVOID inReserved )
 {
diff --git a/mDNSWindows/DLL/dnssd.vcxproj b/mDNSWindows/DLL/dnssd.vcxproj
new file mode 100755 (executable)
index 0000000..7438a3a
--- /dev/null
@@ -0,0 +1,287 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectName>DLL</ProjectName>\r
+    <ProjectGuid>{AB581101-18F0-46F6-B56A-83A6B1EA657E}</ProjectGuid>\r
+    <RootNamespace>DLL</RootNamespace>\r
+    <Keyword>Win32Proj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">dnssd</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">dnssd</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">dnssd</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">dnssd</TargetName>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>../../mDNSCore;../../mDNSShared;../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;DEBUG=1;NOT_HAVE_SA_LEN;MDNS_DEBUGMSGS=0;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <ExceptionHandling>\r
+      </ExceptionHandling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <SmallerTypeCheck>true</SmallerTypeCheck>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ProgramDataBaseFileName>$(IntDir)dnssd.dll.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4127;4204;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)dnssd.dll</OutputFile>\r
+      <ModuleDefinitionFile>dnssd.def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)dnssd.dll.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <BaseAddress>0x16000000</BaseAddress>\r
+      <ImportLibrary>$(OutDir)dnssd.lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>../../mDNSCore;../../mDNSShared;../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;DEBUG=1;MDNS_DEBUGMSGS=0;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;NOT_HAVE_SA_LEN;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <ExceptionHandling>\r
+      </ExceptionHandling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <SmallerTypeCheck>true</SmallerTypeCheck>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ProgramDataBaseFileName>$(IntDir)dnssd.dll.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4127;4204;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)dnssd.dll</OutputFile>\r
+      <ModuleDefinitionFile>dnssd.def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)dnssd.dll.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <BaseAddress>0x16000000</BaseAddress>\r
+      <ImportLibrary>$(OutDir)dnssd.lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ClCompile>\r
+      <AdditionalIncludeDirectories>../../mDNSCore;../../mDNSShared;../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MDNS_DEBUGMSGS=0;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;NOT_HAVE_SA_LEN;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ProgramDataBaseFileName>$(IntDir)dnssd.dll.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4127;4204;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)dnssd.dll</OutputFile>\r
+      <ModuleDefinitionFile>dnssd.def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)dnssd.dll.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <BaseAddress>0x16000000</BaseAddress>\r
+      <ImportLibrary>$(OutDir)dnssd.lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\WINDOWS\system32\$(Platform)"                     mkdir "$(DSTROOT)\WINDOWS\system32\$(Platform)"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\lib"                                     mkdir "$(DSTROOT)\Program Files\Bonjour SDK\lib"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\lib\$(Platform)"     mkdir "$(DSTROOT)\Program Files\Bonjour SDK\lib\$(Platform)"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\include"                            mkdir "$(DSTROOT)\Program Files\Bonjour SDK\include"\r
+if not exist "$(DSTROOT)\AppleInternal"                                                                   mkdir "$(DSTROOT)\AppleInternal"\r
+if not exist "$(DSTROOT)\AppleInternal\bin"                                                           mkdir "$(DSTROOT)\AppleInternal\bin"\r
+if not exist "$(DSTROOT)\AppleInternal\bin\$(Platform)"                           mkdir "$(DSTROOT)\AppleInternal\bin\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                                                           "$(DSTROOT)\WINDOWS\system32\$(Platform)"\r
+xcopy /I/Y "$(OutDir)dnssd.dll.pdb"                                                                          "$(DSTROOT)\AppleInternal\bin\$(Platform)"\r
+xcopy /I/Y "$(ProjectDir)..\..\mDNSShared\dns_sd.h"                                             "$(DSTROOT)\Program Files\Bonjour SDK\include"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <AdditionalIncludeDirectories>../../mDNSCore;../../mDNSShared;../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MDNS_DEBUGMSGS=0;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;NOT_HAVE_SA_LEN;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <ProgramDataBaseFileName>$(IntDir)dnssd.dll.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <CompileAs>Default</CompileAs>\r
+      <DisableSpecificWarnings>4127;4204;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)dnssd.dll</OutputFile>\r
+      <ModuleDefinitionFile>dnssd.def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)dnssd.dll.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <BaseAddress>0x16000000</BaseAddress>\r
+      <ImportLibrary>$(OutDir)dnssd.lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\WINDOWS\system32\$(Platform)"                     mkdir "$(DSTROOT)\WINDOWS\system32\$(Platform)"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\lib"                                     mkdir "$(DSTROOT)\Program Files\Bonjour SDK\lib"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\lib\$(Platform)"     mkdir "$(DSTROOT)\Program Files\Bonjour SDK\lib\$(Platform)"\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\include"                            mkdir "$(DSTROOT)\Program Files\Bonjour SDK\include"\r
+if not exist "$(DSTROOT)\AppleInternal"                                                                   mkdir "$(DSTROOT)\AppleInternal"\r
+if not exist "$(DSTROOT)\AppleInternal\bin"                                                           mkdir "$(DSTROOT)\AppleInternal\bin"\r
+if not exist "$(DSTROOT)\AppleInternal\bin\$(Platform)"                           mkdir "$(DSTROOT)\AppleInternal\bin\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                                                           "$(DSTROOT)\WINDOWS\system32\$(Platform)"\r
+xcopy /I/Y "$(OutDir)dnssd.dll.pdb"                                                                         "$(DSTROOT)\AppleInternal\bin\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c" />\r
+    <ClCompile Include="dllmain.c" />\r
+    <ClCompile Include="..\..\mDNSShared\dnssd_clientlib.c" />\r
+    <ClCompile Include="..\..\mDNSShared\dnssd_clientstub.c" />\r
+    <ClCompile Include="..\..\mDNSShared\dnssd_ipc.c" />\r
+    <ClCompile Include="..\..\mDNSShared\GenLinkedList.c" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="dnssd.def" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h" />\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h" />\r
+    <ClInclude Include="..\..\mDNSShared\dns_sd.h" />\r
+    <ClInclude Include="..\..\mDNSShared\dnssd_ipc.h" />\r
+    <ClInclude Include="..\..\mDNSShared\GenLinkedList.h" />\r
+    <ClInclude Include="resource.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="dll.rc" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/mDNSWindows/DLL/dnssd.vcxproj.filters b/mDNSWindows/DLL/dnssd.vcxproj.filters
new file mode 100755 (executable)
index 0000000..3920fd6
--- /dev/null
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="dllmain.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\dnssd_clientlib.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\dnssd_clientstub.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\dnssd_ipc.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\GenLinkedList.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="dnssd.def">\r
+      <Filter>Source Files</Filter>\r
+    </None>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\dns_sd.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\dnssd_ipc.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\GenLinkedList.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="resource.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="dll.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
index c39a747d01b8194c8625810545fd852f668eb91b..503465f2182a9dcff4d9a6a62b8c2b327ac0d9fc 100755 (executable)
@@ -28,7 +28,7 @@
 
 #include "DLLStub.h"
 
-static int             g_defaultErrorCode = kDNSServiceErr_Unknown;
+static int             g_defaultErrorCode = kDNSServiceErr_ServiceNotRunning;
 static DLLStub g_glueLayer;
 
 
@@ -690,4 +690,4 @@ TXTRecordGetItemAtIndex
        }
        
        return ret;
-}
\ No newline at end of file
+}
diff --git a/mDNSWindows/DLLStub/DLLStub.vcxproj b/mDNSWindows/DLLStub/DLLStub.vcxproj
new file mode 100755 (executable)
index 0000000..292d931
--- /dev/null
@@ -0,0 +1,188 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{3A2B6325-3053-4236-84BD-AA9BE2E323E5}</ProjectGuid>\r
+    <RootNamespace>DLLStub</RootNamespace>\r
+    <Keyword>Win32Proj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfAtl>false</UseOfAtl>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <WholeProgramOptimization>false</WholeProgramOptimization>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfAtl>false</UseOfAtl>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <WholeProgramOptimization>false</WholeProgramOptimization>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfAtl>false</UseOfAtl>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <WholeProgramOptimization>false</WholeProgramOptimization>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>StaticLibrary</ConfigurationType>\r
+    <UseOfAtl>false</UseOfAtl>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+    <WholeProgramOptimization>false</WholeProgramOptimization>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">dnssdStatic</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">dnssdStatic</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">dnssdStatic</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">dnssdStatic</TargetName>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MinimalRebuild>false</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <ProgramDataBaseFileName>$(IntDir)dnssd.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <Lib>\r
+      <OutputFile>$(OutDir)dnssdStatic.lib</OutputFile>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MinimalRebuild>false</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <ProgramDataBaseFileName>$(IntDir)dnssd.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <Lib>\r
+      <OutputFile>$(OutDir)dnssdStatic.lib</OutputFile>\r
+    </Lib>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ClCompile>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <ProgramDataBaseFileName>$(IntDir)dnssd.lib.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <Lib>\r
+      <OutputFile>$(OutDir)dnssdStatic.lib</OutputFile>\r
+    </Lib>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\lib\$(Platform)" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\lib\$(Platform)"\r
+echo F | xcopy /Y "$(OutDir)dnssdStatic.lib"                                                        "$(DSTROOT)\Program Files\Bonjour SDK\lib\$(Platform)\dnssd.lib"\r
+xcopy /Y "$(OutDir)dnssd.lib.pdb"                                                                         "$(DSTROOT)\Program Files\Bonjour SDK\lib\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <ProgramDataBaseFileName>$(IntDir)dnssd.lib.pdb</ProgramDataBaseFileName>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <Lib>\r
+      <OutputFile>$(OutDir)dnssdStatic.lib</OutputFile>\r
+    </Lib>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\lib\$(Platform)" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\lib\$(Platform)"\r
+echo F | xcopy /I/Y "$(OutDir)dnssdStatic.lib"                                                     "$(DSTROOT)\Program Files\Bonjour SDK\lib\$(Platform)\dnssd.lib"\r
+xcopy /Y "$(OutDir)dnssd.lib.pdb"                                                                         "$(DSTROOT)\Program Files\Bonjour SDK\lib\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="DLLStub.cpp" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="DLLStub.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="ReadMe.txt" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\DLL\dnssd.vcxproj">\r
+      <Project>{ab581101-18f0-46f6-b56a-83a6b1ea657e}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/mDNSWindows/DLLStub/DLLStub.vcxproj.filters b/mDNSWindows/DLLStub/DLLStub.vcxproj.filters
new file mode 100755 (executable)
index 0000000..8b6d833
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="DLLStub.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="DLLStub.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="ReadMe.txt" />\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
diff --git a/mDNSWindows/DLLX/DLLX.vcxproj b/mDNSWindows/DLLX/DLLX.vcxproj
new file mode 100755 (executable)
index 0000000..93ca80c
--- /dev/null
@@ -0,0 +1,328 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{78FBFCC5-2873-4AE2-9114-A08082F71124}</ProjectGuid>\r
+    <RootNamespace>DLLX</RootNamespace>\r
+    <Keyword>AtlProj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfAtl>Static</UseOfAtl>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <UseOfAtl>Static</UseOfAtl>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfAtl>Static</UseOfAtl>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <UseOfMfc>false</UseOfMfc>\r
+    <UseOfAtl>Static</UseOfAtl>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</IgnoreImportLibrary>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</IgnoreImportLibrary>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</IgnoreImportLibrary>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <IgnoreImportLibrary Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</IgnoreImportLibrary>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">dnssdX</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">dnssdX</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">dnssdX</TargetName>\r
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">dnssdX</TargetName>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <GenerateStublessProxies>true</GenerateStublessProxies>\r
+      <TypeLibraryName>$(IntDir)dnssdX.tlb</TypeLibraryName>\r
+      <HeaderFileName>DLLX.h</HeaderFileName>\r
+      <DllDataFileName>\r
+      </DllDataFileName>\r
+      <InterfaceIdentifierFileName>DLLX_i.c</InterfaceIdentifierFileName>\r
+      <ProxyFileName>DLLX_p.c</ProxyFileName>\r
+      <ValidateAllParameters>false</ValidateAllParameters>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;_MERGE_PROXYSTUB;DEBUG=1;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>..;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <RegisterOutput>true</RegisterOutput>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)dnssdX.dll</OutputFile>\r
+      <ModuleDefinitionFile>.\DLLX.def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+      <GenerateStublessProxies>true</GenerateStublessProxies>\r
+      <TypeLibraryName>$(IntDir)dnssdX.tlb</TypeLibraryName>\r
+      <HeaderFileName>DLLX.h</HeaderFileName>\r
+      <DllDataFileName>\r
+      </DllDataFileName>\r
+      <InterfaceIdentifierFileName>DLLX_i.c</InterfaceIdentifierFileName>\r
+      <ProxyFileName>DLLX_p.c</ProxyFileName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_USRDLL;_MERGE_PROXYSTUB;DEBUG=1;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>..;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <RegisterOutput>true</RegisterOutput>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)dnssdX.dll</OutputFile>\r
+      <ModuleDefinitionFile>.\DLLX.def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+      <TargetEnvironment>Win32</TargetEnvironment>\r
+      <GenerateStublessProxies>true</GenerateStublessProxies>\r
+      <TypeLibraryName>$(IntDir)dnssdX.tlb</TypeLibraryName>\r
+      <HeaderFileName>DLLX.h</HeaderFileName>\r
+      <DllDataFileName>\r
+      </DllDataFileName>\r
+      <InterfaceIdentifierFileName>DLLX_i.c</InterfaceIdentifierFileName>\r
+      <ProxyFileName>DLLX_p.c</ProxyFileName>\r
+      <ValidateAllParameters>false</ValidateAllParameters>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;_MERGE_PROXYSTUB;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>..;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <RegisterOutput>false</RegisterOutput>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)dnssdX.dll</OutputFile>\r
+      <ModuleDefinitionFile>.\DLLX.def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\WINDOWS\system32\$(Platform)"             mkdir "$(DSTROOT)\WINDOWS\system32\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                                            "$(DSTROOT)\WINDOWS\system32\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <MkTypLibCompatible>false</MkTypLibCompatible>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+      <GenerateStublessProxies>true</GenerateStublessProxies>\r
+      <TypeLibraryName>$(IntDir)dnssdX.tlb</TypeLibraryName>\r
+      <HeaderFileName>DLLX.h</HeaderFileName>\r
+      <DllDataFileName>\r
+      </DllDataFileName>\r
+      <InterfaceIdentifierFileName>DLLX_i.c</InterfaceIdentifierFileName>\r
+      <ProxyFileName>DLLX_p.c</ProxyFileName>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_USRDLL;_MERGE_PROXYSTUB;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <Culture>0x0409</Culture>\r
+      <AdditionalIncludeDirectories>..;$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <RegisterOutput>false</RegisterOutput>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)dnssdX.dll</OutputFile>\r
+      <ModuleDefinitionFile>.\DLLX.def</ModuleDefinitionFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\WINDOWS\system32\$(Platform)"             mkdir "$(DSTROOT)\WINDOWS\system32\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                                            "$(DSTROOT)\WINDOWS\system32\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="dlldatax.c">\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+      </PrecompiledHeader>\r
+    </ClCompile>\r
+    <ClCompile Include="DLLX.cpp" />\r
+    <ClCompile Include="DNSSDEventManager.cpp" />\r
+    <ClCompile Include="DNSSDRecord.cpp" />\r
+    <ClCompile Include="DNSSDService.cpp" />\r
+    <ClCompile Include="TXTRecord.cpp" />\r
+    <ClCompile Include="DLLX_i.c">\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+      </PrecompiledHeader>\r
+      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+      </PrecompiledHeader>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c" />\r
+    <ClCompile Include="StringServices.cpp" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="DLLX.def" />\r
+    <None Include="DLLX.rgs" />\r
+    <None Include="DNSSDEventManager.rgs" />\r
+    <None Include="DNSSDRecord.rgs" />\r
+    <None Include="DNSSDService.rgs" />\r
+    <None Include="TXTRecord.rgs" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Midl Include="DLLX.idl" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="_IDNSSDEvents_CP.H" />\r
+    <ClInclude Include="dlldatax.h" />\r
+    <ClInclude Include="DNSSDEventManager.h" />\r
+    <ClInclude Include="DNSSDRecord.h" />\r
+    <ClInclude Include="DNSSDService.h" />\r
+    <ClInclude Include="Resource.h" />\r
+    <ClInclude Include="stdafx.h" />\r
+    <ClInclude Include="TXTRecord.h" />\r
+    <ClInclude Include="DLLX.h" />\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h" />\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h" />\r
+    <ClInclude Include="StringServices.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="DLLX.rc" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/mDNSWindows/DLLX/DLLX.vcxproj.filters b/mDNSWindows/DLLX/DLLX.vcxproj.filters
new file mode 100755 (executable)
index 0000000..54f4be6
--- /dev/null
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>\r
+    </Filter>\r
+    <Filter Include="Generated Files">\r
+      <UniqueIdentifier>{f6bd0810-64ce-4840-9a29-d80d06414fcf}</UniqueIdentifier>\r
+      <SourceControlFiles>False</SourceControlFiles>\r
+    </Filter>\r
+    <Filter Include="Support Files">\r
+      <UniqueIdentifier>{0756c4a0-cd93-4f7e-a376-dc55c520a2d0}</UniqueIdentifier>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="dlldatax.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="DLLX.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="DNSSDEventManager.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="DNSSDRecord.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="DNSSDService.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="TXTRecord.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="DLLX_i.c">\r
+      <Filter>Generated Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c">\r
+      <Filter>Support Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="StringServices.cpp">\r
+      <Filter>Support Files</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="DLLX.def">\r
+      <Filter>Source Files</Filter>\r
+    </None>\r
+    <None Include="DLLX.rgs">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="DNSSDEventManager.rgs">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="DNSSDRecord.rgs">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="DNSSDService.rgs">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+    <None Include="TXTRecord.rgs">\r
+      <Filter>Resource Files</Filter>\r
+    </None>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <Midl Include="DLLX.idl">\r
+      <Filter>Source Files</Filter>\r
+    </Midl>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="_IDNSSDEvents_CP.H">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="dlldatax.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="DNSSDEventManager.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="DNSSDRecord.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="DNSSDService.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="Resource.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="stdafx.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="TXTRecord.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="DLLX.h">\r
+      <Filter>Generated Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h">\r
+      <Filter>Support Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h">\r
+      <Filter>Support Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="StringServices.h">\r
+      <Filter>Support Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="DLLX.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
index 84a820682fb7697b1ca86a750c9b7b0888523c5a..8813d2df74e5d7566fa7bbe09de4fa9fdb10602f 100755 (executable)
-// DNSSD.cpp : Implementation of CDNSSD\r
-\r
-#include "stdafx.h"\r
-#include "DNSSD.h"\r
-#include "DNSSDService.h"\r
-#include "TXTRecord.h"\r
-#include <dns_sd.h>\r
-#include <CommonServices.h>\r
-#include <DebugServices.h>\r
-#include "StringServices.h"\r
-\r
-\r
-// CDNSSD\r
-\r
-STDMETHODIMP CDNSSD::Browse(DNSSDFlags flags, ULONG ifIndex, BSTR regtype, BSTR domain, IBrowseListener* listener, IDNSSDService** browser )\r
-{\r
-       CComObject<CDNSSDService>       *       object          = NULL;\r
-       std::string                                             regtypeUTF8;\r
-       std::string                                             domainUTF8;\r
-       DNSServiceRef                                   sref            = NULL;\r
-       DNSServiceErrorType                             err                     = 0;\r
-       HRESULT                                                 hr                      = 0;\r
-       BOOL                                                    ok;\r
-\r
-       // Initialize\r
-       *browser = NULL;\r
-\r
-       // Convert BSTR params to utf8\r
-       ok = BSTRToUTF8( regtype, regtypeUTF8 );\r
-       require_action( ok, exit, err = kDNSServiceErr_BadParam );\r
-       ok = BSTRToUTF8( domain, domainUTF8 );\r
-       require_action( ok, exit, err = kDNSServiceErr_BadParam );\r
-\r
-       try\r
-       {\r
-               object = new CComObject<CDNSSDService>();\r
-       }\r
-       catch ( ... )\r
-       {\r
-               object = NULL;\r
-       }\r
-\r
-       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );\r
-       hr = object->FinalConstruct();\r
-       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );\r
-       object->AddRef();\r
-\r
-       err = DNSServiceBrowse( &sref, flags, ifIndex, regtypeUTF8.c_str(), domainUTF8.c_str(), ( DNSServiceBrowseReply ) &BrowseReply, object );\r
-       require_noerr( err, exit );\r
-\r
-       object->SetServiceRef( sref );\r
-       object->SetListener( listener );\r
-\r
-       err = object->Run();\r
-       require_noerr( err, exit );\r
-\r
-       *browser = object;\r
-\r
-exit:\r
-\r
-       if ( err && object )\r
-       {\r
-               object->Release();\r
-       }\r
-\r
-       return err;\r
-}\r
-\r
-\r
-STDMETHODIMP CDNSSD::Resolve(DNSSDFlags flags, ULONG ifIndex, BSTR serviceName, BSTR regType, BSTR domain, IResolveListener* listener, IDNSSDService** service)\r
-{\r
-       CComObject<CDNSSDService>       *       object                  = NULL;\r
-       std::string                                             serviceNameUTF8;\r
-       std::string                                             regTypeUTF8;\r
-       std::string                                             domainUTF8;\r
-       DNSServiceRef                                   sref                    = NULL;\r
-       DNSServiceErrorType                             err                             = 0;\r
-       HRESULT                                                 hr                              = 0;\r
-       BOOL                                                    ok;\r
-\r
-       // Initialize\r
-       *service = NULL;\r
-\r
-       // Convert BSTR params to utf8\r
-       ok = BSTRToUTF8( serviceName, serviceNameUTF8 );\r
-       require_action( ok, exit, err = kDNSServiceErr_BadParam );\r
-       ok = BSTRToUTF8( regType, regTypeUTF8 );\r
-       require_action( ok, exit, err = kDNSServiceErr_BadParam );\r
-       ok = BSTRToUTF8( domain, domainUTF8 );\r
-       require_action( ok, exit, err = kDNSServiceErr_BadParam );\r
-\r
-       try\r
-       {\r
-               object = new CComObject<CDNSSDService>();\r
-       }\r
-       catch ( ... )\r
-       {\r
-               object = NULL;\r
-       }\r
-\r
-       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );\r
-       hr = object->FinalConstruct();\r
-       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );\r
-       object->AddRef();\r
-\r
-       err = DNSServiceResolve( &sref, flags, ifIndex, serviceNameUTF8.c_str(), regTypeUTF8.c_str(), domainUTF8.c_str(), ( DNSServiceResolveReply ) &ResolveReply, object );\r
-       require_noerr( err, exit );\r
-\r
-       object->SetServiceRef( sref );\r
-       object->SetListener( listener );\r
-\r
-       err = object->Run();\r
-       require_noerr( err, exit );\r
-\r
-       *service = object;\r
-\r
-exit:\r
-\r
-       if ( err && object )\r
-       {\r
-               object->Release();\r
-       }\r
-\r
-       return err;\r
-}\r
-\r
-\r
-STDMETHODIMP CDNSSD::EnumerateDomains(DNSSDFlags flags, ULONG ifIndex, IDomainListener *listener, IDNSSDService **service)\r
-{\r
-       CComObject<CDNSSDService>       *       object                  = NULL;\r
-       DNSServiceRef                                   sref                    = NULL;\r
-       DNSServiceErrorType                             err                             = 0;\r
-       HRESULT                                                 hr                              = 0;\r
-\r
-       // Initialize\r
-       *service = NULL;\r
-\r
-       try\r
-       {\r
-               object = new CComObject<CDNSSDService>();\r
-       }\r
-       catch ( ... )\r
-       {\r
-               object = NULL;\r
-       }\r
-\r
-       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );\r
-       hr = object->FinalConstruct();\r
-       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );\r
-       object->AddRef();\r
-\r
-       err = DNSServiceEnumerateDomains( &sref, flags, ifIndex, ( DNSServiceDomainEnumReply ) &DomainEnumReply, object );\r
-       require_noerr( err, exit );\r
-\r
-       object->SetServiceRef( sref );\r
-       object->SetListener( listener );\r
-\r
-       err = object->Run();\r
-       require_noerr( err, exit );\r
-\r
-       *service = object;\r
-\r
-exit:\r
-\r
-       if ( err && object )\r
-       {\r
-               object->Release();\r
-       }\r
-\r
-       return err;\r
-}\r
-\r
-\r
-STDMETHODIMP CDNSSD::Register(DNSSDFlags flags, ULONG ifIndex, BSTR serviceName, BSTR regType, BSTR domain, BSTR host, USHORT port, ITXTRecord *record, IRegisterListener *listener, IDNSSDService **service)\r
-{\r
-       CComObject<CDNSSDService>       *       object                  = NULL;\r
-       std::string                                             serviceNameUTF8;\r
-       std::string                                             regTypeUTF8;\r
-       std::string                                             domainUTF8;\r
-       std::string                                             hostUTF8;\r
-       const void                                      *       txtRecord               = NULL;\r
-       uint16_t                                                txtLen                  = 0;\r
-       DNSServiceRef                                   sref                    = NULL;\r
-       DNSServiceErrorType                             err                             = 0;\r
-       HRESULT                                                 hr                              = 0;\r
-       BOOL                                                    ok;\r
-\r
-       // Initialize\r
-       *service = NULL;\r
-\r
-       // Convert BSTR params to utf8\r
-       ok = BSTRToUTF8( serviceName, serviceNameUTF8 );\r
-       require_action( ok, exit, err = kDNSServiceErr_BadParam );\r
-       ok = BSTRToUTF8( regType, regTypeUTF8 );\r
-       require_action( ok, exit, err = kDNSServiceErr_BadParam );\r
-       ok = BSTRToUTF8( domain, domainUTF8 );\r
-       require_action( ok, exit, err = kDNSServiceErr_BadParam );\r
-       ok = BSTRToUTF8( host, hostUTF8 );\r
-       require_action( ok, exit, err = kDNSServiceErr_BadParam );\r
-\r
-       try\r
-       {\r
-               object = new CComObject<CDNSSDService>();\r
-       }\r
-       catch ( ... )\r
-       {\r
-               object = NULL;\r
-       }\r
-\r
-       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );\r
-       hr = object->FinalConstruct();\r
-       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );\r
-       object->AddRef();\r
-\r
-       if ( record )\r
-       {\r
-               CComObject< CTXTRecord > * realTXTRecord;\r
-\r
-               realTXTRecord = ( CComObject< CTXTRecord >* ) record;\r
-\r
-               txtRecord       = realTXTRecord->GetBytes();\r
-               txtLen          = realTXTRecord->GetLen();\r
-       }\r
-\r
-       err = DNSServiceRegister( &sref, flags, ifIndex, serviceNameUTF8.c_str(), regTypeUTF8.c_str(), domainUTF8.c_str(), hostUTF8.c_str(), port, txtLen, txtRecord, ( DNSServiceRegisterReply ) &RegisterReply, object );\r
-       require_noerr( err, exit );\r
-\r
-       object->SetServiceRef( sref );\r
-       object->SetListener( listener );\r
-\r
-       err = object->Run();\r
-       require_noerr( err, exit );\r
-\r
-       *service = object;\r
-\r
-exit:\r
-\r
-       if ( err && object )\r
-       {\r
-               object->Release();\r
-       }\r
-\r
-       return err;\r
-}\r
-\r
-\r
-STDMETHODIMP CDNSSD::QueryRecord(DNSSDFlags flags, ULONG ifIndex, BSTR fullname, DNSSDRRType rrtype, DNSSDRRClass rrclass, IQueryRecordListener *listener, IDNSSDService **service)\r
-{\r
-       CComObject<CDNSSDService>       *       object                  = NULL;\r
-       DNSServiceRef                                   sref                    = NULL;\r
-       std::string                                             fullNameUTF8;\r
-       DNSServiceErrorType                             err                             = 0;\r
-       HRESULT                                                 hr                              = 0;\r
-       BOOL                                                    ok;\r
-\r
-       // Initialize\r
-       *service = NULL;\r
-\r
-       // Convert BSTR params to utf8\r
-       ok = BSTRToUTF8( fullname, fullNameUTF8 );\r
-       require_action( ok, exit, err = kDNSServiceErr_BadParam );\r
-\r
-       try\r
-       {\r
-               object = new CComObject<CDNSSDService>();\r
-       }\r
-       catch ( ... )\r
-       {\r
-               object = NULL;\r
-       }\r
-\r
-       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );\r
-       hr = object->FinalConstruct();\r
-       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );\r
-       object->AddRef();\r
-\r
-       err = DNSServiceQueryRecord( &sref, flags, ifIndex, fullNameUTF8.c_str(), ( uint16_t ) rrtype, ( uint16_t ) rrclass, ( DNSServiceQueryRecordReply ) &QueryRecordReply, object );\r
-       require_noerr( err, exit );\r
-\r
-       object->SetServiceRef( sref );\r
-       object->SetListener( listener );\r
-\r
-       err = object->Run();\r
-       require_noerr( err, exit );\r
-\r
-       *service = object;\r
-\r
-exit:\r
-\r
-       if ( err && object )\r
-       {\r
-               object->Release();\r
-       }\r
-\r
-       return err;\r
-}\r
-\r
-\r
-STDMETHODIMP CDNSSD::GetAddrInfo(DNSSDFlags flags, ULONG ifIndex, DNSSDAddressFamily addressFamily, BSTR hostName, IGetAddrInfoListener *listener, IDNSSDService **service)\r
-{\r
-       CComObject<CDNSSDService>       *       object                  = NULL;\r
-       DNSServiceRef                                   sref                    = NULL;\r
-       std::string                                             hostNameUTF8;\r
-       DNSServiceErrorType                             err                             = 0;\r
-       HRESULT                                                 hr                              = 0;\r
-       BOOL                                                    ok;\r
-\r
-       // Initialize\r
-       *service = NULL;\r
-\r
-       // Convert BSTR params to utf8\r
-       ok = BSTRToUTF8( hostName, hostNameUTF8 );\r
-       require_action( ok, exit, err = kDNSServiceErr_BadParam );\r
-\r
-       try\r
-       {\r
-               object = new CComObject<CDNSSDService>();\r
-       }\r
-       catch ( ... )\r
-       {\r
-               object = NULL;\r
-       }\r
-\r
-       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );\r
-       hr = object->FinalConstruct();\r
-       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );\r
-       object->AddRef();\r
-\r
-       err = DNSServiceGetAddrInfo( &sref, flags, ifIndex, addressFamily, hostNameUTF8.c_str(), ( DNSServiceGetAddrInfoReply ) &GetAddrInfoReply, object );\r
-       require_noerr( err, exit );\r
-\r
-       object->SetServiceRef( sref );\r
-       object->SetListener( listener );\r
-\r
-       err = object->Run();\r
-       require_noerr( err, exit );\r
-\r
-       *service = object;\r
-\r
-exit:\r
-\r
-       if ( err && object )\r
-       {\r
-               object->Release();\r
-       }\r
-\r
-       return err;\r
-}\r
-\r
-\r
-STDMETHODIMP CDNSSD::CreateConnection(IDNSSDService **service)\r
-{\r
-       CComObject<CDNSSDService>       *       object  = NULL;\r
-       DNSServiceRef                                   sref    = NULL;\r
-       DNSServiceErrorType                             err             = 0;\r
-       HRESULT                                                 hr              = 0;\r
-\r
-       // Initialize\r
-       *service = NULL;\r
-\r
-       try\r
-       {\r
-               object = new CComObject<CDNSSDService>();\r
-       }\r
-       catch ( ... )\r
-       {\r
-               object = NULL;\r
-       }\r
-\r
-       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );\r
-       hr = object->FinalConstruct();\r
-       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );\r
-       object->AddRef();\r
-\r
-       err = DNSServiceCreateConnection( &sref );\r
-       require_noerr( err, exit );\r
-\r
-       object->SetServiceRef( sref );\r
-\r
-       *service = object;\r
-\r
-exit:\r
-\r
-       if ( err && object )\r
-       {\r
-               object->Release();\r
-       }\r
-\r
-       return err;\r
-}\r
-\r
-\r
-STDMETHODIMP CDNSSD::NATPortMappingCreate(DNSSDFlags flags, ULONG ifIndex, DNSSDAddressFamily addressFamily, DNSSDProtocol protocol, USHORT internalPort, USHORT externalPort, ULONG ttl, INATPortMappingListener *listener, IDNSSDService **service)\r
-{\r
-       CComObject<CDNSSDService>       *       object                  = NULL;\r
-       DNSServiceRef                                   sref                    = NULL;\r
-       DNSServiceProtocol                              prot                    = 0;\r
-       DNSServiceErrorType                             err                             = 0;\r
-       HRESULT                                                 hr                              = 0;\r
-\r
-       // Initialize\r
-       *service = NULL;\r
-\r
-       try\r
-       {\r
-               object = new CComObject<CDNSSDService>();\r
-       }\r
-       catch ( ... )\r
-       {\r
-               object = NULL;\r
-       }\r
-\r
-       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );\r
-       hr = object->FinalConstruct();\r
-       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );\r
-       object->AddRef();\r
-\r
-       prot = ( addressFamily | protocol );\r
-\r
-       err = DNSServiceNATPortMappingCreate( &sref, flags, ifIndex, prot, internalPort, externalPort, ttl, ( DNSServiceNATPortMappingReply ) &NATPortMappingReply, object );\r
-       require_noerr( err, exit );\r
-\r
-       object->SetServiceRef( sref );\r
-       object->SetListener( listener );\r
-\r
-       err = object->Run();\r
-       require_noerr( err, exit );\r
-\r
-       *service = object;\r
-\r
-exit:\r
-\r
-       if ( err && object )\r
-       {\r
-               object->Release();\r
-       }\r
-\r
-       return err;\r
-}\r
-\r
-\r
-STDMETHODIMP CDNSSD::GetProperty(BSTR prop, VARIANT * value )\r
-{\r
-       std::string                     propUTF8;\r
-       std::vector< BYTE >     byteArray;\r
-       SAFEARRAY               *       psa                     = NULL;\r
-       BYTE                    *       pData           = NULL;\r
-       uint32_t                        elems           = 0;\r
-       DNSServiceErrorType     err                     = 0;\r
-       BOOL                            ok = TRUE;\r
-\r
-       // Convert BSTR params to utf8\r
-       ok = BSTRToUTF8( prop, propUTF8 );\r
-       require_action( ok, exit, err = kDNSServiceErr_BadParam );\r
-\r
-       // Setup the byte array\r
-       require_action( V_VT( value ) == ( VT_ARRAY|VT_UI1 ), exit, err = kDNSServiceErr_Unknown );\r
-       psa = V_ARRAY( value );\r
-       require_action( psa, exit, err = kDNSServiceErr_Unknown );\r
-       require_action( SafeArrayGetDim( psa ) == 1, exit, err = kDNSServiceErr_Unknown );\r
-       byteArray.reserve( psa->rgsabound[0].cElements );\r
-       byteArray.assign( byteArray.capacity(), 0 );\r
-       elems = ( uint32_t ) byteArray.capacity();\r
-\r
-       // Call the function and package the return value in the Variant\r
-       err = DNSServiceGetProperty( propUTF8.c_str(), &byteArray[ 0 ], &elems );\r
-       require_noerr( err, exit );\r
-       ok = ByteArrayToVariant( &byteArray[ 0 ], elems, value );\r
-       require_action( ok, exit, err = kDNSSDError_Unknown );\r
-\r
-exit:\r
-\r
-       if ( psa )\r
-       {\r
-               SafeArrayUnaccessData( psa );\r
-               psa = NULL;\r
-       }\r
-\r
-       return err;\r
-}\r
-\r
-\r
+// DNSSD.cpp : Implementation of CDNSSD
+
+#include "stdafx.h"
+#include "DNSSD.h"
+#include "DNSSDService.h"
+#include "TXTRecord.h"
+#include <dns_sd.h>
+#include <CommonServices.h>
+#include <DebugServices.h>
+#include "StringServices.h"
+
+
+// CDNSSD
+
+STDMETHODIMP CDNSSD::Browse(DNSSDFlags flags, ULONG ifIndex, BSTR regtype, BSTR domain, IBrowseListener* listener, IDNSSDService** browser )
+{
+       CComObject<CDNSSDService>       *       object          = NULL;
+       std::string                                             regtypeUTF8;
+       std::string                                             domainUTF8;
+       DNSServiceRef                                   sref            = NULL;
+       DNSServiceErrorType                             err                     = 0;
+       HRESULT                                                 hr                      = 0;
+       BOOL                                                    ok;
+
+       // Initialize
+       *browser = NULL;
+
+       // Convert BSTR params to utf8
+       ok = BSTRToUTF8( regtype, regtypeUTF8 );
+       require_action( ok, exit, err = kDNSServiceErr_BadParam );
+       ok = BSTRToUTF8( domain, domainUTF8 );
+       require_action( ok, exit, err = kDNSServiceErr_BadParam );
+
+       try
+       {
+               object = new CComObject<CDNSSDService>();
+       }
+       catch ( ... )
+       {
+               object = NULL;
+       }
+
+       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );
+       hr = object->FinalConstruct();
+       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );
+       object->AddRef();
+
+       err = DNSServiceBrowse( &sref, flags, ifIndex, regtypeUTF8.c_str(), domainUTF8.c_str(), ( DNSServiceBrowseReply ) &BrowseReply, object );
+       require_noerr( err, exit );
+
+       object->SetServiceRef( sref );
+       object->SetListener( listener );
+
+       err = object->Run();
+       require_noerr( err, exit );
+
+       *browser = object;
+
+exit:
+
+       if ( err && object )
+       {
+               object->Release();
+       }
+
+       return err;
+}
+
+
+STDMETHODIMP CDNSSD::Resolve(DNSSDFlags flags, ULONG ifIndex, BSTR serviceName, BSTR regType, BSTR domain, IResolveListener* listener, IDNSSDService** service)
+{
+       CComObject<CDNSSDService>       *       object                  = NULL;
+       std::string                                             serviceNameUTF8;
+       std::string                                             regTypeUTF8;
+       std::string                                             domainUTF8;
+       DNSServiceRef                                   sref                    = NULL;
+       DNSServiceErrorType                             err                             = 0;
+       HRESULT                                                 hr                              = 0;
+       BOOL                                                    ok;
+
+       // Initialize
+       *service = NULL;
+
+       // Convert BSTR params to utf8
+       ok = BSTRToUTF8( serviceName, serviceNameUTF8 );
+       require_action( ok, exit, err = kDNSServiceErr_BadParam );
+       ok = BSTRToUTF8( regType, regTypeUTF8 );
+       require_action( ok, exit, err = kDNSServiceErr_BadParam );
+       ok = BSTRToUTF8( domain, domainUTF8 );
+       require_action( ok, exit, err = kDNSServiceErr_BadParam );
+
+       try
+       {
+               object = new CComObject<CDNSSDService>();
+       }
+       catch ( ... )
+       {
+               object = NULL;
+       }
+
+       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );
+       hr = object->FinalConstruct();
+       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );
+       object->AddRef();
+
+       err = DNSServiceResolve( &sref, flags, ifIndex, serviceNameUTF8.c_str(), regTypeUTF8.c_str(), domainUTF8.c_str(), ( DNSServiceResolveReply ) &ResolveReply, object );
+       require_noerr( err, exit );
+
+       object->SetServiceRef( sref );
+       object->SetListener( listener );
+
+       err = object->Run();
+       require_noerr( err, exit );
+
+       *service = object;
+
+exit:
+
+       if ( err && object )
+       {
+               object->Release();
+       }
+
+       return err;
+}
+
+
+STDMETHODIMP CDNSSD::EnumerateDomains(DNSSDFlags flags, ULONG ifIndex, IDomainListener *listener, IDNSSDService **service)
+{
+       CComObject<CDNSSDService>       *       object                  = NULL;
+       DNSServiceRef                                   sref                    = NULL;
+       DNSServiceErrorType                             err                             = 0;
+       HRESULT                                                 hr                              = 0;
+
+       // Initialize
+       *service = NULL;
+
+       try
+       {
+               object = new CComObject<CDNSSDService>();
+       }
+       catch ( ... )
+       {
+               object = NULL;
+       }
+
+       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );
+       hr = object->FinalConstruct();
+       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );
+       object->AddRef();
+
+       err = DNSServiceEnumerateDomains( &sref, flags, ifIndex, ( DNSServiceDomainEnumReply ) &DomainEnumReply, object );
+       require_noerr( err, exit );
+
+       object->SetServiceRef( sref );
+       object->SetListener( listener );
+
+       err = object->Run();
+       require_noerr( err, exit );
+
+       *service = object;
+
+exit:
+
+       if ( err && object )
+       {
+               object->Release();
+       }
+
+       return err;
+}
+
+
+STDMETHODIMP CDNSSD::Register(DNSSDFlags flags, ULONG ifIndex, BSTR serviceName, BSTR regType, BSTR domain, BSTR host, USHORT port, ITXTRecord *record, IRegisterListener *listener, IDNSSDService **service)
+{
+       CComObject<CDNSSDService>       *       object                  = NULL;
+       std::string                                             serviceNameUTF8;
+       std::string                                             regTypeUTF8;
+       std::string                                             domainUTF8;
+       std::string                                             hostUTF8;
+       const void                                      *       txtRecord               = NULL;
+       uint16_t                                                txtLen                  = 0;
+       DNSServiceRef                                   sref                    = NULL;
+       DNSServiceErrorType                             err                             = 0;
+       HRESULT                                                 hr                              = 0;
+       BOOL                                                    ok;
+
+       // Initialize
+       *service = NULL;
+
+       // Convert BSTR params to utf8
+       ok = BSTRToUTF8( serviceName, serviceNameUTF8 );
+       require_action( ok, exit, err = kDNSServiceErr_BadParam );
+       ok = BSTRToUTF8( regType, regTypeUTF8 );
+       require_action( ok, exit, err = kDNSServiceErr_BadParam );
+       ok = BSTRToUTF8( domain, domainUTF8 );
+       require_action( ok, exit, err = kDNSServiceErr_BadParam );
+       ok = BSTRToUTF8( host, hostUTF8 );
+       require_action( ok, exit, err = kDNSServiceErr_BadParam );
+
+       try
+       {
+               object = new CComObject<CDNSSDService>();
+       }
+       catch ( ... )
+       {
+               object = NULL;
+       }
+
+       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );
+       hr = object->FinalConstruct();
+       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );
+       object->AddRef();
+
+       if ( record )
+       {
+               CComObject< CTXTRecord > * realTXTRecord;
+
+               realTXTRecord = ( CComObject< CTXTRecord >* ) record;
+
+               txtRecord       = realTXTRecord->GetBytes();
+               txtLen          = realTXTRecord->GetLen();
+       }
+
+       err = DNSServiceRegister( &sref, flags, ifIndex, serviceNameUTF8.c_str(), regTypeUTF8.c_str(), domainUTF8.c_str(), hostUTF8.c_str(), port, txtLen, txtRecord, ( DNSServiceRegisterReply ) &RegisterReply, object );
+       require_noerr( err, exit );
+
+       object->SetServiceRef( sref );
+       object->SetListener( listener );
+
+       err = object->Run();
+       require_noerr( err, exit );
+
+       *service = object;
+
+exit:
+
+       if ( err && object )
+       {
+               object->Release();
+       }
+
+       return err;
+}
+
+
+STDMETHODIMP CDNSSD::QueryRecord(DNSSDFlags flags, ULONG ifIndex, BSTR fullname, DNSSDRRType rrtype, DNSSDRRClass rrclass, IQueryRecordListener *listener, IDNSSDService **service)
+{
+       CComObject<CDNSSDService>       *       object                  = NULL;
+       DNSServiceRef                                   sref                    = NULL;
+       std::string                                             fullNameUTF8;
+       DNSServiceErrorType                             err                             = 0;
+       HRESULT                                                 hr                              = 0;
+       BOOL                                                    ok;
+
+       // Initialize
+       *service = NULL;
+
+       // Convert BSTR params to utf8
+       ok = BSTRToUTF8( fullname, fullNameUTF8 );
+       require_action( ok, exit, err = kDNSServiceErr_BadParam );
+
+       try
+       {
+               object = new CComObject<CDNSSDService>();
+       }
+       catch ( ... )
+       {
+               object = NULL;
+       }
+
+       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );
+       hr = object->FinalConstruct();
+       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );
+       object->AddRef();
+
+       err = DNSServiceQueryRecord( &sref, flags, ifIndex, fullNameUTF8.c_str(), ( uint16_t ) rrtype, ( uint16_t ) rrclass, ( DNSServiceQueryRecordReply ) &QueryRecordReply, object );
+       require_noerr( err, exit );
+
+       object->SetServiceRef( sref );
+       object->SetListener( listener );
+
+       err = object->Run();
+       require_noerr( err, exit );
+
+       *service = object;
+
+exit:
+
+       if ( err && object )
+       {
+               object->Release();
+       }
+
+       return err;
+}
+
+
+STDMETHODIMP CDNSSD::GetAddrInfo(DNSSDFlags flags, ULONG ifIndex, DNSSDAddressFamily addressFamily, BSTR hostName, IGetAddrInfoListener *listener, IDNSSDService **service)
+{
+       CComObject<CDNSSDService>       *       object                  = NULL;
+       DNSServiceRef                                   sref                    = NULL;
+       std::string                                             hostNameUTF8;
+       DNSServiceErrorType                             err                             = 0;
+       HRESULT                                                 hr                              = 0;
+       BOOL                                                    ok;
+
+       // Initialize
+       *service = NULL;
+
+       // Convert BSTR params to utf8
+       ok = BSTRToUTF8( hostName, hostNameUTF8 );
+       require_action( ok, exit, err = kDNSServiceErr_BadParam );
+
+       try
+       {
+               object = new CComObject<CDNSSDService>();
+       }
+       catch ( ... )
+       {
+               object = NULL;
+       }
+
+       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );
+       hr = object->FinalConstruct();
+       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );
+       object->AddRef();
+
+       err = DNSServiceGetAddrInfo( &sref, flags, ifIndex, addressFamily, hostNameUTF8.c_str(), ( DNSServiceGetAddrInfoReply ) &GetAddrInfoReply, object );
+       require_noerr( err, exit );
+
+       object->SetServiceRef( sref );
+       object->SetListener( listener );
+
+       err = object->Run();
+       require_noerr( err, exit );
+
+       *service = object;
+
+exit:
+
+       if ( err && object )
+       {
+               object->Release();
+       }
+
+       return err;
+}
+
+
+STDMETHODIMP CDNSSD::CreateConnection(IDNSSDService **service)
+{
+       CComObject<CDNSSDService>       *       object  = NULL;
+       DNSServiceRef                                   sref    = NULL;
+       DNSServiceErrorType                             err             = 0;
+       HRESULT                                                 hr              = 0;
+
+       // Initialize
+       *service = NULL;
+
+       try
+       {
+               object = new CComObject<CDNSSDService>();
+       }
+       catch ( ... )
+       {
+               object = NULL;
+       }
+
+       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );
+       hr = object->FinalConstruct();
+       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );
+       object->AddRef();
+
+       err = DNSServiceCreateConnection( &sref );
+       require_noerr( err, exit );
+
+       object->SetServiceRef( sref );
+
+       *service = object;
+
+exit:
+
+       if ( err && object )
+       {
+               object->Release();
+       }
+
+       return err;
+}
+
+
+STDMETHODIMP CDNSSD::NATPortMappingCreate(DNSSDFlags flags, ULONG ifIndex, DNSSDAddressFamily addressFamily, DNSSDProtocol protocol, USHORT internalPort, USHORT externalPort, ULONG ttl, INATPortMappingListener *listener, IDNSSDService **service)
+{
+       CComObject<CDNSSDService>       *       object                  = NULL;
+       DNSServiceRef                                   sref                    = NULL;
+       DNSServiceProtocol                              prot                    = 0;
+       DNSServiceErrorType                             err                             = 0;
+       HRESULT                                                 hr                              = 0;
+
+       // Initialize
+       *service = NULL;
+
+       try
+       {
+               object = new CComObject<CDNSSDService>();
+       }
+       catch ( ... )
+       {
+               object = NULL;
+       }
+
+       require_action( object != NULL, exit, err = kDNSServiceErr_NoMemory );
+       hr = object->FinalConstruct();
+       require_action( hr == S_OK, exit, err = kDNSServiceErr_Unknown );
+       object->AddRef();
+
+       prot = ( addressFamily | protocol );
+
+       err = DNSServiceNATPortMappingCreate( &sref, flags, ifIndex, prot, internalPort, externalPort, ttl, ( DNSServiceNATPortMappingReply ) &NATPortMappingReply, object );
+       require_noerr( err, exit );
+
+       object->SetServiceRef( sref );
+       object->SetListener( listener );
+
+       err = object->Run();
+       require_noerr( err, exit );
+
+       *service = object;
+
+exit:
+
+       if ( err && object )
+       {
+               object->Release();
+       }
+
+       return err;
+}
+
+
+STDMETHODIMP CDNSSD::GetProperty(BSTR prop, VARIANT * value )
+{
+       std::string                     propUTF8;
+       std::vector< BYTE >     byteArray;
+       SAFEARRAY               *       psa                     = NULL;
+       BYTE                    *       pData           = NULL;
+       uint32_t                        elems           = 0;
+       DNSServiceErrorType     err                     = 0;
+       BOOL                            ok = TRUE;
+
+       // Convert BSTR params to utf8
+       ok = BSTRToUTF8( prop, propUTF8 );
+       require_action( ok, exit, err = kDNSServiceErr_BadParam );
+
+       // Setup the byte array
+       require_action( V_VT( value ) == ( VT_ARRAY|VT_UI1 ), exit, err = kDNSServiceErr_Unknown );
+       psa = V_ARRAY( value );
+       require_action( psa, exit, err = kDNSServiceErr_Unknown );
+       require_action( SafeArrayGetDim( psa ) == 1, exit, err = kDNSServiceErr_Unknown );
+       byteArray.reserve( psa->rgsabound[0].cElements );
+       byteArray.assign( byteArray.capacity(), 0 );
+       elems = ( uint32_t ) byteArray.capacity();
+
+       // Call the function and package the return value in the Variant
+       err = DNSServiceGetProperty( propUTF8.c_str(), &byteArray[ 0 ], &elems );
+       require_noerr( err, exit );
+       ok = ByteArrayToVariant( &byteArray[ 0 ], elems, value );
+       require_action( ok, exit, err = kDNSSDError_Unknown );
+
+exit:
+
+       if ( psa )
+       {
+               SafeArrayUnaccessData( psa );
+               psa = NULL;
+       }
+
+       return err;
+}
+
+
 void DNSSD_API
 CDNSSD::DomainEnumReply
     (
@@ -489,48 +489,48 @@ CDNSSD::DomainEnumReply
     DNSServiceErrorType                 errorCode,
     const char                          *replyDomainUTF8,
     void                                *context
-    )\r
-{\r
-       CComObject<CDNSSDService> * service;\r
-       int err;\r
-       \r
-       service = ( CComObject< CDNSSDService>* ) context;\r
-       require_action( service, exit, err = kDNSServiceErr_Unknown );\r
-\r
-       if ( !service->Stopped() )\r
-       {\r
-               IDomainListener * listener;\r
-\r
-               listener = ( IDomainListener* ) service->GetListener();\r
-               require_action( listener, exit, err = kDNSServiceErr_Unknown );\r
-\r
-               if ( !errorCode )\r
-               {\r
-                       CComBSTR replyDomain;\r
-               \r
-                       UTF8ToBSTR( replyDomainUTF8, replyDomain );\r
-\r
-                       if ( flags & kDNSServiceFlagsAdd )\r
-                       {\r
-                               listener->DomainFound( service, ( DNSSDFlags ) flags, ifIndex, replyDomain );\r
-                       }\r
-                       else\r
-                       {\r
-                               listener->DomainLost( service, ( DNSSDFlags ) flags, ifIndex, replyDomain );\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       listener->EnumDomainsFailed( service, ( DNSSDError ) errorCode );\r
-               }\r
-       }\r
-\r
-exit:\r
-\r
-       return;\r
-}\r
-\r
-\r
+    )
+{
+       CComObject<CDNSSDService> * service;
+       int err;
+       
+       service = ( CComObject< CDNSSDService>* ) context;
+       require_action( service, exit, err = kDNSServiceErr_Unknown );
+
+       if ( !service->Stopped() )
+       {
+               IDomainListener * listener;
+
+               listener = ( IDomainListener* ) service->GetListener();
+               require_action( listener, exit, err = kDNSServiceErr_Unknown );
+
+               if ( !errorCode )
+               {
+                       CComBSTR replyDomain;
+               
+                       UTF8ToBSTR( replyDomainUTF8, replyDomain );
+
+                       if ( flags & kDNSServiceFlagsAdd )
+                       {
+                               listener->DomainFound( service, ( DNSSDFlags ) flags, ifIndex, replyDomain );
+                       }
+                       else
+                       {
+                               listener->DomainLost( service, ( DNSSDFlags ) flags, ifIndex, replyDomain );
+                       }
+               }
+               else
+               {
+                       listener->EnumDomainsFailed( service, ( DNSSDError ) errorCode );
+               }
+       }
+
+exit:
+
+       return;
+}
+
+
 void DNSSD_API
 CDNSSD::BrowseReply
                (
@@ -542,54 +542,54 @@ CDNSSD::BrowseReply
                const char                          *regTypeUTF8,
                const char                          *replyDomainUTF8,
                void                                *context
-               )\r
-{\r
-       CComObject<CDNSSDService> * service;\r
-       int err;\r
-       \r
-       service = ( CComObject< CDNSSDService>* ) context;\r
-       require_action( service, exit, err = kDNSServiceErr_Unknown );\r
-\r
-       if ( !service->Stopped() )\r
-       {\r
-               IBrowseListener * listener;\r
-\r
-               listener = ( IBrowseListener* ) service->GetListener();\r
-               require_action( listener, exit, err = kDNSServiceErr_Unknown );\r
-\r
-               if ( !errorCode )\r
-               {\r
-                       CComBSTR        serviceName;\r
-                       CComBSTR        regType;\r
-                       CComBSTR        replyDomain;\r
-               \r
-                       UTF8ToBSTR( serviceNameUTF8, serviceName );\r
-                       UTF8ToBSTR( regTypeUTF8, regType );\r
-                       UTF8ToBSTR( replyDomainUTF8, replyDomain );\r
-\r
-                       if ( flags & kDNSServiceFlagsAdd )\r
-                       {\r
-                               listener->ServiceFound( service, ( DNSSDFlags ) flags, ifIndex, serviceName, regType, replyDomain );\r
-                       }\r
-                       else\r
-                       {\r
-                               listener->ServiceLost( service, ( DNSSDFlags ) flags, ifIndex, serviceName, regType, replyDomain );\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       listener->BrowseFailed( service, ( DNSSDError ) errorCode );\r
-               }\r
-       }\r
-\r
-exit:\r
-\r
-       return;\r
-}\r
-\r
-\r
-void DNSSD_API\r
-CDNSSD::ResolveReply\r
+               )
+{
+       CComObject<CDNSSDService> * service;
+       int err;
+       
+       service = ( CComObject< CDNSSDService>* ) context;
+       require_action( service, exit, err = kDNSServiceErr_Unknown );
+
+       if ( !service->Stopped() )
+       {
+               IBrowseListener * listener;
+
+               listener = ( IBrowseListener* ) service->GetListener();
+               require_action( listener, exit, err = kDNSServiceErr_Unknown );
+
+               if ( !errorCode )
+               {
+                       CComBSTR        serviceName;
+                       CComBSTR        regType;
+                       CComBSTR        replyDomain;
+               
+                       UTF8ToBSTR( serviceNameUTF8, serviceName );
+                       UTF8ToBSTR( regTypeUTF8, regType );
+                       UTF8ToBSTR( replyDomainUTF8, replyDomain );
+
+                       if ( flags & kDNSServiceFlagsAdd )
+                       {
+                               listener->ServiceFound( service, ( DNSSDFlags ) flags, ifIndex, serviceName, regType, replyDomain );
+                       }
+                       else
+                       {
+                               listener->ServiceLost( service, ( DNSSDFlags ) flags, ifIndex, serviceName, regType, replyDomain );
+                       }
+               }
+               else
+               {
+                       listener->BrowseFailed( service, ( DNSSDError ) errorCode );
+               }
+       }
+
+exit:
+
+       return;
+}
+
+
+void DNSSD_API
+CDNSSD::ResolveReply
                (
                DNSServiceRef                       sdRef,
                DNSServiceFlags                     flags,
@@ -600,71 +600,71 @@ CDNSSD::ResolveReply
                uint16_t                            port,
                uint16_t                            txtLen,
                const unsigned char                 *txtRecord,
-               void                                *context\r
-               )\r
-{\r
-       CComObject<CDNSSDService> * service;\r
-       int err;\r
-       \r
-       service = ( CComObject< CDNSSDService>* ) context;\r
-       require_action( service, exit, err = kDNSServiceErr_Unknown );\r
-\r
-       if ( !service->Stopped() )\r
-       {\r
-               IResolveListener * listener;\r
-\r
-               listener = ( IResolveListener* ) service->GetListener();\r
-               require_action( listener, exit, err = kDNSServiceErr_Unknown );\r
-\r
-               if ( !errorCode )\r
-               {\r
-                       CComBSTR                                        fullName;\r
-                       CComBSTR                                        hostName;\r
-                       CComBSTR                                        regType;\r
-                       CComBSTR                                        replyDomain;\r
-                       CComObject< CTXTRecord >*       record;\r
-                       BOOL                                            ok;\r
-\r
-                       ok = UTF8ToBSTR( fullNameUTF8, fullName );\r
-                       require_action( ok, exit, err = kDNSServiceErr_Unknown );\r
-                       ok = UTF8ToBSTR( hostNameUTF8, hostName );\r
-                       require_action( ok, exit, err = kDNSServiceErr_Unknown );\r
-\r
-                       try\r
-                       {\r
-                               record = new CComObject<CTXTRecord>();\r
-                       }\r
-                       catch ( ... )\r
-                       {\r
-                               record = NULL;\r
-                       }\r
-\r
-                       require_action( record, exit, err = kDNSServiceErr_NoMemory );\r
-                       record->AddRef();\r
-\r
-                       char buf[ 64 ];\r
-                       sprintf( buf, "txtLen = %d", txtLen );\r
-                       OutputDebugStringA( buf );\r
-\r
-                       if ( txtLen > 0 )\r
-                       {\r
-                               record->SetBytes( txtRecord, txtLen );\r
-                       }\r
-\r
-                       listener->ServiceResolved( service, ( DNSSDFlags ) flags, ifIndex, fullName, hostName, port, record );\r
-               }\r
-               else\r
-               {\r
-                       listener->ResolveFailed( service, ( DNSSDError ) errorCode );\r
-               }\r
-       }\r
-\r
-exit:\r
-\r
-       return;\r
-}\r
-\r
-\r
+               void                                *context
+               )
+{
+       CComObject<CDNSSDService> * service;
+       int err;
+       
+       service = ( CComObject< CDNSSDService>* ) context;
+       require_action( service, exit, err = kDNSServiceErr_Unknown );
+
+       if ( !service->Stopped() )
+       {
+               IResolveListener * listener;
+
+               listener = ( IResolveListener* ) service->GetListener();
+               require_action( listener, exit, err = kDNSServiceErr_Unknown );
+
+               if ( !errorCode )
+               {
+                       CComBSTR                                        fullName;
+                       CComBSTR                                        hostName;
+                       CComBSTR                                        regType;
+                       CComBSTR                                        replyDomain;
+                       CComObject< CTXTRecord >*       record;
+                       BOOL                                            ok;
+
+                       ok = UTF8ToBSTR( fullNameUTF8, fullName );
+                       require_action( ok, exit, err = kDNSServiceErr_Unknown );
+                       ok = UTF8ToBSTR( hostNameUTF8, hostName );
+                       require_action( ok, exit, err = kDNSServiceErr_Unknown );
+
+                       try
+                       {
+                               record = new CComObject<CTXTRecord>();
+                       }
+                       catch ( ... )
+                       {
+                               record = NULL;
+                       }
+
+                       require_action( record, exit, err = kDNSServiceErr_NoMemory );
+                       record->AddRef();
+
+                       char buf[ 64 ];
+                       sprintf( buf, "txtLen = %d", txtLen );
+                       OutputDebugStringA( buf );
+
+                       if ( txtLen > 0 )
+                       {
+                               record->SetBytes( txtRecord, txtLen );
+                       }
+
+                       listener->ServiceResolved( service, ( DNSSDFlags ) flags, ifIndex, fullName, hostName, port, record );
+               }
+               else
+               {
+                       listener->ResolveFailed( service, ( DNSSDError ) errorCode );
+               }
+       }
+
+exit:
+
+       return;
+}
+
+
 void DNSSD_API
 CDNSSD::RegisterReply
                (
@@ -675,49 +675,49 @@ CDNSSD::RegisterReply
                const char                          *regTypeUTF8,
                const char                          *domainUTF8,
                void                                *context
-               )\r
-{\r
-       CComObject<CDNSSDService> * service;\r
-       int err;\r
-       \r
-       service = ( CComObject< CDNSSDService>* ) context;\r
-       require_action( service, exit, err = kDNSServiceErr_Unknown );\r
-\r
-       if ( !service->Stopped() )\r
-       {\r
-               IRegisterListener * listener;\r
-\r
-               listener = ( IRegisterListener* ) service->GetListener();\r
-               require_action( listener, exit, err = kDNSServiceErr_Unknown );\r
-\r
-               if ( !errorCode )\r
-               {\r
-                       CComBSTR                                        serviceName;\r
-                       CComBSTR                                        regType;\r
-                       CComBSTR                                        domain;\r
-                       BOOL                                            ok;\r
-\r
-                       ok = UTF8ToBSTR( serviceNameUTF8, serviceName );\r
-                       require_action( ok, exit, err = kDNSServiceErr_Unknown );\r
-                       ok = UTF8ToBSTR( regTypeUTF8, regType );\r
-                       require_action( ok, exit, err = kDNSServiceErr_Unknown );\r
-                       ok = UTF8ToBSTR( domainUTF8, domain );\r
-                       require_action( ok, exit, err = kDNSServiceErr_Unknown );\r
-\r
-                       listener->ServiceRegistered( service, ( DNSSDFlags ) flags, serviceName, regType, domain );\r
-               }\r
-               else\r
-               {\r
-                       listener->ServiceRegisterFailed( service, ( DNSSDError ) errorCode );\r
-               }\r
-       }\r
-\r
-exit:\r
-\r
-       return;\r
-}\r
-\r
-\r
+               )
+{
+       CComObject<CDNSSDService> * service;
+       int err;
+       
+       service = ( CComObject< CDNSSDService>* ) context;
+       require_action( service, exit, err = kDNSServiceErr_Unknown );
+
+       if ( !service->Stopped() )
+       {
+               IRegisterListener * listener;
+
+               listener = ( IRegisterListener* ) service->GetListener();
+               require_action( listener, exit, err = kDNSServiceErr_Unknown );
+
+               if ( !errorCode )
+               {
+                       CComBSTR                                        serviceName;
+                       CComBSTR                                        regType;
+                       CComBSTR                                        domain;
+                       BOOL                                            ok;
+
+                       ok = UTF8ToBSTR( serviceNameUTF8, serviceName );
+                       require_action( ok, exit, err = kDNSServiceErr_Unknown );
+                       ok = UTF8ToBSTR( regTypeUTF8, regType );
+                       require_action( ok, exit, err = kDNSServiceErr_Unknown );
+                       ok = UTF8ToBSTR( domainUTF8, domain );
+                       require_action( ok, exit, err = kDNSServiceErr_Unknown );
+
+                       listener->ServiceRegistered( service, ( DNSSDFlags ) flags, serviceName, regType, domain );
+               }
+               else
+               {
+                       listener->ServiceRegisterFailed( service, ( DNSSDError ) errorCode );
+               }
+       }
+
+exit:
+
+       return;
+}
+
+
 void DNSSD_API
 CDNSSD::QueryRecordReply
                (
@@ -732,46 +732,46 @@ CDNSSD::QueryRecordReply
                const void                          *rdata,
                uint32_t                            ttl,
                void                                *context
-               )\r
-{\r
-       CComObject<CDNSSDService> * service;\r
-       int err;\r
-       \r
-       service = ( CComObject< CDNSSDService>* ) context;\r
-       require_action( service, exit, err = kDNSServiceErr_Unknown );\r
-\r
-       if ( !service->Stopped() )\r
-       {\r
-               IQueryRecordListener * listener;\r
-\r
-               listener = ( IQueryRecordListener* ) service->GetListener();\r
-               require_action( listener, exit, err = kDNSServiceErr_Unknown );\r
-\r
-               if ( !errorCode )\r
-               {\r
-                       CComBSTR        fullName;\r
-                       VARIANT         var;\r
-                       BOOL            ok;\r
-\r
-                       ok = UTF8ToBSTR( fullNameUTF8, fullName );\r
-                       require_action( ok, exit, err = kDNSServiceErr_Unknown );\r
-                       ok = ByteArrayToVariant( rdata, rdlen, &var );\r
-                       require_action( ok, exit, err = kDNSServiceErr_Unknown );\r
-\r
-                       listener->QueryRecordAnswered( service, ( DNSSDFlags ) flags, ifIndex, fullName, ( DNSSDRRType ) rrtype, ( DNSSDRRClass ) rrclass, var, ttl );\r
-               }\r
-               else\r
-               {\r
-                       listener->QueryRecordFailed( service, ( DNSSDError ) errorCode );\r
-               }\r
-       }\r
-\r
-exit:\r
-\r
-       return;\r
-}\r
-\r
-\r
+               )
+{
+       CComObject<CDNSSDService> * service;
+       int err;
+       
+       service = ( CComObject< CDNSSDService>* ) context;
+       require_action( service, exit, err = kDNSServiceErr_Unknown );
+
+       if ( !service->Stopped() )
+       {
+               IQueryRecordListener * listener;
+
+               listener = ( IQueryRecordListener* ) service->GetListener();
+               require_action( listener, exit, err = kDNSServiceErr_Unknown );
+
+               if ( !errorCode )
+               {
+                       CComBSTR        fullName;
+                       VARIANT         var;
+                       BOOL            ok;
+
+                       ok = UTF8ToBSTR( fullNameUTF8, fullName );
+                       require_action( ok, exit, err = kDNSServiceErr_Unknown );
+                       ok = ByteArrayToVariant( rdata, rdlen, &var );
+                       require_action( ok, exit, err = kDNSServiceErr_Unknown );
+
+                       listener->QueryRecordAnswered( service, ( DNSSDFlags ) flags, ifIndex, fullName, ( DNSSDRRType ) rrtype, ( DNSSDRRClass ) rrclass, var, ttl );
+               }
+               else
+               {
+                       listener->QueryRecordFailed( service, ( DNSSDError ) errorCode );
+               }
+       }
+
+exit:
+
+       return;
+}
+
+
 void DNSSD_API
 CDNSSD::GetAddrInfoReply
                (
@@ -783,70 +783,70 @@ CDNSSD::GetAddrInfoReply
                const struct sockaddr            *rawAddress,
                uint32_t                         ttl,
                void                             *context
-               )\r
-{\r
-       CComObject<CDNSSDService> * service;\r
-       int err;\r
-       \r
-       service = ( CComObject< CDNSSDService>* ) context;\r
-       require_action( service, exit, err = kDNSServiceErr_Unknown );\r
-\r
-       if ( !service->Stopped() )\r
-       {\r
-               IGetAddrInfoListener * listener;\r
-\r
-               listener = ( IGetAddrInfoListener* ) service->GetListener();\r
-               require_action( listener, exit, err = kDNSServiceErr_Unknown );\r
-\r
-               if ( !errorCode )\r
-               {\r
-                       CComBSTR                        hostName;\r
-                       DWORD                           sockaddrLen;\r
-                       DNSSDAddressFamily      addressFamily;\r
-                       char                            addressUTF8[INET6_ADDRSTRLEN];\r
-                       DWORD                           addressLen = sizeof( addressUTF8 );\r
-                       CComBSTR                        address;\r
-                       BOOL                            ok;\r
-\r
-                       ok = UTF8ToBSTR( hostNameUTF8, hostName );\r
-                       require_action( ok, exit, err = kDNSServiceErr_Unknown );\r
-\r
-                       switch ( rawAddress->sa_family )\r
-                       {\r
-                               case AF_INET:\r
-                               {\r
-                                       addressFamily   = kDNSSDAddressFamily_IPv4;\r
-                                       sockaddrLen             = sizeof( sockaddr_in );\r
-                               }\r
-                               break;\r
-\r
-                               case AF_INET6:\r
-                               {\r
-                                       addressFamily   = kDNSSDAddressFamily_IPv6;\r
-                                       sockaddrLen             = sizeof( sockaddr_in6 );\r
-                               }\r
-                               break;\r
-                       }\r
-\r
-                       err = WSAAddressToStringA( ( LPSOCKADDR ) rawAddress, sockaddrLen, NULL, addressUTF8, &addressLen );\r
-                       require_noerr( err, exit );\r
-                       ok = UTF8ToBSTR( addressUTF8, address );\r
-                       require_action( ok, exit, err = kDNSServiceErr_Unknown );\r
-\r
-                       listener->GetAddrInfoReply( service, ( DNSSDFlags ) flags, ifIndex, hostName, addressFamily, address, ttl );\r
-               }\r
-               else\r
-               {\r
-                       listener->GetAddrInfoFailed( service, ( DNSSDError ) errorCode );\r
-               }\r
-       }\r
-\r
-exit:\r
-\r
-       return;\r
-}\r
-\r
-\r
+               )
+{
+       CComObject<CDNSSDService> * service;
+       int err;
+       
+       service = ( CComObject< CDNSSDService>* ) context;
+       require_action( service, exit, err = kDNSServiceErr_Unknown );
+
+       if ( !service->Stopped() )
+       {
+               IGetAddrInfoListener * listener;
+
+               listener = ( IGetAddrInfoListener* ) service->GetListener();
+               require_action( listener, exit, err = kDNSServiceErr_Unknown );
+
+               if ( !errorCode )
+               {
+                       CComBSTR                        hostName;
+                       DWORD                           sockaddrLen;
+                       DNSSDAddressFamily      addressFamily;
+                       char                            addressUTF8[INET6_ADDRSTRLEN];
+                       DWORD                           addressLen = sizeof( addressUTF8 );
+                       CComBSTR                        address;
+                       BOOL                            ok;
+
+                       ok = UTF8ToBSTR( hostNameUTF8, hostName );
+                       require_action( ok, exit, err = kDNSServiceErr_Unknown );
+
+                       switch ( rawAddress->sa_family )
+                       {
+                               case AF_INET:
+                               {
+                                       addressFamily   = kDNSSDAddressFamily_IPv4;
+                                       sockaddrLen             = sizeof( sockaddr_in );
+                               }
+                               break;
+
+                               case AF_INET6:
+                               {
+                                       addressFamily   = kDNSSDAddressFamily_IPv6;
+                                       sockaddrLen             = sizeof( sockaddr_in6 );
+                               }
+                               break;
+                       }
+
+                       err = WSAAddressToStringA( ( LPSOCKADDR ) rawAddress, sockaddrLen, NULL, addressUTF8, &addressLen );
+                       require_noerr( err, exit );
+                       ok = UTF8ToBSTR( addressUTF8, address );
+                       require_action( ok, exit, err = kDNSServiceErr_Unknown );
+
+                       listener->GetAddrInfoReply( service, ( DNSSDFlags ) flags, ifIndex, hostName, addressFamily, address, ttl );
+               }
+               else
+               {
+                       listener->GetAddrInfoFailed( service, ( DNSSDError ) errorCode );
+               }
+       }
+
+exit:
+
+       return;
+}
+
+
 void DNSSD_API
 CDNSSD::NATPortMappingReply
     (
@@ -860,33 +860,33 @@ CDNSSD::NATPortMappingReply
     uint16_t                         externalPort,      /* may be different than the requested port     */
     uint32_t                         ttl,               /* may be different than the requested ttl      */
     void                             *context
-    )\r
-{\r
-       CComObject<CDNSSDService> * service;\r
-       int err;\r
-       \r
-       service = ( CComObject< CDNSSDService>* ) context;\r
-       require_action( service, exit, err = kDNSServiceErr_Unknown );\r
-\r
-       if ( !service->Stopped() )\r
-       {\r
-               INATPortMappingListener * listener;\r
-\r
-               listener = ( INATPortMappingListener* ) service->GetListener();\r
-               require_action( listener, exit, err = kDNSServiceErr_Unknown );\r
-\r
-               if ( !errorCode )\r
-               {\r
-                       listener->MappingCreated( service, ( DNSSDFlags ) flags, ifIndex, externalAddress, ( DNSSDAddressFamily ) ( protocol & 0x8 ), ( DNSSDProtocol ) ( protocol & 0x80 ), internalPort, externalPort, ttl  );\r
-               }\r
-               else\r
-               {\r
-                       listener->MappingFailed( service, ( DNSSDError ) errorCode );\r
-               }\r
-       }\r
-\r
-exit:\r
-\r
-       return;\r
-}\r
-\r
+    )
+{
+       CComObject<CDNSSDService> * service;
+       int err;
+       
+       service = ( CComObject< CDNSSDService>* ) context;
+       require_action( service, exit, err = kDNSServiceErr_Unknown );
+
+       if ( !service->Stopped() )
+       {
+               INATPortMappingListener * listener;
+
+               listener = ( INATPortMappingListener* ) service->GetListener();
+               require_action( listener, exit, err = kDNSServiceErr_Unknown );
+
+               if ( !errorCode )
+               {
+                       listener->MappingCreated( service, ( DNSSDFlags ) flags, ifIndex, externalAddress, ( DNSSDAddressFamily ) ( protocol & 0x8 ), ( DNSSDProtocol ) ( protocol & 0x80 ), internalPort, externalPort, ttl  );
+               }
+               else
+               {
+                       listener->MappingFailed( service, ( DNSSDError ) errorCode );
+               }
+       }
+
+exit:
+
+       return;
+}
+
index f00750d0128ebd85a77d16e26ed37b278d46bdaf..87f7aa996d04c6cd99b5307776eb32a85ccb6403 100755 (executable)
@@ -288,57 +288,57 @@ exit:
 extern BOOL
 
 VariantToByteArray
-
        (
-
        VARIANT                         *       inVariant,
-
        std::vector< BYTE >     &       outArray
-
        )
-
 {
+       BOOL ok = TRUE;
 
-       SAFEARRAY       *       psa                     = NULL;
-
-       BYTE            *       pData           = NULL;
-
-       ULONG                   cElements       = 0;
-
-       HRESULT                 hr;
-
-       BOOL                    ok = TRUE;
-
-
-
-       require_action( V_VT( inVariant ) == ( VT_ARRAY|VT_UI1 ), exit, ok = FALSE );
-
-       psa = V_ARRAY( inVariant );
+       if ( V_VT( inVariant ) == VT_BSTR )
+       {
+               BSTR bstr = V_BSTR( inVariant );
+               std::string utf8;
 
-       require_action( psa, exit, ok = FALSE );
+               BSTRToUTF8( bstr, utf8 );
 
-       require_action( SafeArrayGetDim( psa ) == 1, exit, ok = FALSE );
+               outArray.reserve( utf8.size() );
+               outArray.assign( utf8.begin(), utf8.end() );
+       }
+       else if ( V_VT( inVariant ) == VT_ARRAY )
+       {
+               SAFEARRAY       *       psa                     = NULL;
+               BYTE            *       pData           = NULL;
+               ULONG                   cElements       = 0;
+               HRESULT                 hr;
+               
+               psa = V_ARRAY( inVariant );
 
-       hr = SafeArrayAccessData( psa, ( LPVOID* )&pData );
+               require_action( psa, exit, ok = FALSE );
 
-       require_action( hr == S_OK, exit, ok = FALSE );
+               require_action( SafeArrayGetDim( psa ) == 1, exit, ok = FALSE );
 
-       cElements = psa->rgsabound[0].cElements;
+               hr = SafeArrayAccessData( psa, ( LPVOID* )&pData );
 
-       outArray.reserve( cElements );
+               require_action( hr == S_OK, exit, ok = FALSE );
 
-       outArray.assign( cElements, 0 );
+               cElements = psa->rgsabound[0].cElements;
 
-       memcpy( &outArray[ 0 ], pData, cElements );
+               outArray.reserve( cElements );
 
-       SafeArrayUnaccessData( psa );
+               outArray.assign( cElements, 0 );
 
+               memcpy( &outArray[ 0 ], pData, cElements );
 
+               SafeArrayUnaccessData( psa );
+       }
+       else
+       {
+               ok = FALSE;
+       }
 
 exit:
 
-
-
        return ok;
 
 }
\ No newline at end of file
index e5345f8d245e45b93c6b6837f89b01bc5510932b..2ebb67e070e6e57b8f8b095650827fc04a7ad242 100755 (executable)
@@ -245,10 +245,11 @@ STDMETHODIMP CTXTRecord::GetCount(ULONG* count)
 
        *count = 0;
 
-
-
-       if ( m_byteArray.size() > 0 )
-
+       if ( m_allocated )
+       {
+               *count = TXTRecordGetCount( TXTRecordGetLength( &m_tref ), TXTRecordGetBytesPtr( &m_tref ) );
+       }
+       else if ( m_byteArray.size() > 0 )
        {
 
                *count = TXTRecordGetCount( ( uint16_t ) m_byteArray.size(), &m_byteArray[ 0 ] );
index 5c48397fa32039e7f7e28b3bd18c1a99016984a6..90d778fa7101fd5f2ce1f477e70fc6f331631275 100755 (executable)
-\r
-// Wizard-generated connection point proxy class\r
-// WARNING: This file may be regenerated by the wizard\r
-\r
-\r
-#pragma once\r
-\r
-template<class T>\r
-class CProxy_IDNSSDEvents :\r
-       public IConnectionPointImpl<T, &__uuidof(_IDNSSDEvents)>\r
-{\r
-public:\r
-       HRESULT Fire_DomainFound( IDNSSDService * service,  DNSSDFlags flags,  ULONG ifIndex,  BSTR domain)\r
-       {\r
-               HRESULT hr = S_OK;\r
-               T * pThis = static_cast<T *>(this);\r
-               int cConnections = m_vec.GetSize();\r
-\r
-               for (int iConnection = 0; iConnection < cConnections; iConnection++)\r
-               {\r
-                       pThis->Lock();\r
-                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);\r
-                       pThis->Unlock();\r
-\r
-                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);\r
-\r
-                       if (pConnection)\r
-                       {\r
-                               CComVariant avarParams[4];\r
-                               avarParams[3] = service;\r
-                               avarParams[2] = flags;\r
-                               avarParams[1] = ifIndex;\r
-                               avarParams[1].vt = VT_UI4;\r
-                               avarParams[0] = domain;\r
-                               avarParams[0].vt = VT_BSTR;\r
-                               DISPPARAMS params = { avarParams, NULL, 4, 0 };\r
-                               hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);\r
-                       }\r
-               }\r
-               return hr;\r
-       }\r
-       HRESULT Fire_DomainLost( IDNSSDService * service,  DNSSDFlags flags,  ULONG ifIndex,  BSTR domain)\r
-       {\r
-               HRESULT hr = S_OK;\r
-               T * pThis = static_cast<T *>(this);\r
-               int cConnections = m_vec.GetSize();\r
-\r
-               for (int iConnection = 0; iConnection < cConnections; iConnection++)\r
-               {\r
-                       pThis->Lock();\r
-                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);\r
-                       pThis->Unlock();\r
-\r
-                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);\r
-\r
-                       if (pConnection)\r
-                       {\r
-                               CComVariant avarParams[4];\r
-                               avarParams[3] = service;\r
-                               avarParams[2] = flags;\r
-                               avarParams[1] = ifIndex;\r
-                               avarParams[1].vt = VT_UI4;\r
-                               avarParams[0] = domain;\r
-                               avarParams[0].vt = VT_BSTR;\r
-                               DISPPARAMS params = { avarParams, NULL, 4, 0 };\r
-                               hr = pConnection->Invoke(2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);\r
-                       }\r
-               }\r
-               return hr;\r
-       }\r
-       HRESULT Fire_ServiceFound( IDNSSDService * browser,  DNSSDFlags flags,  ULONG ifIndex,  BSTR serviceName,  BSTR regType,  BSTR domain)\r
-       {\r
-               HRESULT hr = S_OK;\r
-               T * pThis = static_cast<T *>(this);\r
-               int cConnections = m_vec.GetSize();\r
-\r
-               for (int iConnection = 0; iConnection < cConnections; iConnection++)\r
-               {\r
-                       pThis->Lock();\r
-                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);\r
-                       pThis->Unlock();\r
-\r
-                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);\r
-\r
-                       if (pConnection)\r
-                       {\r
-                               CComVariant avarParams[6];\r
-                               avarParams[5] = browser;\r
-                               avarParams[4] = flags;\r
-                               avarParams[3] = ifIndex;\r
-                               avarParams[3].vt = VT_UI4;\r
-                               avarParams[2] = serviceName;\r
-                               avarParams[2].vt = VT_BSTR;\r
-                               avarParams[1] = regType;\r
-                               avarParams[1].vt = VT_BSTR;\r
-                               avarParams[0] = domain;\r
-                               avarParams[0].vt = VT_BSTR;\r
-                               DISPPARAMS params = { avarParams, NULL, 6, 0 };\r
-                               hr = pConnection->Invoke(3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);\r
-                       }\r
-               }\r
-               return hr;\r
-       }\r
-       HRESULT Fire_ServiceLost( IDNSSDService * browser,  DNSSDFlags flags,  ULONG ifIndex,  BSTR serviceName,  BSTR regType,  BSTR domain)\r
-       {\r
-               HRESULT hr = S_OK;\r
-               T * pThis = static_cast<T *>(this);\r
-               int cConnections = m_vec.GetSize();\r
-\r
-               for (int iConnection = 0; iConnection < cConnections; iConnection++)\r
-               {\r
-                       pThis->Lock();\r
-                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);\r
-                       pThis->Unlock();\r
-\r
-                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);\r
-\r
-                       if (pConnection)\r
-                       {\r
-                               CComVariant avarParams[6];\r
-                               avarParams[5] = browser;\r
-                               avarParams[4] = flags;\r
-                               avarParams[3] = ifIndex;\r
-                               avarParams[3].vt = VT_UI4;\r
-                               avarParams[2] = serviceName;\r
-                               avarParams[2].vt = VT_BSTR;\r
-                               avarParams[1] = regType;\r
-                               avarParams[1].vt = VT_BSTR;\r
-                               avarParams[0] = domain;\r
-                               avarParams[0].vt = VT_BSTR;\r
-                               DISPPARAMS params = { avarParams, NULL, 6, 0 };\r
-                               hr = pConnection->Invoke(4, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);\r
-                       }\r
-               }\r
-               return hr;\r
-       }\r
-       HRESULT Fire_ServiceResolved( IDNSSDService * service,  DNSSDFlags flags,  ULONG ifIndex,  BSTR fullName,  BSTR hostName,  USHORT port,  ITXTRecord * record)\r
-       {\r
-               HRESULT hr = S_OK;\r
-               T * pThis = static_cast<T *>(this);\r
-               int cConnections = m_vec.GetSize();\r
-\r
-               for (int iConnection = 0; iConnection < cConnections; iConnection++)\r
-               {\r
-                       pThis->Lock();\r
-                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);\r
-                       pThis->Unlock();\r
-\r
-                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);\r
-\r
-                       if (pConnection)\r
-                       {\r
-                               CComVariant avarParams[7];\r
-                               avarParams[6] = service;\r
-                               avarParams[5] = flags;\r
-                               avarParams[4] = ifIndex;\r
-                               avarParams[4].vt = VT_UI4;\r
-                               avarParams[3] = fullName;\r
-                               avarParams[3].vt = VT_BSTR;\r
-                               avarParams[2] = hostName;\r
-                               avarParams[2].vt = VT_BSTR;\r
-                               avarParams[1] = port;\r
-                               avarParams[1].vt = VT_UI2;\r
-                               avarParams[0] = record;\r
-                               DISPPARAMS params = { avarParams, NULL, 7, 0 };\r
-                               hr = pConnection->Invoke(5, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);\r
-                       }\r
-               }\r
-               return hr;\r
-       }\r
-       HRESULT Fire_ServiceRegistered( IDNSSDService * service,  DNSSDFlags flags,  BSTR name,  BSTR regType,  BSTR domain)\r
-       {\r
-               HRESULT hr = S_OK;\r
-               T * pThis = static_cast<T *>(this);\r
-               int cConnections = m_vec.GetSize();\r
-\r
-               for (int iConnection = 0; iConnection < cConnections; iConnection++)\r
-               {\r
-                       pThis->Lock();\r
-                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);\r
-                       pThis->Unlock();\r
-\r
-                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);\r
-\r
-                       if (pConnection)\r
-                       {\r
-                               CComVariant avarParams[5];\r
-                               avarParams[4] = service;\r
-                               avarParams[3] = flags;\r
-                               avarParams[2] = name;\r
-                               avarParams[2].vt = VT_BSTR;\r
-                               avarParams[1] = regType;\r
-                               avarParams[1].vt = VT_BSTR;\r
-                               avarParams[0] = domain;\r
-                               avarParams[0].vt = VT_BSTR;\r
-                               DISPPARAMS params = { avarParams, NULL, 5, 0 };\r
-                               hr = pConnection->Invoke(6, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);\r
-                       }\r
-               }\r
-               return hr;\r
-       }\r
-       HRESULT Fire_QueryRecordAnswered( IDNSSDService * service,  DNSSDFlags flags,  ULONG ifIndex,  BSTR fullName,  DNSSDRRType rrtype,  DNSSDRRClass rrclass,  VARIANT rdata,  ULONG ttl)\r
-       {\r
-               HRESULT hr = S_OK;\r
-               T * pThis = static_cast<T *>(this);\r
-               int cConnections = m_vec.GetSize();\r
-\r
-               for (int iConnection = 0; iConnection < cConnections; iConnection++)\r
-               {\r
-                       pThis->Lock();\r
-                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);\r
-                       pThis->Unlock();\r
-\r
-                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);\r
-\r
-                       if (pConnection)\r
-                       {\r
-                               CComVariant avarParams[8];\r
-                               avarParams[7] = service;\r
-                               avarParams[6] = flags;\r
-                               avarParams[5] = ifIndex;\r
-                               avarParams[5].vt = VT_UI4;\r
-                               avarParams[4] = fullName;\r
-                               avarParams[4].vt = VT_BSTR;\r
-                               avarParams[3] = rrtype;\r
-                               avarParams[2] = rrclass;\r
-                               avarParams[1] = rdata;\r
-                               avarParams[0] = ttl;\r
-                               avarParams[0].vt = VT_UI4;\r
-                               DISPPARAMS params = { avarParams, NULL, 8, 0 };\r
-                               hr = pConnection->Invoke(7, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);\r
-                       }\r
-               }\r
-               return hr;\r
-       }\r
-       HRESULT Fire_RecordRegistered( IDNSSDRecord * record,  DNSSDFlags flags)\r
-       {\r
-               HRESULT hr = S_OK;\r
-               T * pThis = static_cast<T *>(this);\r
-               int cConnections = m_vec.GetSize();\r
-\r
-               for (int iConnection = 0; iConnection < cConnections; iConnection++)\r
-               {\r
-                       pThis->Lock();\r
-                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);\r
-                       pThis->Unlock();\r
-\r
-                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);\r
-\r
-                       if (pConnection)\r
-                       {\r
-                               CComVariant avarParams[2];\r
-                               avarParams[1] = record;\r
-                               avarParams[0] = flags;\r
-                               DISPPARAMS params = { avarParams, NULL, 2, 0 };\r
-                               hr = pConnection->Invoke(8, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);\r
-                       }\r
-               }\r
-               return hr;\r
-       }\r
-       HRESULT Fire_AddressFound( IDNSSDService * service,  DNSSDFlags flags,  ULONG ifIndex,  BSTR hostname,  DNSSDAddressFamily addressFamily,  BSTR address,  ULONG ttl)\r
-       {\r
-               HRESULT hr = S_OK;\r
-               T * pThis = static_cast<T *>(this);\r
-               int cConnections = m_vec.GetSize();\r
-\r
-               for (int iConnection = 0; iConnection < cConnections; iConnection++)\r
-               {\r
-                       pThis->Lock();\r
-                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);\r
-                       pThis->Unlock();\r
-\r
-                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);\r
-\r
-                       if (pConnection)\r
-                       {\r
-                               CComVariant avarParams[7];\r
-                               avarParams[6] = service;\r
-                               avarParams[5] = flags;\r
-                               avarParams[4] = ifIndex;\r
-                               avarParams[4].vt = VT_UI4;\r
-                               avarParams[3] = hostname;\r
-                               avarParams[3].vt = VT_BSTR;\r
-                               avarParams[2] = addressFamily;\r
-                               avarParams[1] = address;\r
-                               avarParams[1].vt = VT_BSTR;\r
-                               avarParams[0] = ttl;\r
-                               avarParams[0].vt = VT_UI4;\r
-                               DISPPARAMS params = { avarParams, NULL, 7, 0 };\r
-                               hr = pConnection->Invoke(9, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);\r
-                       }\r
-               }\r
-               return hr;\r
-       }\r
-       HRESULT Fire_MappingCreated( IDNSSDService * service,  DNSSDFlags flags,  ULONG ifIndex,  ULONG externalAddress,  DNSSDAddressFamily addressFamily,  DNSSDProtocol protocol,  USHORT internalPort,  USHORT externalPort,  ULONG ttl)\r
-       {\r
-               HRESULT hr = S_OK;\r
-               T * pThis = static_cast<T *>(this);\r
-               int cConnections = m_vec.GetSize();\r
-\r
-               for (int iConnection = 0; iConnection < cConnections; iConnection++)\r
-               {\r
-                       pThis->Lock();\r
-                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);\r
-                       pThis->Unlock();\r
-\r
-                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);\r
-\r
-                       if (pConnection)\r
-                       {\r
-                               CComVariant avarParams[9];\r
-                               avarParams[8] = service;\r
-                               avarParams[7] = flags;\r
-                               avarParams[6] = ifIndex;\r
-                               avarParams[6].vt = VT_UI4;\r
-                               avarParams[5] = externalAddress;\r
-                               avarParams[5].vt = VT_UI4;\r
-                               avarParams[4] = addressFamily;\r
-                               avarParams[3] = protocol;\r
-                               avarParams[2] = internalPort;\r
-                               avarParams[2].vt = VT_UI2;\r
-                               avarParams[1] = externalPort;\r
-                               avarParams[1].vt = VT_UI2;\r
-                               avarParams[0] = ttl;\r
-                               avarParams[0].vt = VT_UI4;\r
-                               DISPPARAMS params = { avarParams, NULL, 9, 0 };\r
-                               hr = pConnection->Invoke(10, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);\r
-                       }\r
-               }\r
-               return hr;\r
-       }\r
-       HRESULT Fire_OperationFailed( IDNSSDService * service,  DNSSDError error)\r
-       {\r
-               HRESULT hr = S_OK;\r
-               T * pThis = static_cast<T *>(this);\r
-               int cConnections = m_vec.GetSize();\r
-\r
-               for (int iConnection = 0; iConnection < cConnections; iConnection++)\r
-               {\r
-                       pThis->Lock();\r
-                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);\r
-                       pThis->Unlock();\r
-\r
-                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);\r
-\r
-                       if (pConnection)\r
-                       {\r
-                               CComVariant avarParams[2];\r
-                               avarParams[1] = service;\r
-                               avarParams[0] = error;\r
-                               DISPPARAMS params = { avarParams, NULL, 2, 0 };\r
-                               hr = pConnection->Invoke(11, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);\r
-                       }\r
-               }\r
-               return hr;\r
-       }\r
-};\r
-\r
+
+// Wizard-generated connection point proxy class
+// WARNING: This file may be regenerated by the wizard
+
+
+#pragma once
+
+template<class T>
+class CProxy_IDNSSDEvents :
+       public IConnectionPointImpl<T, &__uuidof(_IDNSSDEvents)>
+{
+public:
+       HRESULT Fire_DomainFound( IDNSSDService * service,  DNSSDFlags flags,  ULONG ifIndex,  BSTR domain)
+       {
+               HRESULT hr = S_OK;
+               T * pThis = static_cast<T *>(this);
+               int cConnections = m_vec.GetSize();
+
+               for (int iConnection = 0; iConnection < cConnections; iConnection++)
+               {
+                       pThis->Lock();
+                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
+                       pThis->Unlock();
+
+                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
+
+                       if (pConnection)
+                       {
+                               CComVariant avarParams[4];
+                               avarParams[3] = service;
+                               avarParams[2] = flags;
+                               avarParams[1] = ifIndex;
+                               avarParams[1].vt = VT_UI4;
+                               avarParams[0] = domain;
+                               avarParams[0].vt = VT_BSTR;
+                               DISPPARAMS params = { avarParams, NULL, 4, 0 };
+                               hr = pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);
+                       }
+               }
+               return hr;
+       }
+       HRESULT Fire_DomainLost( IDNSSDService * service,  DNSSDFlags flags,  ULONG ifIndex,  BSTR domain)
+       {
+               HRESULT hr = S_OK;
+               T * pThis = static_cast<T *>(this);
+               int cConnections = m_vec.GetSize();
+
+               for (int iConnection = 0; iConnection < cConnections; iConnection++)
+               {
+                       pThis->Lock();
+                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
+                       pThis->Unlock();
+
+                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
+
+                       if (pConnection)
+                       {
+                               CComVariant avarParams[4];
+                               avarParams[3] = service;
+                               avarParams[2] = flags;
+                               avarParams[1] = ifIndex;
+                               avarParams[1].vt = VT_UI4;
+                               avarParams[0] = domain;
+                               avarParams[0].vt = VT_BSTR;
+                               DISPPARAMS params = { avarParams, NULL, 4, 0 };
+                               hr = pConnection->Invoke(2, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);
+                       }
+               }
+               return hr;
+       }
+       HRESULT Fire_ServiceFound( IDNSSDService * browser,  DNSSDFlags flags,  ULONG ifIndex,  BSTR serviceName,  BSTR regType,  BSTR domain)
+       {
+               HRESULT hr = S_OK;
+               T * pThis = static_cast<T *>(this);
+               int cConnections = m_vec.GetSize();
+
+               for (int iConnection = 0; iConnection < cConnections; iConnection++)
+               {
+                       pThis->Lock();
+                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
+                       pThis->Unlock();
+
+                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
+
+                       if (pConnection)
+                       {
+                               CComVariant avarParams[6];
+                               avarParams[5] = browser;
+                               avarParams[4] = flags;
+                               avarParams[3] = ifIndex;
+                               avarParams[3].vt = VT_UI4;
+                               avarParams[2] = serviceName;
+                               avarParams[2].vt = VT_BSTR;
+                               avarParams[1] = regType;
+                               avarParams[1].vt = VT_BSTR;
+                               avarParams[0] = domain;
+                               avarParams[0].vt = VT_BSTR;
+                               DISPPARAMS params = { avarParams, NULL, 6, 0 };
+                               hr = pConnection->Invoke(3, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);
+                       }
+               }
+               return hr;
+       }
+       HRESULT Fire_ServiceLost( IDNSSDService * browser,  DNSSDFlags flags,  ULONG ifIndex,  BSTR serviceName,  BSTR regType,  BSTR domain)
+       {
+               HRESULT hr = S_OK;
+               T * pThis = static_cast<T *>(this);
+               int cConnections = m_vec.GetSize();
+
+               for (int iConnection = 0; iConnection < cConnections; iConnection++)
+               {
+                       pThis->Lock();
+                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
+                       pThis->Unlock();
+
+                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
+
+                       if (pConnection)
+                       {
+                               CComVariant avarParams[6];
+                               avarParams[5] = browser;
+                               avarParams[4] = flags;
+                               avarParams[3] = ifIndex;
+                               avarParams[3].vt = VT_UI4;
+                               avarParams[2] = serviceName;
+                               avarParams[2].vt = VT_BSTR;
+                               avarParams[1] = regType;
+                               avarParams[1].vt = VT_BSTR;
+                               avarParams[0] = domain;
+                               avarParams[0].vt = VT_BSTR;
+                               DISPPARAMS params = { avarParams, NULL, 6, 0 };
+                               hr = pConnection->Invoke(4, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);
+                       }
+               }
+               return hr;
+       }
+       HRESULT Fire_ServiceResolved( IDNSSDService * service,  DNSSDFlags flags,  ULONG ifIndex,  BSTR fullName,  BSTR hostName,  USHORT port,  ITXTRecord * record)
+       {
+               HRESULT hr = S_OK;
+               T * pThis = static_cast<T *>(this);
+               int cConnections = m_vec.GetSize();
+
+               for (int iConnection = 0; iConnection < cConnections; iConnection++)
+               {
+                       pThis->Lock();
+                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
+                       pThis->Unlock();
+
+                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
+
+                       if (pConnection)
+                       {
+                               CComVariant avarParams[7];
+                               avarParams[6] = service;
+                               avarParams[5] = flags;
+                               avarParams[4] = ifIndex;
+                               avarParams[4].vt = VT_UI4;
+                               avarParams[3] = fullName;
+                               avarParams[3].vt = VT_BSTR;
+                               avarParams[2] = hostName;
+                               avarParams[2].vt = VT_BSTR;
+                               avarParams[1] = port;
+                               avarParams[1].vt = VT_UI2;
+                               avarParams[0] = record;
+                               DISPPARAMS params = { avarParams, NULL, 7, 0 };
+                               hr = pConnection->Invoke(5, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);
+                       }
+               }
+               return hr;
+       }
+       HRESULT Fire_ServiceRegistered( IDNSSDService * service,  DNSSDFlags flags,  BSTR name,  BSTR regType,  BSTR domain)
+       {
+               HRESULT hr = S_OK;
+               T * pThis = static_cast<T *>(this);
+               int cConnections = m_vec.GetSize();
+
+               for (int iConnection = 0; iConnection < cConnections; iConnection++)
+               {
+                       pThis->Lock();
+                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
+                       pThis->Unlock();
+
+                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
+
+                       if (pConnection)
+                       {
+                               CComVariant avarParams[5];
+                               avarParams[4] = service;
+                               avarParams[3] = flags;
+                               avarParams[2] = name;
+                               avarParams[2].vt = VT_BSTR;
+                               avarParams[1] = regType;
+                               avarParams[1].vt = VT_BSTR;
+                               avarParams[0] = domain;
+                               avarParams[0].vt = VT_BSTR;
+                               DISPPARAMS params = { avarParams, NULL, 5, 0 };
+                               hr = pConnection->Invoke(6, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);
+                       }
+               }
+               return hr;
+       }
+       HRESULT Fire_QueryRecordAnswered( IDNSSDService * service,  DNSSDFlags flags,  ULONG ifIndex,  BSTR fullName,  DNSSDRRType rrtype,  DNSSDRRClass rrclass,  VARIANT rdata,  ULONG ttl)
+       {
+               HRESULT hr = S_OK;
+               T * pThis = static_cast<T *>(this);
+               int cConnections = m_vec.GetSize();
+
+               for (int iConnection = 0; iConnection < cConnections; iConnection++)
+               {
+                       pThis->Lock();
+                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
+                       pThis->Unlock();
+
+                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
+
+                       if (pConnection)
+                       {
+                               CComVariant avarParams[8];
+                               avarParams[7] = service;
+                               avarParams[6] = flags;
+                               avarParams[5] = ifIndex;
+                               avarParams[5].vt = VT_UI4;
+                               avarParams[4] = fullName;
+                               avarParams[4].vt = VT_BSTR;
+                               avarParams[3] = rrtype;
+                               avarParams[2] = rrclass;
+                               avarParams[1] = rdata;
+                               avarParams[0] = ttl;
+                               avarParams[0].vt = VT_UI4;
+                               DISPPARAMS params = { avarParams, NULL, 8, 0 };
+                               hr = pConnection->Invoke(7, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);
+                       }
+               }
+               return hr;
+       }
+       HRESULT Fire_RecordRegistered( IDNSSDRecord * record,  DNSSDFlags flags)
+       {
+               HRESULT hr = S_OK;
+               T * pThis = static_cast<T *>(this);
+               int cConnections = m_vec.GetSize();
+
+               for (int iConnection = 0; iConnection < cConnections; iConnection++)
+               {
+                       pThis->Lock();
+                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
+                       pThis->Unlock();
+
+                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
+
+                       if (pConnection)
+                       {
+                               CComVariant avarParams[2];
+                               avarParams[1] = record;
+                               avarParams[0] = flags;
+                               DISPPARAMS params = { avarParams, NULL, 2, 0 };
+                               hr = pConnection->Invoke(8, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);
+                       }
+               }
+               return hr;
+       }
+       HRESULT Fire_AddressFound( IDNSSDService * service,  DNSSDFlags flags,  ULONG ifIndex,  BSTR hostname,  DNSSDAddressFamily addressFamily,  BSTR address,  ULONG ttl)
+       {
+               HRESULT hr = S_OK;
+               T * pThis = static_cast<T *>(this);
+               int cConnections = m_vec.GetSize();
+
+               for (int iConnection = 0; iConnection < cConnections; iConnection++)
+               {
+                       pThis->Lock();
+                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
+                       pThis->Unlock();
+
+                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
+
+                       if (pConnection)
+                       {
+                               CComVariant avarParams[7];
+                               avarParams[6] = service;
+                               avarParams[5] = flags;
+                               avarParams[4] = ifIndex;
+                               avarParams[4].vt = VT_UI4;
+                               avarParams[3] = hostname;
+                               avarParams[3].vt = VT_BSTR;
+                               avarParams[2] = addressFamily;
+                               avarParams[1] = address;
+                               avarParams[1].vt = VT_BSTR;
+                               avarParams[0] = ttl;
+                               avarParams[0].vt = VT_UI4;
+                               DISPPARAMS params = { avarParams, NULL, 7, 0 };
+                               hr = pConnection->Invoke(9, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);
+                       }
+               }
+               return hr;
+       }
+       HRESULT Fire_MappingCreated( IDNSSDService * service,  DNSSDFlags flags,  ULONG ifIndex,  ULONG externalAddress,  DNSSDAddressFamily addressFamily,  DNSSDProtocol protocol,  USHORT internalPort,  USHORT externalPort,  ULONG ttl)
+       {
+               HRESULT hr = S_OK;
+               T * pThis = static_cast<T *>(this);
+               int cConnections = m_vec.GetSize();
+
+               for (int iConnection = 0; iConnection < cConnections; iConnection++)
+               {
+                       pThis->Lock();
+                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
+                       pThis->Unlock();
+
+                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
+
+                       if (pConnection)
+                       {
+                               CComVariant avarParams[9];
+                               avarParams[8] = service;
+                               avarParams[7] = flags;
+                               avarParams[6] = ifIndex;
+                               avarParams[6].vt = VT_UI4;
+                               avarParams[5] = externalAddress;
+                               avarParams[5].vt = VT_UI4;
+                               avarParams[4] = addressFamily;
+                               avarParams[3] = protocol;
+                               avarParams[2] = internalPort;
+                               avarParams[2].vt = VT_UI2;
+                               avarParams[1] = externalPort;
+                               avarParams[1].vt = VT_UI2;
+                               avarParams[0] = ttl;
+                               avarParams[0].vt = VT_UI4;
+                               DISPPARAMS params = { avarParams, NULL, 9, 0 };
+                               hr = pConnection->Invoke(10, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);
+                       }
+               }
+               return hr;
+       }
+       HRESULT Fire_OperationFailed( IDNSSDService * service,  DNSSDError error)
+       {
+               HRESULT hr = S_OK;
+               T * pThis = static_cast<T *>(this);
+               int cConnections = m_vec.GetSize();
+
+               for (int iConnection = 0; iConnection < cConnections; iConnection++)
+               {
+                       pThis->Lock();
+                       CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
+                       pThis->Unlock();
+
+                       IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
+
+                       if (pConnection)
+                       {
+                               CComVariant avarParams[2];
+                               avarParams[1] = service;
+                               avarParams[0] = error;
+                               DISPPARAMS params = { avarParams, NULL, 2, 0 };
+                               hr = pConnection->Invoke(11, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);
+                       }
+               }
+               return hr;
+       }
+};
+
index 56131874394ff7b8298def556dcadf9bad3db70e..d8a0cbc88852c9c1709af9a7f5e2efcd2d5498ba 100755 (executable)
@@ -1,30 +1,30 @@
-//{{NO_DEPENDENCIES}}\r
-// Microsoft Visual C++ generated include file.\r
-// Used by DLLX.rc\r
-//\r
-#define IDS_PROJNAME                    100\r
-#define IDR_DLLX                               101\r
-#define IDR_DNSSD                       102\r
-#define IDR_DNSSDSERVICE                103\r
-#define IDR_BROWSELISTENER              104\r
-#define IDR_RESOLVELISTENER             105\r
-#define IDR_TXTRECORD                   106\r
-#define IDR_ENUMERATEDOMAINSLISTENER    107\r
-#define IDR_REGISTERLISTENER            108\r
-#define IDR_QUERYRECORDLISTENER         109\r
-#define IDR_GETADDRINFOLISTENER         110\r
-#define IDR_DNSSDRECORD                 111\r
-#define IDR_REGISTERRECORDLISTENER      112\r
-#define IDR_NATPORTMAPPINGLISTENER      113\r
-#define IDR_DNSSDEVENTMANAGER           114\r
-\r
-// Next default values for new objects\r
-// \r
-#ifdef APSTUDIO_INVOKED\r
-#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE        201\r
-#define _APS_NEXT_COMMAND_VALUE         32768\r
-#define _APS_NEXT_CONTROL_VALUE         201\r
-#define _APS_NEXT_SYMED_VALUE           115\r
-#endif\r
-#endif\r
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by DLLX.rc
+//
+#define IDS_PROJNAME                    100
+#define IDR_DLLX                               101
+#define IDR_DNSSD                       102
+#define IDR_DNSSDSERVICE                103
+#define IDR_BROWSELISTENER              104
+#define IDR_RESOLVELISTENER             105
+#define IDR_TXTRECORD                   106
+#define IDR_ENUMERATEDOMAINSLISTENER    107
+#define IDR_REGISTERLISTENER            108
+#define IDR_QUERYRECORDLISTENER         109
+#define IDR_GETADDRINFOLISTENER         110
+#define IDR_DNSSDRECORD                 111
+#define IDR_REGISTERRECORDLISTENER      112
+#define IDR_NATPORTMAPPINGLISTENER      113
+#define IDR_DNSSDEVENTMANAGER           114
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        201
+#define _APS_NEXT_COMMAND_VALUE         32768
+#define _APS_NEXT_CONTROL_VALUE         201
+#define _APS_NEXT_SYMED_VALUE           115
+#endif
+#endif
diff --git a/mDNSWindows/Java/Java.vcxproj b/mDNSWindows/Java/Java.vcxproj
new file mode 100755 (executable)
index 0000000..9c63f87
--- /dev/null
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{9CE2568A-3170-41C6-9F20-A0188A9EC114}</ProjectGuid>\r
+    <Keyword>MakeFileProj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>Makefile</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>Makefile</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>Makefile</ConfigurationType>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>Makefile</ConfigurationType>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>\r
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nmake /f makefile DEBUG=1</NMakeBuildCommandLine>\r
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nmake /f makefile DEBUG=1</NMakeReBuildCommandLine>\r
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nmake /f makefile DEBUG=1 clean</NMakeCleanCommandLine>\r
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />\r
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>\r
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>\r
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>\r
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>\r
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">nmake /f makefile64 DEBUG=1</NMakeBuildCommandLine>\r
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">nmake /f makefile64 DEBUG=1</NMakeReBuildCommandLine>\r
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">nmake /f makefile64 DEBUG=1 clean</NMakeCleanCommandLine>\r
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />\r
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>\r
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>\r
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeForcedIncludes)</NMakeForcedIncludes>\r
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>\r
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>\r
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nmake /f makefile</NMakeBuildCommandLine>\r
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nmake /f makefile</NMakeReBuildCommandLine>\r
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nmake /f makefile clean</NMakeCleanCommandLine>\r
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />\r
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>\r
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>\r
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>\r
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>\r
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">nmake /f makefile64</NMakeBuildCommandLine>\r
+    <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">nmake /f makefile64</NMakeReBuildCommandLine>\r
+    <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">nmake /f makefile64 clean</NMakeCleanCommandLine>\r
+    <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />\r
+    <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>\r
+    <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>\r
+    <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeForcedIncludes)</NMakeForcedIncludes>\r
+    <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>\r
+    <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\DLL\dnssd.vcxproj">\r
+      <Project>{ab581101-18f0-46f6-b56a-83a6b1ea657e}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/mDNSWindows/NSPTool/NSPTool.vcxproj b/mDNSWindows/NSPTool/NSPTool.vcxproj
new file mode 100755 (executable)
index 0000000..7c86852
--- /dev/null
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{208B3A9F-1CA0-4D1D-9D6C-C61616F94705}</ProjectGuid>\r
+    <Keyword>Win32Proj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>.;..;../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <ExceptionHandling>\r
+      </ExceptionHandling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <SmallerTypeCheck>true</SmallerTypeCheck>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <FunctionLevelLinking>false</FunctionLevelLinking>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>\r
+      <CallingConvention>Cdecl</CallingConvention>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)NSPTool.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)NSPTool.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>.;..;../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <ExceptionHandling>\r
+      </ExceptionHandling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <SmallerTypeCheck>true</SmallerTypeCheck>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <FunctionLevelLinking>false</FunctionLevelLinking>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>Cdecl</CallingConvention>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)NSPTool.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)NSPTool.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ClCompile>\r
+      <AdditionalIncludeDirectories>.;..;../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)NSPTool.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <AdditionalIncludeDirectories>.;..;../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)NSPTool.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c" />\r
+    <ClCompile Include="NSPTool.c" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h" />\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h" />\r
+    <ClInclude Include="resource.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="NSPTool.rc" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/mDNSWindows/NSPTool/NSPTool.vcxproj.filters b/mDNSWindows/NSPTool/NSPTool.vcxproj.filters
new file mode 100755 (executable)
index 0000000..e52b917
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="NSPTool.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="resource.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="NSPTool.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
diff --git a/mDNSWindows/Poll.c b/mDNSWindows/Poll.c
new file mode 100755 (executable)
index 0000000..9adc632
--- /dev/null
@@ -0,0 +1,728 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Poll.h"
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <windows.h>
+#include <process.h>
+#include "GenLinkedList.h"
+#include "DebugServices.h"
+
+
+typedef struct PollSource_struct
+{
+       SOCKET socket;
+       HANDLE handle;
+       void   *context;
+
+       union
+       {
+               mDNSPollSocketCallback socket;
+               mDNSPollEventCallback event;
+       } callback;
+
+       struct Worker_struct            *worker;
+       struct PollSource_struct        *next;
+
+} PollSource;
+
+
+typedef struct Worker_struct
+{
+       HANDLE                                  thread;         // NULL for main worker
+       unsigned                                id;                     // 0 for main worker
+
+       HANDLE                                  start;          // NULL for main worker
+       HANDLE                                  stop;           // NULL for main worker
+       BOOL                                    done;           // Not used for main worker
+
+       DWORD                                   numSources;
+       PollSource                              *sources[ MAXIMUM_WAIT_OBJECTS ];
+       HANDLE                                  handles[ MAXIMUM_WAIT_OBJECTS ];
+       DWORD                                   result;
+       struct Worker_struct    *next;
+} Worker;
+
+
+typedef struct Poll_struct
+{
+       mDNSBool                setup;
+       HANDLE                  wakeup;
+       GenLinkedList   sources;
+       DWORD                   numSources;
+       Worker                  main;
+       GenLinkedList   workers;
+       HANDLE                  workerHandles[ MAXIMUM_WAIT_OBJECTS ];
+       DWORD                   numWorkers;
+
+} Poll;
+
+
+/*
+ * Poll Methods
+ */
+
+mDNSlocal mStatus                      PollSetup();
+mDNSlocal mStatus                      PollRegisterSource( PollSource *source ); 
+mDNSlocal void                         PollUnregisterSource( PollSource *source );
+mDNSlocal mStatus                      PollStartWorkers();
+mDNSlocal mStatus                      PollStopWorkers();
+mDNSlocal void                         PollRemoveWorker( Worker *worker );
+
+
+/*
+ * Worker Methods
+ */
+
+mDNSlocal mStatus                      WorkerInit( Worker *worker );
+mDNSlocal void                         WorkerFree( Worker *worker );
+mDNSlocal void                         WorkerRegisterSource( Worker *worker, PollSource *source );
+mDNSlocal int                          WorkerSourceToIndex( Worker *worker, PollSource *source );
+mDNSlocal void                         WorkerUnregisterSource( Worker *worker, PollSource *source );
+mDNSlocal void                         WorkerDispatch( Worker *worker);
+mDNSlocal void CALLBACK                WorkerWakeupNotification( HANDLE event, void *context );
+mDNSlocal unsigned WINAPI      WorkerMain( LPVOID inParam );
+
+
+static void
+ShiftDown( void * arr, size_t arraySize, size_t itemSize, int index )
+{
+    memmove( ( ( unsigned char* ) arr ) + ( ( index - 1 ) * itemSize ), ( ( unsigned char* ) arr ) + ( index * itemSize ), ( arraySize - index ) * itemSize );
+}
+
+
+#define        DEBUG_NAME      "[mDNSWin32] "
+#define gMDNSRecord mDNSStorage
+mDNSlocal Poll gPoll = { mDNSfalse, NULL };
+
+#define LogErr( err, FUNC ) LogMsg( "%s:%d - %s failed: %d\n", __FUNCTION__, __LINE__, FUNC, err );
+
+
+mStatus
+mDNSPollRegisterSocket( SOCKET socket, int networkEvents, mDNSPollSocketCallback callback, void *context )
+{
+       PollSource      *source = NULL;
+       HANDLE          event = INVALID_HANDLE_VALUE;
+       mStatus         err = mStatus_NoError;
+
+       if ( !gPoll.setup )
+       {
+               err = PollSetup();
+               require_noerr( err, exit );
+       }
+
+       source = malloc( sizeof( PollSource ) );
+       require_action( source, exit, err = mStatus_NoMemoryErr );
+
+       event = WSACreateEvent();
+       require_action( event, exit, err = mStatus_NoMemoryErr );
+
+       err = WSAEventSelect( socket, event, networkEvents );
+       require_noerr( err, exit );
+
+       source->socket = socket;
+       source->handle = event;
+       source->callback.socket = callback;
+       source->context = context;
+
+       err = PollRegisterSource( source );
+       require_noerr( err, exit );
+       
+exit:
+
+       if ( err != mStatus_NoError )
+       {
+               if ( event != INVALID_HANDLE_VALUE )
+               {
+                       WSACloseEvent( event );
+               }
+
+               if ( source != NULL )
+               {
+                       free( source );
+               }
+       }
+
+       return err;
+}
+
+
+void
+mDNSPollUnregisterSocket( SOCKET socket )
+{
+       PollSource      *source;
+
+       for ( source = gPoll.sources.Head; source; source = source->next )
+       {
+               if ( source->socket == socket )
+               {
+                       break;
+               }
+       }
+
+       if ( source )
+       {
+               WSACloseEvent( source->handle );
+               PollUnregisterSource( source );
+               free( source );
+       }
+}
+
+
+mStatus
+mDNSPollRegisterEvent( HANDLE event, mDNSPollEventCallback callback, void *context )
+{
+       PollSource      *source = NULL;
+       mStatus         err = mStatus_NoError;
+
+       if ( !gPoll.setup )
+       {
+               err = PollSetup();
+               require_noerr( err, exit );
+       }
+
+       source = malloc( sizeof( PollSource ) );
+       require_action( source, exit, err = mStatus_NoMemoryErr );
+
+       source->socket = INVALID_SOCKET;
+       source->handle = event;
+       source->callback.event = callback;
+       source->context = context;
+
+       err = PollRegisterSource( source ); 
+       require_noerr( err, exit );
+       
+exit:
+
+       if ( err != mStatus_NoError )
+       {
+               if ( source != NULL )
+               {
+                       free( source );
+               }
+       }
+
+       return err;
+}
+
+
+void
+mDNSPollUnregisterEvent( HANDLE event )
+{
+       PollSource      *source;
+
+       for ( source = gPoll.sources.Head; source; source = source->next )
+       {
+               if ( source->handle == event )
+               {
+                       break;
+               }
+       }
+
+       if ( source )
+       {
+               PollUnregisterSource( source );
+               free( source );
+       }
+}
+
+
+mStatus
+mDNSPoll( DWORD msec )
+{
+       mStatus err = mStatus_NoError;
+
+       if ( gPoll.numWorkers > 0 )
+       {       
+               err = PollStartWorkers();
+               require_noerr( err, exit );
+       }
+
+       gPoll.main.result = WaitForMultipleObjects( gPoll.main.numSources, gPoll.main.handles, FALSE, msec );
+       err = translate_errno( ( gPoll.main.result != WAIT_FAILED ), ( mStatus ) GetLastError(), kUnknownErr );
+       if ( err ) LogErr( err, "WaitForMultipleObjects()" );
+       require_action( gPoll.main.result != WAIT_FAILED, exit, err = ( mStatus ) GetLastError() );
+
+       if ( gPoll.numWorkers > 0 )
+       {
+               err = PollStopWorkers();
+               require_noerr( err, exit );
+       }
+
+       WorkerDispatch( &gPoll.main );
+
+exit:
+
+       return ( err );
+}
+
+
+mDNSlocal mStatus
+PollSetup()
+{
+       mStatus err = mStatus_NoError;
+
+       if ( !gPoll.setup )
+       {
+               memset( &gPoll, 0, sizeof( gPoll ) );
+
+               InitLinkedList( &gPoll.sources, offsetof( PollSource, next ) );
+               InitLinkedList( &gPoll.workers, offsetof( Worker, next ) );
+
+               gPoll.wakeup = CreateEvent( NULL, TRUE, FALSE, NULL );
+               require_action( gPoll.wakeup, exit, err = mStatus_NoMemoryErr );
+
+               err = WorkerInit( &gPoll.main );
+               require_noerr( err, exit );
+               
+               gPoll.setup = mDNStrue;
+       }
+
+exit:
+
+       return err;
+}
+
+
+mDNSlocal mStatus
+PollRegisterSource( PollSource *source )
+{
+       Worker  *worker = NULL;
+       mStatus err = mStatus_NoError;
+
+       AddToTail( &gPoll.sources, source );
+       gPoll.numSources++;
+
+       // First check our main worker. In most cases, we won't have to worry about threads
+
+       if ( gPoll.main.numSources < MAXIMUM_WAIT_OBJECTS )
+       {
+               WorkerRegisterSource( &gPoll.main, source );
+       }
+       else
+       {
+               // Try to find a thread to use that we've already created
+
+               for ( worker = gPoll.workers.Head; worker; worker = worker->next )
+               {
+                       if ( worker->numSources < MAXIMUM_WAIT_OBJECTS )
+                       {
+                               WorkerRegisterSource( worker, source );
+                               break;
+                       }
+               }
+
+               // If not, then create a worker and make a thread to run it in
+               
+               if ( !worker )
+               {
+                       worker = ( Worker* ) malloc( sizeof( Worker ) );                        
+                       require_action( worker, exit, err = mStatus_NoMemoryErr );
+
+                       memset( worker, 0, sizeof( Worker ) );
+
+                       worker->start = CreateEvent( NULL, FALSE, FALSE, NULL );
+                       require_action( worker->start, exit, err = mStatus_NoMemoryErr );
+
+                       worker->stop = CreateEvent( NULL, FALSE, FALSE, NULL );
+                       require_action( worker->stop, exit, err = mStatus_NoMemoryErr );
+
+                       err = WorkerInit( worker );
+                       require_noerr( err, exit );
+
+                       // Create thread with _beginthreadex() instead of CreateThread() to avoid
+                       // memory leaks when using static run-time libraries.
+                       // See <http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createthread.asp>.
+
+                       worker->thread = ( HANDLE ) _beginthreadex_compat( NULL, 0, WorkerMain, worker, 0, &worker->id );
+                       err = translate_errno( worker->thread, ( mStatus ) GetLastError(), kUnknownErr );
+                       require_noerr( err, exit );
+
+                       AddToTail( &gPoll.workers, worker );
+                       gPoll.workerHandles[ gPoll.numWorkers++ ] = worker->stop;
+                       
+                       WorkerRegisterSource( worker, source );
+               }
+       }
+
+exit:
+
+       if ( err && worker )
+       {
+               WorkerFree( worker );
+       }
+
+       return err;
+}
+
+
+mDNSlocal void
+PollUnregisterSource( PollSource *source )
+{
+       RemoveFromList( &gPoll.sources, source );
+       gPoll.numSources--;
+
+       WorkerUnregisterSource( source->worker, source );
+}
+
+
+mDNSlocal mStatus
+PollStartWorkers()
+{
+       Worker  *worker;
+       mStatus err = mStatus_NoError;
+       BOOL    ok;
+
+       dlog( kDebugLevelChatty, DEBUG_NAME "starting workers\n" );
+       
+       worker = gPoll.workers.Head;
+
+       while ( worker )
+       {
+               Worker *next = worker->next;
+
+               if ( worker->numSources == 1 )
+               {
+                       PollRemoveWorker( worker );
+               }
+               else
+               {
+                       dlog( kDebugLevelChatty, DEBUG_NAME "waking up worker\n" );
+
+                       ok = SetEvent( worker->start );
+                       err = translate_errno( ok, ( mStatus ) GetLastError(), kUnknownErr );
+                       if ( err ) LogErr( err, "SetEvent()" );
+
+                       if ( err )
+                       {
+                               PollRemoveWorker( worker );
+                       }
+               }
+
+               worker = next;
+       }
+
+       err = mStatus_NoError;
+
+       return err;
+}
+
+
+mDNSlocal mStatus
+PollStopWorkers()
+{
+       DWORD   result;
+       Worker  *worker;
+       BOOL    ok;
+       mStatus err = mStatus_NoError;
+
+       dlog( kDebugLevelChatty, DEBUG_NAME "stopping workers\n" );
+       
+       ok = SetEvent( gPoll.wakeup );
+       err = translate_errno( ok, ( mStatus ) GetLastError(), kUnknownErr );
+       if ( err ) LogErr( err, "SetEvent()" );
+
+       // Wait For 5 seconds for all the workers to wake up
+
+       result = WaitForMultipleObjects( gPoll.numWorkers, gPoll.workerHandles, TRUE, 5000 );
+       err = translate_errno( ( result != WAIT_FAILED ), ( mStatus ) GetLastError(), kUnknownErr );
+       if ( err ) LogErr( err, "WaitForMultipleObjects()" );
+
+       ok = ResetEvent( gPoll.wakeup );
+       err = translate_errno( ok, ( mStatus ) GetLastError(), kUnknownErr );
+       if ( err ) LogErr( err, "ResetEvent()" );
+
+       for ( worker = gPoll.workers.Head; worker; worker = worker->next )
+       {
+               WorkerDispatch( worker );
+       }
+
+       err = mStatus_NoError;
+
+       return err;
+}
+
+
+mDNSlocal void
+PollRemoveWorker( Worker *worker )
+{
+       DWORD   result;
+       mStatus err;
+       BOOL    ok;
+       DWORD   i;
+
+       dlog( kDebugLevelChatty, DEBUG_NAME "removing worker %d\n", worker->id );
+       
+       RemoveFromList( &gPoll.workers, worker );
+
+       // Remove handle from gPoll.workerHandles
+
+       for ( i = 0; i < gPoll.numWorkers; i++ )
+       {
+               if ( gPoll.workerHandles[ i ] == worker->stop )
+               {
+                       ShiftDown( gPoll.workerHandles, gPoll.numWorkers, sizeof( gPoll.workerHandles[ 0 ] ), i + 1 );
+                       break;
+               }
+       }
+
+       worker->done = TRUE;
+       gPoll.numWorkers--;
+
+       // Cause the thread to exit.
+
+       ok = SetEvent( worker->start );
+       err = translate_errno( ok, ( OSStatus ) GetLastError(), kUnknownErr );
+       if ( err ) LogErr( err, "SetEvent()" );
+                       
+       result = WaitForSingleObject( worker->thread, 5000 );
+       err = translate_errno( result != WAIT_FAILED, ( OSStatus ) GetLastError(), kUnknownErr );
+       if ( err ) LogErr( err, "WaitForSingleObject()" );
+                       
+       if ( ( result == WAIT_FAILED ) || ( result == WAIT_TIMEOUT ) )
+       {
+               ok = TerminateThread( worker->thread, 0 );
+               err = translate_errno( ok, ( OSStatus ) GetLastError(), kUnknownErr );
+               if ( err ) LogErr( err, "TerminateThread()" );
+       }
+       
+       CloseHandle( worker->thread );
+       worker->thread = NULL;
+
+       WorkerFree( worker );
+}
+
+
+mDNSlocal void
+WorkerRegisterSource( Worker *worker, PollSource *source )
+{
+       source->worker = worker;
+       worker->sources[ worker->numSources ] = source;
+       worker->handles[ worker->numSources ] = source->handle;
+       worker->numSources++;
+}
+
+
+mDNSlocal int
+WorkerSourceToIndex( Worker *worker, PollSource *source )
+{
+       int index;
+
+       for ( index = 0; index < ( int ) worker->numSources; index++ )
+       {
+               if ( worker->sources[ index ] == source )
+               {
+                       break;
+               }
+       }
+
+       if ( index == ( int ) worker->numSources )
+       {
+               index = -1;
+       }
+
+       return index;
+}
+
+
+mDNSlocal void
+WorkerUnregisterSource( Worker *worker, PollSource *source )
+{
+       int sourceIndex = WorkerSourceToIndex( worker, source );
+       DWORD delta;
+
+       if ( sourceIndex == -1 )
+       {
+               LogMsg( "WorkerUnregisterSource: source not found in list" );
+               goto exit;
+       }
+
+       delta = ( worker->numSources - sourceIndex - 1 );
+
+       // If this source is not at the end of the list, then move memory
+
+       if ( delta > 0 )
+       {
+               ShiftDown( worker->sources, worker->numSources, sizeof( worker->sources[ 0 ] ), sourceIndex + 1 );
+               ShiftDown( worker->handles, worker->numSources, sizeof( worker->handles[ 0 ] ), sourceIndex + 1 );
+       }
+                        
+       worker->numSources--;
+
+exit:
+
+       return;
+}
+
+
+mDNSlocal void CALLBACK
+WorkerWakeupNotification( HANDLE event, void *context )
+{
+       DEBUG_UNUSED( event );
+       DEBUG_UNUSED( context );
+
+       dlog( kDebugLevelChatty, DEBUG_NAME "Worker thread wakeup\n" );
+}
+
+
+mDNSlocal void
+WorkerDispatch( Worker *worker )
+{
+       if ( worker->result == WAIT_FAILED )
+       {
+               /* What should we do here? */
+       }
+       else if ( worker->result == WAIT_TIMEOUT )
+       {
+               dlog( kDebugLevelChatty, DEBUG_NAME "timeout\n" );
+       }
+       else
+       {
+               DWORD           waitItemIndex = ( DWORD )( ( ( int ) worker->result ) - WAIT_OBJECT_0 );
+               PollSource      *source = NULL;
+
+               // Sanity check
+
+               if ( waitItemIndex >= worker->numSources )
+               {
+                       LogMsg( "WorkerDispatch: waitItemIndex (%d) is >= numSources (%d)", waitItemIndex, worker->numSources );
+                       goto exit;
+               }
+
+               source = worker->sources[ waitItemIndex ];
+
+               if ( source->socket != INVALID_SOCKET )
+               {
+                       WSANETWORKEVENTS event;
+       
+                       if ( WSAEnumNetworkEvents( source->socket, source->handle, &event ) == 0 )
+                       {
+                               source->callback.socket( source->socket, &event, source->context );
+                       }
+                       else
+                       {
+                               source->callback.socket( source->socket, NULL, source->context );
+                       }
+               }
+               else
+               {
+                       source->callback.event( source->handle, source->context );
+               }
+       }
+
+exit:
+
+       return;
+}
+
+
+mDNSlocal mStatus
+WorkerInit( Worker *worker )
+{
+       PollSource *source = NULL;
+       mStatus err = mStatus_NoError;
+       
+       require_action( worker, exit, err = mStatus_BadParamErr );
+
+       source = malloc( sizeof( PollSource ) );
+       require_action( source, exit, err = mStatus_NoMemoryErr );
+
+       source->socket = INVALID_SOCKET;
+       source->handle = gPoll.wakeup;
+       source->callback.event = WorkerWakeupNotification;
+       source->context = NULL;
+       
+       WorkerRegisterSource( worker, source );
+
+exit:
+
+       return err;
+}
+       
+
+mDNSlocal void
+WorkerFree( Worker *worker )
+{
+       if ( worker->start )
+       {
+               CloseHandle( worker->start );
+               worker->start = NULL;
+       }
+
+       if ( worker->stop )
+       {
+               CloseHandle( worker->stop );
+               worker->stop = NULL;
+       }
+
+       free( worker );
+}
+
+
+mDNSlocal unsigned WINAPI
+WorkerMain( LPVOID inParam )
+{
+       Worker *worker = ( Worker* ) inParam;
+       mStatus err = mStatus_NoError;
+
+       require_action( worker, exit, err = mStatus_BadParamErr );
+
+       dlog( kDebugLevelVerbose, DEBUG_NAME, "entering WorkerMain()\n" );
+
+       while ( TRUE )
+       {
+               DWORD   result;
+               BOOL    ok;
+
+               dlog( kDebugLevelChatty, DEBUG_NAME, "worker thread %d will wait on main loop\n", worker->id );
+               
+               result = WaitForSingleObject( worker->start, INFINITE );        
+               err = translate_errno( ( result != WAIT_FAILED ), ( mStatus ) GetLastError(), kUnknownErr );
+               if ( err ) { LogErr( err, "WaitForSingleObject()" ); break; }
+               if ( worker->done ) break;
+
+               dlog( kDebugLevelChatty, DEBUG_NAME "worker thread %d will wait on sockets\n", worker->id );
+
+               worker->result = WaitForMultipleObjects( worker->numSources, worker->handles, FALSE, INFINITE );
+               err = translate_errno( ( worker->result != WAIT_FAILED ), ( mStatus ) GetLastError(), kUnknownErr );
+               if ( err ) { LogErr( err, "WaitForMultipleObjects()" ); break; }
+
+               dlog( kDebugLevelChatty, DEBUG_NAME "worker thread %d did wait on sockets: %d\n", worker->id, worker->result );
+
+               ok = SetEvent( gPoll.wakeup );
+               err = translate_errno( ok, ( mStatus ) GetLastError(), kUnknownErr );
+               if ( err ) { LogErr( err, "SetEvent()" ); break; }
+
+               dlog( kDebugLevelChatty, DEBUG_NAME, "worker thread %d preparing to sleep\n", worker->id );
+
+               ok = SetEvent( worker->stop );
+               err = translate_errno( ok, ( mStatus ) GetLastError(), kUnknownErr );
+               if ( err ) { LogErr( err, "SetEvent()" ); break; }
+       }
+
+       dlog( kDebugLevelVerbose, DEBUG_NAME "exiting WorkerMain()\n" );
+
+exit:
+
+       return 0;
+}
diff --git a/mDNSWindows/Poll.h b/mDNSWindows/Poll.h
new file mode 100755 (executable)
index 0000000..bd1b10f
--- /dev/null
@@ -0,0 +1,61 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _Poll_h
+#define _Poll_h
+
+#include       "CommonServices.h"
+#include       <mswsock.h>
+#include       "mDNSEmbeddedAPI.h"
+#include       "uDNS.h"
+
+
+#if defined(__cplusplus )
+extern "C" {
+#endif
+
+
+typedef void ( CALLBACK *mDNSPollSocketCallback )( SOCKET socket, LPWSANETWORKEVENTS event, void *context );
+typedef void ( CALLBACK *mDNSPollEventCallback )( HANDLE event, void *context );
+
+
+extern mStatus
+mDNSPollRegisterSocket( SOCKET socket, int networkEvents, mDNSPollSocketCallback callback, void *context );
+
+
+extern void
+mDNSPollUnregisterSocket( SOCKET socket );
+
+
+extern mStatus
+mDNSPollRegisterEvent( HANDLE event, mDNSPollEventCallback callback, void *context );
+
+
+extern void
+mDNSPollUnregisterEvent( HANDLE event );
+
+
+extern mStatus
+mDNSPoll( DWORD msec );
+
+
+#if defined(__cplusplus)
+}
+#endif
+
+
+#endif
index 506c82b5eb0364f14c878888cf4251b533ce44c2..faabd07324bd73e80a5e6503bc5e2113225b9c40 100755 (executable)
@@ -93,29 +93,29 @@ inet_pton( int family, const char * addr, void * dst )
        }
     else return 0;
 }
-\r
+
 
 int
 gettimeofday( struct timeval * tv, struct timezone * tz )
-{\r
-#define EPOCHFILETIME (116444736000000000i64)\r
-\r
-       if ( tv != NULL )\r
-       {\r
-               FILETIME        ft;\r
-               LARGE_INTEGER   li;\r
-               __int64         t;\r
-\r
-               GetSystemTimeAsFileTime(&ft);\r
-               li.LowPart  = ft.dwLowDateTime;\r
-               li.HighPart = ft.dwHighDateTime;\r
-               t  = li.QuadPart;       /* In 100-nanosecond intervals */\r
-               t -= EPOCHFILETIME;     /* Offset to the Epoch time */\r
-               t /= 10;                        /* In microseconds */\r
-               tv->tv_sec  = ( long )( t / 1000000 );\r
-               tv->tv_usec = ( long )( t % 1000000 );\r
-       }\r
-\r
+{
+#define EPOCHFILETIME (116444736000000000i64)
+
+       if ( tv != NULL )
+       {
+               FILETIME        ft;
+               LARGE_INTEGER   li;
+               __int64         t;
+
+               GetSystemTimeAsFileTime(&ft);
+               li.LowPart  = ft.dwLowDateTime;
+               li.HighPart = ft.dwHighDateTime;
+               t  = li.QuadPart;       /* In 100-nanosecond intervals */
+               t -= EPOCHFILETIME;     /* Offset to the Epoch time */
+               t /= 10;                        /* In microseconds */
+               tv->tv_sec  = ( long )( t / 1000000 );
+               tv->tv_usec = ( long )( t % 1000000 );
+       }
+
        return 0;
 }
 
index 8b4c2c6f5110df7479016da40d397be4fea5e1f3..d175326fc2ff9c041bf111ef7e082ddc3b8f6c6c 100644 (file)
@@ -21,7 +21,7 @@
 #include       <stdarg.h>
 #include       <stddef.h>
 
-
+#include       "Poll.h"
 #include       "CommonServices.h"
 #include       "DebugServices.h"
 #include       "RegNames.h"
@@ -36,6 +36,7 @@
 #include       "mDNSEmbeddedAPI.h"
 #include       "uDNS.h"
 #include       "mDNSWin32.h"
+#include       "mDNSDebug.h"
 
 #include       "Firewall.h"
 
@@ -73,6 +74,7 @@
 #define kDefaultRouteMetric                                    399
 #define kSecondsTo100NSUnits                           ( 10 * 1000 * 1000 )
 #define kSPSMaintenanceWakePeriod                      -30
+#define kWaitToRetry                                           (60 * 5)
 
 #define RR_CACHE_SIZE 500
 static CacheEntity gRRCache[RR_CACHE_SIZE];
@@ -80,36 +82,6 @@ static CacheEntity gRRCache[RR_CACHE_SIZE];
 #pragma mark == Structures ==
 #endif
 
-//===========================================================================================================================
-//     Structures
-//===========================================================================================================================
-
-typedef struct EventSource
-{
-       HANDLE                                                  event;
-       void                                            *       context;
-       RegisterWaitableEventHandler    handler;
-       struct EventSource                      *       next;
-} EventSource;
-
-static BOOL                                                                                    gEventSourceListChanged = FALSE;
-static EventSource                                                             *       gEventSourceList = NULL;
-static EventSource                                                             *       gCurrentSource = NULL;
-static int                                                                                     gEventSources = 0;
-
-#define        kWaitListStopEvent                                                      ( WAIT_OBJECT_0 + 0 )
-#define        kWaitListInterfaceListChangedEvent                      ( WAIT_OBJECT_0 + 1 )
-#define kWaitListComputerDescriptionEvent                      ( WAIT_OBJECT_0 + 2 )
-#define kWaitListTCPIPEvent                                                    ( WAIT_OBJECT_0 + 3 )
-#define kWaitListDynDNSEvent                                           ( WAIT_OBJECT_0 + 4 )
-#define kWaitListFileShareEvent                                                ( WAIT_OBJECT_0 + 5 )
-#define kWaitListFirewallEvent                                         ( WAIT_OBJECT_0 + 6 )
-#define kWaitListAdvertisedServicesEvent                       ( WAIT_OBJECT_0 + 7 )
-#define kWaitListSPSWakeupEvent                                                ( WAIT_OBJECT_0 + 8 )
-#define kWaitListSPSSleepEvent                                         ( WAIT_OBJECT_0 + 9 )
-#define        kWaitListFixedItemCount                                         10
-
-
 #if 0
 #pragma mark == Prototypes ==
 #endif
@@ -117,46 +89,55 @@ static int                                                                                 gEventSources = 0;
 //===========================================================================================================================
 //     Prototypes
 //===========================================================================================================================
-static void                    Usage( void );
-static BOOL WINAPI     ConsoleControlHandler( DWORD inControlEvent );
-static OSStatus                InstallService( LPCTSTR inName, LPCTSTR inDisplayName, LPCTSTR inDescription, LPCTSTR inPath );
-static OSStatus                RemoveService( LPCTSTR inName );
-static OSStatus                SetServiceParameters();
-static OSStatus                GetServiceParameters();
-static OSStatus                CheckFirewall();
-static OSStatus                SetServiceInfo( SC_HANDLE inSCM, LPCTSTR inServiceName, LPCTSTR inDescription );
-static void                    ReportStatus( int inType, const char *inFormat, ... );
-
-static void WINAPI     ServiceMain( DWORD argc, LPTSTR argv[] );
-static OSStatus                ServiceSetupEventLogging( void );
-static DWORD WINAPI    ServiceControlHandler( DWORD inControl, DWORD inEventType, LPVOID inEventData, LPVOID inContext );
-
-static OSStatus                ServiceRun( int argc, LPTSTR argv[] );
-static void                    ServiceStop( void );
-
-static OSStatus                ServiceSpecificInitialize( int argc, LPTSTR  argv[] );
-static OSStatus                ServiceSpecificRun( int argc, LPTSTR argv[] );
-static OSStatus                ServiceSpecificStop( void );
-static void                    ServiceSpecificFinalize( int argc, LPTSTR argv[] );
-static mStatus         SetupNotifications();
-static mStatus         TearDownNotifications();
-static mStatus         RegisterWaitableEvent( mDNS * const inMDNS, HANDLE event, void * context, RegisterWaitableEventHandler handler );
-static void                    UnregisterWaitableEvent( mDNS * const inMDNS, HANDLE event );
-static mStatus         SetupWaitList( mDNS * const inMDNS, HANDLE **outWaitList, int *outWaitListCount );
-static void                    UDSCanAccept( mDNS * const inMDNS, HANDLE event, void * context );
-static void                    UDSCanRead( TCPSocket * sock );
-static void                    HandlePowerSuspend( void * v );
-static void                    HandlePowerResumeSuspend( void * v );
-static void                    CoreCallback(mDNS * const inMDNS, mStatus result);
-static mDNSu8          SystemWakeForNetworkAccess( LARGE_INTEGER * timeout );
-static OSStatus                GetRouteDestination(DWORD * ifIndex, DWORD * address);
-static OSStatus                SetLLRoute( mDNS * const inMDNS );
-static bool                    HaveRoute( PMIB_IPFORWARDROW rowExtant, unsigned long addr, unsigned long metric );
-static bool                    IsValidAddress( const char * addr );
-static bool                    IsNortelVPN( IP_ADAPTER_INFO * pAdapter );
-static bool                    IsJuniperVPN( IP_ADAPTER_INFO * pAdapter );
-static bool                    IsCiscoVPN( IP_ADAPTER_INFO * pAdapter );
-static const char * strnistr( const char * string, const char * subString, size_t max );
+static void                            Usage( void );
+static BOOL WINAPI             ConsoleControlHandler( DWORD inControlEvent );
+static OSStatus                        InstallService( LPCTSTR inName, LPCTSTR inDisplayName, LPCTSTR inDescription, LPCTSTR inPath );
+static OSStatus                        RemoveService( LPCTSTR inName );
+static OSStatus                        SetServiceParameters();
+static OSStatus                        GetServiceParameters();
+static OSStatus                        CheckFirewall();
+static OSStatus                        SetServiceInfo( SC_HANDLE inSCM, LPCTSTR inServiceName, LPCTSTR inDescription );
+static void                            ReportStatus( int inType, const char *inFormat, ... );
+
+static void WINAPI             ServiceMain( DWORD argc, LPTSTR argv[] );
+static OSStatus                        ServiceSetupEventLogging( void );
+static DWORD WINAPI            ServiceControlHandler( DWORD inControl, DWORD inEventType, LPVOID inEventData, LPVOID inContext );
+
+static OSStatus                        ServiceRun( int argc, LPTSTR argv[] );
+static void                            ServiceStop( void );
+
+static OSStatus                        ServiceSpecificInitialize( int argc, LPTSTR  argv[] );
+static OSStatus                        ServiceSpecificRun( int argc, LPTSTR argv[] );
+static OSStatus                        ServiceSpecificStop( void );
+static void                            ServiceSpecificFinalize( int argc, LPTSTR argv[] );
+static mStatus                 SetupServiceEvents();
+static mStatus                 TearDownServiceEvents();
+static mStatus                 SetupNotifications();
+static mStatus                 TearDownNotifications();
+static void CALLBACK   StopNotification( HANDLE event, void * context );
+static void CALLBACK   PowerSuspendNotification( HANDLE event, void * context );
+static void    CALLBACK        PowerResumeNotification( HANDLE event, void * context );
+static void CALLBACK   InterfaceListNotification( SOCKET socket, LPWSANETWORKEVENTS event, void *context );
+static void CALLBACK   ComputerDescriptionNotification( HANDLE event, void *context );
+static void CALLBACK   TCPChangedNotification( HANDLE event, void *context );
+static void CALLBACK   DDNSChangedNotification( HANDLE event, void *context );
+static void CALLBACK   FileSharingChangedNotification( HANDLE event, void *context );
+static void CALLBACK   FirewallChangedNotification( HANDLE event, void *context );
+static void CALLBACK   AdvertisedServicesChangedNotification( HANDLE event, void *context );
+static void CALLBACK   SPSWakeupNotification( HANDLE event, void *context );
+static void    CALLBACK        SPSSleepNotification( HANDLE event, void *context );
+static void CALLBACK   UDSAcceptNotification( SOCKET sock, LPWSANETWORKEVENTS event, void *context );
+static void CALLBACK   UDSReadNotification( SOCKET sock, LPWSANETWORKEVENTS event, void *context );
+static void                            CoreCallback(mDNS * const inMDNS, mStatus result);
+static mDNSu8                  SystemWakeForNetworkAccess( LARGE_INTEGER * timeout );
+static OSStatus                        GetRouteDestination(DWORD * ifIndex, DWORD * address);
+static OSStatus                        SetLLRoute( mDNS * const inMDNS );
+static bool                            HaveRoute( PMIB_IPFORWARDROW rowExtant, unsigned long addr, unsigned long metric );
+static bool                            IsValidAddress( const char * addr );
+static bool                            IsNortelVPN( IP_ADAPTER_INFO * pAdapter );
+static bool                            IsJuniperVPN( IP_ADAPTER_INFO * pAdapter );
+static bool                            IsCiscoVPN( IP_ADAPTER_INFO * pAdapter );
+static const char *            strnistr( const char * string, const char * subString, size_t max );
 
 #if defined(UNICODE)
 #      define StrLen(X)        wcslen(X)
@@ -188,8 +169,11 @@ DEBUG_LOCAL SERVICE_TABLE_ENTRY                    gServiceDispatchTable[] =
        { kServiceName, ServiceMain }, 
        { NULL,                 NULL }
 };
+DEBUG_LOCAL HANDLE                                             gStopEvent                                      = NULL;
+DEBUG_LOCAL HANDLE                                             gPowerSuspendEvent                      = NULL;
+DEBUG_LOCAL HANDLE                                             gPowerSuspendAckEvent           = NULL;
+DEBUG_LOCAL HANDLE                                             gPowerResumeEvent                       = NULL;
 DEBUG_LOCAL SOCKET                                             gInterfaceListChangedSocket     = INVALID_SOCKET;
-DEBUG_LOCAL HANDLE                                             gInterfaceListChangedEvent      = NULL;
 DEBUG_LOCAL HKEY                                               gDescKey                                        = NULL;
 DEBUG_LOCAL HANDLE                                             gDescChangedEvent                       = NULL; // Computer description changed event
 DEBUG_LOCAL HKEY                                               gTcpipKey                                       = NULL;
@@ -208,17 +192,11 @@ DEBUG_LOCAL HANDLE                                                gServiceEventSource             = NULL;
 DEBUG_LOCAL bool                                               gServiceAllowRemote             = false;
 DEBUG_LOCAL int                                                        gServiceCacheEntryCount = 0;    // 0 means to use the DNS-SD default.
 DEBUG_LOCAL bool                                               gServiceManageLLRouting = true;
-DEBUG_LOCAL int                                                        gWaitCount                              = 0;
-DEBUG_LOCAL HANDLE                                     *       gWaitList                               = NULL;
-DEBUG_LOCAL HANDLE                                             gStopEvent                              = NULL;
 DEBUG_LOCAL HANDLE                                             gSPSWakeupEvent                 = NULL;
 DEBUG_LOCAL HANDLE                                             gSPSSleepEvent                  = NULL;
-DEBUG_LOCAL HANDLE                                             gUDSEvent                               = NULL;
 DEBUG_LOCAL SocketRef                                  gUDSSocket                              = 0;
 DEBUG_LOCAL udsEventCallback                   gUDSCallback                    = NULL;
 DEBUG_LOCAL BOOL                                               gRetryFirewall                  = FALSE;
-DEBUG_LOCAL DWORD                                              gOSMajorVersion;
-DEBUG_LOCAL DWORD                                              gOSMinorVersion;
 
 typedef DWORD ( WINAPI * GetIpInterfaceEntryFunctionPtr )( PMIB_IPINTERFACE_ROW );
 mDNSlocal HMODULE                                                              gIPHelperLibraryInstance                = NULL;
@@ -836,6 +814,9 @@ int RunDirect( int argc, LPTSTR argv[] )
        
        initialized = FALSE;
 
+       err = SetupServiceEvents();
+       require_noerr( err, exit );
+
        // Install a Console Control Handler to handle things like control-c signals.
        
        ok = SetConsoleCtrlHandler( ConsoleControlHandler, TRUE );
@@ -860,6 +841,9 @@ exit:
        {
                ServiceSpecificFinalize( argc, argv );
        }
+
+       TearDownServiceEvents();
+
        return( err );
 }
 
@@ -875,6 +859,9 @@ static void WINAPI ServiceMain( DWORD argc, LPTSTR argv[] )
 {
        OSStatus                err;
        BOOL                    ok;
+
+       err = SetupServiceEvents();
+       require_noerr( err, exit );
        
        err = ServiceSetupEventLogging();
        check_noerr( err );
@@ -922,12 +909,15 @@ static void WINAPI ServiceMain( DWORD argc, LPTSTR argv[] )
        // Note: The service status handle should not be closed according to Microsoft documentation.
        
 exit:
+
        if( gServiceEventSource )
        {
                ok = DeregisterEventSource( gServiceEventSource );
                check_translated_errno( ok, GetLastError(), kUnknownErr );
                gServiceEventSource = NULL;
        }
+
+       TearDownServiceEvents();
 }
 
 //===========================================================================================================================
@@ -985,54 +975,6 @@ exit:
        return( err );
 }
 
-//===========================================================================================================================
-//     HandlePowerSuspend
-//===========================================================================================================================
-
-static void HandlePowerSuspend( void * v )
-{
-       LARGE_INTEGER   timeout;
-       BOOL                    ok;
-
-       ( void ) v;
-
-       dlog( kDebugLevelInfo, DEBUG_NAME "HandlePowerSuspend\n" );
-
-       gMDNSRecord.SystemWakeOnLANEnabled = SystemWakeForNetworkAccess( &timeout );
-                               
-       if ( gMDNSRecord.SystemWakeOnLANEnabled )
-       {
-               ok = SetWaitableTimer( gSPSWakeupEvent, &timeout, 0, NULL, NULL, TRUE );
-               check( ok );
-       }
-
-       mDNSCoreMachineSleep(&gMDNSRecord, TRUE);
-}
-
-
-//===========================================================================================================================
-//     HandlePowerResumeSuspend
-//===========================================================================================================================
-
-static void HandlePowerResumeSuspend( void * v )
-{
-       ( void ) v;
-
-       dlog( kDebugLevelInfo, DEBUG_NAME "HandlePowerResumeSuspend\n" );
-
-       if ( gSPSWakeupEvent )
-       {
-               CancelWaitableTimer( gSPSWakeupEvent );
-       }
-
-       if ( gSPSSleepEvent )
-       {
-               CancelWaitableTimer( gSPSSleepEvent );
-       }
-
-       mDNSCoreMachineSleep(&gMDNSRecord, FALSE);
-}
-
 
 //===========================================================================================================================
 //     ServiceControlHandler
@@ -1041,6 +983,7 @@ static void HandlePowerResumeSuspend( void * v )
 static DWORD WINAPI    ServiceControlHandler( DWORD inControl, DWORD inEventType, LPVOID inEventData, LPVOID inContext )
 {
        BOOL            setStatus;
+       OSStatus        err;
        BOOL            ok;
 
        DEBUG_UNUSED( inEventData );
@@ -1051,6 +994,7 @@ static DWORD WINAPI        ServiceControlHandler( DWORD inControl, DWORD inEventType, L
        {
                case SERVICE_CONTROL_STOP:
                case SERVICE_CONTROL_SHUTDOWN:
+                       
                        dlog( kDebugLevelInfo, DEBUG_NAME "ServiceControlHandler: SERVICE_CONTROL_STOP|SERVICE_CONTROL_SHUTDOWN\n" );
                        
                        ServiceStop();
@@ -1063,13 +1007,46 @@ static DWORD WINAPI     ServiceControlHandler( DWORD inControl, DWORD inEventType, L
                        {
                                dlog( kDebugLevelInfo, DEBUG_NAME "ServiceControlHandler: PBT_APMSUSPEND\n" );
 
-                               QueueUserAPC( ( PAPCFUNC ) HandlePowerSuspend, gMDNSRecord.p->mainThread, ( ULONG_PTR ) NULL );
+                               if ( gPowerSuspendEvent )
+                               {
+                                       ok = SetEvent( gPowerSuspendEvent );
+                                       err = translate_errno( ok, (OSStatus) GetLastError(), kUnknownErr );
+                                       check_noerr( err );
+
+                                       switch ( WaitForSingleObject( gPowerSuspendAckEvent, 5 * 1000 ) )
+                                       {
+                                               case WAIT_OBJECT_0:
+                                               {
+                                                       // No error
+                                               }
+                                               break;
+
+                                               case WAIT_TIMEOUT:
+                                               {
+                                                       dlog( kDebugLevelError, DEBUG_NAME "Timed out waiting for acknowledgement of machine sleep\n" );
+                                                       ReportStatus( EVENTLOG_ERROR_TYPE, "Timed out waiting for acknowledgement of machine sleep" );
+                                               }
+                                               break;
+
+                                               default:
+                                               {
+                                                       dlog( kDebugLevelError, DEBUG_NAME "Error waiting for acknowledgement of machine sleep: %d", GetLastError() );
+                                                       ReportStatus( EVENTLOG_ERROR_TYPE, "Error waiting for acknowledgement of machine sleep: %d", GetLastError() );
+                                               }
+                                               break;
+                                       }
+                               }
                        }
                        else if (inEventType == PBT_APMRESUMESUSPEND)
                        {
                                dlog( kDebugLevelInfo, DEBUG_NAME "ServiceControlHandler: PBT_APMRESUMESUSPEND\n" );
 
-                               QueueUserAPC( ( PAPCFUNC ) HandlePowerResumeSuspend, gMDNSRecord.p->mainThread, ( ULONG_PTR ) NULL );
+                               if ( gPowerResumeEvent )
+                               {
+                                       ok = SetEvent( gPowerResumeEvent );
+                                       err = translate_errno( ok, (OSStatus) GetLastError(), kUnknownErr );
+                                       check_noerr( err );
+                               }
                        }
                
                        break;
@@ -1115,8 +1092,44 @@ static OSStatus  ServiceRun( int argc, LPTSTR argv[] )
 
        // Initialize the service-specific stuff
        
-       err = ServiceSpecificInitialize( argc, argv );
-       require_noerr( err, exit );
+       while ( 1 )
+       {
+               DWORD ret;
+
+               ReportStatus( EVENTLOG_INFORMATION_TYPE, "Service initializing" );
+
+               err = ServiceSpecificInitialize( argc, argv );
+
+               if ( !err )
+               {
+                       ReportStatus( EVENTLOG_INFORMATION_TYPE, "Service initialized" );
+                       break;
+               }
+
+               ReportStatus( EVENTLOG_INFORMATION_TYPE, "Service initialization failed with err %d. Waiting %d seconds to retry...", err, kWaitToRetry );
+
+               ret = WaitForSingleObject( gStopEvent, 1000 * kWaitToRetry );
+
+               if ( ret == WAIT_OBJECT_0 )
+               {
+                       ReportStatus( EVENTLOG_INFORMATION_TYPE, "Service received a stop event" );
+                       goto exit;
+               }
+               else if ( ret == WAIT_OBJECT_0 + 1 )
+               {
+                       ReportStatus( EVENTLOG_INFORMATION_TYPE, "Service received a power suspend event" );
+               }
+               else if ( ret == WAIT_OBJECT_0 + 2 )
+               {
+                       ReportStatus( EVENTLOG_INFORMATION_TYPE, "Service received a power resume event" );
+               }
+               else if ( ret != WAIT_TIMEOUT )
+               {
+                       ReportStatus( EVENTLOG_INFORMATION_TYPE, "Service received an error in WaitForSingleObject() : %d, %d", ret, GetLastError() );
+                       goto exit;
+               }
+       }
+
        initialized = TRUE;
        
        err = CheckFirewall();
@@ -1128,19 +1141,23 @@ static OSStatus ServiceRun( int argc, LPTSTR argv[] )
        }
        
        // Run the service-specific stuff. This does not return until the service quits or is stopped.
-       
+
        ReportStatus( EVENTLOG_INFORMATION_TYPE, "Service started\n" );
+
        err = ServiceSpecificRun( argc, argv );
-       ReportStatus( EVENTLOG_INFORMATION_TYPE, "Service stopped (%d)\n", err );
        require_noerr( err, exit );
-       
+
+exit:
+
        // Service stopped. Clean up and we're done.
        
-exit:
+       ReportStatus( EVENTLOG_INFORMATION_TYPE, "Service stopped (%d)\n", err );
+       
        if( initialized )
        {
                ServiceSpecificFinalize( argc, argv );
        }
+       
        return( err );
 }
 
@@ -1166,6 +1183,7 @@ static void       ServiceStop( void )
        check_noerr( err );
 }
 
+
 #if 0
 #pragma mark -
 #pragma mark == Service Specific ==
@@ -1177,9 +1195,7 @@ static void       ServiceStop( void )
 
 static OSStatus        ServiceSpecificInitialize( int argc, LPTSTR argv[] )
 {
-       OSVERSIONINFO osInfo;
        OSStatus err;
-       BOOL ok;
        
        DEBUG_UNUSED( argc );
        DEBUG_UNUSED( argv );
@@ -1187,8 +1203,6 @@ static OSStatus   ServiceSpecificInitialize( int argc, LPTSTR argv[] )
        mDNSPlatformMemZero( &gMDNSRecord, sizeof gMDNSRecord);
        mDNSPlatformMemZero( &gPlatformStorage, sizeof gPlatformStorage);
 
-       gPlatformStorage.registerWaitableEventFunc = RegisterWaitableEvent;
-       gPlatformStorage.unregisterWaitableEventFunc = UnregisterWaitableEvent;
        gPlatformStorage.reportStatusFunc = ReportStatus;
 
        err = mDNS_Init( &gMDNSRecord, &gPlatformStorage, gRRCache, RR_CACHE_SIZE, mDNS_Init_AdvertiseLocalAddresses, CoreCallback, mDNS_Init_NoInitCallbackContext); 
@@ -1200,16 +1214,6 @@ static OSStatus  ServiceSpecificInitialize( int argc, LPTSTR argv[] )
        err = udsserver_init(mDNSNULL, 0);
        require_noerr( err, exit);
 
-       //
-       // Get the version of Windows that we're running on
-       //
-       osInfo.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
-       ok = GetVersionEx( &osInfo );
-       err = translate_errno( ok, (OSStatus) GetLastError(), kUnknownErr );
-       require_noerr( err, exit );
-       gOSMajorVersion = osInfo.dwMajorVersion;
-       gOSMinorVersion = osInfo.dwMinorVersion;
-
        SetLLRoute( &gMDNSRecord );
 
 exit:
@@ -1226,361 +1230,101 @@ exit:
 
 static OSStatus        ServiceSpecificRun( int argc, LPTSTR argv[] )
 {
-       HANDLE  *       waitList;
-       int                     waitListCount;
-       DWORD           timeout;
-       DWORD           result;
-       BOOL            done;
-       mStatus         err;
+       mDNSBool done = mDNSfalse;
+       mStatus err = mStatus_NoError;
        
        DEBUG_UNUSED( argc );
        DEBUG_UNUSED( argv );
 
-       timeout = ( gRetryFirewall ) ? kRetryFirewallPeriod : INFINITE;
-
        err = SetupInterfaceList( &gMDNSRecord );
        check( !err );
 
        err = uDNS_SetupDNSConfig( &gMDNSRecord );
        check( !err );
 
-       done = FALSE;
-
-       // Main event loop.
-
        while( !done )
        {
-               waitList                = NULL;
-               waitListCount   = 0;
-
-               err = SetupWaitList( &gMDNSRecord, &waitList, &waitListCount );
-               require_noerr( err, exit );
-
-               gEventSourceListChanged = FALSE;
-
-               while ( !gEventSourceListChanged )
-               {
-                       static mDNSs32 RepeatedBusy = 0;        
-                       mDNSs32 nextTimerEvent;
+               static mDNSs32 RepeatedBusy = 0;        
+               mDNSs32 nextTimerEvent;
+               mStatus err;
 
-                       // Give the mDNS core a chance to do its work and determine next event time.
+               // Give the mDNS core a chance to do its work and determine next event time.
 
-                       nextTimerEvent = udsserver_idle( mDNS_Execute( &gMDNSRecord ) - mDNS_TimeNow( &gMDNSRecord ) );
+               nextTimerEvent = udsserver_idle( mDNS_Execute( &gMDNSRecord ) - mDNS_TimeNow( &gMDNSRecord ) );
 
-                       if      ( nextTimerEvent < 0)                                   nextTimerEvent = 0;
-                       else if ( nextTimerEvent > (0x7FFFFFFF / 1000)) nextTimerEvent = 0x7FFFFFFF / mDNSPlatformOneSecond;
-                       else                                                                                    nextTimerEvent = ( nextTimerEvent * 1000) / mDNSPlatformOneSecond;
+               if      ( nextTimerEvent < 0)                                   nextTimerEvent = 0;
+               else if ( nextTimerEvent > (0x7FFFFFFF / 1000)) nextTimerEvent = 0x7FFFFFFF / mDNSPlatformOneSecond;
+               else                                                                                    nextTimerEvent = ( nextTimerEvent * 1000) / mDNSPlatformOneSecond;
 
-                       // Debugging sanity check, to guard against CPU spins
+               // Debugging sanity check, to guard against CPU spins
                        
-                       if ( nextTimerEvent > 0 )
+               if ( nextTimerEvent > 0 )
+               {
+                       RepeatedBusy = 0;
+               }
+               else
+               {
+                       nextTimerEvent = 1;
+
+                       if ( ++RepeatedBusy >= mDNSPlatformOneSecond )
                        {
+                               ShowTaskSchedulingError( &gMDNSRecord );
                                RepeatedBusy = 0;
                        }
-                       else
-                       {
-                               nextTimerEvent = 1;
+               }
 
-                               if ( ++RepeatedBusy >= mDNSPlatformOneSecond )
-                               {
-                                       ShowTaskSchedulingError( &gMDNSRecord );
-                                       RepeatedBusy = 0;
-                               }
-                       }
+               if ( gMDNSRecord.ShutdownTime )
+               {
+                       mDNSs32 now = mDNS_TimeNow( &gMDNSRecord );
 
-                       if ( gMDNSRecord.ShutdownTime )
+                       if ( mDNS_ExitNow( &gMDNSRecord, now ) )
                        {
-                               mDNSs32 now = mDNS_TimeNow( &gMDNSRecord );
-
-                               if ( mDNS_ExitNow( &gMDNSRecord, now ) )
-                               {
-                                       mDNS_FinalExit( &gMDNSRecord );
-                                       done = TRUE;
-                                       break;
-                               }
-
-                               if ( nextTimerEvent - gMDNSRecord.ShutdownTime >= 0 )
-                               {
-                                       nextTimerEvent = gMDNSRecord.ShutdownTime;
-                               }
+                               mDNS_FinalExit( &gMDNSRecord );
+                               done = TRUE;
+                               break;
                        }
 
-                       // Wait until something occurs (e.g. cancel, incoming packet, or timeout).
-                       //
-                       // Note: There seems to be a bug in WinSock with respect to Alertable I/O. According
-                       // to MSDN <http://msdn.microsoft.com/en-us/library/aa363772(VS.85).aspx>, Alertable I/O
-                       // callbacks will only be invoked during the following calls (when the caller sets
-                       // the appropriate flag):
-                       //
-                       // - SleepEx
-                       // - WaitForSingleObjectEx
-                       // - WaitForMultipleObjectsEx
-                       // - SignalObjectAndWait
-                       // - MsgWaitForMultipleObjectsEx
-                       //
-                       // However, we have seen callbacks be invoked during calls to bind() (and maybe others). If there
-                       // weren't a bug, then socket events would only be queued during the call to WaitForMultipleObjects() and
-                       // we'd only have to check them once afterwards. However since that doesn't seem to be the case, we'll
-                       // check the queue both before we call WaitForMultipleObjects() and after.
-
-                       DispatchSocketEvents( &gMDNSRecord );
-                       result = WaitForMultipleObjectsEx( ( DWORD ) waitListCount, waitList, FALSE, (DWORD) nextTimerEvent, TRUE );
-                       check( result != WAIT_FAILED );
-                       DispatchSocketEvents( &gMDNSRecord );
-
-                       if ( result != WAIT_FAILED )
+                       if ( nextTimerEvent - gMDNSRecord.ShutdownTime >= 0 )
                        {
-                               if ( result == WAIT_TIMEOUT )
-                               {
-                                       // Next task timeout occurred. Loop back up to give mDNS core a chance to work.
-                                       
-                                       dlog( kDebugLevelChatty - 1, DEBUG_NAME "timeout\n" );
-                                       continue;
-                               }
-                               else if ( result == WAIT_IO_COMPLETION )
-                               {
-                                       dlog( kDebugLevelChatty - 1, DEBUG_NAME "i/o completion\n" );
-                                       continue;
-                               }
-                               else if ( result == kWaitListStopEvent )
-                               {
-                                       // Stop event. Set the done flag and break to exit.
-                                       
-                                       dlog( kDebugLevelVerbose, DEBUG_NAME "stopping...\n" );
-                                       udsserver_exit();
-                                       mDNS_StartExit( &gMDNSRecord );
-                                       break;
-                               }
-                               else if( result == kWaitListInterfaceListChangedEvent )
-                               {
-                                       int             inBuffer;
-                                       int             outBuffer;
-                                       DWORD   outSize;
-
-                                       // It would be nice to come up with a more elegant solution to this, but it seems that
-                                       // GetAdaptersAddresses doesn't always stay in sync after network changed events.  So as
-                                       // as a simple workaround, we'll pause for a couple of seconds before processing the change.
-
-                                       // We arrived at 2 secs by trial and error. We could reproduce the problem after sleeping
-                                       // for 500 msec and 750 msec, but couldn't after sleeping for 1 sec.  We added another
-                                       // second on top of that to account for machine load or some other exigency.
-
-                                       Sleep( 2000 );
-
-                                       // Interface list changed event. Break out of the inner loop to re-setup the wait list.
-                                       
-                                       InterfaceListDidChange( &gMDNSRecord );
-
-                                       // reset the event handler
-                                       inBuffer        = 0;
-                                       outBuffer       = 0;
-                                       err = WSAIoctl( gInterfaceListChangedSocket, SIO_ADDRESS_LIST_CHANGE, &inBuffer, 0, &outBuffer, 0, &outSize, NULL, NULL );
-                                       if( err < 0 )
-                                       {
-                                               check( errno_compat() == WSAEWOULDBLOCK );
-                                       }
-                               }
-                               else if ( result == kWaitListComputerDescriptionEvent )
-                               {
-                                       // The computer description might have changed
-                                       
-                                       ComputerDescriptionDidChange( &gMDNSRecord );
-                                       udsserver_handle_configchange( &gMDNSRecord );
-
-                                       // and reset the event handler
-                                       if ( ( gDescKey != NULL ) && ( gDescChangedEvent != NULL ) )
-                                       {
-                                               err = RegNotifyChangeKeyValue( gDescKey, TRUE, REG_NOTIFY_CHANGE_LAST_SET, gDescChangedEvent, TRUE);
-                                               check_noerr( err );
-                                       }
-                               }
-                               else if ( result == kWaitListTCPIPEvent )
-                               {       
-                                       // The TCP/IP might have changed
-
-                                       TCPIPConfigDidChange( &gMDNSRecord );
-                                       udsserver_handle_configchange( &gMDNSRecord );
-
-                                       // and reset the event handler
-
-                                       if ( ( gTcpipKey != NULL ) && ( gTcpipChangedEvent ) )
-                                       {
-                                               err = RegNotifyChangeKeyValue( gTcpipKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gTcpipChangedEvent, TRUE );
-                                               check_noerr( err );
-                                       }
-                               }
-                               else if ( result == kWaitListDynDNSEvent )
-                               {
-                                       // The DynDNS config might have changed
-
-                                       DynDNSConfigDidChange( &gMDNSRecord );
-                                       udsserver_handle_configchange( &gMDNSRecord );
-
-                                       // and reset the event handler
-
-                                       if ((gDdnsKey != NULL) && (gDdnsChangedEvent))
-                                       {
-                                               err = RegNotifyChangeKeyValue(gDdnsKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gDdnsChangedEvent, TRUE);
-                                               check_noerr( err );
-                                       }
-                               }
-                               else if ( result == kWaitListFileShareEvent )
-                               {
-                                       // File sharing changed
-
-                                       FileSharingDidChange( &gMDNSRecord );
-
-                                       // and reset the event handler
-
-                                       if ((gFileSharingKey != NULL) && (gFileSharingChangedEvent))
-                                       {
-                                               err = RegNotifyChangeKeyValue(gFileSharingKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gFileSharingChangedEvent, TRUE);
-                                               check_noerr( err );
-                                       }
-                               }
-                               else if ( result == kWaitListFirewallEvent )
-                               {
-                                       // Firewall configuration changed
-
-                                       FirewallDidChange( &gMDNSRecord );
-
-                                       // and reset the event handler
-
-                                       if ((gFirewallKey != NULL) && (gFirewallChangedEvent))
-                                       {
-                                               err = RegNotifyChangeKeyValue(gFirewallKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gFirewallChangedEvent, TRUE);
-                                               check_noerr( err );
-                                       }
-                               }
-                               else if ( result == kWaitListAdvertisedServicesEvent )
-                               {
-                                       // Ultimately we'll want to manage multiple services, but right now the only service
-                                       // we'll be managing is SMB.
-
-                                       FileSharingDidChange( &gMDNSRecord );
-
-                                       // and reset the event handler
-
-                                       if ( ( gAdvertisedServicesKey != NULL ) && ( gAdvertisedServicesChangedEvent ) )
-                                       {
-                                               err = RegNotifyChangeKeyValue(gAdvertisedServicesKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gAdvertisedServicesChangedEvent, TRUE);
-                                               check_noerr( err );
-                                       }
-                               }
-                               else if ( result == kWaitListSPSWakeupEvent )
-                               {
-                                       LARGE_INTEGER timeout;
-
-                                       ReportStatus( EVENTLOG_INFORMATION_TYPE, "Maintenance wake" );
-
-                                       timeout.QuadPart  = kSPSMaintenanceWakePeriod;
-                                       timeout.QuadPart *= kSecondsTo100NSUnits;
-
-                                       SetWaitableTimer( gSPSSleepEvent, &timeout, 0, NULL, NULL, TRUE );
-                               }
-                               else if ( result == kWaitListSPSSleepEvent )
-                               {
-                                       ReportStatus( EVENTLOG_INFORMATION_TYPE, "Returning to sleep after maintenance wake" );
-
-                                       // Calling SetSuspendState() doesn't invoke our sleep handlers, so we'll
-                                       // call HandlePowerSuspend() explicity.  This will reset the 
-                                       // maintenance wake timers.
-
-                                       HandlePowerSuspend( NULL );
-                                       SetSuspendState( FALSE, FALSE, FALSE );
-                               }
-                               else
-                               {
-                                       int waitItemIndex;
-
-                                       waitItemIndex = (int)( ( (int) result ) - WAIT_OBJECT_0 );
-                                       dlog( kDebugLevelChatty, DEBUG_NAME "waitable event on %d\n", waitItemIndex );
-                                       check( ( waitItemIndex >= 0 ) && ( waitItemIndex < waitListCount ) );
-
-                                       if ( ( waitItemIndex >= 0 ) && ( waitItemIndex < waitListCount ) )
-                                       {
-                                               HANDLE  signaledEvent;
-                                               int             n = 0;
-                                               
-                                               signaledEvent = waitList[ waitItemIndex ];
-
-                                               // If gCurrentSource is not NULL, then this routine has been called
-                                               // re-entrantly which should never happen.
-
-                                               check( !gCurrentSource );
-
-                                               for ( gCurrentSource = gEventSourceList; gCurrentSource; )
-                                               {
-                                                       EventSource * current = gCurrentSource;
-
-                                                       if ( gCurrentSource->event == signaledEvent )
-                                                       {
-                                                               gCurrentSource->handler( &gMDNSRecord, gCurrentSource->event, gCurrentSource->context );
-                                                               ++n;
-                                                               break;
-                                                       }
-
-                                                       // If the current node was removed as a result of calling
-                                                       // the handler, then gCurrentSource was already incremented to
-                                                       // the next node.  If it wasn't removed, then increment it
-                                                       // ourselves
-
-                                                       if ( gCurrentSource == current )
-                                                       {
-                                                               gCurrentSource = gCurrentSource->next;
-                                                       }
-                                               }
+                               nextTimerEvent = gMDNSRecord.ShutdownTime;
+                       }
+               }
 
-                                               gCurrentSource = NULL;
+               err = mDNSPoll( nextTimerEvent );
 
-                                               check( n > 0 );
-                                       }
-                                       else
-                                       {
-                                               dlog( kDebugLevelWarning, DEBUG_NAME "%s: unexpected wait result (result=0x%08X)\n", __ROUTINE__, result );
-                                       }
-                               }
-                       }
-                       else
-                       {
-                               Sleep( 3 * 1000 );
+               if ( err )
+               {
+                       Sleep( 3 * 1000 );
                                
-                               err = SetupInterfaceList( &gMDNSRecord );
-                               check( !err );
+                       err = SetupInterfaceList( &gMDNSRecord );
+                       check( !err );
 
-                               err = uDNS_SetupDNSConfig( &gMDNSRecord );
-                               check( !err );
+                       err = uDNS_SetupDNSConfig( &gMDNSRecord );
+                       check( !err );
                                
-                               break;
-                       }
-               }
-
-               if ( waitList )
-               {
-                       free( waitList );
-                       waitList = NULL;
-                       waitListCount = 0;
+                       break;
                }
        }
 
-exit:
-
-       return( 0 );
+       return ( err );
 }
 
+
 //===========================================================================================================================
 //     ServiceSpecificStop
 //===========================================================================================================================
 
 static OSStatus        ServiceSpecificStop( void )
 {
-       OSStatus        err;
-       BOOL            ok;
+       OSStatus    err;
+       BOOL        ok;
 
        ok = SetEvent(gStopEvent);
        err = translate_errno( ok, (OSStatus) GetLastError(), kUnknownErr );
        require_noerr( err, exit );
+
 exit:
+
        return( err );
 }
 
@@ -1593,14 +1337,6 @@ static void      ServiceSpecificFinalize( int argc, LPTSTR argv[] )
        DEBUG_UNUSED( argc );
        DEBUG_UNUSED( argv );
        
-       //
-       // clean up any open sessions
-       //
-       while ( gEventSourceList )
-       {
-               UnregisterWaitableEvent( &gMDNSRecord, gEventSourceList->event );
-       }
-
        //
        // clean up the notifications
        //
@@ -1620,6 +1356,47 @@ static void      ServiceSpecificFinalize( int argc, LPTSTR argv[] )
 }
 
 
+//===========================================================================================================================
+//     SetupServiceEvents
+//===========================================================================================================================
+
+mDNSlocal mStatus      SetupServiceEvents()
+{
+       mStatus err;
+       
+       // Stop Event
+
+       gStopEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+       err = translate_errno( gStopEvent, (mStatus) GetLastError(), kUnknownErr );
+       require_noerr( err, exit );
+
+exit:
+
+       if ( err )
+       {
+               TearDownServiceEvents();
+       }
+
+       return err;
+}
+
+
+//===========================================================================================================================
+//     TearDownServiceNotifications
+//===========================================================================================================================
+
+mDNSlocal mStatus      TearDownServiceEvents()
+{
+       if ( gStopEvent )
+       {
+               CloseHandle( gStopEvent );
+               gStopEvent = NULL;
+       }
+
+       return mStatus_NoError;
+}
+
+
 //===========================================================================================================================
 //     SetupNotifications
 //===========================================================================================================================
@@ -1632,17 +1409,35 @@ mDNSlocal mStatus       SetupNotifications()
        int                                     inBuffer;
        int                                     outBuffer;
        DWORD                           outSize;
-       
-       gStopEvent      =       CreateEvent(NULL, FALSE, FALSE, NULL);
-       err = translate_errno( gStopEvent, errno_compat(), kNoResourcesErr );
+
+       require_action( gStopEvent, exit, err = kUnknownErr );
+       err = mDNSPollRegisterEvent( gStopEvent, StopNotification, NULL );
        require_noerr( err, exit );
 
-       // Register to listen for address list changes.
-       
-       gInterfaceListChangedEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
-       err = translate_errno( gInterfaceListChangedEvent, (mStatus) GetLastError(), kUnknownErr );
+       // Power Suspend
+
+       gPowerSuspendEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+       err = translate_errno( gPowerSuspendEvent, (mStatus) GetLastError(), kUnknownErr );
+       require_noerr( err, exit );
+       err = mDNSPollRegisterEvent( gPowerSuspendEvent, PowerSuspendNotification, NULL );
        require_noerr( err, exit );
 
+       // Power Suspend Ack
+
+       gPowerSuspendAckEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
+       err = translate_errno( gPowerSuspendAckEvent, ( mStatus ) GetLastError(), kUnknownErr );
+       require_noerr( err, exit );
+
+       // Power Resume
+
+       gPowerResumeEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+       err = translate_errno( gPowerResumeEvent, (mStatus) GetLastError(), kUnknownErr );
+       require_noerr( err, exit );
+       err = mDNSPollRegisterEvent( gPowerResumeEvent, PowerResumeNotification, NULL );
+       require_noerr( err, exit );
+
+       // Register to listen for address list changes.
+       
        sock = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
        err = translate_errno( IsValidSocket( sock ), errno_compat(), kUnknownErr );
        require_noerr( err, exit );
@@ -1663,11 +1458,10 @@ mDNSlocal mStatus       SetupNotifications()
        {
                check( errno_compat() == WSAEWOULDBLOCK );
        }
-       
-       err = WSAEventSelect( sock, gInterfaceListChangedEvent, FD_ADDRESS_LIST_CHANGE );
-       err = translate_errno( err == 0, errno_compat(), kUnknownErr );
-       require_noerr( err, exit );
 
+       err = mDNSPollRegisterSocket( sock, FD_ADDRESS_LIST_CHANGE, InterfaceListNotification, NULL );
+       require_noerr( err, exit );
+       
        gDescChangedEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
        err = translate_errno( gDescChangedEvent, (mStatus) GetLastError(), kUnknownErr );
        require_noerr( err, exit );
@@ -1681,29 +1475,32 @@ mDNSlocal mStatus       SetupNotifications()
                require_noerr( err, exit );
        }
 
+       err = mDNSPollRegisterEvent( gDescChangedEvent, ComputerDescriptionNotification, NULL );
+       require_noerr( err, exit );
+
        // This will catch all changes to tcp/ip networking, including changes to the domain search list
 
        gTcpipChangedEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
        err = translate_errno( gTcpipChangedEvent, (mStatus) GetLastError(), kUnknownErr );
        require_noerr( err, exit );
-
        err = RegCreateKey( HKEY_LOCAL_MACHINE, TEXT("SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters"), &gTcpipKey );
        require_noerr( err, exit );
-
        err = RegNotifyChangeKeyValue( gTcpipKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gTcpipChangedEvent, TRUE);
        require_noerr( err, exit );
+       err = mDNSPollRegisterEvent( gTcpipChangedEvent, TCPChangedNotification, NULL );
+       require_noerr( err, exit );
 
        // This will catch all changes to ddns configuration
 
        gDdnsChangedEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
        err = translate_errno( gDdnsChangedEvent, (mStatus) GetLastError(), kUnknownErr );
        require_noerr( err, exit );
-
        err = RegCreateKey( HKEY_LOCAL_MACHINE, kServiceParametersNode TEXT("\\DynDNS\\Setup"), &gDdnsKey );
        require_noerr( err, exit );
-
        err = RegNotifyChangeKeyValue( gDdnsKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gDdnsChangedEvent, TRUE);
        require_noerr( err, exit );
+       err = mDNSPollRegisterEvent( gDdnsChangedEvent, DDNSChangedNotification, NULL );
+       require_noerr( err, exit );
 
        // This will catch all changes to file sharing
 
@@ -1721,6 +1518,8 @@ mDNSlocal mStatus SetupNotifications()
        {
                err = RegNotifyChangeKeyValue( gFileSharingKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gFileSharingChangedEvent, TRUE);
                require_noerr( err, exit );
+               err = mDNSPollRegisterEvent( gFileSharingChangedEvent, FileSharingChangedNotification, NULL );
+               require_noerr( err, exit );
        }
        else
        {
@@ -1743,6 +1542,8 @@ mDNSlocal mStatus SetupNotifications()
        {
                err = RegNotifyChangeKeyValue( gFirewallKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gFirewallChangedEvent, TRUE);
                require_noerr( err, exit );
+               err = mDNSPollRegisterEvent( gFirewallChangedEvent, FirewallChangedNotification, NULL );
+               require_noerr( err, exit );
        }
        else
        {
@@ -1754,23 +1555,27 @@ mDNSlocal mStatus       SetupNotifications()
        gAdvertisedServicesChangedEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
        err = translate_errno( gAdvertisedServicesChangedEvent, (mStatus) GetLastError(), kUnknownErr );
        require_noerr( err, exit );
-
        err = RegCreateKey( HKEY_LOCAL_MACHINE, kServiceParametersNode TEXT("\\Services"), &gAdvertisedServicesKey );
        require_noerr( err, exit );
-
        err = RegNotifyChangeKeyValue( gAdvertisedServicesKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gAdvertisedServicesChangedEvent, TRUE);
        require_noerr( err, exit );
+       err = mDNSPollRegisterEvent( gAdvertisedServicesChangedEvent, AdvertisedServicesChangedNotification, NULL );
+       require_noerr( err, exit );
+
+       // SPSWakeup timer
 
        gSPSWakeupEvent = CreateWaitableTimer( NULL, FALSE, NULL );
        err = translate_errno( gSPSWakeupEvent, (mStatus) GetLastError(), kUnknownErr );
        require_noerr( err, exit );
+       err = mDNSPollRegisterEvent( gSPSWakeupEvent, SPSWakeupNotification, NULL );
+       require_noerr( err, exit );
+
+       // SPSSleep timer
 
        gSPSSleepEvent = CreateWaitableTimer( NULL, FALSE, NULL );
        err = translate_errno( gSPSSleepEvent, (mStatus) GetLastError(), kUnknownErr );
        require_noerr( err, exit );
-
-       gUDSEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
-       err = translate_errno( gUDSEvent, ( mStatus ) GetLastError(), kUnknownErr );
+       err = mDNSPollRegisterEvent( gSPSSleepEvent, SPSSleepNotification, NULL );
        require_noerr( err, exit );
 
 exit:
@@ -1787,26 +1592,17 @@ exit:
 
 mDNSlocal mStatus      TearDownNotifications()
 {
-       if ( gStopEvent )
-       {
-               CloseHandle( gStopEvent );
-               gStopEvent = NULL;
-       }
-
        if( IsValidSocket( gInterfaceListChangedSocket ) )
        {
+               mDNSPollUnregisterSocket( gInterfaceListChangedSocket );
+
                close_compat( gInterfaceListChangedSocket );
                gInterfaceListChangedSocket = kInvalidSocketRef;
        }
 
-       if( gInterfaceListChangedEvent )
-       {
-               CloseHandle( gInterfaceListChangedEvent );
-               gInterfaceListChangedEvent = 0;
-       }
-
        if ( gDescChangedEvent != NULL )
        {
+               mDNSPollUnregisterEvent( gDescChangedEvent );
                CloseHandle( gDescChangedEvent );
                gDescChangedEvent = NULL;
        }
@@ -1819,12 +1615,14 @@ mDNSlocal mStatus       TearDownNotifications()
 
        if ( gTcpipChangedEvent != NULL )
        {
+               mDNSPollUnregisterEvent( gTcpipChangedEvent );
                CloseHandle( gTcpipChangedEvent );
                gTcpipChangedEvent = NULL;
        }
 
        if ( gDdnsChangedEvent != NULL )
        {
+               mDNSPollUnregisterEvent( gDdnsChangedEvent );
                CloseHandle( gDdnsChangedEvent );
                gDdnsChangedEvent = NULL;
        }
@@ -1837,6 +1635,7 @@ mDNSlocal mStatus TearDownNotifications()
 
        if ( gFileSharingChangedEvent != NULL )
        {
+               mDNSPollUnregisterEvent( gFileSharingChangedEvent );
                CloseHandle( gFileSharingChangedEvent );
                gFileSharingChangedEvent = NULL;
        }
@@ -1849,6 +1648,7 @@ mDNSlocal mStatus TearDownNotifications()
 
        if ( gFirewallChangedEvent != NULL )
        {
+               mDNSPollUnregisterEvent( gFirewallChangedEvent );
                CloseHandle( gFirewallChangedEvent );
                gFirewallChangedEvent = NULL;
        }
@@ -1861,6 +1661,7 @@ mDNSlocal mStatus TearDownNotifications()
 
        if ( gAdvertisedServicesChangedEvent != NULL )
        {
+               mDNSPollUnregisterEvent( gAdvertisedServicesChangedEvent );
                CloseHandle( gAdvertisedServicesChangedEvent );
                gAdvertisedServicesChangedEvent = NULL;
        }
@@ -1873,159 +1674,304 @@ mDNSlocal mStatus     TearDownNotifications()
 
        if ( gSPSWakeupEvent )
        {
+               mDNSPollUnregisterEvent( gSPSWakeupEvent );
                CloseHandle( gSPSWakeupEvent );
                gSPSWakeupEvent = NULL;
        }
 
        if ( gSPSSleepEvent )
        {
+               mDNSPollUnregisterEvent( gSPSSleepEvent );
                CloseHandle( gSPSSleepEvent );
                gSPSSleepEvent = NULL;
        }
 
+       if ( gPowerResumeEvent )
+       {
+               mDNSPollUnregisterEvent( gPowerResumeEvent );
+               CloseHandle( gPowerResumeEvent );
+               gPowerResumeEvent = NULL;
+       }
+
+       if ( gPowerSuspendAckEvent )
+       {
+               CloseHandle( gPowerSuspendAckEvent );
+               gPowerSuspendAckEvent = NULL;
+       }
+
+       if ( gPowerSuspendEvent )
+       {
+               mDNSPollUnregisterEvent( gPowerSuspendEvent );
+               CloseHandle( gPowerSuspendEvent );
+               gPowerSuspendEvent = NULL;
+       }
+
+       if ( gStopEvent )
+       {
+               mDNSPollUnregisterEvent( gStopEvent );
+       }
+
        return( mStatus_NoError );
 }
 
 
-//===========================================================================================================================
-//     RegisterWaitableEvent
-//===========================================================================================================================
+mDNSlocal void CALLBACK
+StopNotification( HANDLE event, void *context )
+{
+       DEBUG_UNUSED( event );
+       DEBUG_UNUSED( context );
 
-static mStatus RegisterWaitableEvent( mDNS * const inMDNS, HANDLE event, void * context, RegisterWaitableEventHandler handler )
+       dlog( kDebugLevelVerbose, DEBUG_NAME "stopping...\n" );
+       udsserver_exit();
+       mDNS_StartExit( &gMDNSRecord );
+}
+
+
+mDNSlocal void CALLBACK
+PowerSuspendNotification( HANDLE event, void * context )
 {
-       EventSource * source;
-       mStatus err = mStatus_NoError;
+       LARGE_INTEGER   timeout;
+       BOOL                    ok;
+
+       DEBUG_UNUSED( event );
+       DEBUG_UNUSED( context );
 
-       ( void ) inMDNS;
-       check( event );
-       check( handler );
+       dlog( kDebugLevelInfo, DEBUG_NAME "PowerSuspendNotification\n" );
 
-       source = ( EventSource* ) malloc( sizeof( EventSource ) );
-       require_action( source, exit, err = mStatus_NoMemoryErr );
-       mDNSPlatformMemZero( source, sizeof( EventSource ) );
-       source->event = event;
-       source->context = context;
-       source->handler = handler;
+       gMDNSRecord.SystemWakeOnLANEnabled = SystemWakeForNetworkAccess( &timeout );
+                               
+       if ( gMDNSRecord.SystemWakeOnLANEnabled )
+       {
+               ok = SetWaitableTimer( gSPSWakeupEvent, &timeout, 0, NULL, NULL, TRUE );
+               check( ok );
+       }
 
-       source->next                    = gEventSourceList;
-       gEventSourceList                = source;
-       gEventSourceListChanged = TRUE;
-       gEventSources++;
+       mDNSCoreMachineSleep(&gMDNSRecord, TRUE);
 
-exit:
+       ok = SetEvent( gPowerSuspendAckEvent );
 
-       return err;
+       if ( !ok )
+       {
+               dlog( kDebugLevelError, DEBUG_NAME "PowerSuspendNotification: error while setting acknowledgement: %d", GetLastError() );
+               ReportStatus( EVENTLOG_ERROR_TYPE, "PowerSuspendNotification: error while setting acknowledgement: %d", GetLastError() );
+       }
 }
 
 
-//===========================================================================================================================
-//     UnregisterWaitableEvent
-//===========================================================================================================================
+mDNSlocal void CALLBACK
+PowerResumeNotification( HANDLE event, void * context )
+{
+       DEBUG_UNUSED( event );
+       DEBUG_UNUSED( context );
+
+       dlog( kDebugLevelInfo, DEBUG_NAME "PowerResumeNotification\n" );
 
-static void UnregisterWaitableEvent( mDNS * const inMDNS, HANDLE event )
+       if ( gSPSWakeupEvent )
+       {
+               CancelWaitableTimer( gSPSWakeupEvent );
+       }
+
+       if ( gSPSSleepEvent )
+       {
+               CancelWaitableTimer( gSPSSleepEvent );
+       }
+
+       mDNSCoreMachineSleep(&gMDNSRecord, FALSE);
+}
+
+
+
+mDNSlocal void CALLBACK
+InterfaceListNotification( SOCKET socket, LPWSANETWORKEVENTS event, void *context )
 {
-       EventSource     *       current = gEventSourceList;
-       EventSource     *       last    = NULL;
+       int             inBuffer;
+       int             outBuffer;
+       DWORD   outSize;
+       int             err;
+
+       DEBUG_UNUSED( socket );
+       DEBUG_UNUSED( event );
+       DEBUG_UNUSED( context );
 
-       ( void ) inMDNS;
-       check( event );
+       // It would be nice to come up with a more elegant solution to this, but it seems that
+       // GetAdaptersAddresses doesn't always stay in sync after network changed events.  So as
+       // as a simple workaround, we'll pause for a couple of seconds before processing the change.
 
-       while ( current )
+       // We arrived at 2 secs by trial and error. We could reproduce the problem after sleeping
+       // for 500 msec and 750 msec, but couldn't after sleeping for 1 sec.  We added another
+       // second on top of that to account for machine load or some other exigency.
+
+       Sleep( 2000 );
+
+       // Interface list changed event. Break out of the inner loop to re-setup the wait list.
+                                       
+       InterfaceListDidChange( &gMDNSRecord );
+
+       // reset the event handler
+       inBuffer        = 0;
+       outBuffer       = 0;
+       err = WSAIoctl( gInterfaceListChangedSocket, SIO_ADDRESS_LIST_CHANGE, &inBuffer, 0, &outBuffer, 0, &outSize, NULL, NULL );
+       if( err < 0 )
        {
-               if ( current->event == event )
-               {
-                       if ( last == NULL )
-                       {
-                               gEventSourceList = current->next;
-                       }
-                       else
-                       {
-                               last->next = current->next;
-                       }
+               check( errno_compat() == WSAEWOULDBLOCK );
+       }
+}
 
-                       gEventSourceListChanged = TRUE;
 
-                       // Protect against removing the node that we happen
-                       // to be looking at as we iterate through the event
-                       // source list in ServiceSpecificRun()
+mDNSlocal void CALLBACK
+ComputerDescriptionNotification( HANDLE event, void *context )
+{
+       // The computer description might have changed
+                                       
+       DEBUG_UNUSED( event );
+       DEBUG_UNUSED( context );
 
-                       if ( current == gCurrentSource )
-                       {
-                               gCurrentSource = current->next;
-                       }
+       ComputerDescriptionDidChange( &gMDNSRecord );
+       udsserver_handle_configchange( &gMDNSRecord );
 
-                       gEventSources--;
-                       free( current );
+       // and reset the event handler
+       if ( ( gDescKey != NULL ) && ( gDescChangedEvent != NULL ) )
+       {
+               int err = RegNotifyChangeKeyValue( gDescKey, TRUE, REG_NOTIFY_CHANGE_LAST_SET, gDescChangedEvent, TRUE);
+               check_noerr( err );
+       }
+}
 
-                       break;
-               }
 
-               last    = current;
-               current = current->next;
+mDNSlocal void CALLBACK
+TCPChangedNotification( HANDLE event, void *context )
+{
+       // The TCP/IP might have changed
+
+       DEBUG_UNUSED( event );
+       DEBUG_UNUSED( context );
+
+       TCPIPConfigDidChange( &gMDNSRecord );
+       udsserver_handle_configchange( &gMDNSRecord );
+
+       // and reset the event handler
+
+       if ( ( gTcpipKey != NULL ) && ( gTcpipChangedEvent ) )
+       {
+               int err = RegNotifyChangeKeyValue( gTcpipKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gTcpipChangedEvent, TRUE );
+               check_noerr( err );
        }
 }
 
 
-//===========================================================================================================================
-//     SetupWaitList
-//===========================================================================================================================
+mDNSlocal void CALLBACK
+DDNSChangedNotification( HANDLE event, void *context )
+{
+       // The DynDNS config might have changed
+
+       DEBUG_UNUSED( event );
+       DEBUG_UNUSED( context );
+
+       DynDNSConfigDidChange( &gMDNSRecord );
+       udsserver_handle_configchange( &gMDNSRecord );
+
+       // and reset the event handler
+
+       if ((gDdnsKey != NULL) && (gDdnsChangedEvent))
+       {
+               int err = RegNotifyChangeKeyValue(gDdnsKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gDdnsChangedEvent, TRUE);
+               check_noerr( err );
+       }
+}
+
 
-mDNSlocal mStatus SetupWaitList( mDNS * const inMDNS, HANDLE **outWaitList, int *outWaitListCount )
+mDNSlocal void CALLBACK
+FileSharingChangedNotification( HANDLE event, void *context )
 {
-       int                             waitListCount;
-       HANDLE          *       waitList;
-       HANDLE          *       waitItemPtr;
-       EventSource     *       source;
-       mStatus                 err;
-       
-       dlog( kDebugLevelTrace, DEBUG_NAME "setting up wait list\n" );
-       
-       ( void ) inMDNS;
-       check( inMDNS->p );
-       check( outWaitList );
-       check( outWaitListCount );
-       
-       // Allocate an array to hold all the objects to wait on.
-       
-       waitListCount = kWaitListFixedItemCount + gEventSources;
-       waitList = ( HANDLE* ) malloc( waitListCount * sizeof( *waitList ) );
-       require_action( waitList, exit, err = mStatus_NoMemoryErr );
-       waitItemPtr = waitList;
-       
-       // Add the fixed wait items to the beginning of the list.
-       
-       *waitItemPtr++  =       gStopEvent;
-       *waitItemPtr++  =       gInterfaceListChangedEvent;
-       *waitItemPtr++  =       gDescChangedEvent;
-       *waitItemPtr++  =       gTcpipChangedEvent;
-       *waitItemPtr++  =       gDdnsChangedEvent;
-       *waitItemPtr++  =       gFileSharingChangedEvent;
-       *waitItemPtr++  =       gFirewallChangedEvent;
-       *waitItemPtr++  =       gAdvertisedServicesChangedEvent;
-       *waitItemPtr++  =       gSPSWakeupEvent;
-       *waitItemPtr++  =       gSPSSleepEvent;
+       // File sharing changed
+
+       DEBUG_UNUSED( event );
+       DEBUG_UNUSED( context );
+
+       FileSharingDidChange( &gMDNSRecord );
 
-       for ( source = gEventSourceList; source; source = source->next )
+       // and reset the event handler
+
+       if ((gFileSharingKey != NULL) && (gFileSharingChangedEvent))
        {
-               *waitItemPtr++ = source->event;
+               int err = RegNotifyChangeKeyValue(gFileSharingKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gFileSharingChangedEvent, TRUE);
+               check_noerr( err );
        }
+}
 
-       check( ( int )( waitItemPtr - waitList ) == waitListCount );
-       
-       *outWaitList            = waitList;
-       *outWaitListCount       = waitListCount;
-       waitList                        = NULL;
-       err                                     = mStatus_NoError;
-       
-exit:
 
-       if( waitList )
+mDNSlocal void CALLBACK
+FirewallChangedNotification( HANDLE event, void *context )
+{
+       // Firewall configuration changed
+
+       DEBUG_UNUSED( event );
+       DEBUG_UNUSED( context );
+
+       FirewallDidChange( &gMDNSRecord );
+
+       // and reset the event handler
+
+       if ((gFirewallKey != NULL) && (gFirewallChangedEvent))
        {
-               free( waitList );
+               int err = RegNotifyChangeKeyValue(gFirewallKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gFirewallChangedEvent, TRUE);
+               check_noerr( err );
        }
+}
 
-       dlog( kDebugLevelTrace, DEBUG_NAME "setting up wait list done (err=%d %m)\n", err, err );
-       return( err );
+
+mDNSlocal void CALLBACK
+AdvertisedServicesChangedNotification( HANDLE event, void *context )
+{
+       // Ultimately we'll want to manage multiple services, but right now the only service
+       // we'll be managing is SMB.
+
+       DEBUG_UNUSED( event );
+       DEBUG_UNUSED( context );
+
+       FileSharingDidChange( &gMDNSRecord );
+
+       // and reset the event handler
+
+       if ( ( gAdvertisedServicesKey != NULL ) && ( gAdvertisedServicesChangedEvent ) )
+       {
+               int err = RegNotifyChangeKeyValue(gAdvertisedServicesKey, TRUE, REG_NOTIFY_CHANGE_NAME|REG_NOTIFY_CHANGE_LAST_SET, gAdvertisedServicesChangedEvent, TRUE);
+               check_noerr( err );
+       }
+}
+
+
+mDNSlocal void CALLBACK
+SPSWakeupNotification( HANDLE event, void *context )
+{
+       LARGE_INTEGER timeout;
+
+       DEBUG_UNUSED( event );
+       DEBUG_UNUSED( context );
+
+       ReportStatus( EVENTLOG_INFORMATION_TYPE, "Maintenance wake" );
+
+       timeout.QuadPart  = kSPSMaintenanceWakePeriod;
+       timeout.QuadPart *= kSecondsTo100NSUnits;
+
+       SetWaitableTimer( gSPSSleepEvent, &timeout, 0, NULL, NULL, TRUE );
+}
+
+
+mDNSlocal void CALLBACK
+SPSSleepNotification( HANDLE event, void *context )
+{
+       DEBUG_UNUSED( event );
+       DEBUG_UNUSED( context );
+
+       ReportStatus( EVENTLOG_INFORMATION_TYPE, "Returning to sleep after maintenance wake" );
+
+       // Calling SetSuspendState() doesn't invoke our sleep handlers, so we'll
+       // call HandlePowerSuspend() explicity.  This will reset the 
+       // maintenance wake timers.
+
+       PowerSuspendNotification( gPowerSuspendEvent, NULL );
+       SetSuspendState( FALSE, FALSE, FALSE );
 }
 
 
@@ -2044,13 +1990,15 @@ CoreCallback(mDNS * const inMDNS, mStatus status)
 
 
 //===========================================================================================================================
-//     UDSCanAccept
+//     UDSAcceptNotification
 //===========================================================================================================================
 
-mDNSlocal void UDSCanAccept( mDNS * const inMDNS, HANDLE event, void * context )
+mDNSlocal void CALLBACK
+UDSAcceptNotification( SOCKET sock, LPWSANETWORKEVENTS event, void *context )
 {
-       ( void ) inMDNS;
+       ( void ) sock;
        ( void ) event;
+       ( void ) context;
        
        if ( gUDSCallback )
        {
@@ -2060,16 +2008,20 @@ mDNSlocal void UDSCanAccept( mDNS * const inMDNS, HANDLE event, void * context )
 
 
 //===========================================================================================================================
-//     UDSCanRead
+//     UDSReadNotification
 //===========================================================================================================================
 
-mDNSlocal void UDSCanRead( TCPSocket * sock )
+mDNSlocal void CALLBACK
+UDSReadNotification( SOCKET sock, LPWSANETWORKEVENTS event, void *context )
 {
-       udsEventCallback callback = ( udsEventCallback ) sock->userCallback;
+       TCPSocket *tcpSock = ( TCPSocket* ) context;
 
-       if ( callback )
+       ( void ) sock;
+       ( void ) event;
+
+       if ( tcpSock )
        {
-               callback( (int) sock->fd, 0, sock->userContext );
+               tcpSock->userCallback( ( int ) tcpSock->fd, 0, tcpSock->userContext );
        }
 }
 
@@ -2078,16 +2030,14 @@ mDNSlocal void UDSCanRead( TCPSocket * sock )
 //     udsSupportAddFDToEventLoop
 //===========================================================================================================================
 
-
 mStatus
 udsSupportAddFDToEventLoop( SocketRef fd, udsEventCallback callback, void *context, void **platform_data)
 {
        mStatus err = mStatus_NoError;
 
        // We are using some knowledge of what is being passed to us here.  If the fd is a listen socket,
-       // then the "callback" parameter is NULL.  If it is an actual read/write socket, then the "callback"
-       // parameter is not null. This is important because we use waitable events for the listen socket
-       // and alertable I/O for the read/write sockets.
+       // then the "context" parameter is NULL.  If it is an actual read/write socket, then the "context"
+       // parameter is not null.
 
        if ( context )
        {
@@ -2098,27 +2048,21 @@ udsSupportAddFDToEventLoop( SocketRef fd, udsEventCallback callback, void *conte
                mDNSPlatformMemZero( sock, sizeof( TCPSocket ) );
 
                sock->fd                                = (SOCKET) fd;
-               sock->readEventHandler  = UDSCanRead;
                sock->userCallback              = callback;
                sock->userContext               = context;
                sock->m                                 = &gMDNSRecord;
 
-               err = TCPAddSocket( sock->m, sock );
-               require_noerr( err, exit );
-
                *platform_data = sock;
+
+               err = mDNSPollRegisterSocket( sock->fd, FD_READ | FD_CLOSE, UDSReadNotification, sock );
+               require_noerr( err, exit );
        }
        else
        {
                gUDSSocket              = fd;
                gUDSCallback    = callback;
-               gUDSEvent               = CreateEvent( NULL, FALSE, FALSE, NULL );
-               err = translate_errno( gUDSEvent, (mStatus) GetLastError(), kUnknownErr );
-               require_noerr( err, exit ); 
-               err = WSAEventSelect( fd, gUDSEvent, FD_ACCEPT | FD_CLOSE );
-               err = translate_errno( err == 0, WSAGetLastError(), kNoResourcesErr );
-               require_noerr( err, exit );
-               err = RegisterWaitableEvent( &gMDNSRecord, gUDSEvent, context, UDSCanAccept );
+
+               err = mDNSPollRegisterSocket( gUDSSocket, FD_ACCEPT | FD_CLOSE, UDSAcceptNotification, NULL );
                require_noerr( err, exit );
        }
 
@@ -2147,6 +2091,14 @@ udsSupportReadFD( SocketRef fd, char *buf, int len, int flags, void *platform_da
        {
                ret = 0;
        }
+       else if ( !ret && ( WSAGetLastError() == WSAEWOULDBLOCK ) )
+       {
+               // mDNSPlatformReadTCP will return 0 if it gets WSAEWOULDBLOCK, but
+               // that caller of this routine interprets that as close connection.
+               // We'll fix that by returning -1 in that case.
+
+               ret = -1;
+       }
 
 exit:
 
@@ -2159,6 +2111,8 @@ udsSupportRemoveFDFromEventLoop( SocketRef fd, void *platform_data)               // Note: Th
 {
        mStatus err = kNoErr;
 
+       mDNSPollUnregisterSocket( fd );
+
        if ( platform_data != NULL )
        {
                TCPSocket * sock;
@@ -2168,13 +2122,6 @@ udsSupportRemoveFDFromEventLoop( SocketRef fd, void *platform_data)              // Note: Th
                check( sock->fd == fd );
                mDNSPlatformTCPCloseConnection( sock );
        }
-       else if ( gUDSEvent != NULL )
-       {
-               UnregisterWaitableEvent( &gMDNSRecord, gUDSEvent );
-               WSAEventSelect( fd, gUDSEvent, 0 );
-               CloseHandle( gUDSEvent );
-               gUDSEvent = NULL;
-       }
 
        return err;
 }
@@ -2403,7 +2350,7 @@ SetLLRoute( mDNS * const inMDNS )
        // they have a permanent route to link-local addresses. Otherwise,
        // set a route to link local addresses (169.254.0.0)
        //
-       if ( ( gOSMajorVersion < 6 ) && gServiceManageLLRouting && !gPlatformStorage.registeredLoopback4 )
+       if ( ( inMDNS->p->osMajorVersion < 6 ) && gServiceManageLLRouting && !gPlatformStorage.registeredLoopback4 )
        {
                DWORD                           ifIndex;
                MIB_IPFORWARDROW        rowExtant;
index 720f00aceaffcea123b54fdeb747e350695e558f..7db6bc153136af2f2b4c85cb95688e4786fa1d05 100644 (file)
                                RelativePath="..\mDNSWin32.c"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\Poll.c"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\Secret.c"\r
                                >\r
                                RelativePath="..\mDNSWin32.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\Poll.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath=".\Resource.h"\r
                                >\r
diff --git a/mDNSWindows/SystemService/Service.vcxproj b/mDNSWindows/SystemService/Service.vcxproj
new file mode 100755 (executable)
index 0000000..fe0758c
--- /dev/null
@@ -0,0 +1,307 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectName>mDNSResponder</ProjectName>\r
+    <ProjectGuid>{C1D98254-BA27-4427-A3BE-A68CA2CC5F69}</ProjectGuid>\r
+    <RootNamespace>mDNSResponder</RootNamespace>\r
+    <Keyword>Win32Proj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>.;../;../../mDNSCore;../../mDNSShared;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;DEBUG=1;MDNS_DEBUGMSGS=0;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE="";UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_LEGACY_NAT_TRAVERSAL_;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <ExceptionHandling>\r
+      </ExceptionHandling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <SmallerTypeCheck>true</SmallerTypeCheck>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <DisableSpecificWarnings>4127;4201;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+      <ShowIncludes>false</ShowIncludes>\r
+      <PrecompiledHeaderFile>\r
+      </PrecompiledHeaderFile>\r
+      <PrecompiledHeaderOutputFile>\r
+      </PrecompiledHeaderOutputFile>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;crypt32.lib;netapi32.lib;powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)mDNSResponder.exe</OutputFile>\r
+      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)mDNSResponder.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\mDNSResponder.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>.;../;../../mDNSCore;../../mDNSShared;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;DEBUG=1;MDNS_DEBUGMSGS=0;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE="";UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_LEGACY_NAT_TRAVERSAL_;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <ExceptionHandling>\r
+      </ExceptionHandling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <SmallerTypeCheck>true</SmallerTypeCheck>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <DisableSpecificWarnings>4127;4201;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;crypt32.lib;netapi32.lib;powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)mDNSResponder.exe</OutputFile>\r
+      <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)mDNSResponder.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\mDNSResponder64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ClCompile>\r
+      <AdditionalIncludeDirectories>.;../;../../mDNSCore;../../mDNSShared;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE="";UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_LEGACY_NAT_TRAVERSAL_;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+      <DisableSpecificWarnings>4127;4201;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;crypt32.lib;netapi32.lib;powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)mDNSResponder.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\mDNSResponder.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour\$(Platform)"   mkdir "$(DSTROOT)\Program Files\Bonjour\$(Platform)"\r
+if not exist "$(DSTROOT)\AppleInternal"                                                   mkdir "$(DSTROOT)\AppleInternal"\r
+if not exist "$(DSTROOT)\AppleInternal\bin"                                            mkdir "$(DSTROOT)\AppleInternal\bin"\r
+xcopy /I/Y "$(TargetPath)"                                                                           "$(DSTROOT)\Program Files\Bonjour\$(Platform)"\r
+xcopy /I/Y "$(TargetDir)$(TargetName).pdb"                                          "$(DSTROOT)\AppleInternal\bin"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <AdditionalIncludeDirectories>.;../;../../mDNSCore;../../mDNSShared;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE="";UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_LEGACY_NAT_TRAVERSAL_;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <DisableSpecificWarnings>4127;4201;%(DisableSpecificWarnings)</DisableSpecificWarnings>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;netapi32.lib;powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)mDNSResponder.exe</OutputFile>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Console</SubSystem>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+      <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>\r
+    </Link>\r
+    <Manifest>\r
+      <AdditionalManifestFiles>res\mDNSResponder64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>\r
+    </Manifest>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour\$(Platform)"   mkdir "$(DSTROOT)\Program Files\Bonjour\$(Platform)"\r
+if not exist "$(DSTROOT)\AppleInternal"                                                   mkdir "$(DSTROOT)\AppleInternal"\r
+if not exist "$(DSTROOT)\AppleInternal\bin"                                            mkdir "$(DSTROOT)\AppleInternal\bin"\r
+xcopy /I/Y "$(TargetPath)"                                                                           "$(DSTROOT)\Program Files\Bonjour\$(Platform)"\r
+xcopy /I/Y "$(TargetDir)$(TargetName).pdb"                                          "$(DSTROOT)\AppleInternal\bin"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c" />\r
+    <ClCompile Include="..\..\mDNSCore\DNSCommon.c" />\r
+    <ClCompile Include="..\..\mDNSCore\DNSDigest.c" />\r
+    <ClCompile Include="..\..\mDNSShared\dnssd_ipc.c" />\r
+    <ClCompile Include="Firewall.cpp" />\r
+    <ClCompile Include="..\..\mDNSShared\GenLinkedList.c" />\r
+    <ClCompile Include="..\..\mDNSMacOSX\LegacyNATTraversal.c" />\r
+    <ClCompile Include="main.c" />\r
+    <ClCompile Include="..\..\mDNSCore\mDNS.c" />\r
+    <ClCompile Include="..\..\mDNSShared\mDNSDebug.c" />\r
+    <ClCompile Include="..\mDNSWin32.c" />\r
+    <ClCompile Include="..\Poll.c" />\r
+    <ClCompile Include="..\Secret.c" />\r
+    <ClCompile Include="Service.c" />\r
+    <ClCompile Include="..\..\mDNSCore\uDNS.c" />\r
+    <ClCompile Include="..\..\mDNSShared\uds_daemon.c" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <CustomBuild Include="EventLog.mc">\r
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compiling Message Resource</Message>\r
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">mc.exe EventLog.mc</Command>\r
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EventLog.rc EventLog.h;%(Outputs)</Outputs>\r
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Compiling Message Resource</Message>\r
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">mc.exe EventLog.mc</Command>\r
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">EventLog.rc EventLog.h;%(Outputs)</Outputs>\r
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compiling Message Resource</Message>\r
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">mc.exe EventLog.mc</Command>\r
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">EventLog.rc EventLog.h;%(Outputs)</Outputs>\r
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Compiling Message Resource</Message>\r
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">mc.exe EventLog.mc</Command>\r
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">EventLog.rc EventLog.h;%(Outputs)</Outputs>\r
+    </CustomBuild>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h" />\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h" />\r
+    <ClInclude Include="..\..\mDNSCore\DNSCommon.h" />\r
+    <ClInclude Include="..\..\mDNSShared\dnssd_ipc.h" />\r
+    <ClInclude Include="..\..\mDNSShared\GenLinkedList.h" />\r
+    <ClInclude Include="..\..\mDNSCore\mDNSDebug.h" />\r
+    <ClInclude Include="..\..\mDNSCore\mDNSEmbeddedAPI.h" />\r
+    <ClInclude Include="..\mDNSWin32.h" />\r
+    <ClInclude Include="..\Poll.h" />\r
+    <ClInclude Include="Resource.h" />\r
+    <ClInclude Include="..\Secret.h" />\r
+    <ClInclude Include="Service.h" />\r
+    <ClInclude Include="..\..\mDNSCore\uDNS.h" />\r
+    <ClInclude Include="..\..\mDNSShared\uds_daemon.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="Service.rc" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/mDNSWindows/SystemService/Service.vcxproj.filters b/mDNSWindows/SystemService/Service.vcxproj.filters
new file mode 100755 (executable)
index 0000000..0f3b710
--- /dev/null
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSCore\DNSCommon.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSCore\DNSDigest.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\dnssd_ipc.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="Firewall.cpp">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\GenLinkedList.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSMacOSX\LegacyNATTraversal.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="main.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSCore\mDNS.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\mDNSDebug.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\mDNSWin32.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\Poll.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\Secret.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="Service.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSCore\uDNS.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\uds_daemon.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSCore\DNSCommon.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\dnssd_ipc.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\GenLinkedList.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSCore\mDNSDebug.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSCore\mDNSEmbeddedAPI.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\mDNSWin32.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\Poll.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="Resource.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\Secret.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="Service.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSCore\uDNS.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\uds_daemon.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="Service.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <CustomBuild Include="EventLog.mc">\r
+      <Filter>Source Files</Filter>\r
+    </CustomBuild>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file
index c395aa443495344ff686d0388e8cc39f83230dc3..1ee40d86a7802c5e584e0d3870e79f4ca9d11770 100644 (file)
 #define MASTER_COMPANY_NAME   "Apple Inc."
 
 // Define the product version for mDNSResponder on Windows
-#define MASTER_PROD_VERS               2,0,0,19
-#define MASTER_PROD_VERS_STR   "2,0,0,19"
-#define MASTER_PROD_VERS_STR2  "2.0.0.19"
-#define MASTER_PROD_VERS_STR3 "Explorer Plugin 2.0.0.19"
+#define MASTER_PROD_VERS               3,0,0,10
+#define MASTER_PROD_VERS_STR   "3,0,0,10"
+#define MASTER_PROD_VERS_STR2  "3.0.0.10"
+#define MASTER_PROD_VERS_STR3 "Explorer Plugin 3.0.0.10"
 
 // Define the legal copyright
-#define MASTER_LEGAL_COPYRIGHT "Copyright (C) 2003-2010 Apple Inc."
+#define MASTER_LEGAL_COPYRIGHT "Copyright (C) 2003-2011 Apple Inc."
 
 #endif // WINRESVERS_H
index 179ba783e1c8508ffd4a04c1dedae2c4582fb468..d2c05db1972664b04d8c331ff34248c70b0df775 100755 (executable)
@@ -23,6 +23,8 @@
 
 */
 
+#define _CRT_RAND_S
+
 #include       <stdarg.h>
 #include       <stddef.h>
 #include       <stdio.h>
@@ -30,6 +32,7 @@
 #include       <crtdbg.h>
 #include       <string.h>
 
+#include       "Poll.h"
 #include       "CommonServices.h"
 #include       "DebugServices.h"
 #include       "Firewall.h"
@@ -119,6 +122,26 @@ struct     mDNSPlatformInterfaceInfo
 mDNSexport mStatus     mDNSPlatformInterfaceNameToID( mDNS * const inMDNS, const char *inName, mDNSInterfaceID *outID );
 mDNSexport mStatus     mDNSPlatformInterfaceIDToInfo( mDNS * const inMDNS, mDNSInterfaceID inID, mDNSPlatformInterfaceInfo *outInfo );
 
+
+// Wakeup Structs
+
+#define kUnicastWakeupNumTries                         ( 1 )
+#define kUnicastWakeupSleepBetweenTries                ( 0 )
+#define kMulticastWakeupNumTries                       ( 18 )
+#define kMulticastWakeupSleepBetweenTries      ( 100 )
+
+typedef struct MulticastWakeupStruct
+{
+       mDNS                                    *inMDNS;
+       struct sockaddr_in              addr;
+       INT                                             addrLen;
+       unsigned char                   data[ 102 ];
+       INT                                             dataLen;
+       INT                                             numTries;
+       INT                                             msecSleep;
+} MulticastWakeupStruct;
+
+
 // Utilities
 
 #if( MDNS_WINDOWS_USE_IPV6_IF_ADDRS )
@@ -138,16 +161,10 @@ mDNSlocal mStatus                 RegQueryString( HKEY key, LPCSTR param, LPSTR * string, DWOR
 mDNSlocal struct ifaddrs*      myGetIfAddrs(int refresh);
 mDNSlocal OSStatus                     TCHARtoUTF8( const TCHAR *inString, char *inBuffer, size_t inBufferSize );
 mDNSlocal OSStatus                     WindowsLatin1toUTF8( const char *inString, char *inBuffer, size_t inBufferSize );
-mDNSlocal void                         TCPDidConnect( mDNS * const inMDNS, HANDLE event, void * context );
-mDNSlocal void                         TCPCanRead( TCPSocket * sock );
-mDNSlocal mStatus                      TCPBeginRecv( TCPSocket * sock );
-mDNSlocal void CALLBACK                TCPEndRecv( DWORD error, DWORD bytesTransferred, LPWSAOVERLAPPED overlapped, DWORD flags );
+mDNSlocal void CALLBACK                TCPSocketNotification( SOCKET sock, LPWSANETWORKEVENTS event, void *context );
 mDNSlocal void                         TCPCloseSocket( TCPSocket * socket );
-mDNSlocal void CALLBACK                TCPFreeSocket( TCPSocket *sock );
-mDNSlocal OSStatus                     UDPBeginRecv( UDPSocket * socket );
-mDNSlocal void CALLBACK                UDPEndRecv( DWORD err, DWORD bytesTransferred, LPWSAOVERLAPPED overlapped, DWORD flags );
+mDNSlocal void CALLBACK                UDPSocketNotification( SOCKET sock, LPWSANETWORKEVENTS event, void *context );
 mDNSlocal void                         UDPCloseSocket( UDPSocket * sock );
-mDNSlocal void CALLBACK                UDPFreeSocket( UDPSocket * sock );
 mDNSlocal mStatus           SetupAddr(mDNSAddr *ip, const struct sockaddr *const sa);
 mDNSlocal void                         GetDDNSFQDN( domainname *const fqdn );
 #ifdef UNICODE
@@ -161,8 +178,8 @@ mDNSlocal VOID CALLBACK             CheckFileSharesProc( LPVOID arg, DWORD dwTimerLowValue,
 mDNSlocal void                         CheckFileShares( mDNS * const inMDNS );
 mDNSlocal void                         SMBCallback(mDNS *const m, ServiceRecordSet *const srs, mStatus result);
 mDNSlocal mDNSu8                       IsWOMPEnabledForAdapter( const char * adapterName );
-mDNSlocal void                         DispatchUDPEvent( mDNS * const m, UDPSocket * sock );
-mDNSlocal void                         DispatchTCPEvent( mDNS * const m, TCPSocket * sock );
+mDNSlocal void                         SendWakeupPacket( mDNS * const inMDNS, LPSOCKADDR addr, INT addrlen, const char * buf, INT buflen, INT numTries, INT msecSleep );
+mDNSlocal void _cdecl          SendMulticastWakeupPacket( void *arg );
 
 #ifdef __cplusplus
        }
@@ -180,8 +197,7 @@ mDNSlocal mDNS_PlatformSupport      gMDNSPlatformSupport;
 mDNSs32                                                        mDNSPlatformOneSecond   = 0;
 mDNSlocal UDPSocket            *               gUDPSockets                             = NULL;
 mDNSlocal int                                  gUDPNumSockets                  = 0;
-mDNSlocal GenLinkedList                        gUDPDispatchableSockets;
-mDNSlocal GenLinkedList                        gTCPDispatchableSockets;
+mDNSlocal BOOL                                 gEnableIPv6                             = TRUE;
 
 #if( MDNS_WINDOWS_USE_IPV6_IF_ADDRS )
 
@@ -272,6 +288,8 @@ mDNSlocal HANDLE                                    gSMBThreadQuitEvent                     = NULL;
 mDNSexport mStatus     mDNSPlatformInit( mDNS * const inMDNS )
 {
        mStatus         err;
+       OSVERSIONINFO osInfo;
+       BOOL ok;
        WSADATA         wsaData;
        int                     supported;
        struct sockaddr_in      sa4;
@@ -279,7 +297,6 @@ mDNSexport mStatus  mDNSPlatformInit( mDNS * const inMDNS )
        int                                     sa4len;
        int                                     sa6len;
        DWORD                           size;
-       DWORD                           val;
        
        dlog( kDebugLevelTrace, DEBUG_NAME "platform init\n" );
        
@@ -294,9 +311,23 @@ mDNSexport mStatus mDNSPlatformInit( mDNS * const inMDNS )
        require_action( inMDNS->p->checkFileSharesTimer, exit, err = mStatus_UnknownErr );
        inMDNS->p->checkFileSharesTimeout               = 10;           // Retry time for CheckFileShares() in seconds
        mDNSPlatformOneSecond                                   = 1000;         // Use milliseconds as the quantum of time
-       InitLinkedList( &gTCPDispatchableSockets, offsetof( TCPSocket, nextDispatchable ) );
-       InitLinkedList( &gUDPDispatchableSockets, offsetof( UDPSocket, nextDispatchable ) );
        
+       // Get OS version info
+       
+       osInfo.dwOSVersionInfoSize = sizeof( OSVERSIONINFO );
+       ok = GetVersionEx( &osInfo );
+       err = translate_errno( ok, (OSStatus) GetLastError(), kUnknownErr );
+       require_noerr( err, exit );
+       inMDNS->p->osMajorVersion = osInfo.dwMajorVersion;
+       inMDNS->p->osMinorVersion = osInfo.dwMinorVersion;
+       
+       // Don't enable IPv6 on anything less recent than Windows Vista
+
+       if ( inMDNS->p->osMajorVersion < 6 )
+       {
+               gEnableIPv6 = FALSE;
+       }
+
        // Startup WinSock 2.2 or later.
        
        err = WSAStartup( MAKEWORD( kWinSockMajorMin, kWinSockMinorMin ), &wsaData );
@@ -322,19 +353,11 @@ mDNSexport mStatus        mDNSPlatformInit( mDNS * const inMDNS )
        dlog( kDebugLevelInfo, DEBUG_NAME "HISoftware: %#s\n", inMDNS->HISoftware.c );
 #endif
 
-       // Set the thread global overlapped flag
-
-       val = 0;
-       err = setsockopt( INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, ( char* ) &val, sizeof( val ) );
-       err = translate_errno( err != SOCKET_ERROR, WSAGetLastError(), kUnknownErr );
-       require_noerr( err, exit );
-
        // Set up the IPv4 unicast socket
 
        inMDNS->p->unicastSock4.fd                      = INVALID_SOCKET;
        inMDNS->p->unicastSock4.recvMsgPtr      = NULL;
        inMDNS->p->unicastSock4.ifd                     = NULL;
-       inMDNS->p->unicastSock4.overlapped.pending = FALSE;
        inMDNS->p->unicastSock4.next            = NULL;
        inMDNS->p->unicastSock4.m                       = inMDNS;
 
@@ -356,7 +379,7 @@ mDNSexport mStatus  mDNSPlatformInit( mDNS * const inMDNS )
                inMDNS->p->unicastSock4.recvMsgPtr = NULL;
        }
 
-       err = UDPBeginRecv( &inMDNS->p->unicastSock4 );
+       err = mDNSPollRegisterSocket( inMDNS->p->unicastSock4.fd, FD_READ, UDPSocketNotification, &inMDNS->p->unicastSock4 );
        require_noerr( err, exit ); 
 
 #endif
@@ -366,43 +389,45 @@ mDNSexport mStatus        mDNSPlatformInit( mDNS * const inMDNS )
        inMDNS->p->unicastSock6.fd                      = INVALID_SOCKET;
        inMDNS->p->unicastSock6.recvMsgPtr      = NULL;
        inMDNS->p->unicastSock6.ifd                     = NULL;
-       inMDNS->p->unicastSock6.overlapped.pending = FALSE;
        inMDNS->p->unicastSock6.next            = NULL;
        inMDNS->p->unicastSock6.m                       = inMDNS;
 
 #if ( MDNS_WINDOWS_ENABLE_IPV6 )
 
-       sa6.sin6_family         = AF_INET6;
-       sa6.sin6_addr           = in6addr_any;
-       sa6.sin6_scope_id       = 0;
-
-       // This call will fail if the machine hasn't installed IPv6.  In that case,
-       // the error will be WSAEAFNOSUPPORT.
-
-       err = SetupSocket( inMDNS, (const struct sockaddr*) &sa6, zeroIPPort, &inMDNS->p->unicastSock6.fd );
-       require_action( !err || ( err == WSAEAFNOSUPPORT ), exit, err = (mStatus) WSAGetLastError() );
-       err = kNoErr;
-       
-       // If we weren't able to create the socket (because IPv6 hasn't been installed) don't do this
-
-       if ( inMDNS->p->unicastSock6.fd != INVALID_SOCKET )
+       if ( gEnableIPv6 )
        {
-               sa6len = sizeof( sa6 );
-               err = getsockname( inMDNS->p->unicastSock6.fd, (struct sockaddr*) &sa6, &sa6len );
-               require_noerr( err, exit );
-               inMDNS->p->unicastSock6.port.NotAnInteger = sa6.sin6_port;
-               inMDNS->UnicastPort6 = inMDNS->p->unicastSock6.port;
+               sa6.sin6_family         = AF_INET6;
+               sa6.sin6_addr           = in6addr_any;
+               sa6.sin6_scope_id       = 0;
 
-               err = WSAIoctl( inMDNS->p->unicastSock6.fd, SIO_GET_EXTENSION_FUNCTION_POINTER, &kWSARecvMsgGUID, sizeof( kWSARecvMsgGUID ), &inMDNS->p->unicastSock6.recvMsgPtr, sizeof( inMDNS->p->unicastSock6.recvMsgPtr ), &size, NULL, NULL );
+               // This call will fail if the machine hasn't installed IPv6.  In that case,
+               // the error will be WSAEAFNOSUPPORT.
+
+               err = SetupSocket( inMDNS, (const struct sockaddr*) &sa6, zeroIPPort, &inMDNS->p->unicastSock6.fd );
+               require_action( !err || ( err == WSAEAFNOSUPPORT ), exit, err = (mStatus) WSAGetLastError() );
+               err = kNoErr;
                
-               if ( err != 0 )
+               // If we weren't able to create the socket (because IPv6 hasn't been installed) don't do this
+
+               if ( inMDNS->p->unicastSock6.fd != INVALID_SOCKET )
                {
-                       inMDNS->p->unicastSock6.recvMsgPtr = NULL;
-               }
+                       sa6len = sizeof( sa6 );
+                       err = getsockname( inMDNS->p->unicastSock6.fd, (struct sockaddr*) &sa6, &sa6len );
+                       require_noerr( err, exit );
+                       inMDNS->p->unicastSock6.port.NotAnInteger = sa6.sin6_port;
+                       inMDNS->UnicastPort6 = inMDNS->p->unicastSock6.port;
 
-               err = UDPBeginRecv( &inMDNS->p->unicastSock6 );
-               require_noerr( err, exit );
-       } 
+                       err = WSAIoctl( inMDNS->p->unicastSock6.fd, SIO_GET_EXTENSION_FUNCTION_POINTER, &kWSARecvMsgGUID, sizeof( kWSARecvMsgGUID ), &inMDNS->p->unicastSock6.recvMsgPtr, sizeof( inMDNS->p->unicastSock6.recvMsgPtr ), &size, NULL, NULL );
+                       
+                       if ( err != 0 )
+                       {
+                               inMDNS->p->unicastSock6.recvMsgPtr = NULL;
+                       }
+
+                       err = mDNSPollRegisterSocket( inMDNS->p->unicastSock6.fd, FD_READ, UDPSocketNotification, &inMDNS->p->unicastSock6 );
+                       require_noerr( err, exit );
+               }
+       }
 
 #endif
 
@@ -497,7 +522,10 @@ mDNSexport void    mDNSPlatformClose( mDNS * const inMDNS )
        
 #if ( MDNS_WINDOWS_ENABLE_IPV6 )
 
-       UDPCloseSocket( &inMDNS->p->unicastSock6 );
+       if ( gEnableIPv6 )
+       {
+               UDPCloseSocket( &inMDNS->p->unicastSock6 );
+       }
 
 #endif
 
@@ -535,13 +563,6 @@ mDNSexport void    mDNSPlatformClose( mDNS * const inMDNS )
                g_hAAPI32                               = NULL;
        }
 
-       // Clear out the APC queue
-
-       while ( SleepEx( 0, TRUE ) == WAIT_IO_COMPLETION )
-       {
-               DispatchSocketEvents( inMDNS );
-       }
-
        WSACleanup();
        
        dlog( kDebugLevelTrace, DEBUG_NAME "platform close done\n" );
@@ -657,67 +678,10 @@ mDNSexport void   mDNSPlatformMemFree( void *inMem )
 
 mDNSexport mDNSu32 mDNSPlatformRandomNumber(void)
 {
-       mDNSu32         randomNumber = 0;
-       BOOL            bResult;
-       OSStatus        err = 0;
-
-       if ( !g_hAAPI32 )
-       {
-               g_hAAPI32 = LoadLibrary( TEXT("AdvAPI32.dll") );
-               err = translate_errno( g_hAAPI32 != NULL, GetLastError(), mStatus_UnknownErr );
-               require_noerr( err, exit );
-       }
-
-       // Function Pointer: CryptAcquireContext
-
-       if ( !g_lpCryptAcquireContext )
-       {
-               g_lpCryptAcquireContext = ( fnCryptAcquireContext )
-#ifdef UNICODE
-                       ( GetProcAddress( g_hAAPI32, "CryptAcquireContextW" ) );
-#else
-                       ( GetProcAddress( g_hAAPI32, "CryptAcquireContextA" ) );
-#endif
-               err = translate_errno( g_lpCryptAcquireContext != NULL, GetLastError(), mStatus_UnknownErr );
-               require_noerr( err, exit );
-       }
-
-       // Function Pointer: CryptReleaseContext
-
-       if ( !g_lpCryptReleaseContext )
-       {
-               g_lpCryptReleaseContext = ( fnCryptReleaseContext )
-         ( GetProcAddress( g_hAAPI32, "CryptReleaseContext" ) );
-               err = translate_errno( g_lpCryptReleaseContext != NULL, GetLastError(), mStatus_UnknownErr );
-               require_noerr( err, exit );
-       }
-      
-       // Function Pointer: CryptGenRandom
-
-       if ( !g_lpCryptGenRandom )
-       {
-               g_lpCryptGenRandom = ( fnCryptGenRandom )
-          ( GetProcAddress( g_hAAPI32, "CryptGenRandom" ) );
-               err = translate_errno( g_lpCryptGenRandom != NULL, GetLastError(), mStatus_UnknownErr );
-               require_noerr( err, exit );
-       }
-
-       // Setup
-
-       if ( !g_hProvider )
-       {
-               bResult = (*g_lpCryptAcquireContext)( &g_hProvider, NULL, NULL, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET );
-
-               if ( !bResult )
-               {
-                       bResult =  ( *g_lpCryptAcquireContext)( &g_hProvider, NULL, NULL, PROV_RSA_FULL, CRYPT_MACHINE_KEYSET | CRYPT_NEWKEYSET );
-                       err = translate_errno( bResult, GetLastError(), mStatus_UnknownErr );
-                       require_noerr( err, exit );
-               }
-       }
+       unsigned int    randomNumber;
+       errno_t                 err;
 
-       bResult = (*g_lpCryptGenRandom)( g_hProvider, sizeof( randomNumber ), ( BYTE* ) &randomNumber );
-       err = translate_errno( bResult, GetLastError(), mStatus_UnknownErr );
+       err = rand_s( &randomNumber );
        require_noerr( err, exit );
 
 exit:
@@ -727,7 +691,7 @@ exit:
                randomNumber = rand();
        }
 
-       return randomNumber;
+       return ( mDNSu32 ) randomNumber;
 }
 
 //===========================================================================================================================
@@ -841,12 +805,6 @@ mDNSexport mDNSInterfaceID mDNSPlatformInterfaceIDfromInterfaceIndex( mDNS * con
        {
                id = mDNSInterface_LocalOnly;
        }
-       /* uncomment if Windows ever supports P2P
-       else if( inIndex == kDNSServiceInterfaceIndexP2P )
-       {
-               id = mDNSInterface_P2P;
-       }
-       */
        else if( inIndex != 0 )
        {
                mDNSInterfaceData *             ifd;
@@ -871,19 +829,14 @@ mDNSexport mDNSInterfaceID        mDNSPlatformInterfaceIDfromInterfaceIndex( mDNS * con
 mDNSexport mDNSu32     mDNSPlatformInterfaceIndexfromInterfaceID( mDNS * const inMDNS, mDNSInterfaceID inID, mDNSBool suppressNetworkChange )
 {
        mDNSu32         index;
-       (void) suppressNetworkChange; // Unused
        
+       (void) suppressNetworkChange;
+
        index = 0;
        if( inID == mDNSInterface_LocalOnly )
        {
                index = (mDNSu32) kDNSServiceInterfaceIndexLocalOnly;
        }
-       /* uncomment if Windows ever supports P2P
-       else if( inID == mDNSInterface_P2P )
-       {
-               index = (mDNSu32) kDNSServiceInterfaceIndexP2P;
-       }
-       */
        else if( inID )
        {
                mDNSInterfaceData *             ifd;
@@ -986,12 +939,13 @@ exit:
 
        if ( err && sock )
        {
-               TCPFreeSocket( sock );
+               TCPCloseSocket( sock );
+               free( sock );
                sock = mDNSNULL;
        }
 
        return sock;
-} 
+}
 
 //===========================================================================================================================
 //     mDNSPlatformTCPConnect
@@ -1003,7 +957,7 @@ mDNSPlatformTCPConnect
        TCPSocket                       *       sock,
        const mDNSAddr          *       inDstIP, 
        mDNSOpaque16                    inDstPort, 
-       domainname          *   hostname,
+       domainname                      *       hostname,
        mDNSInterfaceID                 inInterfaceID,
        TCPConnectionCallback   inCallback, 
        void *                                  inContext
@@ -1012,8 +966,8 @@ mDNSPlatformTCPConnect
        struct sockaddr_in      saddr;
        mStatus                         err             = mStatus_NoError;
 
+       DEBUG_UNUSED( hostname );
        DEBUG_UNUSED( inInterfaceID );
-       ( void ) hostname;
 
        if ( inDstIP->type != mDNSAddrType_IPv4 )
        {
@@ -1023,9 +977,8 @@ mDNSPlatformTCPConnect
 
        // Setup connection data object
 
-       sock->readEventHandler  = TCPCanRead;
-       sock->userCallback              = inCallback;
-       sock->userContext               = inContext;
+       sock->userCallback      = inCallback;
+       sock->userContext       = inContext;
 
        mDNSPlatformMemZero(&saddr, sizeof(saddr));
        saddr.sin_family        = AF_INET;
@@ -1038,25 +991,8 @@ mDNSPlatformTCPConnect
        require_action( !err || ( WSAGetLastError() == WSAEWOULDBLOCK ), exit, err = mStatus_ConnFailed );
        sock->connected = !err ? TRUE : FALSE;
 
-       if ( sock->connected )
-       {
-               err = TCPAddSocket( sock->m, sock );
-               require_noerr( err, exit );
-       }
-       else
-       {
-               require_action( sock->m->p->registerWaitableEventFunc != NULL, exit, err = mStatus_ConnFailed );
-
-               sock->connectEvent      = CreateEvent( NULL, FALSE, FALSE, NULL );
-               err = translate_errno( sock->connectEvent, GetLastError(), mStatus_UnknownErr );
-               require_noerr( err, exit );
-
-               err = WSAEventSelect( sock->fd, sock->connectEvent, FD_CONNECT );
-               require_noerr( err, exit );
-
-               err = sock->m->p->registerWaitableEventFunc( sock->m, sock->connectEvent, sock, TCPDidConnect );
-               require_noerr( err, exit );
-       }
+       err = mDNSPollRegisterSocket( sock->fd, FD_CONNECT | FD_READ | FD_CLOSE, TCPSocketNotification, sock );
+       require_noerr( err, exit );
 
 exit:
 
@@ -1068,6 +1004,7 @@ exit:
        return err;
 }
 
+
 //===========================================================================================================================
 //     mDNSPlatformTCPAccept
 //===========================================================================================================================
@@ -1108,16 +1045,18 @@ mDNSexport void mDNSPlatformTCPCloseConnection( TCPSocket *sock )
 {
        check( sock );
 
-       if ( sock->connectEvent && sock->m->p->unregisterWaitableEventFunc )
+       if ( sock )
        {
-               sock->m->p->unregisterWaitableEventFunc( sock->m, sock->connectEvent );
-       }
+               dlog( kDebugLevelChatty, DEBUG_NAME "mDNSPlatformTCPCloseConnection 0x%x:%d\n", sock, sock->fd );
 
-       if ( sock->fd != INVALID_SOCKET )
-       {
-               TCPCloseSocket( sock );
+               if ( sock->fd != INVALID_SOCKET )
+               {
+                       mDNSPollUnregisterSocket( sock->fd );
+                       closesocket( sock->fd );
+                       sock->fd = INVALID_SOCKET;
+               }
 
-               QueueUserAPC( ( PAPCFUNC ) TCPFreeSocket, sock->m->p->mainThread, ( ULONG_PTR ) sock );
+               free( sock );
        }
 }
 
@@ -1128,50 +1067,37 @@ mDNSexport void mDNSPlatformTCPCloseConnection( TCPSocket *sock )
 
 mDNSexport long        mDNSPlatformReadTCP( TCPSocket *sock, void *inBuffer, unsigned long inBufferSize, mDNSBool * closed )
 {
-       unsigned long   bytesLeft;
-       int                             wsaError;
-       long                    ret;
+       int                     nread;
+    OSStatus    err;
 
-       *closed = sock->closed;
-       wsaError = sock->lastError;
-       ret = -1;
-
-       if ( *closed )
+       *closed = mDNSfalse;
+    nread = recv( sock->fd, inBuffer, inBufferSize, 0 );
+    err = translate_errno( ( nread >= 0 ), WSAGetLastError(), mStatus_UnknownErr );
+       
+       if ( nread > 0 )
        {
-               ret = 0;
+               dlog( kDebugLevelChatty, DEBUG_NAME "mDNSPlatformReadTCP: 0x%x:%d read %d bytes\n", sock, sock->fd, nread );
        }
-       else if ( sock->lastError == 0 )
+       else if ( !nread )
        {
-               // First check to see if we have any data left in our buffer
-
-               bytesLeft = ( DWORD ) ( sock->eptr - sock->bptr );
-
-               if ( bytesLeft )
-               {
-                       unsigned long bytesToCopy = ( bytesLeft < inBufferSize ) ? bytesLeft : inBufferSize;
-
-                       memcpy( inBuffer, sock->bptr, bytesToCopy );
-                       sock->bptr += bytesToCopy;
-
-                       if ( !sock->overlapped.pending && ( sock->bptr == sock->eptr ) )
-                       {
-                               sock->bptr = sock->bbuf;
-                               sock->eptr = sock->bbuf;
-                       }
-
-                       ret = bytesToCopy;
-               }
-               else
-               {
-                       wsaError = WSAEWOULDBLOCK;
-               }
+               *closed = mDNStrue;
+       }
+       else if ( err == WSAECONNRESET )
+       {
+               *closed = mDNStrue;
+               nread = 0;
+       }
+       else if ( err == WSAEWOULDBLOCK )
+       {
+               nread = 0;
+       }
+       else
+       {
+               LogMsg( "ERROR: mDNSPlatformReadTCP - recv: %d\n", err );
+               nread = -1;
        }
 
-       // Always set the last winsock error, so that we don't inadvertently use a previous one         
-       
-       WSASetLastError( wsaError );
-
-       return ret;
+    return nread;
 }
 
 
@@ -1209,147 +1135,40 @@ mDNSexport int mDNSPlatformTCPGetFD(TCPSocket *sock )
 }
 
 
-//===========================================================================================================================
-//     TCPAddConnection
-//===========================================================================================================================
-
-mStatus TCPAddSocket( mDNS * const inMDNS, TCPSocket *sock )
-{
-       mStatus err;
-
-       ( void ) inMDNS;
-
-       sock->bptr      = sock->bbuf;
-       sock->eptr      = sock->bbuf;
-       sock->ebuf      = sock->bbuf + sizeof( sock->bbuf );
-
-       dlog( kDebugLevelChatty, DEBUG_NAME "adding TCPSocket 0x%x:%d\n", sock, sock->fd );
-       err = TCPBeginRecv( sock );
-       require_noerr( err, exit );
-
-exit:
-
-       return err;
-}
-
 
 //===========================================================================================================================
-//     TCPDidConnect
+//     TCPSocketNotification
 //===========================================================================================================================
 
-mDNSlocal void TCPDidConnect( mDNS * const inMDNS, HANDLE event, void * context )
+mDNSlocal void CALLBACK
+TCPSocketNotification( SOCKET sock, LPWSANETWORKEVENTS event, void *context )
 {
-       TCPSocket * sock = ( TCPSocket* ) context;
-       TCPConnectionCallback callback = NULL;
-       WSANETWORKEVENTS sockEvent;
-       int err = kNoErr;
-
-       if ( inMDNS->p->unregisterWaitableEventFunc )
-       {
-               inMDNS->p->unregisterWaitableEventFunc( inMDNS, event );
-       }
+       TCPSocket                               *tcpSock = ( TCPSocket* ) context;
+       TCPConnectionCallback   callback;
+       int                                             err;
 
-       if ( sock )
-       {
-               callback = ( TCPConnectionCallback ) sock->userCallback;
-               err = WSAEnumNetworkEvents( sock->fd, sock->connectEvent, &sockEvent );
-               require_noerr( err, exit );
-               require_action( sockEvent.lNetworkEvents & FD_CONNECT, exit, err = mStatus_UnknownErr );
-               require_action( sockEvent.iErrorCode[ FD_CONNECT_BIT ] == 0, exit, err = sockEvent.iErrorCode[ FD_CONNECT_BIT ] );
+       DEBUG_UNUSED( sock );
 
-               sock->connected = mDNStrue;
+       require_action( tcpSock, exit, err = mStatus_BadParamErr );
+       callback = ( TCPConnectionCallback ) tcpSock->userCallback;
+       require_action( callback, exit, err = mStatus_BadParamErr );
 
-               if ( sock->fd != INVALID_SOCKET )
+       if ( event && ( event->lNetworkEvents & FD_CONNECT ) )
+       {
+               if ( event->iErrorCode[ FD_CONNECT_BIT ] == 0 )
                {
-                       err = TCPAddSocket( sock->m, sock );
-                       require_noerr( err, exit );
+                       callback( tcpSock, tcpSock->userContext, mDNStrue, 0 );
+                       tcpSock->connected = mDNStrue;
                }
-
-               if ( callback )
+               else
                {
-                       callback( sock, sock->userContext, TRUE, 0 );
+                       callback( tcpSock, tcpSock->userContext, mDNSfalse, event->iErrorCode[ FD_CONNECT_BIT ] );
                }
        }
-
-exit:
-
-       if ( err && callback )
-       {
-               callback( sock, sock->userContext, TRUE, err );
-       }
-}
-
-
-
-//===========================================================================================================================
-//     TCPCanRead
-//===========================================================================================================================
-
-mDNSlocal void TCPCanRead( TCPSocket * sock )
-{
-       TCPConnectionCallback callback = ( TCPConnectionCallback ) sock->userCallback;
-
-       if ( callback )
+       else
        {
-               callback( sock, sock->userContext, mDNSfalse, sock->lastError );
+               callback( tcpSock, tcpSock->userContext, mDNSfalse, 0 );
        }
-}
-
-
-//===========================================================================================================================
-//     TCPBeginRecv
-//===========================================================================================================================
-
-mDNSlocal mStatus TCPBeginRecv( TCPSocket * sock )
-{
-       DWORD   bytesReceived   = 0;
-       DWORD   flags                   = 0;
-       mStatus err;
-
-       dlog( kDebugLevelChatty, DEBUG_NAME "%s: sock = %d\n", __ROUTINE__, sock->fd );
-
-       check( !sock->overlapped.pending );
-
-       ZeroMemory( &sock->overlapped.data, sizeof( sock->overlapped.data ) );
-       sock->overlapped.data.hEvent = sock;
-
-       sock->overlapped.wbuf.buf = ( char* ) sock->eptr;
-       sock->overlapped.wbuf.len = ( ULONG) ( sock->ebuf - sock->eptr );
-       
-       err = WSARecv( sock->fd, &sock->overlapped.wbuf, 1, &bytesReceived, &flags, &sock->overlapped.data, ( LPWSAOVERLAPPED_COMPLETION_ROUTINE ) TCPEndRecv );
-       err = translate_errno( ( err == 0 ) || ( WSAGetLastError() == WSA_IO_PENDING ), WSAGetLastError(), kUnknownErr );
-       require_noerr( err, exit );
-
-       sock->overlapped.pending = TRUE;
-
-exit:
-
-       return err;
-}
-
-
-//===========================================================================================================================
-//     TCPEndRecv
-//===========================================================================================================================
-
-mDNSlocal void CALLBACK TCPEndRecv( DWORD error, DWORD bytesTransferred, LPWSAOVERLAPPED overlapped, DWORD flags )
-{
-       TCPSocket * sock;
-
-       ( void ) flags;
-
-       dlog( kDebugLevelChatty, DEBUG_NAME "%s: error = %d, bytesTransferred = %d\n", __ROUTINE__, error, bytesTransferred );
-       sock = ( overlapped != NULL ) ? overlapped->hEvent : NULL;
-       require_action( sock, exit, error = ( DWORD ) mStatus_BadStateErr );
-       dlog( kDebugLevelChatty, DEBUG_NAME "%s: sock = %d\n", __ROUTINE__, sock->fd );
-       sock->overlapped.error                          = error;
-       sock->overlapped.bytesTransferred       = bytesTransferred;
-       check( sock->overlapped.pending );
-       sock->overlapped.pending                        = FALSE;
-
-       // Queue this socket
-
-       AddToTail( &gTCPDispatchableSockets, sock );
 
 exit:
 
@@ -1357,7 +1176,7 @@ exit:
 }
 
 
-       
+
 //===========================================================================================================================
 //     mDNSPlatformUDPSocket
 //===========================================================================================================================
@@ -1377,12 +1196,11 @@ mDNSexport UDPSocket* mDNSPlatformUDPSocket(mDNS *const m, const mDNSIPPort requ
 
        // Create the socket
 
-       sock->fd                                        = INVALID_SOCKET;
-       sock->recvMsgPtr                        = m->p->unicastSock4.recvMsgPtr;
-       sock->addr                                      = m->p->unicastSock4.addr;
-       sock->ifd                                       = NULL;
-       sock->overlapped.pending        = FALSE;
-       sock->m                                         = m;
+       sock->fd                        = INVALID_SOCKET;
+       sock->recvMsgPtr        = m->p->unicastSock4.recvMsgPtr;
+       sock->addr                      = m->p->unicastSock4.addr;
+       sock->ifd                       = NULL;
+       sock->m                         = m;
 
        // Try at most 10000 times to get a unique random port
 
@@ -1415,7 +1233,7 @@ mDNSexport UDPSocket* mDNSPlatformUDPSocket(mDNS *const m, const mDNSIPPort requ
 
        // Arm the completion routine
 
-       err = UDPBeginRecv( sock );
+       err = mDNSPollRegisterSocket( sock->fd, FD_READ, UDPSocketNotification, sock );
        require_noerr( err, exit ); 
 
        // Bookkeeping
@@ -1428,7 +1246,8 @@ exit:
 
        if ( err && sock )
        {
-               UDPFreeSocket( sock );
+               UDPCloseSocket( sock );
+               free( sock );
                sock = NULL;
        }
 
@@ -1457,20 +1276,8 @@ mDNSexport void mDNSPlatformUDPClose( UDPSocket *sock )
                                last->next = sock->next;
                        }
 
-                       // Alertable I/O is great, except not so much when it comes to closing
-                       // the socket.  Anything that has been previously queued for this socket
-                       // will stay in the queue after you close the socket.  This is problematic
-                       // for obvious reasons. So we'll attempt to workaround this by closing
-                       // the socket which will prevent any further queued packets and then not calling
-                       // UDPFreeSocket directly, but by queueing it using QueueUserAPC.  The queues
-                       // are FIFO, so that will execute *after* any other previous items in the queue
-                       //
-                       // UDPEndRecv will check if the socket is valid, and if not, it will ignore
-                       // the packet
-
                        UDPCloseSocket( sock );
-
-                       QueueUserAPC( ( PAPCFUNC ) UDPFreeSocket, sock->m->p->mainThread, ( ULONG_PTR ) sock );
+                       free( sock );
 
                        gUDPNumSockets--;
 
@@ -1575,16 +1382,121 @@ mDNSexport void mDNSPlatformUpdateProxyList(mDNS *const m, const mDNSInterfaceID
        DEBUG_UNUSED( InterfaceID );
        }
 
+
+mDNSexport void mDNSPlatformSetAllowSleep(mDNS *const m, mDNSBool allowSleep, const char *reason)
+       {
+       DEBUG_UNUSED( m );
+       DEBUG_UNUSED( allowSleep );
+       DEBUG_UNUSED( reason );
+       }
+
 //===========================================================================================================================
 //     mDNSPlatformSendRawPacket
 //===========================================================================================================================
+
+mDNSexport void mDNSPlatformSendWakeupPacket(mDNS *const m, mDNSInterfaceID InterfaceID, char *ethaddr, char *ipaddr, int iteration)
+{
+       unsigned char                   mac[ 6 ];
+       unsigned char                   buf[ 102 ];
+       char                                    hex[ 3 ] = { 0 };
+       unsigned char                   *bufPtr = buf;
+       struct sockaddr_storage saddr;
+       INT                                             len = sizeof( saddr );
+       mDNSBool                                unicast = mDNSfalse;
+       MulticastWakeupStruct   *info;
+       int                                             i;
+       mStatus                                 err;
+
+       (void) InterfaceID;
+
+       require_action( ethaddr, exit, err = mStatus_BadParamErr );
+
+       for ( i = 0; i < 6; i++ )
+       {
+               memcpy( hex, ethaddr + ( i * 3 ), 2 );
+               mac[ i ] = ( unsigned char ) strtoul( hex, NULL, 16 );
+       }
+
+       memset( buf, 0, sizeof( buf ) );
+
+       for ( i = 0; i < 6; i++ )
+       {
+               *bufPtr++ = 0xff;
+       }
        
-mDNSexport void mDNSPlatformSetAllowSleep(mDNS *const m, mDNSBool allowSleep, const char *reason)\r
-    {\r
-    DEBUG_UNUSED( m );\r
-       DEBUG_UNUSED( allowSleep );\r
-       DEBUG_UNUSED( reason );\r
-    }\r
+       for ( i = 0; i < 16; i++ )
+       {
+               memcpy( bufPtr, mac, sizeof( mac ) );
+               bufPtr += sizeof( mac );
+       }
+
+       if ( ipaddr )
+       {
+               if ( WSAStringToAddressA( ipaddr, AF_INET, NULL, ( LPSOCKADDR ) &saddr, &len ) == 0 )
+               {
+                       struct sockaddr_in * saddr4 = ( struct sockaddr_in* ) &saddr;
+                       saddr4->sin_port = htons( 9 );
+                       len = sizeof( *saddr4 );
+
+                       if ( saddr4->sin_addr.s_addr != htonl( INADDR_ANY ) )
+                       {
+                               unicast = mDNStrue;
+                       }
+               }
+               else if ( WSAStringToAddressA( ipaddr, AF_INET6, NULL, ( LPSOCKADDR ) &saddr, &len ) == 0 )
+               {
+                       mDNSInterfaceData *ifd = ( mDNSInterfaceData* ) InterfaceID;
+                       struct sockaddr_in6 * saddr6 = ( struct sockaddr_in6* ) &saddr;
+                       saddr6->sin6_port = htons( 9 );
+
+                       if ( ifd != NULL )
+                       {
+                               saddr6->sin6_scope_id = ifd->scopeID;
+                       }
+
+                       len = sizeof( *saddr6 );
+
+                       if ( memcmp( &saddr6->sin6_addr, &in6addr_any, sizeof( IN6_ADDR ) ) != 0 )
+                       {
+                               unicast = mDNStrue;
+                       }
+               }
+       }
+
+       if ( ( iteration < 2 ) && ( unicast ) )
+       {
+               SendWakeupPacket( m, ( LPSOCKADDR ) &saddr, len, ( const char* ) buf, sizeof( buf ), kUnicastWakeupNumTries, kUnicastWakeupSleepBetweenTries );
+       }               
+
+       info = ( MulticastWakeupStruct* ) malloc( sizeof( MulticastWakeupStruct ) );
+       require_action( info, exit, err = mStatus_NoMemoryErr );
+       info->inMDNS = m;
+       memset( &info->addr, 0, sizeof( info->addr ) );
+       info->addr.sin_family = AF_INET;
+       info->addr.sin_addr.s_addr = AllDNSLinkGroup_v4.ip.v4.NotAnInteger;
+       info->addr.sin_port = htons( 9 );
+       info->addrLen = sizeof( info->addr );
+       memcpy( info->data, buf, sizeof( buf ) );
+       info->dataLen = sizeof( buf );
+       info->numTries  = kMulticastWakeupNumTries;
+       info->msecSleep = kMulticastWakeupSleepBetweenTries;
+
+       _beginthread( SendMulticastWakeupPacket, 0, ( void* ) info );
+
+exit:
+
+       return;
+}
+
+
+mDNSexport mDNSBool mDNSPlatformValidRecordForInterface(AuthRecord *rr, const NetworkInterfaceInfo *intf)
+{
+       DEBUG_UNUSED( rr );
+       DEBUG_UNUSED( intf );
+
+       return mDNStrue;
+}
 
 mDNSexport void mDNSPlatformSendRawPacket(const void *const msg, const mDNSu8 *const end, mDNSInterfaceID InterfaceID)
        {
@@ -1593,6 +1505,16 @@ mDNSexport void mDNSPlatformSendRawPacket(const void *const msg, const mDNSu8 *c
        DEBUG_UNUSED( InterfaceID );
        }
 
+
+mDNSexport void mDNSPlatformSetLocalAddressCacheEntry(mDNS *const m, const mDNSAddr *const tpa, const mDNSEthAddr *const tha, mDNSInterfaceID InterfaceID)
+       {
+       DEBUG_UNUSED( m );
+       DEBUG_UNUSED( tpa );
+       DEBUG_UNUSED( tha );
+       DEBUG_UNUSED( InterfaceID );
+       }
+
+
 mDNSexport void mDNSPlatformReceiveRawPacket(const void *const msg, const mDNSu8 *const end, mDNSInterfaceID InterfaceID)
        {
        DEBUG_UNUSED( msg );
@@ -1600,9 +1522,8 @@ mDNSexport void mDNSPlatformReceiveRawPacket(const void *const msg, const mDNSu8
        DEBUG_UNUSED( InterfaceID );
        }
 
-mDNSexport void mDNSPlatformSetLocalAddressCacheEntry(mDNS *const m, const mDNSAddr *const tpa, const mDNSEthAddr *const tha, mDNSInterfaceID InterfaceID)
+mDNSexport void mDNSPlatformSetLocalARP( const mDNSv4Addr * const tpa, const mDNSEthAddr * const tha, mDNSInterfaceID InterfaceID )
        {
-       DEBUG_UNUSED( m );
        DEBUG_UNUSED( tpa );
        DEBUG_UNUSED( tha );
        DEBUG_UNUSED( InterfaceID );
@@ -1737,15 +1658,6 @@ exit:
 }
 
 
-mDNSexport void FreeEtcHosts(mDNS *const m, AuthRecord *const rr, mStatus result)
-    {
-    (void)m;  // unused
-    (void)rr;
-    (void)result;
-    }
-
-
-
 //===========================================================================================================================
 //     SetDomainSecrets
 //===========================================================================================================================
@@ -1951,7 +1863,7 @@ SetDNSServers( mDNS *const m )
        {
                mDNSAddr addr;
                err = StringToAddress( &addr, ipAddr->IpAddress.String );
-               if ( !err ) mDNS_AddDNSServer(m, mDNSNULL, mDNSInterface_Any, &addr, UnicastDNSPort, mDNSfalse, 0);
+               if ( !err ) mDNS_AddDNSServer(m, mDNSNULL, mDNSInterface_Any, &addr, UnicastDNSPort, mDNSfalse, DEFAULT_UDNS_TIMEOUT, mDNSfalse);
        }
 
 exit:
@@ -2133,23 +2045,6 @@ exit:
        return err;
 }
 
-mDNSexport void mDNSPlatformSendWakeupPacket(mDNS *const m, mDNSInterfaceID InterfaceID, char *EthAddr, char *IPAddr, int iteration)
-       {
-       (void) m;
-       (void) InterfaceID;
-       (void) EthAddr;
-       (void) IPAddr;
-       (void) iteration;
-       }
-
-mDNSexport mDNSBool mDNSPlatformValidRecordForInterface(AuthRecord *rr, const NetworkInterfaceInfo *intf)
-       {
-       (void) rr;
-       (void) intf;
-
-       return 1;
-       }
-
 
 #if 0
 #pragma mark -
@@ -2496,51 +2391,56 @@ mStatus SetupInterfaceList( mDNS * const inMDNS )
        // Set up IPv6 interface(s) after IPv4 is set up (see IPv4 notes above for reasoning).
        
 #if( MDNS_WINDOWS_ENABLE_IPV6 )
-       for( p = addrs; p; p = p->ifa_next )
+
+       if ( gEnableIPv6 )
        {
-               if( !p->ifa_addr || ( p->ifa_addr->sa_family != AF_INET6 ) || ( ( p->ifa_flags & flagMask ) != flagTest ) )
+               for( p = addrs; p; p = p->ifa_next )
                {
-                       continue;
-               }
-               if( p->ifa_flags & IFF_LOOPBACK )
-               {
-                       if( !loopbackv6 )
+                       if( !p->ifa_addr || ( p->ifa_addr->sa_family != AF_INET6 ) || ( ( p->ifa_flags & flagMask ) != flagTest ) )
                        {
-                               loopbackv6 = p;
+                               continue;
+                       }
+                       if( p->ifa_flags & IFF_LOOPBACK )
+                       {
+                               if( !loopbackv6 )
+                               {
+                                       loopbackv6 = p;
+                               }
+                               continue;
+                       }
+                       dlog( kDebugLevelVerbose, DEBUG_NAME "Interface %40s (0x%08X) %##a\n", 
+                               p->ifa_name ? p->ifa_name : "<null>", p->ifa_extra.index, p->ifa_addr );
+                       
+                       err = SetupInterface( inMDNS, p, &ifd );
+                       require_noerr( err, exit );
+                                       
+                       // If this guy is point-to-point (ifd->interfaceInfo.McastTxRx == 0 ) we still want to
+                       // register him, but we also want to note that we haven't found a v4 interface
+                       // so that we register loopback so same host operations work
+                       
+                       if ( ifd->interfaceInfo.McastTxRx == mDNStrue )
+                       {
+                               foundv6 = mDNStrue;
                        }
-                       continue;
-               }
-               dlog( kDebugLevelVerbose, DEBUG_NAME "Interface %40s (0x%08X) %##a\n", 
-                       p->ifa_name ? p->ifa_name : "<null>", p->ifa_extra.index, p->ifa_addr );
-               
-               err = SetupInterface( inMDNS, p, &ifd );
-               require_noerr( err, exit );
-                               
-               // If this guy is point-to-point (ifd->interfaceInfo.McastTxRx == 0 ) we still want to
-               // register him, but we also want to note that we haven't found a v4 interface
-               // so that we register loopback so same host operations work
-               
-               if ( ifd->interfaceInfo.McastTxRx == mDNStrue )
-               {
-                       foundv6 = mDNStrue;
-               }
 
-               // If we're on a platform that doesn't have WSARecvMsg(), there's no way
-               // of determing the destination address of a packet that is sent to us.
-               // For multicast packets, that's easy to determine.  But for the unicast
-               // sockets, we'll fake it by taking the address of the first interface
-               // that is successfully setup.
+                       // If we're on a platform that doesn't have WSARecvMsg(), there's no way
+                       // of determing the destination address of a packet that is sent to us.
+                       // For multicast packets, that's easy to determine.  But for the unicast
+                       // sockets, we'll fake it by taking the address of the first interface
+                       // that is successfully setup.
 
-               if ( !foundUnicastSock6DestAddr )
-               {
-                       inMDNS->p->unicastSock6.addr = ifd->interfaceInfo.ip;
-                       foundUnicastSock6DestAddr = TRUE;
-               }
+                       if ( !foundUnicastSock6DestAddr )
+                       {
+                               inMDNS->p->unicastSock6.addr = ifd->interfaceInfo.ip;
+                               foundUnicastSock6DestAddr = TRUE;
+                       }
 
-               *next = ifd;
-               next  = &ifd->next;
-               ++inMDNS->p->interfaceCount;
+                       *next = ifd;
+                       next  = &ifd->next;
+                       ++inMDNS->p->interfaceCount;
+               }
        }
+
 #endif
 
        // If there are no real interfaces, but there is a loopback interface, use that so same-machine operations work.
@@ -2607,17 +2507,21 @@ mStatus SetupInterfaceList( mDNS * const inMDNS )
                
 #if( MDNS_WINDOWS_ENABLE_IPV6 )
 
-               // If we're on a platform that doesn't have WSARecvMsg(), there's no way
-               // of determing the destination address of a packet that is sent to us.
-               // For multicast packets, that's easy to determine.  But for the unicast
-               // sockets, we'll fake it by taking the address of the first interface
-               // that is successfully setup.
-
-               if ( !foundUnicastSock6DestAddr )
+               if ( gEnableIPv6 )
                {
-                       inMDNS->p->unicastSock6.addr = ifd->sock.addr;
-                       foundUnicastSock6DestAddr = TRUE;
+                       // If we're on a platform that doesn't have WSARecvMsg(), there's no way
+                       // of determing the destination address of a packet that is sent to us.
+                       // For multicast packets, that's easy to determine.  But for the unicast
+                       // sockets, we'll fake it by taking the address of the first interface
+                       // that is successfully setup.
+
+                       if ( !foundUnicastSock6DestAddr )
+                       {
+                               inMDNS->p->unicastSock6.addr = ifd->sock.addr;
+                               foundUnicastSock6DestAddr = TRUE;
+                       }
                }
+
 #endif
 
                *next = ifd;
@@ -2710,13 +2614,12 @@ mDNSlocal mStatus       SetupInterface( mDNS * const inMDNS, const struct ifaddrs *inI
        
        ifd = (mDNSInterfaceData *) calloc( 1, sizeof( *ifd ) );
        require_action( ifd, exit, err = mStatus_NoMemoryErr );
-       ifd->sock.fd            = kInvalidSocketRef;
-       ifd->sock.overlapped.pending = FALSE;
-       ifd->sock.ifd           = ifd;
-       ifd->sock.next          = NULL;
-       ifd->sock.m                     = inMDNS;
-       ifd->index                      = inIFA->ifa_extra.index;
-       ifd->scopeID            = inIFA->ifa_extra.index;
+       ifd->sock.fd    = kInvalidSocketRef;
+       ifd->sock.ifd   = ifd;
+       ifd->sock.next  = NULL;
+       ifd->sock.m             = inMDNS;
+       ifd->index              = inIFA->ifa_extra.index;
+       ifd->scopeID    = inIFA->ifa_extra.index;
        check( strlen( inIFA->ifa_name ) < sizeof( ifd->name ) );
        strncpy( ifd->name, inIFA->ifa_name, sizeof( ifd->name ) - 1 );
        ifd->name[ sizeof( ifd->name ) - 1 ] = '\0';
@@ -2801,7 +2704,7 @@ mDNSlocal mStatus SetupInterface( mDNS * const inMDNS, const struct ifaddrs *inI
 
        if ( ifd->sock.fd != kInvalidSocketRef )
        {
-               err = UDPBeginRecv( &ifd->sock );
+               err = mDNSPollRegisterSocket( ifd->sock.fd, FD_READ, UDPSocketNotification, &ifd->sock );
                require_noerr( err, exit );
        }
 
@@ -2899,7 +2802,7 @@ mDNSlocal mStatus SetupSocket( mDNS * const inMDNS, const struct sockaddr *inAdd
        // Turn on reuse address option so multiple servers can listen for Multicast DNS packets,
        // if we're creating a multicast socket
        
-       if ( port.NotAnInteger )
+       if ( !mDNSIPPortIsZero( port ) )
        {
                option = 1;
                err = setsockopt( sock, SOL_SOCKET, SO_REUSEADDR, (char *) &option, sizeof( option ) );
@@ -2950,7 +2853,7 @@ mDNSlocal mStatus SetupSocket( mDNS * const inMDNS, const struct sockaddr *inAdd
                err = setsockopt( sock, IPPROTO_IP, IP_PKTINFO, (char *) &option, sizeof( option ) );
                check_translated_errno( err == 0, errno_compat(), kOptionErr );
                
-               if (port.NotAnInteger)
+               if ( !mDNSIPPortIsZero( port ) )
                {
                        // Join the all-DNS multicast group so we receive Multicast DNS packets
 
@@ -3021,7 +2924,7 @@ mDNSlocal mStatus SetupSocket( mDNS * const inMDNS, const struct sockaddr *inAdd
                        check_translated_errno( err == 0, errno_compat(), kOptionErr );         
                #endif
                
-               if ( port.NotAnInteger )
+               if ( !mDNSIPPortIsZero( port ) )
                {
                        // Join the all-DNS multicast group so we receive Multicast DNS packets.
                
@@ -3131,63 +3034,76 @@ mDNSlocal mStatus       SockAddrToMDNSAddr( const struct sockaddr * const inSA, mDNSAd
 #endif
 
 //===========================================================================================================================
-//     UDPBeginRecv
+//     UDPSocketNotification
 //===========================================================================================================================
 
-mDNSlocal OSStatus UDPBeginRecv( UDPSocket * sock )
+mDNSlocal void CALLBACK
+UDPSocketNotification( SOCKET sock, LPWSANETWORKEVENTS event, void *context )
 {
-       DWORD   size;
-       DWORD   numTries;
-       mStatus err;
+       UDPSocket                               *udpSock = ( UDPSocket* ) context;
+       WSAMSG                                  wmsg;
+       WSABUF                                  wbuf;
+       struct sockaddr_storage sockSrcAddr;            // This is filled in by the WSARecv* function
+       INT                                             sockSrcAddrLen;         // See above
+       mDNSAddr                                srcAddr;
+       mDNSInterfaceID                 iid;
+       mDNSIPPort                              srcPort;
+       mDNSAddr                                dstAddr;
+       mDNSIPPort                              dstPort;
+       uint8_t                                 controlBuffer[ 128 ];
+       mDNSu8                          *       end;
+       int                                             num;
+       DWORD                                   numTries;
+       mStatus                                 err;
 
-       dlog( kDebugLevelChatty, DEBUG_NAME "%s: sock = %d\n", __ROUTINE__, sock->fd );
-       
-       require_action( sock != NULL, exit, err = mStatus_BadStateErr );
-       check( !sock->overlapped.pending );
-       
-       // Initialize the buffer structure
+       DEBUG_UNUSED( sock );
+       DEBUG_UNUSED( event );
 
-       sock->overlapped.wbuf.buf       = (char *) &sock->packet;
-       sock->overlapped.wbuf.len       = (u_long) sizeof( sock->packet );
-       sock->srcAddrLen                        = sizeof( sock->srcAddr );
+       require_action( udpSock != NULL, exit, err = mStatus_BadStateErr );
 
-       // Initialize the overlapped structure
+       dlog( kDebugLevelChatty, DEBUG_NAME "%s: sock = %d\n", __ROUTINE__, udpSock->fd );
+       
+       // Initialize the buffer structure
 
-       ZeroMemory( &sock->overlapped.data, sizeof( OVERLAPPED ) );
-       sock->overlapped.data.hEvent = sock;
+       wbuf.buf                = (char *) &udpSock->packet;
+       wbuf.len                = (u_long) sizeof( udpSock->packet );
+       sockSrcAddrLen  = sizeof( sockSrcAddr );
 
        numTries = 0;
 
        do
        {
-               if ( sock->recvMsgPtr )
+               if ( udpSock->recvMsgPtr )
                {
-                       sock->wmsg.name                         = ( LPSOCKADDR ) &sock->srcAddr;
-                       sock->wmsg.namelen                      = sock->srcAddrLen;
-                       sock->wmsg.lpBuffers            = &sock->overlapped.wbuf;
-                       sock->wmsg.dwBufferCount        = 1;
-                       sock->wmsg.Control.buf          = ( CHAR* ) sock->controlBuffer;
-                       sock->wmsg.Control.len          = sizeof( sock->controlBuffer );
-                       sock->wmsg.dwFlags                      = 0;
+                       DWORD size;
+
+                       wmsg.name                       = ( LPSOCKADDR ) &sockSrcAddr;
+                       wmsg.namelen            = sockSrcAddrLen;
+                       wmsg.lpBuffers          = &wbuf;
+                       wmsg.dwBufferCount      = 1;
+                       wmsg.Control.buf        = ( CHAR* ) controlBuffer;
+                       wmsg.Control.len        = sizeof( controlBuffer );
+                       wmsg.dwFlags            = 0;
 
-                       err = sock->recvMsgPtr( sock->fd, &sock->wmsg, &size, &sock->overlapped.data, ( LPWSAOVERLAPPED_COMPLETION_ROUTINE ) UDPEndRecv );
-                       err = translate_errno( ( err == 0 ) || ( WSAGetLastError() == WSA_IO_PENDING ), (OSStatus) WSAGetLastError(), kUnknownErr ); 
+                       err = udpSock->recvMsgPtr( udpSock->fd, &wmsg, &size, NULL, NULL );
+                       err = translate_errno( ( err == 0 ), (OSStatus) WSAGetLastError(), kUnknownErr ); 
+                       num = ( int ) size;
 
                        // <rdar://problem/7824093> iTunes 9.1 fails to install with Bonjour service on Windows 7 Ultimate
                        //
-                       // There seems to be a bug in some network device drivers that involves calling WSARecvMsg() in
-                       // overlapped i/o mode. Although all the parameters to WSARecvMsg() are correct, it returns a
+                       // There seems to be a bug in some network device drivers that involves calling WSARecvMsg().
+                       // Although all the parameters to WSARecvMsg() are correct, it returns a
                        // WSAEFAULT error code when there is no actual error. We have found experientially that falling
                        // back to using WSARecvFrom() when this happens will work correctly.
 
-                       if ( err == WSAEFAULT ) sock->recvMsgPtr = NULL;
+                       if ( err == WSAEFAULT ) udpSock->recvMsgPtr = NULL;
                }
                else
                {
                        DWORD flags = 0;
 
-                       err = WSARecvFrom( sock->fd, &sock->overlapped.wbuf, 1, NULL, &flags, ( LPSOCKADDR ) &sock->srcAddr, &sock->srcAddrLen, &sock->overlapped.data, ( LPWSAOVERLAPPED_COMPLETION_ROUTINE ) UDPEndRecv );
-                       err = translate_errno( ( err == 0 ) || ( WSAGetLastError() == WSA_IO_PENDING ), ( OSStatus ) WSAGetLastError(), kUnknownErr );
+                       num = WSARecvFrom( udpSock->fd, &wbuf, 1, NULL, &flags, ( LPSOCKADDR ) &sockSrcAddr, &sockSrcAddrLen, NULL, NULL );
+                       err = translate_errno( ( num >= 0 ), ( OSStatus ) WSAGetLastError(), kUnknownErr );
                }
 
                // According to MSDN <http://msdn.microsoft.com/en-us/library/ms741687(VS.85).aspx>:
@@ -3202,53 +3118,21 @@ mDNSlocal OSStatus UDPBeginRecv( UDPSocket * sock )
                require_action( !err || ( err == WSAECONNRESET ) || ( err == WSAEFAULT ), exit, err = WSAGetLastError() );
        }
        while ( ( ( err == WSAECONNRESET ) || ( err == WSAEFAULT ) ) && ( numTries++ < 100 ) );
-
-       sock->overlapped.pending = TRUE;
-
-exit:
-
-       if ( err )
-       {
-               LogMsg( "WSARecvMsg failed (%d)\n", err );
-       }
-
-       return err;
-}
-
-
-//===========================================================================================================================
-//     UDPEndRecv
-//===========================================================================================================================
-
-mDNSlocal void CALLBACK UDPEndRecv( DWORD err, DWORD bytesTransferred, LPWSAOVERLAPPED overlapped, DWORD flags )
-{
-       UDPSocket * sock = NULL;
-
-       ( void ) flags;
        
-       dlog( kDebugLevelChatty, DEBUG_NAME "%s: err = %d, bytesTransferred = %d\n", __ROUTINE__, err, bytesTransferred );
-       require_action_quiet( err != WSA_OPERATION_ABORTED, exit, err = ( DWORD ) kUnknownErr );
        require_noerr( err, exit );
-       sock = ( overlapped != NULL ) ? overlapped->hEvent : NULL;
-       require_action( sock != NULL, exit, err = ( DWORD ) kUnknownErr );
-       dlog( kDebugLevelChatty, DEBUG_NAME "%s: sock = %d\n", __ROUTINE__, sock->fd );
-       sock->overlapped.error                          = err;
-       sock->overlapped.bytesTransferred       = bytesTransferred;
-       check( sock->overlapped.pending );
-       sock->overlapped.pending                        = FALSE;
        
        // Translate the source of this packet into mDNS data types
 
-       SockAddrToMDNSAddr( (struct sockaddr *) &sock->srcAddr, &sock->overlapped.srcAddr, &sock->overlapped.srcPort );
+       SockAddrToMDNSAddr( (struct sockaddr* ) &sockSrcAddr, &srcAddr, &srcPort );
        
        // Initialize the destination of this packet. Just in case
        // we can't determine this info because we couldn't call
        // WSARecvMsg (recvMsgPtr)
 
-       sock->overlapped.dstAddr = sock->addr;
-       sock->overlapped.dstPort = sock->port;
+       dstAddr = udpSock->addr;
+       dstPort = udpSock->port;
 
-       if ( sock->recvMsgPtr )
+       if ( udpSock->recvMsgPtr )
        {
                LPWSACMSGHDR    header;
                LPWSACMSGHDR    last = NULL;
@@ -3267,7 +3151,7 @@ mDNSlocal void CALLBACK UDPEndRecv( DWORD err, DWORD bytesTransferred, LPWSAOVER
                // after 100 iterations, just in case the corruption isn't caught by the first
                // check.
 
-               for ( header = WSA_CMSG_FIRSTHDR( &sock->wmsg ); header; header = WSA_CMSG_NXTHDR( &sock->wmsg, header ) )
+               for ( header = WSA_CMSG_FIRSTHDR( &wmsg ); header; header = WSA_CMSG_NXTHDR( &wmsg, header ) )
                {
                        if ( ( header != last ) && ( ++count < 100 ) )
                        {
@@ -3279,13 +3163,13 @@ mDNSlocal void CALLBACK UDPEndRecv( DWORD err, DWORD bytesTransferred, LPWSAOVER
                                        
                                        ipv4PacketInfo = (IN_PKTINFO *) WSA_CMSG_DATA( header );
 
-                                       if ( sock->ifd != NULL )
+                                       if ( udpSock->ifd != NULL )
                                        {
-                                               require_action( ipv4PacketInfo->ipi_ifindex == sock->ifd->index, exit, err = ( DWORD ) kMismatchErr );
+                                               require_action( ipv4PacketInfo->ipi_ifindex == udpSock->ifd->index, exit, err = ( DWORD ) kMismatchErr );
                                        }
 
-                                       sock->overlapped.dstAddr.type                           = mDNSAddrType_IPv4;
-                                       sock->overlapped.dstAddr.ip.v4.NotAnInteger     = ipv4PacketInfo->ipi_addr.s_addr;
+                                       dstAddr.type                            = mDNSAddrType_IPv4;
+                                       dstAddr.ip.v4.NotAnInteger      = ipv4PacketInfo->ipi_addr.s_addr;
                                }
                                else if( ( header->cmsg_level == IPPROTO_IPV6 ) && ( header->cmsg_type == IPV6_PKTINFO ) )
                                {
@@ -3293,13 +3177,13 @@ mDNSlocal void CALLBACK UDPEndRecv( DWORD err, DWORD bytesTransferred, LPWSAOVER
                                                
                                        ipv6PacketInfo = (IN6_PKTINFO *) WSA_CMSG_DATA( header );
                
-                                       if ( sock->ifd != NULL )
+                                       if ( udpSock->ifd != NULL )
                                        {
-                                               require_action( ipv6PacketInfo->ipi6_ifindex == ( sock->ifd->index - kIPv6IfIndexBase ), exit, err = ( DWORD ) kMismatchErr );
+                                               require_action( ipv6PacketInfo->ipi6_ifindex == ( udpSock->ifd->index - kIPv6IfIndexBase ), exit, err = ( DWORD ) kMismatchErr );
                                        }
 
-                                       sock->overlapped.dstAddr.type   = mDNSAddrType_IPv6;
-                                       sock->overlapped.dstAddr.ip.v6  = *( (mDNSv6Addr *) &ipv6PacketInfo->ipi6_addr );
+                                       dstAddr.type    = mDNSAddrType_IPv6;
+                                       dstAddr.ip.v6   = *( (mDNSv6Addr *) &ipv6PacketInfo->ipi6_addr );
                                }
                        }
                        else
@@ -3318,20 +3202,21 @@ mDNSlocal void CALLBACK UDPEndRecv( DWORD err, DWORD bytesTransferred, LPWSAOVER
        }
 
        dlog( kDebugLevelChatty, DEBUG_NAME "packet received\n" );
-       dlog( kDebugLevelChatty, DEBUG_NAME "    size      = %d\n", bytesTransferred );
-       dlog( kDebugLevelChatty, DEBUG_NAME "    src       = %#a:%u\n", &sock->overlapped.srcAddr, ntohs( sock->overlapped.srcPort.NotAnInteger ) );
-       dlog( kDebugLevelChatty, DEBUG_NAME "    dst       = %#a:%u\n", &sock->overlapped.dstAddr, ntohs( sock->overlapped.dstPort.NotAnInteger ) );
+       dlog( kDebugLevelChatty, DEBUG_NAME "    size      = %d\n", num );
+       dlog( kDebugLevelChatty, DEBUG_NAME "    src       = %#a:%u\n", &srcAddr, ntohs( srcPort.NotAnInteger ) );
+       dlog( kDebugLevelChatty, DEBUG_NAME "    dst       = %#a:%u\n", &dstAddr, ntohs( dstPort.NotAnInteger ) );
        
-       if ( sock->ifd != NULL )
+       if ( udpSock->ifd != NULL )
        {
-               dlog( kDebugLevelChatty, DEBUG_NAME "    interface = %#a (index=0x%08X)\n", &sock->ifd->interfaceInfo.ip, sock->ifd->index );
+               dlog( kDebugLevelChatty, DEBUG_NAME "    interface = %#a (index=0x%08X)\n", &udpSock->ifd->interfaceInfo.ip, udpSock->ifd->index );
        }
 
        dlog( kDebugLevelChatty, DEBUG_NAME "\n" );
 
-       // Queue this socket
-       
-       AddToTail( &gUDPDispatchableSockets, sock );
+       iid = udpSock->ifd ? udpSock->ifd->interfaceInfo.InterfaceID : NULL;
+       end = ( (mDNSu8 *) &udpSock->packet ) + num;
+
+       mDNSCoreReceive( udpSock->m, &udpSock->packet, end, &srcAddr, srcPort, &dstAddr, dstPort, iid );
 
 exit:
 
@@ -3597,9 +3482,7 @@ mDNSlocal int     getifaddrs_ipv6( struct ifaddrs **outAddrs )
                for( addrIndex = 0, addr = iaa->FirstUnicastAddress; addr; ++addrIndex, addr = addr->Next )
                {                       
                        int                                             family;
-                       int                                             prefixIndex;
                        IP_ADAPTER_PREFIX *             prefix;
-                       ULONG                                   prefixLength;
                        uint32_t                                ipv4Index;
                        struct sockaddr_in              ipv4Netmask;
 
@@ -3711,18 +3594,8 @@ mDNSlocal int    getifaddrs_ipv6( struct ifaddrs **outAddrs )
                        check( ifa->ifa_addr );
                        
                        // Get subnet mask (IPv4)/link prefix (IPv6). It is specified as a bit length (e.g. 24 for 255.255.255.0).
-                       
-                       prefixLength = 0;
-                       for( prefixIndex = 0, prefix = firstPrefix; prefix; ++prefixIndex, prefix = prefix->Next )
-                       {
-                               if( ( prefix->Address.lpSockaddr->sa_family == family ) && ( prefixIndex == addrIndex ) )
-                               {
-                                       check_string( prefix->Address.lpSockaddr->sa_family == family, "addr family != netmask family" );
-                                       prefixLength = prefix->PrefixLength;
-                                       break;
-                               }
-                       }
-                       switch( family )
+
+                       switch ( family )
                        {
                                case AF_INET:
                                {
@@ -3737,33 +3610,75 @@ mDNSlocal int   getifaddrs_ipv6( struct ifaddrs **outAddrs )
                                        ifa->ifa_netmask = (struct sockaddr *) sa4;
                                        break;
                                }
-                               
+
                                case AF_INET6:
                                {
-                                       struct sockaddr_in6 *           sa6;
-                                       int                                                     len;
-                                       int                                                     maskIndex;
-                                       uint8_t                                         maskByte;
-                                       
-                                       require_action( prefixLength <= 128, exit, err = ERROR_INVALID_DATA );
-                                       
+                                       struct sockaddr_in6 *sa6;
+                                       char buf[ 256 ] = { 0 };
+                                       DWORD buflen = sizeof( buf );
+
                                        sa6 = (struct sockaddr_in6 *) calloc( 1, sizeof( *sa6 ) );
                                        require_action( sa6, exit, err = WSAENOBUFS );
                                        sa6->sin6_family = AF_INET6;
-                                       
-                                       if( prefixLength == 0 )
-                                       {
-                                               dlog( kDebugLevelWarning, DEBUG_NAME "%s: IPv6 link prefix 0, defaulting to /128\n", __ROUTINE__ );
-                                               prefixLength = 128;
-                                       }
-                                       maskIndex = 0;
-                                       for( len = (int) prefixLength; len > 0; len -= 8 )
+                                       memset( sa6->sin6_addr.s6_addr, 0xFF, sizeof( sa6->sin6_addr.s6_addr ) );
+                                       ifa->ifa_netmask = (struct sockaddr *) sa6;
+
+                                       for ( prefix = firstPrefix; prefix; prefix = prefix->Next )
                                        {
-                                               if( len >= 8 ) maskByte = 0xFF;
-                                               else               maskByte = (uint8_t)( ( 0xFFU << ( 8 - len ) ) & 0xFFU );
-                                               sa6->sin6_addr.s6_addr[ maskIndex++ ] = maskByte;
+                                               IN6_ADDR        mask;
+                                               IN6_ADDR        maskedAddr;
+                                               int                     maskIndex;
+                                               DWORD           len;
+
+                                               // According to MSDN:
+                                               // "On Windows Vista and later, the linked IP_ADAPTER_PREFIX structures pointed to by the FirstPrefix member
+                                               // include three IP adapter prefixes for each IP address assigned to the adapter. These include the host IP address prefix,
+                                               // the subnet IP address prefix, and the subnet broadcast IP address prefix.
+                                               // In addition, for each adapter there is a multicast address prefix and a broadcast address prefix.
+                                               // On Windows XP with SP1 and later prior to Windows Vista, the linked IP_ADAPTER_PREFIX structures pointed to by the FirstPrefix member
+                                               // include only a single IP adapter prefix for each IP address assigned to the adapter."
+                                               
+                                               // We're only interested in the subnet IP address prefix.  We'll determine if the prefix is the
+                                               // subnet prefix by masking our address with a mask (computed from the prefix length) and see if that is the same
+                                               // as the prefix address.
+
+                                               if ( ( prefix->PrefixLength == 0 ) ||
+                                                    ( prefix->PrefixLength > 128 ) ||
+                                                    ( addr->Address.iSockaddrLength != prefix->Address.iSockaddrLength ) ||
+                                                        ( memcmp( addr->Address.lpSockaddr, prefix->Address.lpSockaddr, addr->Address.iSockaddrLength ) == 0 ) )
+                                               {
+                                                       continue;
+                                               }
+
+                                               // Compute the mask
+
+                                               memset( mask.s6_addr, 0, sizeof( mask.s6_addr ) );
+
+                                               for ( len = (int) prefix->PrefixLength, maskIndex = 0; len > 0; len -= 8 )
+                                               {
+                                                       uint8_t maskByte = ( len >= 8 ) ? 0xFF : (uint8_t)( ( 0xFFU << ( 8 - len ) ) & 0xFFU );
+                                                       mask.s6_addr[ maskIndex++ ] = maskByte;
+                                               }
+
+                                               // Apply the mask
+
+                                               for ( i = 0; i < 16; i++ )
+                                               {
+                                                       maskedAddr.s6_addr[ i ] = ( ( struct sockaddr_in6* ) addr->Address.lpSockaddr )->sin6_addr.s6_addr[ i ] & mask.s6_addr[ i ];
+                                               }
+
+                                               // Compare
+
+                                               if ( memcmp( ( ( struct sockaddr_in6* ) prefix->Address.lpSockaddr )->sin6_addr.s6_addr, maskedAddr.s6_addr, sizeof( maskedAddr.s6_addr ) ) == 0 )
+                                               {
+                                                       memcpy( sa6->sin6_addr.s6_addr, mask.s6_addr, sizeof( mask.s6_addr ) );
+                                                       break;
+                                               }
                                        }
-                                       ifa->ifa_netmask = (struct sockaddr *) sa6;
+
+                                       WSAAddressToStringA( ( LPSOCKADDR ) sa6, sizeof( struct sockaddr_in6 ), NULL, buf, &buflen );
+                                       dlog( kDebugLevelInfo, DEBUG_NAME "%s: IPv6 mask = %s\n", __ROUTINE__, buf );                           
+
                                        break;
                                }
                                
@@ -4475,40 +4390,11 @@ TCPCloseSocket( TCPSocket * sock )
 {
        dlog( kDebugLevelChatty, DEBUG_NAME "closing TCPSocket 0x%x:%d\n", sock, sock->fd );
 
-       RemoveFromList( &gTCPDispatchableSockets, sock );       
-
-       if ( sock->fd != INVALID_SOCKET )
-       {
-               closesocket( sock->fd );
-               sock->fd = INVALID_SOCKET;
-       }
-}
-
-
-//===========================================================================================================================
-//     TCPFreeSocket
-//===========================================================================================================================
-
-mDNSlocal void CALLBACK
-TCPFreeSocket( TCPSocket *sock )
-{
-       check( sock );
-
-       dlog( kDebugLevelChatty, DEBUG_NAME "freeing TCPSocket 0x%x:%d\n", sock, sock->fd );
-       
-       if ( sock->connectEvent )
-       {
-               CloseHandle( sock->connectEvent );
-               sock->connectEvent = NULL;
-       }
-
        if ( sock->fd != INVALID_SOCKET )
        {
                closesocket( sock->fd );
                sock->fd = INVALID_SOCKET;
        }
-
-       free( sock );
 }
 
 
@@ -4521,36 +4407,15 @@ UDPCloseSocket( UDPSocket * sock )
 {
        dlog( kDebugLevelChatty, DEBUG_NAME "closing UDPSocket %d\n", sock->fd );
 
-       RemoveFromList( &gUDPDispatchableSockets, sock );
-
        if ( sock->fd != INVALID_SOCKET )
        {
+               mDNSPollUnregisterSocket( sock->fd );
                closesocket( sock->fd );
                sock->fd = INVALID_SOCKET;
        }
 }
 
 
-//===========================================================================================================================
-//  UDPFreeSocket
-//===========================================================================================================================
-
-mDNSlocal void CALLBACK
-UDPFreeSocket( UDPSocket * sock )
-{
-    check( sock );
-
-       dlog( kDebugLevelChatty, DEBUG_NAME "freeing UDPSocket %d\n", sock->fd );
-
-    if ( sock->fd != INVALID_SOCKET )
-    {          
-        closesocket( sock->fd );
-               sock->fd = INVALID_SOCKET;
-    }
-
-    free( sock );
-}
-
 //===========================================================================================================================
 //     SetupAddr
 //===========================================================================================================================
@@ -4744,7 +4609,7 @@ mDNSlocal void SetDomainSecret( mDNS * const m, const domainname * inDomain )
                        require_action( ptr, exit, err = mStatus_NoMemoryErr );
                }
 
-               err = mDNS_SetSecretForDomain(m, ptr, &domain, &key, outSecret, NULL );
+               err = mDNS_SetSecretForDomain(m, ptr, &domain, &key, outSecret, NULL, NULL, FALSE );
                require_action( err != mStatus_BadParamErr, exit, if (!foundInList ) mDNSPlatformMemFree( ptr ) );
 
                debugf("Setting shared secret for zone %s with key %##s", outDomain, key.c);
@@ -5083,85 +4948,71 @@ exit:
 }
 
 
-void
-DispatchSocketEvents( mDNS * const inMDNS )
-{
-       UDPSocket * udpSock;
-       TCPSocket * tcpSock;
-
-       while ( ( udpSock = ( UDPSocket* ) gUDPDispatchableSockets.Head ) != NULL )
-       {
-               dlog( kDebugLevelChatty, DEBUG_NAME "%s: calling DispatchUDPEvent on socket %d, error = %d, bytesTransferred = %d\n",
-                                                    __ROUTINE__, udpSock->fd, udpSock->overlapped.error, udpSock->overlapped.bytesTransferred );
-               RemoveFromList( &gUDPDispatchableSockets, udpSock );
-               DispatchUDPEvent( inMDNS, udpSock );
-       }
-               
-       while ( ( tcpSock = ( TCPSocket* ) gTCPDispatchableSockets.Head ) != NULL )
-       {
-               dlog( kDebugLevelChatty, DEBUG_NAME "%s: calling DispatchTCPEvent on socket %d, error = %d, bytesTransferred = %d\n",
-                                                    __ROUTINE__, tcpSock->fd, tcpSock->overlapped.error, tcpSock->overlapped.bytesTransferred );
-               RemoveFromList( &gTCPDispatchableSockets, tcpSock );
-               DispatchTCPEvent( inMDNS, tcpSock );
-       }
-}
-
-
 mDNSlocal void
-DispatchUDPEvent( mDNS * const inMDNS, UDPSocket * sock )
+SendWakeupPacket( mDNS * const inMDNS, LPSOCKADDR addr, INT addrlen, const char * buf, INT buflen, INT numTries, INT msecSleep )
 {
+       mDNSBool        repeat = ( numTries == 1 ) ? mDNStrue : mDNSfalse;
+       SOCKET          sock;
+       int                     num;
+       mStatus         err;
+
        ( void ) inMDNS;
 
-       // If we've closed the socket, then we want to ignore
-       // this read.  The packet might have been queued before
-       // the socket was closed.
+       sock = socket( addr->sa_family, SOCK_DGRAM, IPPROTO_UDP );
+       require_action( sock != INVALID_SOCKET, exit, err = mStatus_UnknownErr );
 
-       if ( sock->fd != INVALID_SOCKET )
+       while ( numTries-- )
        {
-               const mDNSInterfaceID   iid = sock->ifd ? sock->ifd->interfaceInfo.InterfaceID : NULL;
-               mDNSu8                          *       end = ( (mDNSu8 *) &sock->packet ) + sock->overlapped.bytesTransferred;
+               num = sendto( sock, ( const char* ) buf, buflen, 0, addr, addrlen );
+
+               if ( num != buflen )
+               {
+                       LogMsg( "SendWakeupPacket error: sent %d bytes: %d\n", num, WSAGetLastError() );
+               }
+
+               if ( repeat )
+               {
+                       num = sendto( sock, buf, buflen, 0, addr, addrlen );
+
+                       if ( num != buflen )
+                       {
+                               LogMsg( "SendWakeupPacket error: sent %d bytes: %d\n", num, WSAGetLastError() );
+                       }
+               }
 
-               dlog( kDebugLevelChatty, DEBUG_NAME "calling mDNSCoreReceive on socket: %d\n", sock->fd );
-               mDNSCoreReceive( sock->m, &sock->packet, end, &sock->overlapped.srcAddr, sock->overlapped.srcPort, &sock->overlapped.dstAddr, sock->overlapped.dstPort, iid );
+               if ( msecSleep )
+               {
+                       Sleep( msecSleep );
+               }
        }
 
-       // If the socket is still good, then start up another asynchronous read
+exit:
 
-       if ( sock->fd != INVALID_SOCKET )
+       if ( sock != INVALID_SOCKET )
        {
-               int err = UDPBeginRecv( sock );
-               check_noerr( err );
+               closesocket( sock );
        }
-}
+} 
 
 
-mDNSlocal void
-DispatchTCPEvent( mDNS * const inMDNS, TCPSocket * sock )
+mDNSlocal void _cdecl
+SendMulticastWakeupPacket( void *arg )
 {
-       ( void ) inMDNS;
-
-       if ( sock->fd != INVALID_SOCKET )
+       MulticastWakeupStruct *info = ( MulticastWakeupStruct* ) arg;
+       
+       if ( info )
        {
-               sock->eptr += sock->overlapped.bytesTransferred;
-               sock->lastError = sock->overlapped.error;
-
-               if ( !sock->overlapped.error && !sock->overlapped.bytesTransferred )
-               {
-                       sock->closed = TRUE;
-               }
-
-               if ( sock->readEventHandler != NULL )
-               {
-                       dlog( kDebugLevelChatty, DEBUG_NAME "calling TCP read handler  on socket: %d\n", sock->fd );
-                       sock->readEventHandler( sock );
-               }
+               SendWakeupPacket( info->inMDNS, ( LPSOCKADDR ) &info->addr, sizeof( info->addr ), ( const char* ) info->data, sizeof( info->data ), info->numTries, info->msecSleep );
+               free( info );
        }
 
-       // If the socket is still good, then start up another asynchronous read
+       _endthread();
+}
 
-       if ( !sock->closed && ( sock->fd != INVALID_SOCKET ) )
-       {
-               int err = TCPBeginRecv( sock );
-               check_noerr( err );
-       }
+
+mDNSexport void FreeEtcHosts(mDNS *const m, AuthRecord *const rr, mStatus result)
+{
+       DEBUG_UNUSED( m );
+       DEBUG_UNUSED( rr );
+       DEBUG_UNUSED( result );
 }
index e08c462b637de7c37e1cbd94d238baf006c6b1a6..6b5b43566484cdc04ff5182f4fc723569c9e911c 100755 (executable)
 #endif
 
 
-typedef struct Overlapped
-{
-       BOOL            pending;
-       OVERLAPPED      data;
-       WSABUF          wbuf;
-       DWORD           error;
-       DWORD           bytesTransferred;
-       mDNSAddr        srcAddr;
-       mDNSIPPort      srcPort;
-       mDNSAddr        dstAddr;
-       mDNSIPPort      dstPort;
-} Overlapped;
-
-
-typedef void ( *TCPReadEventHandler )( TCPSocket * sock );
 typedef void ( *TCPUserCallback )();
 
 struct TCPSocket_struct
 {
        TCPSocketFlags                          flags;          // MUST BE FIRST FIELD -- mDNSCore expects every TCPSocket_struct to begin with TCPSocketFlags flags
        SOCKET                                          fd;
-       TCPReadEventHandler                     readEventHandler;
-       HANDLE                                          connectEvent;
        BOOL                                            connected;
        TCPUserCallback                         userCallback;
        void                                    *       userContext;
-       Overlapped                                      overlapped;
-       DWORD                                           lastError;
-       BOOL                                            closed;\r
-       uint8_t                                         bbuf[ 4192 ];
-       uint8_t                                 *       bptr;
-       uint8_t                                 *       eptr;
-       uint8_t                                 *       ebuf;
-       TCPSocket                               *       nextDispatchable;
+       BOOL                                            closed;
        mDNS                                    *       m;
 };
 
 
 struct UDPSocket_struct
 {
-       mDNSIPPort                                              port;                   // MUST BE FIRST FIELD -- mDNSCoreReceive expects every UDPSocket_struct to begin with mDNSIPPort port
-       mDNSAddr                                                addr;                   // This is initialized by our code. If we don't get the 
-                                                                                                       // dstAddr from WSARecvMsg we use this value instead.
-       SOCKET                                                  fd;
-       LPFN_WSARECVMSG                                 recvMsgPtr;
-       Overlapped                                              overlapped;
-       WSAMSG                                                  wmsg;
-       DNSMessage                                              packet;
-       uint8_t                                                 controlBuffer[ 128 ];
-       struct sockaddr_storage                 srcAddr;                // This is filled in by the WSARecv* function
-       INT                                                             srcAddrLen;             // See above
-       struct mDNSInterfaceData        *       ifd;
-       UDPSocket                                       *       nextDispatchable;
-       UDPSocket                                       *       next;
-       mDNS                                            *       m;
+       mDNSIPPort                                      port;           // MUST BE FIRST FIELD -- mDNSCoreReceive expects every UDPSocket_struct to begin with mDNSIPPort port
+       mDNSAddr                                        addr;           // This is initialized by our code. If we don't get the 
+                                                                                       // dstAddr from WSARecvMsg we use this value instead.
+       SOCKET                                          fd;
+       LPFN_WSARECVMSG                         recvMsgPtr;
+       DNSMessage                                      packet;
+       struct mDNSInterfaceData        *ifd;
+       UDPSocket                                       *next;
+       mDNS                                            *m;
 };
 
 
@@ -109,21 +79,6 @@ struct      mDNSInterfaceData
 };
 
 
-//---------------------------------------------------------------------------------------------------------------------------
-/*!    @typedef        RegisterWaitableEventHandler
-*/
-typedef void           (*RegisterWaitableEventHandler)(mDNS * const inMDNS, HANDLE event, void * context );
-
-//---------------------------------------------------------------------------------------------------------------------------
-/*!    @typedef        RegisterWaitableEventFunc
-*/
-typedef mStatus                (*RegisterWaitableEventFunc)(mDNS * const inMDNS, HANDLE event, void * context, RegisterWaitableEventHandler handler );
-
-//---------------------------------------------------------------------------------------------------------------------------
-/*!    @typedef        UnregisterWaitableEventHandler
-*/
-typedef void           (*UnregisterWaitableEventFunc)(mDNS * const inMDNS, HANDLE event );
-
 //---------------------------------------------------------------------------------------------------------------------------
 /*!    @typedef        ReportStatusFunc
 */
@@ -141,8 +96,6 @@ struct       mDNS_PlatformSupport_struct
        HANDLE                                          mainThread;
        HANDLE                                          checkFileSharesTimer;
        mDNSs32                                         checkFileSharesTimeout;
-       RegisterWaitableEventFunc       registerWaitableEventFunc;
-       UnregisterWaitableEventFunc     unregisterWaitableEventFunc;
        ReportStatusFunc                        reportStatusFunc;
        time_t                                          nextDHCPLeaseExpires;
        char                                            nbname[ 32 ];
@@ -157,6 +110,8 @@ struct      mDNS_PlatformSupport_struct
        mDNSInterfaceData *                     inactiveInterfaceList;
        struct UDPSocket_struct         unicastSock4;
        struct UDPSocket_struct         unicastSock6;
+       DWORD                                           osMajorVersion;
+       DWORD                                           osMinorVersion;
 };
 
 //---------------------------------------------------------------------------------------------------------------------------
@@ -187,7 +142,7 @@ struct ifaddrs
        }       ifa_extra;
 };
 
-\r
+
 extern void            InterfaceListDidChange( mDNS * const inMDNS );
 extern void            ComputerDescriptionDidChange( mDNS * const inMDNS );
 extern void            TCPIPConfigDidChange( mDNS * const inMDNS );
diff --git a/mDNSWindows/mdnsNSP/mdnsNSP.vcxproj b/mDNSWindows/mdnsNSP/mdnsNSP.vcxproj
new file mode 100755 (executable)
index 0000000..71b2b98
--- /dev/null
@@ -0,0 +1,276 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Debug|x64">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|x64">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>x64</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{F4F15529-F0EB-402F-8662-73C5797EE557}</ProjectGuid>\r
+    <Keyword>Win32Proj</Keyword>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">\r
+    <ConfigurationType>DynamicLibrary</ConfigurationType>\r
+    <CharacterSet>MultiByte</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup>\r
+    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>\r
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>\r
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>\r
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>.;../;../../mDNSShared;../../Clients;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NSP_EXPORTS;DEBUG;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <ExceptionHandling>\r
+      </ExceptionHandling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <SmallerTypeCheck>true</SmallerTypeCheck>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;iphlpapi.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)mdnsNSP.dll</OutputFile>\r
+      <ModuleDefinitionFile>mdnsNSP.def</ModuleDefinitionFile>\r
+      <DelayLoadDLLs>dnssd.dll;%(DelayLoadDLLs)</DelayLoadDLLs>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)mdnsNSP.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <BaseAddress>0x64000000</BaseAddress>\r
+      <ImportLibrary>$(OutDir)mdnsNSP.lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <Optimization>Disabled</Optimization>\r
+      <AdditionalIncludeDirectories>.;../;../../mDNSShared;../../Clients;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;NSP_EXPORTS;DEBUG;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <ExceptionHandling>\r
+      </ExceptionHandling>\r
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>\r
+      <SmallerTypeCheck>true</SmallerTypeCheck>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+      <BufferSecurityCheck>true</BufferSecurityCheck>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;iphlpapi.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)mdnsNSP.dll</OutputFile>\r
+      <ModuleDefinitionFile>mdnsNSP.def</ModuleDefinitionFile>\r
+      <DelayLoadDLLs>dnssd.dll;%(DelayLoadDLLs)</DelayLoadDLLs>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(OutDir)mdnsNSP.pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <BaseAddress>0x64000000</BaseAddress>\r
+      <ImportLibrary>$(OutDir)mdnsNSP.lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ClCompile>\r
+      <AdditionalIncludeDirectories>.;../;../../mDNSShared;../../Clients;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_USRDLL;NSP_EXPORTS;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <ExceptionHandling>\r
+      </ExceptionHandling>\r
+      <BasicRuntimeChecks>Default</BasicRuntimeChecks>\r
+      <SmallerTypeCheck>false</SmallerTypeCheck>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;iphlpapi.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)mdnsNSP.dll</OutputFile>\r
+      <ModuleDefinitionFile>mdnsNSP.def</ModuleDefinitionFile>\r
+      <DelayLoadDLLs>dnssd.dll;%(DelayLoadDLLs)</DelayLoadDLLs>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <BaseAddress>0x64000000</BaseAddress>\r
+      <ImportLibrary>$(IntDir)mdnsNSP.lib</ImportLibrary>\r
+      <TargetMachine>MachineX86</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour\$(Platform)"   mkdir "$(DSTROOT)\Program Files\Bonjour\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                                  "$(DSTROOT)\Program Files\Bonjour\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
+    <Midl>\r
+      <TargetEnvironment>X64</TargetEnvironment>\r
+    </Midl>\r
+    <ClCompile>\r
+      <AdditionalIncludeDirectories>.;../;../../mDNSShared;../../Clients;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+      <PreprocessorDefinitions>WIN32;_WINDOWS;_USRDLL;NSP_EXPORTS;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <StringPooling>true</StringPooling>\r
+      <MinimalRebuild>true</MinimalRebuild>\r
+      <ExceptionHandling>\r
+      </ExceptionHandling>\r
+      <BasicRuntimeChecks>Default</BasicRuntimeChecks>\r
+      <SmallerTypeCheck>false</SmallerTypeCheck>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>\r
+      <WarningLevel>Level4</WarningLevel>\r
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>\r
+      <CallingConvention>StdCall</CallingConvention>\r
+    </ClCompile>\r
+    <ResourceCompile>\r
+      <AdditionalIncludeDirectories>../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+    </ResourceCompile>\r
+    <Link>\r
+      <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>\r
+      <AdditionalDependencies>../DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;iphlpapi.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+      <OutputFile>$(OutDir)mdnsNSP.dll</OutputFile>\r
+      <ModuleDefinitionFile>mdnsNSP.def</ModuleDefinitionFile>\r
+      <DelayLoadDLLs>dnssd.dll;%(DelayLoadDLLs)</DelayLoadDLLs>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>\r
+      <SubSystem>Windows</SubSystem>\r
+      <OptimizeReferences>\r
+      </OptimizeReferences>\r
+      <EnableCOMDATFolding>\r
+      </EnableCOMDATFolding>\r
+      <BaseAddress>0x64000000</BaseAddress>\r
+      <ImportLibrary>$(IntDir)mdnsNSP.lib</ImportLibrary>\r
+      <TargetMachine>MachineX64</TargetMachine>\r
+    </Link>\r
+    <PostBuildEvent>\r
+      <Command>if not "%RC_XBS%" == "YES" goto END\r
+if not exist "$(DSTROOT)\Program Files\Bonjour\$(Platform)"   mkdir "$(DSTROOT)\Program Files\Bonjour\$(Platform)"\r
+xcopy /I/Y "$(TargetPath)"                                                                  "$(DSTROOT)\Program Files\Bonjour\$(Platform)"\r
+:END\r
+</Command>\r
+    </PostBuildEvent>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\Clients\ClientCommon.c" />\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c" />\r
+    <ClCompile Include="mdnsNSP.c" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="mdnsNSP.def" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\Clients\ClientCommon.h" />\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h" />\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h" />\r
+    <ClInclude Include="..\..\..\mDNSShared\dns_sd.h" />\r
+    <ClInclude Include="resource.h" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="mdnsNSP.rc" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ProjectReference Include="..\DLL\dnssd.vcxproj">\r
+      <Project>{ab581101-18f0-46f6-b56a-83a6b1ea657e}</Project>\r
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>\r
+    </ProjectReference>\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/mDNSWindows/mdnsNSP/mdnsNSP.vcxproj.filters b/mDNSWindows/mdnsNSP/mdnsNSP.vcxproj.filters
new file mode 100755 (executable)
index 0000000..f09d07a
--- /dev/null
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup>\r
+    <Filter Include="Source Files">\r
+      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>\r
+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>\r
+    </Filter>\r
+    <Filter Include="Header Files">\r
+      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>\r
+      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>\r
+    </Filter>\r
+    <Filter Include="Resource Files">\r
+      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>\r
+      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>\r
+    </Filter>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\..\Clients\ClientCommon.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="..\..\mDNSShared\DebugServices.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+    <ClCompile Include="mdnsNSP.c">\r
+      <Filter>Source Files</Filter>\r
+    </ClCompile>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <None Include="mdnsNSP.def">\r
+      <Filter>Source Files</Filter>\r
+    </None>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\..\Clients\ClientCommon.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\CommonServices.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\mDNSShared\DebugServices.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="..\..\..\mDNSShared\dns_sd.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+    <ClInclude Include="resource.h">\r
+      <Filter>Header Files</Filter>\r
+    </ClInclude>\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ResourceCompile Include="mdnsNSP.rc">\r
+      <Filter>Resource Files</Filter>\r
+    </ResourceCompile>\r
+  </ItemGroup>\r
+</Project>
\ No newline at end of file