merge in oc-release history after reset to master
diff --git a/Android.mk b/Android.mk
index 5d6160a..21143a3 100644
--- a/Android.mk
+++ b/Android.mk
@@ -12,11 +12,8 @@
     -fno-strict-aliasing \
     -D_GNU_SOURCE \
     -DHAVE_IPV6 \
-    -DHAVE_LINUX \
     -DNOT_HAVE_SA_LEN \
     -DPLATFORM_NO_RLIMIT \
-    -DTARGET_OS_LINUX \
-    -DUSES_NETLINK \
     -DMDNS_DEBUGMSGS=0 \
     -DMDNS_UDS_SERVERPATH=\"/dev/socket/mdnsd\" \
     -DMDNS_USERNAME=\"mdnsr\" \
@@ -30,44 +27,150 @@
     -Wno-unused-parameter \
     -Werror=implicit-function-declaration \
 
+daemonSources := mDNSCore/mDNS.c            \
+                 mDNSCore/DNSDigest.c       \
+                 mDNSCore/uDNS.c            \
+                 mDNSCore/DNSCommon.c       \
+                 mDNSShared/uds_daemon.c    \
+                 mDNSShared/mDNSDebug.c     \
+                 mDNSShared/dnssd_ipc.c     \
+                 mDNSShared/GenLinkedList.c \
+                 mDNSShared/PlatformCommon.c \
+                 mDNSPosix/PosixDaemon.c    \
+                 mDNSPosix/mDNSPosix.c      \
+                 mDNSPosix/mDNSUNP.c
+
+daemonIncludes := external/mdnsresponder/mDNSCore  \
+                  external/mdnsresponder/mDNSShared \
+                  external/mdnsresponder/mDNSPosix
+
 #########################
 
 include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES :=  mDNSPosix/PosixDaemon.c    \
-                    mDNSPosix/mDNSPosix.c      \
-                    mDNSPosix/mDNSUNP.c        \
-                    mDNSCore/mDNS.c            \
-                    mDNSCore/DNSDigest.c       \
-                    mDNSCore/uDNS.c            \
-                    mDNSCore/DNSCommon.c       \
-                    mDNSShared/uds_daemon.c    \
-                    mDNSShared/mDNSDebug.c     \
-                    mDNSShared/dnssd_ipc.c     \
-                    mDNSShared/GenLinkedList.c \
-                    mDNSShared/PlatformCommon.c
-
+LOCAL_SRC_FILES :=  $(daemonSources)
 LOCAL_MODULE := mdnsd
 LOCAL_MODULE_TAGS := optional
 
-LOCAL_C_INCLUDES := external/mdnsresponder/mDNSPosix \
-                    external/mdnsresponder/mDNSCore  \
-                    external/mdnsresponder/mDNSShared
+LOCAL_C_INCLUDES := $(daemonIncludes)
 
-LOCAL_CFLAGS := $(commonFlags) -DMDNS_VERSIONSTR_NODTS=1
+LOCAL_CFLAGS := \
+  $(commonFlags) \
+  -DTARGET_OS_LINUX \
+  -DMDNS_VERSIONSTR_NODTS=1 \
+  -DHAVE_LINUX \
+  -DUSES_NETLINK \
 
 LOCAL_STATIC_LIBRARIES := $(commonLibs) libc
 LOCAL_FORCE_STATIC_EXECUTABLE := true
 LOCAL_INIT_RC := mdnsd.rc
 include $(BUILD_EXECUTABLE)
 
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES :=  $(daemonSources)
+LOCAL_MODULE := mdnsd
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_C_INCLUDES := $(daemonIncludes)
+
+LOCAL_CFLAGS := \
+  $(commonFlags) \
+  -DMDNS_VERSIONSTR_NODTS=1 \
+
+LOCAL_CFLAGS_linux := -DTARGET_OS_LINUX -DHAVE_LINUX -DUSES_NETLINK
+LOCAL_CFLAGS_darwin := -DTARGET_OS_MAC
+
+LOCAL_STATIC_LIBRARIES := $(commonLibs)
+include $(BUILD_HOST_EXECUTABLE)
+
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := \
+  mDNSWindows/SystemService/main.c    \
+  mDNSWindows/SystemService/Service.c \
+  mDNSWindows/Secret.c                \
+  mDNSWindows/mDNSWin32.c             \
+  mDNSShared/dnssd_ipc.c              \
+  mDNSShared/uds_daemon.c             \
+  mDNSShared/mDNSDebug.c              \
+  mDNSShared/GenLinkedList.c          \
+  mDNSShared/DebugServices.c          \
+  mDNSCore/DNSDigest.c                \
+  mDNSCore/DNSCommon.c                \
+  mDNSCore/uDNS.c                     \
+  mDNSCore/mDNS.c                     \
+  android/windows_firewall_dummy.c
+
+LOCAL_MODULE := mdnsd
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := EXECUTABLES
+
+mdnsd_generated_sources := $(call local-generated-sources-dir)
+event_log_h := $(mdnsd_generated_sources)/EventLog.h
+event_log_o := $(mdnsd_generated_sources)/EventLog.o
+event_log_rc := $(mdnsd_generated_sources)/EventLog.rc
+
+event_log_mc := external/mdnsresponder/mDNSWindows/SystemService/EventLog.mc
+mingw_bin := prebuilts/gcc/$(HOST_PREBUILT_TAG)/host/x86_64-w64-mingw32-4.8/bin
+windmc := $(mingw_bin)/x86_64-w64-mingw32-windmc
+windres := $(mingw_bin)/x86_64-w64-mingw32-windres
+
+$(event_log_h) $(event_log_o): $(event_log_mc)
+	@echo "Generating EventLog messages"
+	@mkdir -p $(mdnsd_generated_sources)
+	@$(windmc) -r$(mdnsd_generated_sources) -h$(mdnsd_generated_sources) $<
+	@$(windres) -F pe-i386 -I$(mdnsd_generated_sources) $(event_log_rc) $(event_log_o)
+
+LOCAL_GENERATED_SOURCES := \
+  $(mdnsd_generated_sources)/EventLog.h \
+  $(mdnsd_generated_sources)/EventLog.o
+
+LOCAL_C_INCLUDES := \
+  external/mdnsresponder/mDNSShared \
+  external/mdnsresponder/mDNSCore \
+  external/mdnsresponder/mDNSWindows/SystemService \
+  external/mdnsresponder/mDNSWindows \
+  external/mdnsresponder/android/caseMapping \
+  $(mdnsd_generated_sources)
+
+LOCAL_CFLAGS := $(commonFlags) \
+  -DMDNS_VERSIONSTR_NODTS=1 \
+  -DTARGET_OS_WINDOWS \
+  -DTARGET_OS_WIN32 \
+  -DWIN32 \
+  -DNDEBUG \
+  -D_CONSOLE \
+  -D_WIN32_LEAN_AND_MEAN \
+  -DUSE_TCP_LOOPBACK \
+  -DPLATFORM_NO_STRSEP \
+  -DPLATFORM_NO_EPIPE \
+  -DPLATFORM_NO_RLIMIT \
+  -DPID_FILE='""' \
+  -DUNICODE \
+  -D_UNICODE \
+  -D_CRT_SECURE_NO_DEPRECATE \
+  -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 \
+  -D_LEGACY_NAT_TRAVERSAL \
+  -include stdint.h \
+  -include winsock2.h \
+  -include ws2ipdef.h \
+  -include wincrypt.h \
+  -include netioapi.h \
+  -Wno-sign-compare \
+  -Wno-empty-body
+
+LOCAL_LDFLAGS := -lws2_32 -liphlpapi -lpowrprof -lnetapi32 -municode
+
+
+LOCAL_MODULE_HOST_OS := windows
+
+LOCAL_STATIC_LIBRARIES := $(commonLibs)
+include $(BUILD_HOST_EXECUTABLE)
 ##########################
 
 include $(CLEAR_VARS)
 LOCAL_SRC_FILES := $(commonSources)
 LOCAL_MODULE := libmdnssd
 LOCAL_MODULE_TAGS := optional
-LOCAL_CFLAGS := $(commonFlags)
+LOCAL_CFLAGS := $(commonFlags) -DTARGET_OS_LINUX -DHAVE_LINUX -DUSES_NETLINK
 LOCAL_SYSTEM_SHARED_LIBRARIES := libc
 LOCAL_SHARED_LIBRARIES := $(commonLibs)
 LOCAL_EXPORT_C_INCLUDE_DIRS := external/mdnsresponder/mDNSShared
@@ -77,18 +180,58 @@
 LOCAL_SRC_FILES := $(commonSources)
 LOCAL_MODULE := libmdnssd
 LOCAL_MODULE_TAGS := optional
-LOCAL_CFLAGS := $(commonFlags)
+LOCAL_CFLAGS := $(commonFlags) -DTARGET_OS_LINUX -DHAVE_LINUX -DUSES_NETLINK
 LOCAL_STATIC_LIBRARIES := $(commonLibs)
 LOCAL_EXPORT_C_INCLUDE_DIRS := external/mdnsresponder/mDNSShared
 include $(BUILD_STATIC_LIBRARY)
 
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := $(commonSources)
+LOCAL_SRC_FILES_windows := mDNSWindows/DLL/dllmain.c
+LOCAL_MODULE := libmdnssd
+LOCAL_MODULE_TAGS := optional
+LOCAL_CFLAGS := $(commonFlags)
+LOCAL_CFLAGS_windows := \
+  -DTARGET_OS_WINDOWS \
+  -DWIN32 \
+  -DNDEBUG \
+  -D_WINDOWS \
+  -D_USERDLL \
+  -D_MDNS_DEBUGMSGS=0 \
+  -D_WIN32_LEAN_AND_MEAN \
+  -D_SSIZE_T \
+  -DUSE_TCP_LOOPBACK \
+  -D_CRT_SECURE_NO_DEPRECATE \
+  -D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 \
+  -DNOT_HAVE_SA_LENGTH \
+  -Wno-unknown-pragmas \
+  -Wno-sign-compare \
+  -Wno-overflow \
+  -include stdint.h \
+  -include winsock2.h \
+  -include ws2ipdef.h \
+  -include wincrypt.h \
+  -include iphlpapi.h \
+  -include netioapi.h \
+  -include stdlib.h \
+  -include stdio.h
+
+LOCAL_CFLAGS_linux := -DTARGET_OS_LINUX -DHAVE_LINUX -DUSES_NETLINK
+LOCAL_CFLAGS_darwin := -DTARGET_OS_MAC
+LOCAL_STATIC_LIBRARIES := $(commonLibs)
+LOCAL_EXPORT_C_INCLUDE_DIRS := external/mdnsresponder/mDNSShared
+LOCAL_C_INCLUDES_windows := external/mdnsresponder/mDNSShared external/mdnsresponder/mDNSWindows
+LOCAL_C_INCLUDES_windows += external/mdnsresponder/android/caseMapping
+LOCAL_MODULE_HOST_OS := darwin linux windows
+include $(BUILD_HOST_STATIC_LIBRARY)
+
 ############################
 
 include $(CLEAR_VARS)
 LOCAL_SRC_FILES := Clients/dns-sd.c Clients/ClientCommon.c
 LOCAL_MODULE := dnssd
 LOCAL_MODULE_TAGS := optional
-LOCAL_CFLAGS := $(commonFlags)
+LOCAL_CFLAGS := $(commonFlags) -DTARGET_OS_LINUX -DHAVE_LINUX -DUSES_NETLINK
 LOCAL_SYSTEM_SHARED_LIBRARIES := libc
 LOCAL_SHARED_LIBRARIES := libmdnssd libcutils liblog
 include $(BUILD_EXECUTABLE)
@@ -123,7 +266,10 @@
                 -UMDNS_DEBUGMSGS \
                 -DMDNS_DEBUGMSGS=0 \
                 -DSO_REUSEADDR \
-                -DUNICAST_DISABLED
+                -DUNICAST_DISABLED \
+                -DTARGET_OS_LINUX \
+                -DHAVE_LINUX \
+                -DUSES_NETLINK
 
 ifeq ($(TARGET_BUILD_TYPE),debug)
   LOCAL_CFLAGS += -O0 -UNDEBUG -fno-omit-frame-pointer
diff --git a/android/caseMapping/Iphlpapi.h b/android/caseMapping/Iphlpapi.h
new file mode 100644
index 0000000..4d08efd
--- /dev/null
+++ b/android/caseMapping/Iphlpapi.h
@@ -0,0 +1 @@
+#include <iphlpapi.h>
diff --git a/android/caseMapping/README b/android/caseMapping/README
new file mode 100644
index 0000000..951082f
--- /dev/null
+++ b/android/caseMapping/README
@@ -0,0 +1,3 @@
+Windows filesystems, and consequently Windows C include files, are
+case-insensitive. This folder provides alternately-cased versions of header
+files for cases where that becomes a problem.
diff --git a/android/caseMapping/Resource.h b/android/caseMapping/Resource.h
new file mode 100644
index 0000000..f4649ed
--- /dev/null
+++ b/android/caseMapping/Resource.h
@@ -0,0 +1 @@
+#include <resource.h>
diff --git a/android/caseMapping/Ws2tcpip.h b/android/caseMapping/Ws2tcpip.h
new file mode 100644
index 0000000..8fc8783
--- /dev/null
+++ b/android/caseMapping/Ws2tcpip.h
@@ -0,0 +1 @@
+#include <ws2tcpip.h>
diff --git a/android/caseMapping/ipExport.h b/android/caseMapping/ipExport.h
new file mode 100644
index 0000000..76ed79f
--- /dev/null
+++ b/android/caseMapping/ipExport.h
@@ -0,0 +1 @@
+#include <ipexport.h>
diff --git a/android/windows_firewall_dummy.c b/android/windows_firewall_dummy.c
new file mode 100644
index 0000000..f4d25ce
--- /dev/null
+++ b/android/windows_firewall_dummy.c
@@ -0,0 +1,10 @@
+int mDNSIsFileAndPrintSharingEnabled(int *ignored) {
+  (void)ignored;
+  return 0;
+}
+
+int mDNSAddToFirewall(const char* ignored, const char* also_ignored) {
+  (void)ignored;
+  (void)also_ignored;
+  return 0;
+}
diff --git a/mDNSCore/mDNSEmbeddedAPI.h b/mDNSCore/mDNSEmbeddedAPI.h
index 5c3115c..44f7ec0 100755
--- a/mDNSCore/mDNSEmbeddedAPI.h
+++ b/mDNSCore/mDNSEmbeddedAPI.h
@@ -54,6 +54,17 @@
 #ifndef __mDNSClientAPI_h
 #define __mDNSClientAPI_h
 
+/* MinGW thinks "#define interface struct" is a cute way to do ObjC
+ * compatibility. Everything is terrible.
+ */
+#ifdef _WIN32
+#ifndef interface
+#warning "MinGW no longer does weird things with 'interface'. "\
+         "You can remove this code."
+#endif /* ! interface */
+#undef interface
+#endif /* _WIN32 */
+
 #if defined(EFI32) || defined(EFI64) || defined(EFIX64)
 // EFI doesn't have stdarg.h unless it's building with GCC.
 #include "Tiano.h"
diff --git a/mDNSPosix/mDNSPosix.c b/mDNSPosix/mDNSPosix.c
index a8ac88a..5e47657 100644
--- a/mDNSPosix/mDNSPosix.c
+++ b/mDNSPosix/mDNSPosix.c
@@ -1357,13 +1357,27 @@
 	strcpy((char *)dst, (char *)src);
 	}
 
-// mDNS core calls this routine to copy C strings while taking the destination
-// buffer size into account.
-// On the Posix platform this maps directly to the ANSI C strncpy.
-mDNSexport mDNSu32  mDNSPlatformStrLCopy(void *dst, const void *src, mDNSu32 dstlen)
-	{
-	return (strlcpy((char *)dst, (const char *)src, dstlen));
-	}
+mDNSexport mDNSu32  mDNSPlatformStrLCopy(void *dst, const void *src, mDNSu32 len)
+{
+#if HAVE_STRLCPY
+    return ((mDNSu32)strlcpy((char *)dst, (const char *)src, len));
+#else
+    size_t srcLen;
+
+    srcLen = strlen((const char *)src);
+    if (srcLen < len)
+    {
+        memcpy(dst, src, srcLen + 1);
+    }
+    else if (len > 0)
+    {
+        memcpy(dst, src, len - 1);
+        ((char *)dst)[len - 1] = '\0';
+    }
+
+    return ((mDNSu32)srcLen);
+#endif
+}
 
 // mDNS core calls this routine to get the length of a C string.
 // On the Posix platform this maps directly to the ANSI C strlen.
diff --git a/mDNSShared/uds_daemon.c b/mDNSShared/uds_daemon.c
index e269be6..fd214ac 100644
--- a/mDNSShared/uds_daemon.c
+++ b/mDNSShared/uds_daemon.c
@@ -21,7 +21,6 @@
 #else
 #include <fcntl.h>
 #include <errno.h>
-#include <cutils/log.h>
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <sys/time.h>
@@ -1628,7 +1627,6 @@
 	if (!request->msgptr)
 		{
 		LogMsg("%3d: DNSServiceRegister(unreadable parameters)", request->sd);
-		android_errorWriteWithInfoLog(0x534e4554, "25852056", -1, NULL, 0);
 		return(mStatus_BadParamErr);
 		}
 
diff --git a/mDNSWindows/ControlPanel/BrowsingPage.cpp b/mDNSWindows/ControlPanel/BrowsingPage.cpp
new file mode 100755
index 0000000..20b5c6d
--- /dev/null
+++ b/mDNSWindows/ControlPanel/BrowsingPage.cpp
@@ -0,0 +1,441 @@
+/* -*- 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 "BrowsingPage.h"
+#include "resource.h"
+
+#include "ConfigPropertySheet.h"
+
+#include <WinServices.h>
+    
+#define MAX_KEY_LENGTH 255
+
+
+IMPLEMENT_DYNCREATE(CBrowsingPage, CPropertyPage)
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CBrowsingPage::CBrowsingPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+CBrowsingPage::CBrowsingPage()
+:
+	CPropertyPage(CBrowsingPage::IDD)
+{
+	//{{AFX_DATA_INIT(CBrowsingPage)
+	//}}AFX_DATA_INIT
+
+	m_firstTime = true;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CBrowsingPage::~CBrowsingPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+CBrowsingPage::~CBrowsingPage()
+{
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CBrowsingPage::DoDataExchange
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CBrowsingPage::DoDataExchange(CDataExchange* pDX)
+{
+	CPropertyPage::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CBrowsingPage)
+	//}}AFX_DATA_MAP
+	DDX_Control(pDX, IDC_BROWSE_LIST, m_browseListCtrl);
+	DDX_Control(pDX, IDC_REMOVE_BROWSE_DOMAIN, m_removeButton);
+}
+
+BEGIN_MESSAGE_MAP(CBrowsingPage, CPropertyPage)
+	//{{AFX_MSG_MAP(CBrowsingPage)
+	//}}AFX_MSG_MAP
+	ON_BN_CLICKED(IDC_ADD_BROWSE_DOMAIN, OnBnClickedAddBrowseDomain)
+	ON_BN_CLICKED(IDC_REMOVE_BROWSE_DOMAIN, OnBnClickedRemoveBrowseDomain)
+	ON_NOTIFY(LVN_ITEMCHANGED, IDC_BROWSE_LIST, OnLvnItemchangedBrowseList)
+END_MESSAGE_MAP()
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CBrowsingPage::SetModified
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CBrowsingPage::SetModified( BOOL bChanged )
+{
+	m_modified = bChanged;
+
+	CPropertyPage::SetModified( bChanged );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CBrowsingPage::OnSetActive
+//---------------------------------------------------------------------------------------------------------------------------
+
+BOOL
+CBrowsingPage::OnSetActive()
+{
+	CConfigPropertySheet	*	psheet;
+	HKEY						key = NULL;
+	HKEY						subKey = NULL;
+	DWORD						dwSize;
+	DWORD						enabled;
+	DWORD						err;
+	TCHAR						subKeyName[MAX_KEY_LENGTH];
+	DWORD						cSubKeys = 0;
+	DWORD						cbMaxSubKey;
+	DWORD						cchMaxClass;
+	int							nIndex;
+    DWORD						i; 
+	BOOL						b = CPropertyPage::OnSetActive();
+
+	psheet = reinterpret_cast<CConfigPropertySheet*>(GetParent());
+	require_quiet( psheet, exit );
+	
+	m_modified = FALSE;
+
+	if ( m_firstTime )
+	{
+		m_browseListCtrl.SetExtendedStyle((m_browseListCtrl.GetStyle() & (~LVS_EX_GRIDLINES))|LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
+
+		m_browseListCtrl.InsertColumn(0, L"", LVCFMT_LEFT, 20 );
+		m_browseListCtrl.InsertColumn(1, L"", LVCFMT_LEFT, 345);
+
+		m_firstTime = false;
+	}
+
+	m_initialized = false;
+
+	// Clear out what's there
+
+	m_browseListCtrl.DeleteAllItems();
+
+	// 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 );
+	require_noerr( err, exit );
+
+	// Get information about this node
+
+    err = RegQueryInfoKey( key, NULL, NULL, NULL, &cSubKeys, &cbMaxSubKey, &cchMaxClass, NULL, NULL, NULL, NULL, NULL );       
+	require_noerr( err, exit );
+
+	for ( i = 0; i < cSubKeys; i++)
+	{	
+		dwSize = MAX_KEY_LENGTH;
+            
+		err = RegEnumKeyEx( key, i, subKeyName, &dwSize, NULL, NULL, NULL, NULL );
+		require_noerr( err, exit );
+
+		err = RegOpenKey( key, subKeyName, &subKey );
+		require_noerr( err, exit );
+
+		dwSize = sizeof( DWORD );
+		err = RegQueryValueEx( subKey, L"Enabled", NULL, NULL, (LPBYTE) &enabled, &dwSize );
+		require_noerr( err, exit );
+
+		nIndex = m_browseListCtrl.InsertItem( m_browseListCtrl.GetItemCount(), L"");
+		m_browseListCtrl.SetItemText( nIndex, 1, subKeyName );
+		m_browseListCtrl.SetCheck( nIndex, enabled );
+
+		RegCloseKey( subKey );
+		subKey = NULL;
+    }
+
+	m_browseListCtrl.SortItems( SortFunc, (DWORD_PTR) this );
+
+	m_removeButton.EnableWindow( FALSE );
+ 
+exit:
+
+	if ( subKey )
+	{
+		RegCloseKey( subKey );
+	}
+
+	if ( key )
+	{
+		RegCloseKey( key );
+	}
+
+	m_initialized = true;
+
+	return b;
+}
+
+ 
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CBrowsingPage::OnOK
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CBrowsingPage::OnOK()
+{
+	if ( m_modified )
+	{
+		Commit();
+	}
+}
+
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CBrowsingPage::Commit
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CBrowsingPage::Commit()
+{
+	HKEY		key		= NULL;
+	HKEY		subKey	= NULL;
+	TCHAR		subKeyName[MAX_KEY_LENGTH];
+	DWORD		cSubKeys = 0;
+	DWORD		cbMaxSubKey;
+	DWORD		cchMaxClass;
+	DWORD		dwSize;
+	int			i;
+	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 );
+	require_noerr( err, exit );
+
+	// First, remove all the entries that are there
+
+    err = RegQueryInfoKey( key, NULL, NULL, NULL, &cSubKeys, &cbMaxSubKey, &cchMaxClass, NULL, NULL, NULL, NULL, NULL );       
+	require_noerr( err, exit );
+
+	for ( i = 0; i < (int) cSubKeys; i++ )
+	{	
+		dwSize = MAX_KEY_LENGTH;
+            
+		err = RegEnumKeyEx( key, 0, subKeyName, &dwSize, NULL, NULL, NULL, NULL );
+		require_noerr( err, exit );
+			
+		err = RegDeleteKey( key, subKeyName );
+		require_noerr( err, exit );
+	}
+
+	// Now re-populate
+
+	for ( i = 0; i < m_browseListCtrl.GetItemCount(); i++ )
+	{
+		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 );
+		require_noerr( err, exit );
+
+		err = RegSetValueEx( subKey, L"Enabled", NULL, REG_DWORD, (LPBYTE) &enabled, sizeof( enabled ) );
+		require_noerr( err, exit );
+
+		RegCloseKey( subKey );
+		subKey = NULL;
+	}
+	
+exit:
+
+	if ( subKey )
+	{
+		RegCloseKey( subKey );
+	}
+
+	if ( key )
+	{
+		RegCloseKey( key );
+	}
+}
+
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CBrowsingPage::OnBnClickedAddBrowseDomain
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CBrowsingPage::OnBnClickedAddBrowseDomain()
+{
+	CAddBrowseDomain dlg( GetParent() );
+
+	if ( ( dlg.DoModal() == IDOK ) && ( dlg.m_text.GetLength() > 0 ) )
+	{
+		int nIndex;
+
+		nIndex = m_browseListCtrl.InsertItem( m_browseListCtrl.GetItemCount(), L"");
+		m_browseListCtrl.SetItemText( nIndex, 1, dlg.m_text );
+		m_browseListCtrl.SetCheck( nIndex, 1 );
+
+		m_browseListCtrl.SortItems( SortFunc, (DWORD_PTR) this );
+
+		m_browseListCtrl.Invalidate();
+
+		SetModified( TRUE );
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CBrowsingPage::OnBnClickedRemoveBrowseDomain
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CBrowsingPage::OnBnClickedRemoveBrowseDomain()
+{
+	UINT	selectedCount = m_browseListCtrl.GetSelectedCount();
+	int		nItem = -1;
+	UINT	i;
+
+	// Update all of the selected items.
+
+	for ( i = 0; i < selectedCount; i++ )
+	{
+		nItem = m_browseListCtrl.GetNextItem( -1, LVNI_SELECTED );
+		check( nItem != -1 );
+
+		m_browseListCtrl.DeleteItem( nItem );
+
+		SetModified( TRUE );
+	}
+
+	m_removeButton.EnableWindow( FALSE );
+}
+
+
+void
+CBrowsingPage::OnLvnItemchangedBrowseList(NMHDR *pNMHDR, LRESULT *pResult)
+{
+	if ( m_browseListCtrl.GetSelectedCount() )
+	{
+		m_removeButton.EnableWindow( TRUE );
+	}
+
+	if ( m_initialized )
+	{
+		NM_LISTVIEW * pNMListView = (NM_LISTVIEW*)pNMHDR; 
+	 
+		BOOL bPrevState = (BOOL) ( ( ( pNMListView->uOldState & LVIS_STATEIMAGEMASK ) >> 12 ) - 1 ); 
+	 
+		if ( bPrevState < 0 )
+		{
+			bPrevState = 0;
+		}
+
+
+		BOOL bChecked = ( BOOL ) ( ( ( pNMListView->uNewState & LVIS_STATEIMAGEMASK ) >> 12) - 1 ); 
+	 
+		if ( bChecked < 0 )
+		{
+			bChecked = 0;
+		}
+
+		if ( bPrevState != bChecked )
+		{
+			SetModified( TRUE );
+		}
+	}
+
+	*pResult = 0;
+}
+
+
+
+int CALLBACK 
+CBrowsingPage::SortFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
+{
+	CString str1;
+	CString	str2;
+	int		ret = 0;
+
+	CBrowsingPage * self = reinterpret_cast<CBrowsingPage*>( lParamSort );
+	require_quiet( self, exit );
+
+	str1 = self->m_browseListCtrl.GetItemText( (int) lParam1, 1 );
+	str2 = self->m_browseListCtrl.GetItemText( (int) lParam2, 1 );
+
+	ret = str1.Compare( str2 );
+
+exit:
+
+	return ret;
+}
+
+
+// CAddBrowseDomain dialog
+
+IMPLEMENT_DYNAMIC(CAddBrowseDomain, CDialog)
+CAddBrowseDomain::CAddBrowseDomain(CWnd* pParent /*=NULL*/)
+	: CDialog(CAddBrowseDomain::IDD, pParent)
+{
+}
+
+CAddBrowseDomain::~CAddBrowseDomain()
+{
+}
+
+void CAddBrowseDomain::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	DDX_Control(pDX, IDC_COMBO1, m_comboBox);
+}
+
+
+BOOL
+CAddBrowseDomain::OnInitDialog()
+{
+	CConfigPropertySheet	*	psheet;
+	CConfigPropertySheet::StringList::iterator		it;
+	
+	BOOL b = CDialog::OnInitDialog();
+
+	psheet = reinterpret_cast<CConfigPropertySheet*>(GetParent());
+	require_quiet( psheet, exit );
+
+	for ( it = psheet->m_browseDomains.begin(); it != psheet->m_browseDomains.end(); it++ )
+	{
+		CString text = *it;
+
+		if ( m_comboBox.FindStringExact( -1, *it ) == CB_ERR )
+		{
+			m_comboBox.AddString( *it );
+		}
+	}
+
+exit:
+
+	return b;
+}
+
+
+void
+CAddBrowseDomain::OnOK()
+{
+	m_comboBox.GetWindowText( m_text );
+
+	CDialog::OnOK();
+}
+
+
+
+BEGIN_MESSAGE_MAP(CAddBrowseDomain, CDialog)
+END_MESSAGE_MAP()
+
diff --git a/mDNSWindows/ControlPanel/BrowsingPage.h b/mDNSWindows/ControlPanel/BrowsingPage.h
new file mode 100755
index 0000000..4711b36
--- /dev/null
+++ b/mDNSWindows/ControlPanel/BrowsingPage.h
@@ -0,0 +1,156 @@
+/* -*- 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.
+ */
+
+#pragma once
+
+#include "stdafx.h"
+#include "resource.h"
+
+#include <DebugServices.h>
+#include <list>
+#include "afxcmn.h"
+
+#include "afxwin.h"
+
+
+
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CBrowsingPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+class CBrowsingPage : public CPropertyPage
+{
+public:
+	CBrowsingPage();
+	~CBrowsingPage();
+
+protected:
+
+	//{{AFX_DATA(CBrowsingPage)
+	enum { IDD = IDR_APPLET_PAGE3 };
+	//}}AFX_DATA
+
+	//{{AFX_VIRTUAL(CBrowsingPage)
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+	DECLARE_DYNCREATE(CBrowsingPage)
+
+	//{{AFX_MSG(CBrowsingPage)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+	
+private:
+	
+	typedef std::list<CString> StringList;
+
+	afx_msg BOOL
+	OnSetActive();
+	
+	afx_msg void
+	OnOK();
+	
+	void
+	SetModified( BOOL bChanged = TRUE );
+	
+	void
+	Commit();
+
+	BOOL			m_modified;
+
+public:
+private:
+
+	static int CALLBACK 
+
+	SortFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
+
+
+
+	CListCtrl	m_browseListCtrl;
+
+	bool		m_initialized;
+
+	bool		m_firstTime;
+
+
+
+public:
+
+
+
+	afx_msg void OnBnClickedAddBrowseDomain();
+
+	afx_msg void OnBnClickedRemoveBrowseDomain();
+
+	afx_msg void OnLvnItemchangedBrowseList(NMHDR *pNMHDR, LRESULT *pResult);
+
+	CButton m_removeButton;
+
+};
+
+
+
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CAddBrowseDomain
+//---------------------------------------------------------------------------------------------------------------------------
+
+
+class CAddBrowseDomain : public CDialog
+
+{
+
+	DECLARE_DYNAMIC(CAddBrowseDomain)
+
+
+
+public:
+
+	CAddBrowseDomain(CWnd* pParent = NULL);   // standard constructor
+
+	virtual ~CAddBrowseDomain();
+
+
+
+// Dialog Data
+
+	enum { IDD = IDR_ADD_BROWSE_DOMAIN };
+
+
+
+protected:
+
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+
+	virtual BOOL OnInitDialog();
+
+	virtual void OnOK();
+
+	DECLARE_MESSAGE_MAP()
+
+public:
+
+	CComboBox	m_comboBox;
+
+	CString		m_text;
+
+};
+
diff --git a/mDNSWindows/ControlPanel/ConfigDialog.cpp b/mDNSWindows/ControlPanel/ConfigDialog.cpp
new file mode 100755
index 0000000..ad59066
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ConfigDialog.cpp
@@ -0,0 +1,59 @@
+/* -*- 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 "ConfigDialog.h"
+#include "ControlPanel.h"
+
+
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+IMPLEMENT_DYNCREATE(CConfigDialog, CDialog)
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigDialog::CConfigDialog
+//---------------------------------------------------------------------------------------------------------------------------
+
+CConfigDialog::CConfigDialog()
+	: CDialog(CConfigDialog::IDD, NULL)
+{
+	//{{AFX_DATA_INIT(CConfigDialog)
+	//}}AFX_DATA_INIT
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigDialog::DoDataExchange
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CConfigDialog::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CConfigDialog)
+	//}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CConfigDialog, CDialog)
+	//{{AFX_MSG_MAP(CConfigDialog)
+	//}}AFX_MSG_MAP
+END_MESSAGE_MAP()
diff --git a/mDNSWindows/ControlPanel/ConfigDialog.h b/mDNSWindows/ControlPanel/ConfigDialog.h
new file mode 100644
index 0000000..fa8df5f
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ConfigDialog.h
@@ -0,0 +1,48 @@
+/* -*- 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.
+ */
+
+#pragma once
+
+#include "stdafx.h"
+#include "resource.h"
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigDialog
+//---------------------------------------------------------------------------------------------------------------------------
+
+class CConfigDialog : public CDialog
+{
+public:
+
+	CConfigDialog();
+
+protected:
+
+	//{{AFX_DATA(CConfigDialog)
+	enum { IDD = IDR_APPLET };
+	//}}AFX_DATA
+
+	//{{AFX_VIRTUAL(CConfigDialog)
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+	//{{AFX_MSG(CConfigDialog)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+
+	DECLARE_DYNCREATE(CConfigDialog)
+};
diff --git a/mDNSWindows/ControlPanel/ConfigPropertySheet.cpp b/mDNSWindows/ControlPanel/ConfigPropertySheet.cpp
new file mode 100755
index 0000000..5fae955
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ConfigPropertySheet.cpp
@@ -0,0 +1,301 @@
+/* -*- 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 "ConfigPropertySheet.h"
+#include <WinServices.h>
+extern "C"
+{
+#include <ClientCommon.h>
+}
+#include <process.h>
+
+// Custom events
+
+#define WM_DATAREADY		( WM_USER + 0x100 )
+
+
+IMPLEMENT_DYNCREATE(CConfigPropertySheet, CPropertySheet)
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigPropertySheet::CConfigPropertySheet
+//---------------------------------------------------------------------------------------------------------------------------
+
+CConfigPropertySheet::CConfigPropertySheet()
+:
+	CPropertySheet(),
+	m_browseDomainsRef( NULL ),
+	m_thread( NULL ),
+	m_threadExited( NULL )
+{
+	AddPage(&m_firstPage );
+	AddPage(&m_secondPage);
+	AddPage(&m_thirdPage);
+
+	InitializeCriticalSection( &m_lock );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigPropertySheet::~CConfigPropertySheet
+//---------------------------------------------------------------------------------------------------------------------------
+
+CConfigPropertySheet::~CConfigPropertySheet()
+{
+	DeleteCriticalSection( &m_lock );
+}
+
+
+BEGIN_MESSAGE_MAP(CConfigPropertySheet, CPropertySheet)
+	//{{AFX_MSG_MAP(CConfigPropertySheet)
+	//}}AFX_MSG_MAP
+	ON_MESSAGE( WM_DATAREADY, OnDataReady )
+END_MESSAGE_MAP()
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigPropertySheet::OnInitDialog
+//---------------------------------------------------------------------------------------------------------------------------
+
+BOOL
+CConfigPropertySheet::OnInitDialog()
+{
+	OSStatus err;
+
+	BOOL b = CPropertySheet::OnInitDialog();
+
+	err = SetupBrowsing();
+	require_noerr( err, exit );
+
+exit:
+
+	return b;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigPropertySheet::OnCommand
+//---------------------------------------------------------------------------------------------------------------------------
+
+BOOL
+CConfigPropertySheet::OnCommand(WPARAM wParam, LPARAM lParam)
+{
+   // Check if OK or Cancel was hit
+
+   if ( ( wParam == ID_WIZFINISH ) || ( wParam == IDOK ) || ( wParam == IDCANCEL ) ) 
+   {
+      OnEndDialog();
+   }
+
+   return CPropertySheet::OnCommand(wParam, lParam);
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigPropertySheet::OnDataReady
+//---------------------------------------------------------------------------------------------------------------------------
+
+LRESULT
+CConfigPropertySheet::OnDataReady(WPARAM inWParam, LPARAM inLParam)
+{
+	if (WSAGETSELECTERROR(inLParam) && !(HIWORD(inLParam)))
+	{
+		dlog( kDebugLevelError, "OnSocket: window error\n" );
+	}
+	else
+	{
+		SOCKET sock = (SOCKET) inWParam;
+
+		if ( m_browseDomainsRef && DNSServiceRefSockFD( m_browseDomainsRef ) == (int) sock )
+		{
+			DNSServiceProcessResult( m_browseDomainsRef );
+		}
+	}
+
+	return 0;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigPropertySheet::OnEndDialog
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CConfigPropertySheet::OnEndDialog()
+{
+	OSStatus err;
+
+	err = TearDownBrowsing();
+	check_noerr( err );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigPropertySheet::SetupBrowsing
+//---------------------------------------------------------------------------------------------------------------------------
+
+OSStatus
+CConfigPropertySheet::SetupBrowsing()
+{
+	OSStatus err;
+
+	// Start browsing for browse domains
+
+	err = DNSServiceEnumerateDomains( &m_browseDomainsRef, kDNSServiceFlagsBrowseDomains, 0, BrowseDomainsReply, this );
+	require_noerr( err, exit );
+
+	err = WSAAsyncSelect( DNSServiceRefSockFD( m_browseDomainsRef ), m_hWnd, WM_DATAREADY, FD_READ|FD_CLOSE );
+	require_noerr( err, exit );
+
+exit:
+
+	if ( err )
+	{
+		TearDownBrowsing();
+	}
+
+	return err;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigPropertySheet::TearDownBrowsing
+//---------------------------------------------------------------------------------------------------------------------------
+
+OSStatus
+CConfigPropertySheet::TearDownBrowsing()
+{
+	OSStatus err = kNoErr;
+
+	if ( m_browseDomainsRef )
+	{
+		err = WSAAsyncSelect( DNSServiceRefSockFD( m_browseDomainsRef ), m_hWnd, 0, 0 );
+		check_noerr( err );
+
+		DNSServiceRefDeallocate( m_browseDomainsRef );
+	
+		m_browseDomainsRef = NULL;
+	}
+
+	return err;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigPropertySheet::DecodeDomainName
+//---------------------------------------------------------------------------------------------------------------------------
+
+OSStatus
+CConfigPropertySheet::DecodeDomainName( const char * raw, CString & decoded )
+{
+	char nextLabel[128] = "\0";
+	char decodedDomainString[kDNSServiceMaxDomainName];
+    char * buffer = (char *) raw;
+    int labels = 0, i;
+    char text[64];
+	const char *label[128];
+	OSStatus	err;
+    
+	// Initialize
+
+	decodedDomainString[0] = '\0';
+
+    // Count the labels
+
+	while ( *buffer )
+	{
+		label[labels++] = buffer;
+		buffer = (char *) GetNextLabel(buffer, text);
+    }
+        
+    buffer = (char*) raw;
+
+    for (i = 0; i < labels; i++)
+	{
+		buffer = (char *)GetNextLabel(buffer, nextLabel);
+        strcat(decodedDomainString, nextLabel);
+        strcat(decodedDomainString, ".");
+    }
+    
+    // Remove trailing dot from domain name.
+    
+	decodedDomainString[ strlen( decodedDomainString ) - 1 ] = '\0';
+
+	// Convert to Unicode
+
+	err = UTF8StringToStringObject( decodedDomainString, decoded );
+
+	return err;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigPropertySheet::BrowseDomainsReply
+//---------------------------------------------------------------------------------------------------------------------------
+
+void DNSSD_API
+CConfigPropertySheet::BrowseDomainsReply
+							(
+							DNSServiceRef			sdRef,
+							DNSServiceFlags			flags,
+							uint32_t				interfaceIndex,
+							DNSServiceErrorType		errorCode,
+							const char			*	replyDomain,
+							void				*	context
+							)
+{
+	CConfigPropertySheet	*	self = reinterpret_cast<CConfigPropertySheet*>(context);
+	CString						decoded;
+	OSStatus					err;
+
+	DEBUG_UNUSED( sdRef );
+	DEBUG_UNUSED( interfaceIndex );
+
+	if ( errorCode )
+	{
+		goto exit;
+	}
+
+	check( replyDomain );
+	
+	// Ignore local domains
+
+	if ( strcmp( replyDomain, "local." ) == 0 )
+	{
+		goto exit;
+	}
+
+	err = self->DecodeDomainName( replyDomain, decoded );
+	require_noerr( err, exit );
+
+	// Remove trailing '.'
+
+	decoded.TrimRight( '.' );
+
+	if ( flags & kDNSServiceFlagsAdd )
+	{
+		self->m_browseDomains.push_back( decoded );
+	}
+	else
+	{
+		self->m_browseDomains.remove( decoded );
+	}
+
+exit:
+
+	return;
+}
diff --git a/mDNSWindows/ControlPanel/ConfigPropertySheet.h b/mDNSWindows/ControlPanel/ConfigPropertySheet.h
new file mode 100755
index 0000000..9e4fda8
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ConfigPropertySheet.h
@@ -0,0 +1,105 @@
+/* -*- 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 _ConfigPropertySheet_h
+#define _ConfigPropertySheet_h
+
+#include "stdafx.h"
+#include "ServicesPage.h"
+#include "RegistrationPage.h"
+#include "BrowsingPage.h"
+
+#include <RegNames.h>
+#include <dns_sd.h>
+#include <list>
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CConfigPropertySheet
+//---------------------------------------------------------------------------------------------------------------------------
+
+class CConfigPropertySheet : public CPropertySheet
+{
+public:
+
+	CConfigPropertySheet();
+	virtual ~CConfigPropertySheet();
+
+	typedef std::list<CString> StringList;
+
+	StringList	m_browseDomains;
+
+protected:
+
+	CServicesPage		m_firstPage;
+	CRegistrationPage	m_secondPage;
+	CBrowsingPage		m_thirdPage;
+
+	//{{AFX_VIRTUAL(CConfigPropertySheet)
+	//}}AFX_VIRTUAL
+
+	DECLARE_DYNCREATE(CConfigPropertySheet)
+
+	//{{AFX_MSG(CConfigPropertySheet)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+
+	afx_msg BOOL	OnInitDialog();
+	afx_msg BOOL	OnCommand( WPARAM wParam, LPARAM lParam );
+	afx_msg LRESULT	OnDataReady( WPARAM inWParam, LPARAM inLParam );
+	afx_msg LRESULT	OnRegistryChanged( WPARAM inWParam, LPARAM inLParam );
+	void			OnEndDialog();
+
+private:
+
+	OSStatus
+	SetupBrowsing();
+
+	OSStatus
+	TearDownBrowsing();
+
+	OSStatus
+	DecodeDomainName( const char * raw, CString & decoded );
+
+	static void DNSSD_API
+	BrowseDomainsReply
+				(
+				DNSServiceRef			sdRef,
+				DNSServiceFlags			flags,
+				uint32_t				interfaceIndex,
+				DNSServiceErrorType		errorCode,
+				const char			*	replyDomain,
+				void				*	context
+				);
+
+	// This thread will watch for registry changes
+
+	static unsigned WINAPI
+	WatchRegistry
+				(
+				LPVOID inParam
+				);
+
+	HKEY				m_statusKey;
+	HANDLE				m_thread;
+	HANDLE				m_threadExited;
+	DNSServiceRef		m_browseDomainsRef;
+	CRITICAL_SECTION	m_lock;
+};
+
+
+#endif
diff --git a/mDNSWindows/ControlPanel/ControlPanel.cpp b/mDNSWindows/ControlPanel/ControlPanel.cpp
new file mode 100755
index 0000000..4bf5df3
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanel.cpp
@@ -0,0 +1,380 @@
+/* -*- 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 "ControlPanel.h"
+#include "ConfigDialog.h"
+#include "ConfigPropertySheet.h"
+#include "resource.h"
+
+#include <DebugServices.h>
+
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+
+static CCPApp theApp;
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	GetControlPanelApp
+//---------------------------------------------------------------------------------------------------------------------------
+
+CCPApp*
+GetControlPanelApp()
+{
+	CCPApp * pApp = (CCPApp*) AfxGetApp();
+
+	check( pApp );
+	check( pApp->IsKindOf( RUNTIME_CLASS( CCPApp ) ) );
+
+	return pApp;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CPlApplet
+//---------------------------------------------------------------------------------------------------------------------------
+
+LONG APIENTRY
+CPlApplet(HWND hWndCPl, UINT uMsg, LONG lParam1, LONG lParam2)
+{
+	AFX_MANAGE_STATE(AfxGetStaticModuleState());
+
+	CCPApp * pApp = GetControlPanelApp();
+
+	return ( LONG ) pApp->OnCplMsg(hWndCPl, uMsg, lParam1, lParam2);
+}
+
+
+IMPLEMENT_DYNAMIC(CCPApplet, CCmdTarget);
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApplet::CCPApplet
+//---------------------------------------------------------------------------------------------------------------------------
+
+CCPApplet::CCPApplet(UINT resourceId, UINT descId, CRuntimeClass * uiClass)
+:
+	m_resourceId(resourceId),
+	m_descId(descId),
+	m_uiClass(uiClass),
+	m_pageNumber(0)
+{
+	check( uiClass );
+	check( uiClass->IsDerivedFrom( RUNTIME_CLASS( CDialog ) ) || 
+	       uiClass->IsDerivedFrom( RUNTIME_CLASS( CPropertySheet ) ) );
+
+	m_name.LoadString(resourceId);
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApplet::~CCPApplet
+//---------------------------------------------------------------------------------------------------------------------------
+
+CCPApplet::~CCPApplet()
+{
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApplet::OnStartParms
+//---------------------------------------------------------------------------------------------------------------------------
+
+LRESULT
+CCPApplet::OnStartParms(CWnd * pParentWnd, LPCTSTR extra)
+{
+	DEBUG_UNUSED( pParentWnd );
+
+	if ( extra )
+	{
+		m_pageNumber = ::_ttoi( extra ) - 1;
+	}
+
+	return 0;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApplet::OnRun
+//---------------------------------------------------------------------------------------------------------------------------
+
+LRESULT
+CCPApplet::OnRun(CWnd* pParentWnd)
+{
+	LRESULT		lResult = 1;
+	CWnd	*	pWnd;
+
+	InitCommonControls();
+
+	pWnd = (CWnd*) m_uiClass->CreateObject(); 
+
+	if ( pWnd )
+	{
+		lResult = ERROR_SUCCESS;
+
+		if ( pWnd->IsKindOf( RUNTIME_CLASS( CPropertySheet ) ) )
+		{
+			CPropertySheet * pSheet = (CPropertySheet*) pWnd;
+
+			pSheet->Construct(m_name, pParentWnd, m_pageNumber);
+
+			pSheet->DoModal();
+		}
+		else
+		{
+			check( pWnd->IsKindOf( RUNTIME_CLASS( CDialog ) ) );
+
+			CDialog * pDialog = (CDialog*) pWnd;
+
+      		pDialog->DoModal();
+    	}
+
+		delete pWnd;
+  	}
+
+	return lResult;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApplet::OnInquire
+//---------------------------------------------------------------------------------------------------------------------------
+
+LRESULT
+CCPApplet::OnInquire(CPLINFO* pInfo)
+{
+	pInfo->idIcon = m_resourceId;
+	pInfo->idName = m_resourceId;
+	pInfo->idInfo = m_descId;
+	pInfo->lData  = reinterpret_cast<LONG>(this);
+
+	return 0;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApplet::OnNewInquire
+//---------------------------------------------------------------------------------------------------------------------------
+
+LRESULT
+CCPApplet::OnNewInquire(NEWCPLINFO* pInfo)
+{
+	DEBUG_UNUSED( pInfo );
+
+	return 1;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApplet::OnSelect
+//---------------------------------------------------------------------------------------------------------------------------
+
+LRESULT
+CCPApplet::OnSelect()
+{
+	return 0;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApplet::OnStop
+//---------------------------------------------------------------------------------------------------------------------------
+
+LRESULT
+CCPApplet::OnStop()
+{
+	return 0;
+}
+
+
+IMPLEMENT_DYNAMIC(CCPApp, CWinApp);
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApp::CCPApp
+//---------------------------------------------------------------------------------------------------------------------------
+
+CCPApp::CCPApp()
+{
+	debug_initialize( kDebugOutputTypeWindowsEventLog, "DNS-SD Control Panel", GetModuleHandle( NULL ) );
+	debug_set_property( kDebugPropertyTagPrintLevel, kDebugLevelInfo );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApp::~CCPApp
+//---------------------------------------------------------------------------------------------------------------------------
+
+CCPApp::~CCPApp()
+{
+	while ( !m_applets.IsEmpty() )
+	{
+    	delete m_applets.RemoveHead();
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApp::AddApplet
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CCPApp::AddApplet( CCPApplet * applet )
+{
+	check( applet );
+
+	m_applets.AddTail( applet );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApp::OnInit
+//---------------------------------------------------------------------------------------------------------------------------
+
+LRESULT
+CCPApp::OnInit()
+{
+	CCPApplet * applet;
+
+	try
+	{
+		applet = new CCPApplet( IDR_APPLET, IDS_APPLET_DESCRIPTION, RUNTIME_CLASS( CConfigPropertySheet ) );
+	}
+	catch (...)
+	{
+		applet = NULL;
+	}
+   
+	require_action( applet, exit, kNoMemoryErr );
+	
+	AddApplet( applet );
+
+exit:
+
+	return m_applets.GetCount();
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApp::OnExit
+//---------------------------------------------------------------------------------------------------------------------------
+
+LRESULT
+CCPApp::OnExit()
+{
+  return 1;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApp::OnCplMsg
+//---------------------------------------------------------------------------------------------------------------------------
+
+LRESULT
+CCPApp::OnCplMsg(HWND hWndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
+{
+	LRESULT lResult = 1;
+
+	switch ( uMsg )
+	{
+		case CPL_INIT:
+		{
+			lResult = OnInit();
+		}
+		break;
+
+		case CPL_EXIT:
+		{
+			lResult = OnExit();
+		}
+		break;
+
+		case CPL_GETCOUNT:
+		{      
+    		lResult = m_applets.GetCount();
+  		}
+		break;
+
+		default:
+  		{
+    		POSITION pos = m_applets.FindIndex( lParam1 );
+			check( pos );
+
+			CCPApplet * applet = m_applets.GetAt( pos );  
+			check( applet );
+
+    		switch (uMsg)
+    		{
+      			case CPL_INQUIRE:
+      			{
+					LPCPLINFO pInfo = reinterpret_cast<LPCPLINFO>(lParam2);
+        			lResult = applet->OnInquire(pInfo);
+				}  
+        		break;
+
+				case CPL_NEWINQUIRE:
+      			{
+        			LPNEWCPLINFO pInfo = reinterpret_cast<LPNEWCPLINFO>(lParam2);
+					lResult = applet->OnNewInquire(pInfo);
+				}  
+        		break;
+
+				case CPL_STARTWPARMS:
+      			{
+        			CWnd * pParentWnd = CWnd::FromHandle(hWndCPl);
+        			LPCTSTR lpszExtra = reinterpret_cast<LPCTSTR>(lParam2);
+        			lResult = applet->OnStartParms(pParentWnd, lpszExtra);
+				}
+				break;
+
+				case CPL_DBLCLK:
+				{
+        			CWnd* pParentWnd = CWnd::FromHandle(hWndCPl);
+        			lResult = applet->OnRun(pParentWnd);
+				}
+        		break;
+
+				case CPL_SELECT:
+				{
+        			lResult = applet->OnSelect();
+				}
+				break;
+
+				case CPL_STOP:
+				{
+					lResult = applet->OnStop();
+				}
+				break;
+
+				default:
+				{
+					// TRACE(_T("Warning, Received an unknown control panel message:%d\n"), uMsg);
+					lResult = 1;
+				}
+				break;
+    		}
+  		}
+		break;
+	}
+
+	return lResult;
+}
diff --git a/mDNSWindows/ControlPanel/ControlPanel.def b/mDNSWindows/ControlPanel/ControlPanel.def
new file mode 100644
index 0000000..3cb05eb
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanel.def
@@ -0,0 +1,20 @@
+; -*- 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.
+    
+LIBRARY	"Bonjour"
+
+EXPORTS
+	CPlApplet
diff --git a/mDNSWindows/ControlPanel/ControlPanel.h b/mDNSWindows/ControlPanel/ControlPanel.h
new file mode 100644
index 0000000..dec5e58
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanel.h
@@ -0,0 +1,84 @@
+/* -*- 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.
+ */
+
+    
+#pragma once
+
+#include "stdafx.h"
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApplet
+//---------------------------------------------------------------------------------------------------------------------------
+
+class CCPApplet : public CCmdTarget
+{
+public:
+
+	CCPApplet( UINT nResourceID, UINT nDescriptionID, CRuntimeClass* pUIClass );
+
+	virtual ~CCPApplet();
+
+protected:
+
+	virtual LRESULT OnRun(CWnd* pParentWnd);
+	virtual LRESULT OnStartParms(CWnd* pParentWnd, LPCTSTR lpszExtra);
+	virtual LRESULT OnInquire(CPLINFO* pInfo);
+	virtual LRESULT OnNewInquire(NEWCPLINFO* pInfo);
+	virtual LRESULT OnSelect();
+	virtual LRESULT OnStop();
+
+	CRuntimeClass	*	m_uiClass;
+	UINT				m_resourceId;
+	UINT				m_descId;
+	CString				m_name;
+	int					m_pageNumber;
+  
+	friend class CCPApp;
+
+	DECLARE_DYNAMIC(CCPApplet);
+};
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApp
+//---------------------------------------------------------------------------------------------------------------------------
+
+class CCPApp : public CWinApp
+{
+public:
+
+	CCPApp();
+	virtual ~CCPApp();
+
+	void AddApplet( CCPApplet* pApplet );
+
+protected:
+
+	CList<CCPApplet*, CCPApplet*&> m_applets;
+
+	friend LONG APIENTRY
+	CPlApplet(HWND hWndCPl, UINT uMsg, LONG lParam1, LONG lParam2);
+
+	virtual LRESULT OnCplMsg(HWND hWndCPl, UINT msg, LPARAM lp1, LPARAM lp2);
+	virtual LRESULT OnInit();
+	virtual LRESULT OnExit();
+
+	DECLARE_DYNAMIC(CCPApp);
+};
+
+
+CCPApp * GetControlPanelApp();
diff --git a/mDNSWindows/ControlPanel/ControlPanel.rc b/mDNSWindows/ControlPanel/ControlPanel.rc
new file mode 100644
index 0000000..1df3e90
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanel.rc
@@ -0,0 +1,141 @@
+// Microsoft Visual C++ generated resource script.

+//

+#include "resource.h"

+

+#define APSTUDIO_READONLY_SYMBOLS

+/////////////////////////////////////////////////////////////////////////////

+//

+// Generated from the TEXTINCLUDE 2 resource.

+//

+#include "afxres.h"

+#include "WinVersRes.h"

+

+/////////////////////////////////////////////////////////////////////////////

+#undef APSTUDIO_READONLY_SYMBOLS

+

+/////////////////////////////////////////////////////////////////////////////

+// English (U.S.) resources

+

+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

+#ifdef _WIN32

+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

+#pragma code_page(1252)

+#endif //_WIN32

+

+#ifdef APSTUDIO_INVOKED

+/////////////////////////////////////////////////////////////////////////////

+//

+// TEXTINCLUDE

+//

+

+1 TEXTINCLUDE 

+BEGIN

+    "resource.h\0"

+END

+

+2 TEXTINCLUDE 

+BEGIN

+    "#include ""afxres.h""\r\n"

+    "#include ""WinVersRes.h""\r\n"

+    "\0"

+END

+

+3 TEXTINCLUDE 

+BEGIN

+    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"

+    "#define _AFX_NO_OLE_RESOURCES\r\n"

+    "#define _AFX_NO_TRACKER_RESOURCES\r\n"

+    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"

+    "\r\n"

+    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"

+    "LANGUAGE 9, 1\r\n"

+    "#pragma code_page(1252)\r\n"

+    "#include ""afxres.rc""     // Standard components\r\n"

+    "#endif\r\n"

+    "\0"

+END

+

+#endif    // APSTUDIO_INVOKED

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// Icon

+//

+

+// Icon with lowest ID value placed first to ensure application icon

+// remains consistent on all systems.

+IDR_APPLET              ICON                    "res\\controlpanel.ico"

+

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// Version

+//

+

+VS_VERSION_INFO VERSIONINFO

+ FILEVERSION MASTER_PROD_VERS

+ PRODUCTVERSION MASTER_PROD_VERS

+ FILEFLAGSMASK 0x3fL

+#ifdef _DEBUG

+ FILEFLAGS 0x1L

+#else

+ FILEFLAGS 0x0L

+#endif

+ FILEOS 0x4L

+ FILETYPE 0x2L

+ FILESUBTYPE 0x0L

+BEGIN

+    BLOCK "StringFileInfo"

+    BEGIN

+        BLOCK "040904b0"

+        BEGIN

+            VALUE "CompanyName", MASTER_COMPANY_NAME

+            VALUE "FileDescription", "Bonjour Control Panel"

+            VALUE "FileVersion", MASTER_PROD_VERS_STR

+            VALUE "InternalName", "ControlPanel.cpl"

+            VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT

+            VALUE "OriginalFilename", "ControlPanel.cpl"

+            VALUE "ProductName", MASTER_PROD_NAME

+            VALUE "ProductVersion", MASTER_PROD_VERS_STR

+        END

+    END

+    BLOCK "VarFileInfo"

+    BEGIN

+        VALUE "Translation", 0x409, 1200

+    END

+END

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// String Table

+//

+

+STRINGTABLE

+BEGIN

+	IDS_REINSTALL    "Bonjour Control Panel cannot run because some of its required files are missing.  Please reinstall Bonjour Control Panel."

+	IDS_REINSTALL_CAPTION "Bonjour"

+END

+#endif    // English (U.S.) resources

+/////////////////////////////////////////////////////////////////////////////

+

+

+

+#ifndef APSTUDIO_INVOKED

+/////////////////////////////////////////////////////////////////////////////

+//

+// Generated from the TEXTINCLUDE 3 resource.

+//

+#define _AFX_NO_SPLITTER_RESOURCES

+#define _AFX_NO_OLE_RESOURCES

+#define _AFX_NO_TRACKER_RESOURCES

+#define _AFX_NO_PROPERTY_RESOURCES

+

+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

+LANGUAGE 9, 1

+#pragma code_page(1252)

+#include "afxres.rc"     // Standard components

+#endif

+

+/////////////////////////////////////////////////////////////////////////////

+#endif    // not APSTUDIO_INVOKED

+

diff --git a/mDNSWindows/ControlPanel/ControlPanel.vcproj b/mDNSWindows/ControlPanel/ControlPanel.vcproj
new file mode 100755
index 0000000..2f2d0ab
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanel.vcproj
@@ -0,0 +1,727 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="8.00"

+	Name="ControlPanel"

+	ProjectGUID="{0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}"

+	RootNamespace="ControlPanel"

+	Keyword="MFCProj"

+	>

+	<Platforms>

+		<Platform

+			Name="Win32"

+		/>

+		<Platform

+			Name="x64"

+		/>

+	</Platforms>

+	<ToolFiles>

+	</ToolFiles>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="_DEBUG"

+				MkTypLibCompatible="false"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories="..;../../mDNSCore;../../mDNSShared;../../Clients"

+				PreprocessorDefinitions="WIN32;_DEBUG;DEBUG=1;UNICODE;_UNICODE;_WINDOWS;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				StringPooling="true"

+				MinimalRebuild="true"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderThrough=""

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation="$(IntDir)\"

+				ObjectFile="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\vc80.pdb"

+				WarningLevel="4"

+				SuppressStartupBanner="true"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+				CallingConvention="0"

+				DisableSpecificWarnings="4311;4312"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"

+				AdditionalDependencies="../DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib ws2_32.lib"

+				OutputFile="$(OutDir)/ControlPanel.exe"

+				LinkIncremental="2"

+				SuppressStartupBanner="true"

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)\ControlPanel.pdb"

+				SubSystem="2"

+				EntryPointSymbol="wWinMainCRTStartup"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+				AdditionalManifestFiles="res\ControlPanel.manifest"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="_DEBUG"

+				MkTypLibCompatible="false"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories="..;../../mDNSCore;../../mDNSShared;../../Clients"

+				PreprocessorDefinitions="WIN32;_DEBUG;DEBUG=1;UNICODE;_UNICODE;_WINDOWS;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				StringPooling="true"

+				MinimalRebuild="true"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderThrough=""

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation="$(IntDir)\"

+				ObjectFile="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\vc80.pdb"

+				WarningLevel="4"

+				SuppressStartupBanner="true"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+				CallingConvention="0"

+				DisableSpecificWarnings="4311;4312"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE"

+				AdditionalDependencies="../DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib ws2_32.lib"

+				OutputFile="$(OutDir)/ControlPanel.exe"

+				LinkIncremental="2"

+				SuppressStartupBanner="true"

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)\ControlPanel.pdb"

+				SubSystem="2"

+				EntryPointSymbol="wWinMainCRTStartup"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+				AdditionalManifestFiles="res\ControlPanel64.manifest"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="NDEBUG"

+				MkTypLibCompatible="false"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="2"

+				InlineFunctionExpansion="1"

+				AdditionalIncludeDirectories="..;../../mDNSCore;../../mDNSShared;../../Clients"

+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				StringPooling="true"

+				MinimalRebuild="false"

+				RuntimeLibrary="0"

+				EnableFunctionLevelLinking="true"

+				TreatWChar_tAsBuiltInType="true"

+				UsePrecompiledHeader="0"

+				AssemblerListingLocation="$(IntDir)\"

+				ObjectFile="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\vc80.pdb"

+				WarningLevel="4"

+				SuppressStartupBanner="true"

+				DisableSpecificWarnings="4702"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"

+				AdditionalDependencies="../DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib ws2_32.lib"

+				OutputFile="$(OutDir)/ControlPanel.exe"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				ProgramDatabaseFile="$(OutDir)\ControlPanel.pdb"

+				SubSystem="2"

+				OptimizeReferences="0"

+				EnableCOMDATFolding="0"

+				EntryPointSymbol="wWinMainCRTStartup"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+				AdditionalManifestFiles="res\ControlPanel.manifest"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="if not &quot;%RC_XBS%&quot; == &quot;YES&quot; goto END&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)&quot;   mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot;                                                                  &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="NDEBUG"

+				MkTypLibCompatible="false"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="2"

+				InlineFunctionExpansion="1"

+				AdditionalIncludeDirectories="..;../../mDNSCore;../../mDNSShared;../../Clients"

+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				StringPooling="true"

+				MinimalRebuild="false"

+				RuntimeLibrary="0"

+				EnableFunctionLevelLinking="true"

+				TreatWChar_tAsBuiltInType="true"

+				UsePrecompiledHeader="0"

+				AssemblerListingLocation="$(IntDir)\"

+				ObjectFile="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\vc80.pdb"

+				WarningLevel="4"

+				SuppressStartupBanner="true"

+				DisableSpecificWarnings="4702"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE"

+				AdditionalDependencies="../DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib ws2_32.lib"

+				OutputFile="$(OutDir)/ControlPanel.exe"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				ProgramDatabaseFile="$(OutDir)\ControlPanel.pdb"

+				SubSystem="2"

+				OptimizeReferences="0"

+				EnableCOMDATFolding="0"

+				EntryPointSymbol="wWinMainCRTStartup"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+				AdditionalManifestFiles="res\ControlPanel64.manifest"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="if not &quot;%RC_XBS%&quot; == &quot;YES&quot; goto END&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)&quot;   mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot;                                                                  &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"

+			/>

+		</Configuration>

+	</Configurations>

+	<References>

+	</References>

+	<Files>

+		<Filter

+			Name="Source Files"

+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"

+			>

+			<File

+				RelativePath="ConfigDialog.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="ConfigPropertySheet.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath=".\ControlPanelExe.cpp"

+				>

+			</File>

+			<File

+				RelativePath=".\ServicesPage.cpp"

+				>

+			</File>

+			<File

+				RelativePath="RegistrationPage.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="..\loclibrary.c"

+				>

+			</File>

+			<File

+				RelativePath="stdafx.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="BrowsingPage.cpp"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl"

+			>

+			<File

+				RelativePath="ConfigDialog.h"

+				>

+			</File>

+			<File

+				RelativePath="ConfigPropertySheet.h"

+				>

+			</File>

+			<File

+				RelativePath=".\ControlPanelExe.h"

+				>

+			</File>

+			<File

+				RelativePath=".\ServicesPage.h"

+				>

+			</File>

+			<File

+				RelativePath="RegistrationPage.h"

+				>

+			</File>

+			<File

+				RelativePath="..\loclibrary.h"

+				>

+			</File>

+			<File

+				RelativePath="Resource.h"

+				>

+			</File>

+			<File

+				RelativePath="stdafx.h"

+				>

+			</File>

+			<File

+				RelativePath="BrowsingPage.h"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Resource Files"

+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"

+			>

+			<File

+				RelativePath="res\configurator.ico"

+				>

+			</File>

+			<File

+				RelativePath="res\controlpanel.ico"

+				>

+			</File>

+			<File

+				RelativePath=".\ControlPanel.rc"

+				>

+			</File>

+			<File

+				RelativePath=".\res\ControlPanel.rc2"

+				>

+			</File>

+			<File

+				RelativePath=".\res\EnergySaver.ico"

+				>

+			</File>

+			<File

+				RelativePath="res\failure.ico"

+				>

+			</File>

+			<File

+				RelativePath="res\success.ico"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Support"

+			>

+			<File

+				RelativePath="..\..\Clients\ClientCommon.c"

+				>

+			</File>

+			<File

+				RelativePath="..\..\Clients\ClientCommon.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\CommonServices.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\DebugServices.c"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\DebugServices.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\dns_sd.h"

+				>

+			</File>

+			<File

+				RelativePath="..\Secret.c"

+				>

+			</File>

+			<File

+				RelativePath="..\Secret.h"

+				>

+			</File>

+			<File

+				RelativePath="..\WinServices.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\WinServices.h"

+				>

+			</File>

+		</Filter>

+	</Files>

+	<Globals>

+	</Globals>

+</VisualStudioProject>

diff --git a/mDNSWindows/ControlPanel/ControlPanelDll.rc b/mDNSWindows/ControlPanel/ControlPanelDll.rc
new file mode 100644
index 0000000..5d1f495
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanelDll.rc
@@ -0,0 +1,123 @@
+// Microsoft Visual C++ generated resource script.

+//

+#include "resource.h"

+

+#define APSTUDIO_READONLY_SYMBOLS

+/////////////////////////////////////////////////////////////////////////////

+//

+// Generated from the TEXTINCLUDE 2 resource.

+//

+#include "afxres.h"

+#include "WinVersRes.h"

+

+/////////////////////////////////////////////////////////////////////////////

+#undef APSTUDIO_READONLY_SYMBOLS

+

+/////////////////////////////////////////////////////////////////////////////

+// English (U.S.) resources

+

+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

+#ifdef _WIN32

+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

+#pragma code_page(1252)

+#endif //_WIN32

+

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// Version

+//

+

+VS_VERSION_INFO VERSIONINFO

+ FILEVERSION MASTER_PROD_VERS

+ PRODUCTVERSION MASTER_PROD_VERS

+ FILEFLAGSMASK 0x3fL

+#ifdef _DEBUG

+ FILEFLAGS 0x1L

+#else

+ FILEFLAGS 0x0L

+#endif

+ FILEOS 0x4L

+ FILETYPE 0x1L

+ FILESUBTYPE 0x0L

+BEGIN

+    BLOCK "StringFileInfo"

+    BEGIN

+        BLOCK "040904e4"

+        BEGIN

+            VALUE "CompanyName", MASTER_COMPANY_NAME

+            VALUE "FileDescription", "Bonjour Configuration Applet"

+            VALUE "FileVersion", MASTER_PROD_VERS_STR

+            VALUE "InternalName", "Bonjour.cpl"

+            VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT

+            VALUE "OriginalFilename", "Bonjour.cpl"

+            VALUE "ProductName", MASTER_PROD_NAME

+            VALUE "ProductVersion", MASTER_PROD_VERS_STR

+        END

+    END

+    BLOCK "VarFileInfo"

+    BEGIN

+        VALUE "Translation", 0x409, 1252

+    END

+END

+

+

+#ifdef APSTUDIO_INVOKED

+/////////////////////////////////////////////////////////////////////////////

+//

+// TEXTINCLUDE

+//

+

+1 TEXTINCLUDE 

+BEGIN

+    "resource.h\0"

+END

+

+2 TEXTINCLUDE 

+BEGIN

+    "#include ""afxres.h""\r\n"

+    "#include ""WinVersRes.h""\r\n"

+    "\0"

+END

+

+3 TEXTINCLUDE 

+BEGIN

+    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"

+    "#define _AFX_NO_OLE_RESOURCES\r\n"

+    "#define _AFX_NO_TRACKER_RESOURCES\r\n"

+    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"

+    "\r\n"

+    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"

+    "LANGUAGE 9, 1\r\n"

+    "#pragma code_page(1252)\r\n"

+    "#include ""afxres.rc""         // Standard components\r\n"

+    "#include ""ControlPanel.rc""\r\n"

+    "#endif\r\n"

+    "\0"

+END

+

+#endif    // APSTUDIO_INVOKED

+

+

+#endif    // English (U.S.) resources

+

+

+#ifndef APSTUDIO_INVOKED

+/////////////////////////////////////////////////////////////////////////////

+//

+// Generated from the TEXTINCLUDE 3 resource.

+//

+#define _AFX_NO_SPLITTER_RESOURCES

+#define _AFX_NO_OLE_RESOURCES

+#define _AFX_NO_TRACKER_RESOURCES

+#define _AFX_NO_PROPERTY_RESOURCES

+

+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

+LANGUAGE 9, 1

+#pragma code_page(1252)

+#include "afxres.rc"         // Standard components

+#include "ControlPanel.rc"

+#endif

+

+/////////////////////////////////////////////////////////////////////////////

+#endif    // not APSTUDIO_INVOKED

diff --git a/mDNSWindows/ControlPanel/ControlPanelExe.cpp b/mDNSWindows/ControlPanel/ControlPanelExe.cpp
new file mode 100755
index 0000000..36447d1
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanelExe.cpp
@@ -0,0 +1,373 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2002-2007 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.
+ */
+
+    
+#include "ControlPanelExe.h"
+#include "ConfigDialog.h"
+#include "ConfigPropertySheet.h"
+#include "resource.h"
+
+#include <DebugServices.h>
+#include "loclibrary.h"
+
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+#ifndef HeapEnableTerminationOnCorruption
+#	define HeapEnableTerminationOnCorruption (HEAP_INFORMATION_CLASS) 1
+#endif
+
+
+// Stash away pointers to our resource DLLs
+
+static HINSTANCE g_nonLocalizedResources	= NULL;
+static HINSTANCE g_localizedResources		= NULL;
+
+
+HINSTANCE	GetNonLocalizedResources()
+{
+	return g_nonLocalizedResources;
+}
+
+
+HINSTANCE	GetLocalizedResources()
+{
+	return g_localizedResources;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	Static Declarations
+//---------------------------------------------------------------------------------------------------------------------------
+DEFINE_GUID(CLSID_ControlPanel, 
+
+0x1207552c, 0xe59, 0x4d9f, 0x85, 0x54, 0xf1, 0xf8, 0x6, 0xcd, 0x7f, 0xa9);
+
+static LPCTSTR g_controlPanelGUID			=	TEXT( "{1207552C-0E59-4d9f-8554-F1F806CD7FA9}" );
+static LPCTSTR g_controlPanelName			=	TEXT( "Bonjour" );
+static LPCTSTR g_controlPanelCanonicalName	=	TEXT( "Apple.Bonjour" );
+static LPCTSTR g_controlPanelCategory		=	TEXT( "3,8" );
+
+static CCPApp theApp;
+
+//===========================================================================================================================
+//	MyRegDeleteKey
+//===========================================================================================================================
+
+DEBUG_LOCAL OSStatus MyRegDeleteKey( HKEY hKeyRoot, LPTSTR lpSubKey )
+{
+    LPTSTR lpEnd;
+    OSStatus err;
+    DWORD dwSize;
+    TCHAR szName[MAX_PATH];
+    HKEY hKey;
+    FILETIME ftWrite;
+
+    // First, see if we can delete the key without having to recurse.
+
+    err = RegDeleteKey( hKeyRoot, lpSubKey );
+
+    if ( !err )
+	{
+		goto exit;
+	}
+
+    err = RegOpenKeyEx( hKeyRoot, lpSubKey, 0, KEY_READ, &hKey );
+	require_noerr( err, exit );
+
+    // Check for an ending slash and add one if it is missing.
+
+    lpEnd = lpSubKey + lstrlen(lpSubKey);
+
+    if ( *( lpEnd - 1 ) != TEXT( '\\' ) ) 
+    {
+        *lpEnd =  TEXT('\\');
+        lpEnd++;
+        *lpEnd =  TEXT('\0');
+    }
+
+    // Enumerate the keys
+
+    dwSize = MAX_PATH;
+    err = RegEnumKeyEx(hKey, 0, szName, &dwSize, NULL, NULL, NULL, &ftWrite);
+
+    if ( !err ) 
+    {
+        do
+		{
+            lstrcpy (lpEnd, szName);
+
+            if ( !MyRegDeleteKey( hKeyRoot, lpSubKey ) )
+			{
+                break;
+            }
+
+            dwSize = MAX_PATH;
+
+            err = RegEnumKeyEx( hKey, 0, szName, &dwSize, NULL, NULL, NULL, &ftWrite );
+
+        }
+		while ( !err );
+    }
+
+    lpEnd--;
+    *lpEnd = TEXT('\0');
+
+    RegCloseKey( hKey );
+
+    // Try again to delete the key.
+
+    err = RegDeleteKey(hKeyRoot, lpSubKey);
+	require_noerr( err, exit );
+
+exit:
+
+	return err;
+}
+
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApp::CCPApp
+//---------------------------------------------------------------------------------------------------------------------------
+IMPLEMENT_DYNAMIC(CCPApp, CWinApp);
+
+CCPApp::CCPApp()
+{
+	debug_initialize( kDebugOutputTypeWindowsEventLog, "DNS-SD Control Panel", GetModuleHandle( NULL ) );
+	debug_set_property( kDebugPropertyTagPrintLevel, kDebugLevelInfo );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CCPApp::~CCPApp
+//---------------------------------------------------------------------------------------------------------------------------
+
+CCPApp::~CCPApp()
+{
+}
+
+
+void
+CCPApp::Register( LPCTSTR inClsidString, LPCTSTR inName, LPCTSTR inCanonicalName, LPCTSTR inCategory, LPCTSTR inLocalizedName, LPCTSTR inInfoTip, LPCTSTR inIconPath, LPCTSTR inExePath )
+{
+	typedef struct	RegistryBuilder		RegistryBuilder;
+	
+	struct	RegistryBuilder
+	{
+		HKEY		rootKey;
+		LPCTSTR		subKey;
+		LPCTSTR		valueName;
+		DWORD		valueType;
+		LPCTSTR		data;
+	};
+	
+	OSStatus			err;
+	size_t				n;
+	size_t				i;
+	HKEY				key;
+	TCHAR				keyName[ MAX_PATH ];
+	RegistryBuilder		entries[] = 
+	{
+		{ HKEY_LOCAL_MACHINE,	TEXT( "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\\NameSpace\\%s" ),	NULL,									REG_SZ,		inName },
+		{ HKEY_CLASSES_ROOT,	TEXT( "CLSID\\%s" ),																			NULL,									NULL,		NULL },
+		{ HKEY_CLASSES_ROOT,	TEXT( "CLSID\\%s" ),																			TEXT( "System.ApplicationName" ),		REG_SZ,		inCanonicalName },
+		{ HKEY_CLASSES_ROOT,	TEXT( "CLSID\\%s" ),																			TEXT( "System.ControlPanel.Category" ),	REG_SZ,		inCategory },
+		{ HKEY_CLASSES_ROOT,	TEXT( "CLSID\\%s" ),																			TEXT( "LocalizedString" ),				REG_SZ,		inLocalizedName },
+		{ HKEY_CLASSES_ROOT,	TEXT( "CLSID\\%s" ),																			TEXT( "InfoTip" ),						REG_SZ,		inInfoTip },
+		{ HKEY_CLASSES_ROOT,	TEXT( "CLSID\\%s\\DefaultIcon" ),																NULL,									REG_SZ,		inIconPath },
+		{ HKEY_CLASSES_ROOT,	TEXT( "CLSID\\%s\\Shell" ),																		NULL,									NULL,		NULL },
+		{ HKEY_CLASSES_ROOT,	TEXT( "CLSID\\%s\\Shell\\Open" ),																NULL,									NULL,		NULL },
+		{ HKEY_CLASSES_ROOT,	TEXT( "CLSID\\%s\\Shell\\Open\\Command" ),														NULL,									REG_SZ,		inExePath }
+	};
+	DWORD				size;
+	
+	// Register the registry entries.
+
+	n = sizeof_array( entries );
+	for( i = 0; i < n; ++i )
+	{
+		wsprintf( keyName, entries[ i ].subKey, inClsidString );		
+		err = RegCreateKeyEx( entries[ i ].rootKey, keyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &key, NULL );
+		require_noerr( err, exit );
+		
+		if ( entries[ i ].data )
+		{
+			size = (DWORD)( ( lstrlen( entries[ i ].data ) + 1 ) * sizeof( TCHAR ) );
+			err = RegSetValueEx( key, entries[ i ].valueName, 0, entries[ i ].valueType, (LPBYTE) entries[ i ].data, size );
+			require_noerr( err, exit );
+		}
+
+		RegCloseKey( key );
+	}
+	
+exit:
+	return;
+}
+
+
+//-----------------------------------------------------------
+//	CCPApp::Unregister
+//-----------------------------------------------------------
+void
+CCPApp::Unregister( LPCTSTR clsidString )
+{
+	TCHAR keyName[ MAX_PATH * 2 ];
+
+	wsprintf( keyName, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\ControlPanel\\NameSpace\\%s", clsidString );							
+	MyRegDeleteKey( HKEY_LOCAL_MACHINE, keyName );
+
+	wsprintf( keyName, L"CLSID\\%s", clsidString );
+	MyRegDeleteKey( HKEY_CLASSES_ROOT, keyName );
+}
+
+
+
+//-----------------------------------------------------------
+//	CCPApp::InitInstance
+//-----------------------------------------------------------
+
+BOOL
+CCPApp::InitInstance()
+{
+	CCommandLineInfo	commandLine;
+	wchar_t				resource[MAX_PATH];
+	CString				errorMessage;
+	CString				errorCaption;
+	int					res;
+	OSStatus			err = kNoErr;
+
+	HeapSetInformation( NULL, HeapEnableTerminationOnCorruption, NULL, 0 );
+
+	//
+	// initialize the debugging framework
+	//
+	debug_initialize( kDebugOutputTypeWindowsDebugger, "ControlPanel", NULL );
+	debug_set_property( kDebugPropertyTagPrintLevel, kDebugLevelTrace );
+
+	// Before we load the resources, let's load the error string
+
+	errorMessage.LoadString( IDS_REINSTALL );
+	errorCaption.LoadString( IDS_REINSTALL_CAPTION );
+
+	res = PathForResource( NULL, L"ControlPanelResources.dll", resource, MAX_PATH );
+	err = translate_errno( res != 0, kUnknownErr, kUnknownErr );
+	require_noerr( err, exit );
+
+	g_nonLocalizedResources = LoadLibrary( resource );
+	translate_errno( g_nonLocalizedResources, GetLastError(), kUnknownErr );
+	require_noerr( err, exit );
+
+	res = PathForResource( NULL, L"ControlPanelLocalized.dll", resource, MAX_PATH );
+	err = translate_errno( res != 0, kUnknownErr, kUnknownErr );
+	require_noerr( err, exit );
+
+	g_localizedResources = LoadLibrary( resource );
+	translate_errno( g_localizedResources, GetLastError(), kUnknownErr );
+	require_noerr( err, exit );
+
+	AfxSetResourceHandle( g_localizedResources );
+
+	// InitCommonControls() is required on Windows XP if an application
+	// manifest specifies use of ComCtl32.dll version 6 or later to enable
+	// visual styles.  Otherwise, any window creation will fail.
+
+	InitCommonControls();
+
+	CWinApp::InitInstance();
+
+	AfxEnableControlContainer();
+
+	ParseCommandLine( commandLine );
+
+	if ( commandLine.m_nShellCommand == CCommandLineInfo::AppRegister )
+	{
+		CString		localizedName;
+		CString		toolTip;
+		TCHAR		iconPath[ MAX_PATH + 12 ]	= TEXT( "" );
+		TCHAR		exePath[ MAX_PATH ]			= TEXT( "" );
+		DWORD		nChars;
+		OSStatus	err;
+
+		nChars = GetModuleFileName( NULL, exePath, sizeof_array( exePath ) );
+
+		err = translate_errno( nChars > 0, (OSStatus) GetLastError(), kUnknownErr );
+
+		require_noerr( err, exit );
+
+		wsprintf( iconPath, L"%s,-%d", exePath, IDR_APPLET );
+
+		localizedName.LoadString( IDS_APPLET_NAME );
+		toolTip.LoadString( IDS_APPLET_TOOLTIP );
+
+		Register( g_controlPanelGUID, g_controlPanelName, g_controlPanelCanonicalName, g_controlPanelCategory, localizedName, toolTip, iconPath, exePath );
+	}
+	else if ( commandLine.m_nShellCommand == CCommandLineInfo::AppUnregister )
+	{
+		Unregister( g_controlPanelGUID );
+	}
+	else
+	{
+		CString					name;
+		CConfigPropertySheet	dlg;
+		
+		name.LoadString( IDR_APPLET );
+		dlg.Construct( name, NULL, 0 );
+
+		m_pMainWnd = &dlg;
+
+		try
+		{
+			INT_PTR nResponse = dlg.DoModal();
+		
+			if (nResponse == IDOK)
+			{
+				// TODO: Place code here to handle when the dialog is
+				//  dismissed with OK
+			}
+			else if (nResponse == IDCANCEL)
+			{
+				// TODO: Place code here to handle when the dialog is
+				//  dismissed with Cancel
+			}
+		}
+		catch (...)
+		{
+			MessageBox(NULL, L"", L"", MB_OK|MB_ICONEXCLAMATION);
+		}
+	}
+
+	if ( err )
+	{
+		MessageBox( NULL, L"", L"", MB_ICONERROR | MB_OK );
+	}
+
+exit:
+
+	if ( err )
+	{
+		MessageBox( NULL, errorMessage, errorCaption, MB_ICONERROR | MB_OK );
+	}
+
+	// Since the dialog has been closed, return FALSE so that we exit the
+	//  application, rather than start the application's message pump.
+	return FALSE;
+}
diff --git a/mDNSWindows/ControlPanel/ControlPanelExe.h b/mDNSWindows/ControlPanel/ControlPanelExe.h
new file mode 100644
index 0000000..079422b
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanelExe.h
@@ -0,0 +1,48 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2002-2007 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.
+ */
+
+    
+#pragma once
+
+#include "stdafx.h"

+
+extern HINSTANCE	GetNonLocalizedResources();
+extern HINSTANCE	GetLocalizedResources();
+
+//-------------------------------------------------
+//	CCPApp
+//-------------------------------------------------
+
+class CCPApp : public CWinApp
+{
+public:
+
+	CCPApp();
+	virtual ~CCPApp();
+
+protected:
+
+	virtual BOOL    InitInstance();
+
+	void
+	Register( LPCTSTR inClsidString, LPCTSTR inName, LPCTSTR inCanonicalName, LPCTSTR inCategory, LPCTSTR inLocalizedName, LPCTSTR inInfoTip, LPCTSTR inIconPath, LPCTSTR inExePath );
+
+	void
+	Unregister( LPCTSTR clsidString );
+
+	DECLARE_DYNAMIC(CCPApp);
+};
diff --git a/mDNSWindows/ControlPanel/ControlPanelExe.rc b/mDNSWindows/ControlPanel/ControlPanelExe.rc
new file mode 100644
index 0000000..4ea5f95
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanelExe.rc
@@ -0,0 +1,123 @@
+// Microsoft Visual C++ generated resource script.

+//

+#include "resource.h"

+

+#define APSTUDIO_READONLY_SYMBOLS

+/////////////////////////////////////////////////////////////////////////////

+//

+// Generated from the TEXTINCLUDE 2 resource.

+//

+#include "afxres.h"

+#include "WinVersRes.h"

+

+/////////////////////////////////////////////////////////////////////////////

+#undef APSTUDIO_READONLY_SYMBOLS

+

+/////////////////////////////////////////////////////////////////////////////

+// English (U.S.) resources

+

+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

+#ifdef _WIN32

+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

+#pragma code_page(1252)

+#endif //_WIN32

+

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// Version

+//

+

+VS_VERSION_INFO VERSIONINFO

+ FILEVERSION MASTER_PROD_VERS

+ PRODUCTVERSION MASTER_PROD_VERS

+ FILEFLAGSMASK 0x3fL

+#ifdef _DEBUG

+ FILEFLAGS 0x1L

+#else

+ FILEFLAGS 0x0L

+#endif

+ FILEOS 0x4L

+ FILETYPE 0x1L

+ FILESUBTYPE 0x0L

+BEGIN

+    BLOCK "StringFileInfo"

+    BEGIN

+        BLOCK "040904e4"

+        BEGIN

+            VALUE "CompanyName", MASTER_COMPANY_NAME

+            VALUE "FileDescription", "Bonjour Configuration Applet"

+            VALUE "FileVersion", MASTER_PROD_VERS_STR

+            VALUE "InternalName", "ControlPanel.exe"

+            VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT

+            VALUE "OriginalFilename", "ControlPanel.exe"

+            VALUE "ProductName", MASTER_PROD_NAME

+            VALUE "ProductVersion", MASTER_PROD_VERS_STR

+        END

+    END

+    BLOCK "VarFileInfo"

+    BEGIN

+        VALUE "Translation", 0x409, 1252

+    END

+END

+

+

+#ifdef APSTUDIO_INVOKED

+/////////////////////////////////////////////////////////////////////////////

+//

+// TEXTINCLUDE

+//

+

+1 TEXTINCLUDE 

+BEGIN

+    "resource.h\0"

+END

+

+2 TEXTINCLUDE 

+BEGIN

+    "#include ""afxres.h""\r\n"

+    "#include ""WinVersRes.h""\r\n"

+    "\0"

+END

+

+3 TEXTINCLUDE 

+BEGIN

+    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"

+    "#define _AFX_NO_OLE_RESOURCES\r\n"

+    "#define _AFX_NO_TRACKER_RESOURCES\r\n"

+    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"

+    "\r\n"

+    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"

+    "LANGUAGE 9, 1\r\n"

+    "#pragma code_page(1252)\r\n"

+    "#include ""afxres.rc""         // Standard components\r\n"

+    "#include ""ControlPanel.rc""\r\n"

+    "#endif\r\n"

+    "\0"

+END

+

+#endif    // APSTUDIO_INVOKED

+

+

+#endif    // English (U.S.) resources

+

+

+#ifndef APSTUDIO_INVOKED

+/////////////////////////////////////////////////////////////////////////////

+//

+// Generated from the TEXTINCLUDE 3 resource.

+//

+#define _AFX_NO_SPLITTER_RESOURCES

+#define _AFX_NO_OLE_RESOURCES

+#define _AFX_NO_TRACKER_RESOURCES

+#define _AFX_NO_PROPERTY_RESOURCES

+

+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

+LANGUAGE 9, 1

+#pragma code_page(1252)

+#include "afxres.rc"         // Standard components

+#include "ControlPanel.rc"

+#endif

+

+/////////////////////////////////////////////////////////////////////////////

+#endif    // not APSTUDIO_INVOKED

diff --git a/mDNSWindows/ControlPanel/ControlPanelExe.vcproj b/mDNSWindows/ControlPanel/ControlPanelExe.vcproj
new file mode 100755
index 0000000..8bc0b29
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanelExe.vcproj
@@ -0,0 +1,764 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="8.00"

+	Name="ControlPanel (Vista)"

+	ProjectGUID="{0DF09484-B4C2-4AB4-9FC0-7B091ADEAFEB}"

+	Keyword="MFCProj"

+	>

+	<Platforms>

+		<Platform

+			Name="Win32"

+		/>

+		<Platform

+			Name="x64"

+		/>

+	</Platforms>

+	<ToolFiles>

+	</ToolFiles>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			OutputDirectory="ExeBuild\$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="ExeBuild\$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="_DEBUG"

+				MkTypLibCompatible="false"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories="..;../../mDNSCore;../../mDNSShared"

+				PreprocessorDefinitions="WIN32;_DEBUG;DEBUG=1;UNICODE;_UNICODE;_WINDOWS;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				StringPooling="true"

+				MinimalRebuild="true"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderThrough=""

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation="$(IntDir)\"

+				ObjectFile="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\vc80.pdb"

+				WarningLevel="4"

+				SuppressStartupBanner="true"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+				CallingConvention="0"

+				DisableSpecificWarnings="4311;4312"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"

+				AdditionalDependencies="../DLL/$(PlatformName)/$(ConfigurationName)/dnssd.lib ws2_32.lib"

+				OutputFile="$(OutDir)/ControlPanel.exe"

+				LinkIncremental="2"

+				SuppressStartupBanner="true"

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)\ControlPanel.pdb"

+				SubSystem="2"

+				EntryPointSymbol="wWinMainCRTStartup"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+				AdditionalManifestFiles="res\ControlPanel.manifest"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|x64"

+			OutputDirectory="ExeBuild\$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="ExeBuild\$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="_DEBUG"

+				MkTypLibCompatible="false"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories="..;../../mDNSCore;../../mDNSShared"

+				PreprocessorDefinitions="WIN32;_DEBUG;DEBUG=1;UNICODE;_UNICODE;_WINDOWS;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				StringPooling="true"

+				MinimalRebuild="true"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderThrough=""

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation="$(IntDir)\"

+				ObjectFile="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\vc80.pdb"

+				WarningLevel="4"

+				SuppressStartupBanner="true"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+				CallingConvention="0"

+				DisableSpecificWarnings="4311;4312"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE"

+				AdditionalDependencies="../DLL/$(PlatformName)/$(ConfigurationName)/dnssd.lib ws2_32.lib"

+				OutputFile="$(OutDir)/ControlPanel.exe"

+				LinkIncremental="2"

+				SuppressStartupBanner="true"

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)\ControlPanel.pdb"

+				SubSystem="2"

+				EntryPointSymbol="wWinMainCRTStartup"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+				AdditionalManifestFiles="res\ControlPanel64.manifest"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			OutputDirectory="ExeBuild\$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="ExeBuild\$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="NDEBUG"

+				MkTypLibCompatible="false"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="2"

+				InlineFunctionExpansion="1"

+				AdditionalIncludeDirectories="..;../../mDNSCore;../../mDNSShared"

+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				StringPooling="true"

+				MinimalRebuild="false"

+				RuntimeLibrary="0"

+				EnableFunctionLevelLinking="true"

+				TreatWChar_tAsBuiltInType="true"

+				UsePrecompiledHeader="0"

+				AssemblerListingLocation="$(IntDir)\"

+				ObjectFile="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\vc80.pdb"

+				WarningLevel="4"

+				SuppressStartupBanner="true"

+				DisableSpecificWarnings="4702"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"

+				AdditionalDependencies="../DLL/$(PlatformName)/$(ConfigurationName)/dnssd.lib ws2_32.lib"

+				OutputFile="$(OutDir)/ControlPanel.exe"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				ProgramDatabaseFile="$(OutDir)\ControlPanel.pdb"

+				SubSystem="2"

+				OptimizeReferences="0"

+				EnableCOMDATFolding="0"

+				EntryPointSymbol="wWinMainCRTStartup"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+				AdditionalManifestFiles="res\ControlPanel.manifest"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|x64"

+			OutputDirectory="ExeBuild\$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="ExeBuild\$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="1"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="NDEBUG"

+				MkTypLibCompatible="false"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="2"

+				InlineFunctionExpansion="1"

+				AdditionalIncludeDirectories="..;../../mDNSCore;../../mDNSShared"

+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				StringPooling="true"

+				MinimalRebuild="false"

+				RuntimeLibrary="0"

+				EnableFunctionLevelLinking="true"

+				TreatWChar_tAsBuiltInType="true"

+				UsePrecompiledHeader="0"

+				AssemblerListingLocation="$(IntDir)\"

+				ObjectFile="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\vc80.pdb"

+				WarningLevel="4"

+				SuppressStartupBanner="true"

+				DisableSpecificWarnings="4702"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE"

+				AdditionalDependencies="../DLL/$(PlatformName)/$(ConfigurationName)/dnssd.lib ws2_32.lib"

+				OutputFile="$(OutDir)/ControlPanel.exe"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				ProgramDatabaseFile="$(OutDir)\ControlPanel.pdb"

+				SubSystem="2"

+				OptimizeReferences="0"

+				EnableCOMDATFolding="0"

+				EntryPointSymbol="wWinMainCRTStartup"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+				AdditionalManifestFiles="res\ControlPanel64.manifest"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+	</Configurations>

+	<References>

+	</References>

+	<Files>

+		<Filter

+			Name="Source Files"

+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"

+			>

+			<File

+				RelativePath="ConfigDialog.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="ConfigPropertySheet.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath=".\ControlPanelExe.cpp"

+				>

+			</File>

+			<File

+				RelativePath=".\FifthPage.cpp"

+				>

+			</File>

+			<File

+				RelativePath="FirstPage.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath=".\FourthPage.cpp"

+				>

+			</File>

+			<File

+				RelativePath="SecondPage.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="SharedSecret.cpp"

+				>

+			</File>

+			<File

+				RelativePath="stdafx.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="0"

+						PreprocessorDefinitions=""

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						Optimization="2"

+						PreprocessorDefinitions=""

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath="ThirdPage.cpp"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl"

+			>

+			<File

+				RelativePath="ConfigDialog.h"

+				>

+			</File>

+			<File

+				RelativePath="ConfigPropertySheet.h"

+				>

+			</File>

+			<File

+				RelativePath=".\ControlPanelExe.h"

+				>

+			</File>

+			<File

+				RelativePath=".\FifthPage.h"

+				>

+			</File>

+			<File

+				RelativePath="FirstPage.h"

+				>

+			</File>

+			<File

+				RelativePath=".\FourthPage.h"

+				>

+			</File>

+			<File

+				RelativePath="Resource.h"

+				>

+			</File>

+			<File

+				RelativePath="SecondPage.h"

+				>

+			</File>

+			<File

+				RelativePath="SharedSecret.h"

+				>

+			</File>

+			<File

+				RelativePath="stdafx.h"

+				>

+			</File>

+			<File

+				RelativePath="ThirdPage.h"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Resource Files"

+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"

+			>

+			<File

+				RelativePath="res\configurator.ico"

+				>

+			</File>

+			<File

+				RelativePath="res\controlpanel.ico"

+				>

+			</File>

+			<File

+				RelativePath=".\res\ControlPanel.rc2"

+				>

+			</File>

+			<File

+				RelativePath=".\ControlPanelExe.rc"

+				>

+			</File>

+			<File

+				RelativePath="res\failure.ico"

+				>

+			</File>

+			<File

+				RelativePath="res\success.ico"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Support"

+			>

+			<File

+				RelativePath="..\..\mDNSShared\CommonServices.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\DebugServices.c"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\DebugServices.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\dns_sd.h"

+				>

+			</File>

+			<File

+				RelativePath="..\Secret.c"

+				>

+			</File>

+			<File

+				RelativePath="..\Secret.h"

+				>

+			</File>

+			<File

+				RelativePath="..\WinServices.cpp"

+				>

+			</File>

+			<File

+				RelativePath="..\WinServices.h"

+				>

+			</File>

+		</Filter>

+	</Files>

+	<Globals>

+	</Globals>

+</VisualStudioProject>

diff --git a/mDNSWindows/ControlPanel/ControlPanelLocRes.rc b/mDNSWindows/ControlPanel/ControlPanelLocRes.rc
new file mode 100755
index 0000000..4ba22b4
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanelLocRes.rc
@@ -0,0 +1,270 @@
+// Microsoft Visual C++ generated resource script.

+//

+#include "resource.h"

+

+#define APSTUDIO_READONLY_SYMBOLS

+/////////////////////////////////////////////////////////////////////////////

+//

+// Generated from the TEXTINCLUDE 2 resource.

+//

+#include "afxres.h"

+#include "WinVersRes.h"

+

+/////////////////////////////////////////////////////////////////////////////

+#undef APSTUDIO_READONLY_SYMBOLS

+

+/////////////////////////////////////////////////////////////////////////////

+// English (U.S.) resources

+

+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

+#ifdef _WIN32

+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

+#pragma code_page(1252)

+#endif //_WIN32

+

+#ifdef APSTUDIO_INVOKED

+/////////////////////////////////////////////////////////////////////////////

+//

+// TEXTINCLUDE

+//

+

+1 TEXTINCLUDE 

+BEGIN

+    "resource.h\0"

+END

+

+2 TEXTINCLUDE 

+BEGIN

+    "#include ""afxres.h""\r\n"

+    "#include ""WinVersRes.h""\r\n"

+    "\0"

+END

+

+3 TEXTINCLUDE 

+BEGIN

+    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"

+    "#define _AFX_NO_OLE_RESOURCES\r\n"

+    "#define _AFX_NO_TRACKER_RESOURCES\r\n"

+    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"

+    "\r\n"

+    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"

+    "LANGUAGE 9, 1\r\n"

+    "#pragma code_page(1252)\r\n"

+    "#include ""afxres.rc""     // Standard components\r\n"

+    "#endif\r\n"

+    "\0"

+END

+

+#endif    // APSTUDIO_INVOKED

+

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// Version

+//

+

+VS_VERSION_INFO VERSIONINFO

+ FILEVERSION MASTER_PROD_VERS

+ PRODUCTVERSION MASTER_PROD_VERS

+ FILEFLAGSMASK 0x3fL

+#ifdef _DEBUG

+ FILEFLAGS 0x1L

+#else

+ FILEFLAGS 0x0L

+#endif

+ FILEOS 0x4L

+ FILETYPE 0x2L

+ FILESUBTYPE 0x0L

+BEGIN

+    BLOCK "StringFileInfo"

+    BEGIN

+        BLOCK "040904b0"

+        BEGIN

+            VALUE "CompanyName", MASTER_COMPANY_NAME

+            VALUE "FileDescription", "Bonjour Resource Module"

+            VALUE "FileVersion", MASTER_PROD_VERS_STR

+            VALUE "InternalName", "ControlPanelLocalized.dll"

+            VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT

+            VALUE "OriginalFilename", "ControlPanelLocalized.dll"

+            VALUE "ProductName", MASTER_PROD_NAME

+            VALUE "ProductVersion", MASTER_PROD_VERS_STR

+        END

+    END

+    BLOCK "VarFileInfo"

+    BEGIN

+        VALUE "Translation", 0x409, 1200

+    END

+END

+

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// Dialog

+//

+

+IDR_APPLET_PAGE1 DIALOGEX 0, 0, 262, 140

+STYLE DS_SETFONT | WS_CHILD | WS_CAPTION

+CAPTION "Registration"

+FONT 8, "MS Sans Serif", 0, 0, 0x0

+BEGIN

+    LTEXT           "Hostname:",IDC_STATIC,13,22,35,8

+    EDITTEXT        IDC_HOSTNAME,55,20,184,12,ES_AUTOHSCROLL

+    LTEXT           "User:",IDC_STATIC,13,38,35,8

+    EDITTEXT        IDC_USERNAME,55,36,184,12,ES_AUTOHSCROLL

+    LTEXT           "Password:",IDC_STATIC,13,54,35,8

+    EDITTEXT        IDC_PASSWORD,55,52,184,12,ES_PASSWORD | ES_AUTOHSCROLL

+    CONTROL         "Advertise services in this domain using Bonjour",IDC_ADVERTISE_SERVICES,

+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,55,80,199,8

+END

+

+IDR_APPLET_PAGE3 DIALOGEX 0, 0, 262, 140

+STYLE DS_SETFONT | WS_CHILD | WS_CAPTION

+CAPTION "Browsing"

+FONT 8, "MS Sans Serif", 0, 0, 0x0

+BEGIN

+    LTEXT           "Choose which domains to browse using wide-area Bonjour",

+                    -1,7,16,248,12

+    CONTROL         "",IDC_BROWSE_LIST,"SysListView32",LVS_REPORT | 

+                    LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER | 

+                    WS_TABSTOP,7,37,248,57

+    PUSHBUTTON      "Add",IDC_ADD_BROWSE_DOMAIN,152,100,50,14

+    PUSHBUTTON      "Remove",IDC_REMOVE_BROWSE_DOMAIN,205,100,50,14

+END

+

+IDR_APPLET_PAGE5 DIALOGEX 0, 0, 262, 140

+STYLE DS_SETFONT | WS_CHILD | WS_CAPTION

+CAPTION "Services"

+FONT 8, "MS Sans Serif", 0, 0, 0x0

+BEGIN

+    CONTROL         "Advertise shared folders using Bonjour",IDC_ADVERTISE_SMB,

+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,19,199,8

+    CONTROL         "Enable Wake on Demand",IDC_POWER_MANAGEMENT,

+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,34,199,8

+END

+

+IDR_POWER_MANAGEMENT_WARNING DIALOGEX 0, 0, 230, 95

+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | 

+    WS_SYSMENU

+CAPTION "Power Management"

+FONT 8, "MS Shell Dlg", 400, 0, 0x1

+BEGIN

+    DEFPUSHBUTTON   "OK",IDOK,173,74,50,14

+    LTEXT           "When 'Wake On Demand' is enabled, you may hear your computer wake up occasionally.",

+					IDC_STATIC,50,12,175,26

+    LTEXT           "This informs other devices that your computer is still available on the network.",

+                    IDC_STATIC,50,38,175,26

+    ICON            IDI_ENERGY_SAVER,IDC_ENERGY_SAVER,2,10,64,64,SS_REALSIZEIMAGE

+END

+

+IDR_ADD_BROWSE_DOMAIN DIALOGEX 0, 0, 230, 95

+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | 

+    WS_SYSMENU

+CAPTION "Add Browse Domain"

+FONT 8, "MS Shell Dlg", 400, 0, 0x1

+BEGIN

+    DEFPUSHBUTTON   "OK",IDOK,117,74,50,14

+    PUSHBUTTON      "Cancel",IDCANCEL,173,74,50,14

+    COMBOBOX        IDC_COMBO1,35,42,188,100,CBS_DROPDOWN | CBS_SORT | 

+                    WS_VSCROLL | WS_TABSTOP

+    LTEXT           "Domain:",IDC_STATIC,7,43,27,8

+    LTEXT           "The following domain will be added to your list of Bonjour browse domains.",

+                    IDC_STATIC,7,15,216,16

+END

+

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// DESIGNINFO

+//

+

+#ifdef APSTUDIO_INVOKED

+GUIDELINES DESIGNINFO 

+BEGIN

+    IDR_APPLET_PAGE1, DIALOG

+    BEGIN

+        LEFTMARGIN, 7

+        RIGHTMARGIN, 255

+        TOPMARGIN, 7

+        BOTTOMMARGIN, 133

+    END

+

+    IDR_APPLET_PAGE2, DIALOG

+    BEGIN

+        LEFTMARGIN, 7

+        RIGHTMARGIN, 255

+        TOPMARGIN, 7

+        BOTTOMMARGIN, 133

+    END

+

+    IDR_SECRET, DIALOG

+    BEGIN

+        LEFTMARGIN, 7

+        RIGHTMARGIN, 244

+        TOPMARGIN, 7

+        BOTTOMMARGIN, 83

+    END

+

+    IDR_APPLET_PAGE3, DIALOG

+    BEGIN

+        LEFTMARGIN, 7

+        RIGHTMARGIN, 255

+        TOPMARGIN, 7

+        BOTTOMMARGIN, 133

+    END

+

+	IDR_POWER_MANAGEMENT_WARNING, DIALOG

+	BEGIN

+		LEFTMARGIN, 7

+		RIGHTMARGIN, 223

+		TOPMARGIN, 7,

+		BOTTOMMARGIN, 88

+	END

+

+    IDR_ADD_BROWSE_DOMAIN, DIALOG

+    BEGIN

+        LEFTMARGIN, 7

+        RIGHTMARGIN, 223

+        TOPMARGIN, 7

+        BOTTOMMARGIN, 88

+    END

+END

+#endif    // APSTUDIO_INVOKED

+

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// String Table

+//

+

+STRINGTABLE 

+BEGIN

+    IDR_APPLET              "Bonjour"

+	IDS_APPLET_NAME			"Bonjour"

+    IDS_APPLET_DESCRIPTION  "Bonjour"

+	IDS_APPLET_TOOLTIP		"Change Bonjour settings for this computer."

+END

+

+#endif    // English (U.S.) resources

+/////////////////////////////////////////////////////////////////////////////

+

+

+

+#ifndef APSTUDIO_INVOKED

+/////////////////////////////////////////////////////////////////////////////

+//

+// Generated from the TEXTINCLUDE 3 resource.

+//

+#define _AFX_NO_SPLITTER_RESOURCES

+#define _AFX_NO_OLE_RESOURCES

+#define _AFX_NO_TRACKER_RESOURCES

+#define _AFX_NO_PROPERTY_RESOURCES

+

+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

+LANGUAGE 9, 1

+#pragma code_page(1252)

+#include "afxres.rc"     // Standard components

+#endif

+

+/////////////////////////////////////////////////////////////////////////////

+#endif    // not APSTUDIO_INVOKED

+

diff --git a/mDNSWindows/ControlPanel/ControlPanelLocRes.vcproj b/mDNSWindows/ControlPanel/ControlPanelLocRes.vcproj
new file mode 100755
index 0000000..cdcee9b
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanelLocRes.vcproj
@@ -0,0 +1,487 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="8.00"

+	Name="ControlPanelLocRes"

+	ProjectGUID="{4490229E-025A-478F-A2CF-51154DA83E39}"

+	RootNamespace="ControlPanelLocRes"

+	>

+	<Platforms>

+		<Platform

+			Name="Win32"

+		/>

+		<Platform

+			Name="x64"

+		/>

+	</Platforms>

+	<ToolFiles>

+	</ToolFiles>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="_DEBUG"

+				MkTypLibCompatible="true"

+				SuppressStartupBanner="true"

+				TargetEnvironment="1"

+				TypeLibraryName="$(OutDir)/$(ProjectName).tlb"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories=".."

+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400"

+				StringPooling="true"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				ForceConformanceInForLoopScope="true"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation=".\Debug/"

+				ObjectFile=".\Debug/"

+				ProgramDataBaseFileName=".\Debug/"

+				BrowseInformation="1"

+				WarningLevel="4"

+				WarnAsError="false"

+				SuppressStartupBanner="true"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+				CallingConvention="2"

+				CompileAs="0"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories=".."

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+				Description="Building Output Directories"

+				CommandLine="if not exist $(OutDir)\ControlPanel.Resources mkdir $(OutDir)\ControlPanel.Resources&#x0D;&#x0A;if not exist $(OutDir)\ControlPanel.Resources\en.lproj mkdir $(OutDir)\ControlPanel.Resources\en.lproj&#x0D;&#x0A;"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "

+				AdditionalDependencies=""

+				OutputFile="$(OutDir)\ControlPanel.Resources\en.lproj\ControlPanelLocalized.dll"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				IgnoreDefaultLibraryNames=""

+				ModuleDefinitionFile=""

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"

+				SubSystem="2"

+				ResourceOnlyDLL="true"

+				ImportLibrary="$(OutDir)/$(ProjectName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="_DEBUG"

+				MkTypLibCompatible="true"

+				SuppressStartupBanner="true"

+				TargetEnvironment="3"

+				TypeLibraryName="$(OutDir)/$(ProjectName).tlb"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories=".."

+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400"

+				StringPooling="true"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				ForceConformanceInForLoopScope="true"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation=".\Debug/"

+				ObjectFile=".\Debug/"

+				ProgramDataBaseFileName=".\Debug/"

+				BrowseInformation="1"

+				WarningLevel="4"

+				WarnAsError="false"

+				SuppressStartupBanner="true"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+				CallingConvention="2"

+				CompileAs="0"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories=".."

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+				Description="Building Output Directories"

+				CommandLine="if not exist $(OutDir)\ControlPanel.Resources mkdir $(OutDir)\ControlPanel.Resources&#x0D;&#x0A;if not exist $(OutDir)\ControlPanel.Resources\en.lproj mkdir $(OutDir)\ControlPanel.Resources\en.lproj&#x0D;&#x0A;"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "

+				AdditionalDependencies=""

+				OutputFile="$(OutDir)\ControlPanel.Resources\en.lproj\ControlPanelLocalized.dll"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				IgnoreDefaultLibraryNames=""

+				ModuleDefinitionFile=""

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"

+				SubSystem="2"

+				ResourceOnlyDLL="true"

+				ImportLibrary="$(OutDir)/$(ProjectName).lib"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="NDEBUG"

+				MkTypLibCompatible="true"

+				SuppressStartupBanner="true"

+				TargetEnvironment="1"

+				TypeLibraryName="$(OutDir)/$(ProjectName).tlb"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="2"

+				InlineFunctionExpansion="2"

+				FavorSizeOrSpeed="2"

+				OmitFramePointers="true"

+				AdditionalIncludeDirectories=".."

+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WINVER=0x0400"

+				StringPooling="true"

+				RuntimeLibrary="0"

+				BufferSecurityCheck="false"

+				EnableFunctionLevelLinking="false"

+				ForceConformanceInForLoopScope="true"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation=".\Release/"

+				ObjectFile=".\Release/"

+				ProgramDataBaseFileName=".\Release/"

+				BrowseInformation="1"

+				WarningLevel="4"

+				WarnAsError="false"

+				SuppressStartupBanner="true"

+				Detect64BitPortabilityProblems="true"

+				CompileAs="0"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories=".."

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+				Description="Building Output Directories"

+				CommandLine="if not exist $(OutDir)\ControlPanel.Resources mkdir $(OutDir)\ControlPanel.Resources&#x0D;&#x0A;if not exist $(OutDir)\ControlPanel.Resources\en.lproj mkdir $(OutDir)\ControlPanel.Resources\en.lproj&#x0D;&#x0A;"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "

+				AdditionalDependencies=""

+				OutputFile="$(OutDir)\ControlPanel.Resources\en.lproj\ControlPanelLocalized.dll"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				IgnoreDefaultLibraryNames=""

+				ModuleDefinitionFile=""

+				ProgramDatabaseFile=""

+				SubSystem="2"

+				OptimizeReferences="0"

+				EnableCOMDATFolding="0"

+				ResourceOnlyDLL="true"

+				ImportLibrary="$(IntDir)/$(ProjectName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="if not &quot;%RC_XBS%&quot; == &quot;YES&quot; goto END&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ControlPanel.Resources\en.lproj&quot;   mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ControlPanel.Resources\en.lproj&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot;                                                                                                                          &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ControlPanel.Resources\en.lproj&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="NDEBUG"

+				MkTypLibCompatible="true"

+				SuppressStartupBanner="true"

+				TargetEnvironment="3"

+				TypeLibraryName="$(OutDir)/$(ProjectName).tlb"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="2"

+				InlineFunctionExpansion="2"

+				FavorSizeOrSpeed="2"

+				OmitFramePointers="true"

+				AdditionalIncludeDirectories=".."

+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WINVER=0x0400"

+				StringPooling="true"

+				RuntimeLibrary="0"

+				BufferSecurityCheck="false"

+				EnableFunctionLevelLinking="false"

+				ForceConformanceInForLoopScope="true"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation=".\Release/"

+				ObjectFile=".\Release/"

+				ProgramDataBaseFileName=".\Release/"

+				BrowseInformation="1"

+				WarningLevel="4"

+				WarnAsError="false"

+				SuppressStartupBanner="true"

+				Detect64BitPortabilityProblems="true"

+				CompileAs="0"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories=".."

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+				Description="Building Output Directories"

+				CommandLine="if not exist $(OutDir)\ControlPanel.Resources mkdir $(OutDir)\ControlPanel.Resources&#x0D;&#x0A;if not exist $(OutDir)\ControlPanel.Resources\en.lproj mkdir $(OutDir)\ControlPanel.Resources\en.lproj&#x0D;&#x0A;"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "

+				AdditionalDependencies=""

+				OutputFile="$(OutDir)\ControlPanel.Resources\en.lproj\ControlPanelLocalized.dll"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				IgnoreDefaultLibraryNames=""

+				ModuleDefinitionFile=""

+				ProgramDatabaseFile=""

+				SubSystem="2"

+				OptimizeReferences="0"

+				EnableCOMDATFolding="0"

+				ResourceOnlyDLL="true"

+				ImportLibrary="$(IntDir)/$(ProjectName).lib"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="if not &quot;%RC_XBS%&quot; == &quot;YES&quot; goto END&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ControlPanel.Resources\en.lproj&quot;   mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ControlPanel.Resources\en.lproj&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot;                                                                                                                          &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ControlPanel.Resources\en.lproj&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"

+			/>

+		</Configuration>

+	</Configurations>

+	<References>

+	</References>

+	<Files>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl;inc"

+			>

+			<File

+				RelativePath="resource_loc_res.h"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Resource Files"

+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest"

+			>

+			<File

+				RelativePath="ControlPanelLocRes.rc"

+				>

+			</File>

+		</Filter>

+	</Files>

+	<Globals>

+		<Global

+			Name="RESOURCE_FILE"

+			Value="ControlPanelLocRes.rc"

+		/>

+	</Globals>

+</VisualStudioProject>

diff --git a/mDNSWindows/ControlPanel/ControlPanelRes.rc b/mDNSWindows/ControlPanel/ControlPanelRes.rc
new file mode 100755
index 0000000..b74c59b
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanelRes.rc
@@ -0,0 +1,134 @@
+// Microsoft Visual C++ generated resource script.

+//

+#include "resource.h"

+

+#define APSTUDIO_READONLY_SYMBOLS

+/////////////////////////////////////////////////////////////////////////////

+//

+// Generated from the TEXTINCLUDE 2 resource.

+//

+#include "afxres.h"

+#include "WinVersRes.h"

+

+/////////////////////////////////////////////////////////////////////////////

+#undef APSTUDIO_READONLY_SYMBOLS

+

+/////////////////////////////////////////////////////////////////////////////

+// English (U.S.) resources

+

+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

+#ifdef _WIN32

+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

+#pragma code_page(1252)

+#endif //_WIN32

+

+#ifdef APSTUDIO_INVOKED

+/////////////////////////////////////////////////////////////////////////////

+//

+// TEXTINCLUDE

+//

+

+1 TEXTINCLUDE 

+BEGIN

+    "resource.h\0"

+END

+

+2 TEXTINCLUDE 

+BEGIN

+    "#include ""afxres.h""\r\n"

+    "#include ""WinVersRes.h""\r\n"

+    "\0"

+END

+

+3 TEXTINCLUDE 

+BEGIN

+    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"

+    "#define _AFX_NO_OLE_RESOURCES\r\n"

+    "#define _AFX_NO_TRACKER_RESOURCES\r\n"

+    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"

+    "\r\n"

+    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"

+    "LANGUAGE 9, 1\r\n"

+    "#pragma code_page(1252)\r\n"

+    "#include ""afxres.rc""     // Standard components\r\n"

+    "#endif\r\n"

+    "\0"

+END

+

+#endif    // APSTUDIO_INVOKED

+

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// Version

+//

+

+VS_VERSION_INFO VERSIONINFO

+ FILEVERSION MASTER_PROD_VERS

+ PRODUCTVERSION MASTER_PROD_VERS

+ FILEFLAGSMASK 0x3fL

+#ifdef _DEBUG

+ FILEFLAGS 0x1L

+#else

+ FILEFLAGS 0x0L

+#endif

+ FILEOS 0x4L

+ FILETYPE 0x2L

+ FILESUBTYPE 0x0L

+BEGIN

+    BLOCK "StringFileInfo"

+    BEGIN

+        BLOCK "040904b0"

+        BEGIN

+            VALUE "CompanyName", MASTER_COMPANY_NAME

+            VALUE "FileDescription", "Bonjour Resource Module"

+            VALUE "FileVersion", MASTER_PROD_VERS_STR

+            VALUE "InternalName", "ControlPanelResources.dll"

+            VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT

+            VALUE "OriginalFilename", "ControlPanelResources.dll"

+            VALUE "ProductName", MASTER_PROD_NAME

+            VALUE "ProductVersion", MASTER_PROD_VERS_STR

+        END

+    END

+    BLOCK "VarFileInfo"

+    BEGIN

+        VALUE "Translation", 0x409, 1200

+    END

+END

+

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// Icon

+//

+

+// Icon with lowest ID value placed first to ensure application icon

+// remains consistent on all systems.

+IDR_APPLET              ICON                    "res\\controlpanel.ico"

+IDI_FAILURE             ICON                    "res\\failure.ico"

+IDI_SUCCESS             ICON                    "res\\success.ico"

+IDI_ENERGY_SAVER	ICON			"res\\EnergySaver.ico"

+#endif    // English (U.S.) resources

+/////////////////////////////////////////////////////////////////////////////

+

+

+

+#ifndef APSTUDIO_INVOKED

+/////////////////////////////////////////////////////////////////////////////

+//

+// Generated from the TEXTINCLUDE 3 resource.

+//

+#define _AFX_NO_SPLITTER_RESOURCES

+#define _AFX_NO_OLE_RESOURCES

+#define _AFX_NO_TRACKER_RESOURCES

+#define _AFX_NO_PROPERTY_RESOURCES

+

+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

+LANGUAGE 9, 1

+#pragma code_page(1252)

+#include "afxres.rc"     // Standard components

+#endif

+

+/////////////////////////////////////////////////////////////////////////////

+#endif    // not APSTUDIO_INVOKED

+

diff --git a/mDNSWindows/ControlPanel/ControlPanelRes.vcproj b/mDNSWindows/ControlPanel/ControlPanelRes.vcproj
new file mode 100755
index 0000000..3e36161
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ControlPanelRes.vcproj
@@ -0,0 +1,518 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="8.00"

+	Name="ControlPanelRes"

+	ProjectGUID="{5254AA9C-3D2E-4539-86D9-5EB0F4151215}"

+	>

+	<Platforms>

+		<Platform

+			Name="Win32"

+		/>

+		<Platform

+			Name="x64"

+		/>

+	</Platforms>

+	<ToolFiles>

+	</ToolFiles>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="_DEBUG"

+				MkTypLibCompatible="true"

+				SuppressStartupBanner="true"

+				TargetEnvironment="1"

+				TypeLibraryName="$(OutDir)/$(ProjectName).tlb"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories=".."

+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400"

+				StringPooling="true"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				ForceConformanceInForLoopScope="true"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation=".\Debug/"

+				ObjectFile=".\Debug/"

+				ProgramDataBaseFileName=".\Debug/"

+				BrowseInformation="1"

+				WarningLevel="4"

+				WarnAsError="false"

+				SuppressStartupBanner="true"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+				CallingConvention="2"

+				CompileAs="0"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories=".."

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+				Description="Building Output Directories"

+				CommandLine="if not exist $(OutDir)\ControlPanel.Resources mkdir $(OutDir)\ControlPanel.Resources&#x0D;&#x0A;"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "

+				OutputFile="$(OutDir)\ControlPanel.Resources\ControlPanelResources.dll"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				IgnoreDefaultLibraryNames=""

+				ModuleDefinitionFile=""

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"

+				SubSystem="2"

+				ResourceOnlyDLL="true"

+				ImportLibrary="$(OutDir)/$(ProjectName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="_DEBUG"

+				MkTypLibCompatible="true"

+				SuppressStartupBanner="true"

+				TargetEnvironment="3"

+				TypeLibraryName="$(OutDir)/$(ProjectName).tlb"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories=".."

+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400"

+				StringPooling="true"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				ForceConformanceInForLoopScope="true"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation=".\Debug/"

+				ObjectFile=".\Debug/"

+				ProgramDataBaseFileName=".\Debug/"

+				BrowseInformation="1"

+				WarningLevel="4"

+				WarnAsError="false"

+				SuppressStartupBanner="true"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+				CallingConvention="2"

+				CompileAs="0"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories=".."

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+				Description="Building Output Directories"

+				CommandLine="if not exist $(OutDir)\ControlPanel.Resources mkdir $(OutDir)\ControlPanel.Resources&#x0D;&#x0A;"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "

+				OutputFile="$(OutDir)\ControlPanel.Resources\ControlPanelResources.dll"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				IgnoreDefaultLibraryNames=""

+				ModuleDefinitionFile=""

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"

+				SubSystem="2"

+				ResourceOnlyDLL="true"

+				ImportLibrary="$(OutDir)/$(ProjectName).lib"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="NDEBUG"

+				MkTypLibCompatible="true"

+				SuppressStartupBanner="true"

+				TargetEnvironment="1"

+				TypeLibraryName="$(OutDir)/$(ProjectName).tlb"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="2"

+				InlineFunctionExpansion="2"

+				FavorSizeOrSpeed="2"

+				OmitFramePointers="true"

+				AdditionalIncludeDirectories="..\..\mDNSShared;.."

+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WINVER=0x0400"

+				StringPooling="true"

+				RuntimeLibrary="0"

+				BufferSecurityCheck="false"

+				EnableFunctionLevelLinking="false"

+				ForceConformanceInForLoopScope="true"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation=".\Release/"

+				ObjectFile=".\Release/"

+				ProgramDataBaseFileName=".\Release/"

+				BrowseInformation="1"

+				WarningLevel="4"

+				WarnAsError="false"

+				SuppressStartupBanner="true"

+				Detect64BitPortabilityProblems="true"

+				CompileAs="0"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories=".."

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+				Description="Building Output Directories"

+				CommandLine="if not exist $(OutDir)\ControlPanel.Resources mkdir $(OutDir)\ControlPanel.Resources&#x0D;&#x0A;"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "

+				OutputFile="$(OutDir)\ControlPanel.Resources\ControlPanelResources.dll"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				IgnoreDefaultLibraryNames=""

+				ModuleDefinitionFile=""

+				ProgramDatabaseFile=""

+				SubSystem="2"

+				OptimizeReferences="0"

+				EnableCOMDATFolding="0"

+				ResourceOnlyDLL="true"

+				ImportLibrary="$(IntDir)/$(ProjectName).lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="if not &quot;%RC_XBS%&quot; == &quot;YES&quot; goto END&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ControlPanel.Resources&quot;   mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ControlPanel.Resources&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot;                                                                                                            &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ControlPanel.Resources&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			UseOfMFC="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="NDEBUG"

+				MkTypLibCompatible="true"

+				SuppressStartupBanner="true"

+				TargetEnvironment="3"

+				TypeLibraryName="$(OutDir)/$(ProjectName).tlb"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="2"

+				InlineFunctionExpansion="2"

+				FavorSizeOrSpeed="2"

+				OmitFramePointers="true"

+				AdditionalIncludeDirectories="..\..\mDNSShared;.."

+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WINVER=0x0400"

+				StringPooling="true"

+				RuntimeLibrary="0"

+				BufferSecurityCheck="false"

+				EnableFunctionLevelLinking="false"

+				ForceConformanceInForLoopScope="true"

+				UsePrecompiledHeader="0"

+				PrecompiledHeaderFile=""

+				AssemblerListingLocation=".\Release/"

+				ObjectFile=".\Release/"

+				ProgramDataBaseFileName=".\Release/"

+				BrowseInformation="1"

+				WarningLevel="4"

+				WarnAsError="false"

+				SuppressStartupBanner="true"

+				Detect64BitPortabilityProblems="true"

+				CompileAs="0"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories=".."

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+				Description="Building Output Directories"

+				CommandLine="if not exist $(OutDir)\ControlPanel.Resources mkdir $(OutDir)\ControlPanel.Resources&#x0D;&#x0A;"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "

+				OutputFile="$(OutDir)\ControlPanel.Resources\ControlPanelResources.dll"

+				LinkIncremental="1"

+				SuppressStartupBanner="true"

+				IgnoreDefaultLibraryNames=""

+				ModuleDefinitionFile=""

+				ProgramDatabaseFile=""

+				SubSystem="2"

+				OptimizeReferences="0"

+				EnableCOMDATFolding="0"

+				ResourceOnlyDLL="true"

+				ImportLibrary="$(IntDir)/$(ProjectName).lib"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="if not &quot;%RC_XBS%&quot; == &quot;YES&quot; goto END&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ControlPanel.Resources&quot;   mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ControlPanel.Resources&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot;                                                                                                            &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ControlPanel.Resources&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"

+			/>

+		</Configuration>

+	</Configurations>

+	<References>

+	</References>

+	<Files>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl;inc"

+			>

+			<File

+				RelativePath="resource_res.h"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Resource Files"

+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest"

+			>

+			<File

+				RelativePath="res\about.bmp"

+				>

+			</File>

+			<File

+				RelativePath=".\about.bmp"

+				>

+			</File>

+			<File

+				RelativePath="res\button-2k.ico"

+				>

+			</File>

+			<File

+				RelativePath="res\button-xp.ico"

+				>

+			</File>

+			<File

+				RelativePath=".\res\cold.ico"

+				>

+			</File>

+			<File

+				RelativePath="ControlPanelRes.rc"

+				>

+			</File>

+			<File

+				RelativePath=".\hot.ico"

+				>

+			</File>

+			<File

+				RelativePath="res\logo.bmp"

+				>

+			</File>

+			<File

+				RelativePath=".\logo.bmp"

+				>

+			</File>

+			<File

+				RelativePath="Web.ico"

+				>

+			</File>

+		</Filter>

+	</Files>

+	<Globals>

+		<Global

+			Name="RESOURCE_FILE"

+			Value="ControlPanelRes.rc"

+		/>

+	</Globals>

+</VisualStudioProject>

diff --git a/mDNSWindows/ControlPanel/FourthPage.cpp b/mDNSWindows/ControlPanel/FourthPage.cpp
new file mode 100755
index 0000000..f748efd
--- /dev/null
+++ b/mDNSWindows/ControlPanel/FourthPage.cpp
@@ -0,0 +1,197 @@
+/* -*- 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 "FourthPage.h"
+#include "resource.h"
+
+#include "ConfigPropertySheet.h"
+#include "SharedSecret.h"
+
+#include <WinServices.h>
+    
+#define MAX_KEY_LENGTH 255
+
+
+IMPLEMENT_DYNCREATE(CFourthPage, CPropertyPage)
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CFourthPage::CFourthPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+CFourthPage::CFourthPage()
+:
+	CPropertyPage(CFourthPage::IDD)
+{
+	//{{AFX_DATA_INIT(CFourthPage)
+	//}}AFX_DATA_INIT
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CFourthPage::~CFourthPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+CFourthPage::~CFourthPage()
+{
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CFourthPage::DoDataExchange
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CFourthPage::DoDataExchange(CDataExchange* pDX)
+{
+	CPropertyPage::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CFourthPage)
+	//}}AFX_DATA_MAP
+	DDX_Control(pDX, IDC_POWER_MANAGEMENT, m_checkBox);
+}
+
+BEGIN_MESSAGE_MAP(CFourthPage, CPropertyPage)
+	//{{AFX_MSG_MAP(CFourthPage)
+	//}}AFX_MSG_MAP
+
+	ON_BN_CLICKED(IDC_POWER_MANAGEMENT, &CFourthPage::OnBnClickedPowerManagement)
+
+END_MESSAGE_MAP()
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CFourthPage::SetModified
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CFourthPage::SetModified( BOOL bChanged )
+{
+	m_modified = bChanged;
+
+	CPropertyPage::SetModified( bChanged );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CFourthPage::OnSetActive
+//---------------------------------------------------------------------------------------------------------------------------
+
+BOOL
+CFourthPage::OnSetActive()
+{
+	CConfigPropertySheet	*	psheet;
+	HKEY						key = NULL;
+	DWORD						dwSize;
+	DWORD						enabled;
+	DWORD						err;
+	BOOL						b = CPropertyPage::OnSetActive();
+
+	psheet = reinterpret_cast<CConfigPropertySheet*>(GetParent());
+	require_quiet( psheet, exit );
+
+	m_checkBox.SetCheck( 0 );
+
+	// 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 );
+	require_noerr( err, exit );
+
+	dwSize = sizeof( DWORD );
+	err = RegQueryValueEx( key, L"Enabled", NULL, NULL, (LPBYTE) &enabled, &dwSize );
+	require_noerr( err, exit );
+
+	m_checkBox.SetCheck( enabled );
+ 
+exit:
+
+	if ( key )
+	{
+		RegCloseKey( key );
+	}
+
+	return b;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CFourthPage::OnOK
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CFourthPage::OnOK()
+{
+	if ( m_modified )
+	{
+		Commit();
+	}
+}
+
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CFourthPage::Commit
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CFourthPage::Commit()
+{
+	HKEY		key		= NULL;
+	DWORD		enabled;
+	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 );
+	require_noerr( err, exit );
+
+	enabled = m_checkBox.GetCheck();
+	err = RegSetValueEx( key, L"Enabled", NULL, REG_DWORD, (LPBYTE) &enabled, sizeof( enabled ) );
+	require_noerr( err, exit );
+	
+exit:
+
+	if ( key )
+	{
+		RegCloseKey( key );
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CFourthPage::OnBnClickedRemoveBrowseDomain
+//---------------------------------------------------------------------------------------------------------------------------
+
+
+
+void CFourthPage::OnBnClickedPowerManagement()
+
+{
+
+	char buf[ 256 ];
+
+
+
+	sprintf( buf, "check box: %d", m_checkBox.GetCheck() );
+
+	OutputDebugStringA( buf );
+
+	// TODO: Add your control notification handler code here
+
+
+
+	SetModified( TRUE );
+
+}
+
diff --git a/mDNSWindows/ControlPanel/FourthPage.h b/mDNSWindows/ControlPanel/FourthPage.h
new file mode 100755
index 0000000..d595291
--- /dev/null
+++ b/mDNSWindows/ControlPanel/FourthPage.h
@@ -0,0 +1,87 @@
+/* -*- 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.
+ */
+
+#pragma once
+
+#include "stdafx.h"
+#include "resource.h"
+
+#include <DebugServices.h>
+#include <list>
+#include "afxcmn.h"
+
+#include "afxwin.h"
+
+
+
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CFourthPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+class CFourthPage : public CPropertyPage
+{
+public:
+	CFourthPage();
+	~CFourthPage();
+
+protected:
+
+	//{{AFX_DATA(CFourthPage)
+	enum { IDD = IDR_APPLET_PAGE4 };
+	//}}AFX_DATA
+
+	//{{AFX_VIRTUAL(CFourthPage)
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+	DECLARE_DYNCREATE(CFourthPage)
+
+	//{{AFX_MSG(CFourthPage)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+	
+private:
+	
+	typedef std::list<CString> StringList;
+
+	afx_msg BOOL
+	OnSetActive();
+	
+	afx_msg void
+	OnOK();
+	
+	void
+	SetModified( BOOL bChanged = TRUE );
+	
+	void
+	Commit();
+
+	BOOL			m_modified;
+
+public:
+private:
+
+	CButton m_checkBox;
+
+public:
+
+
+	afx_msg void OnBnClickedPowerManagement();
+
+};
diff --git a/mDNSWindows/ControlPanel/RegistrationPage.cpp b/mDNSWindows/ControlPanel/RegistrationPage.cpp
new file mode 100755
index 0000000..9328a75
--- /dev/null
+++ b/mDNSWindows/ControlPanel/RegistrationPage.cpp
@@ -0,0 +1,387 @@
+/* -*- 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 <Secret.h>
+#include "RegistrationPage.h"
+#include "resource.h"
+
+#include "ConfigPropertySheet.h"
+extern "C"
+{
+#include <ClientCommon.h>
+}
+#include <WinServices.h>
+
+#define MAX_KEY_LENGTH 255
+
+
+IMPLEMENT_DYNCREATE(CRegistrationPage, CPropertyPage)
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CRegistrationPage::CRegistrationPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+CRegistrationPage::CRegistrationPage()
+:
+	CPropertyPage(CRegistrationPage::IDD),
+	m_ignoreChanges( false ),
+	m_hostnameSetupKey( NULL ),
+	m_registrationSetupKey( NULL ),
+	m_statusKey( NULL )
+{
+	//{{AFX_DATA_INIT(CRegistrationPage)
+	//}}AFX_DATA_INIT
+
+	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 );
+	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 );
+	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 );
+	check_noerr( err );
+
+	
+}
+
+CRegistrationPage::~CRegistrationPage()
+{
+	if ( m_hostnameSetupKey )
+	{
+		RegCloseKey( m_hostnameSetupKey );
+		m_hostnameSetupKey = NULL;
+	}
+
+	if ( m_registrationSetupKey )
+	{
+		RegCloseKey( m_registrationSetupKey );
+		m_registrationSetupKey = NULL;
+	}
+
+	if ( m_statusKey )
+	{
+		RegCloseKey( m_statusKey );
+		m_statusKey = NULL;
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CRegistrationPage::DoDataExchange
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CRegistrationPage::DoDataExchange(CDataExchange* pDX)
+{
+	CPropertyPage::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CRegistrationPage)
+	//}}AFX_DATA_MAP
+	DDX_Control(pDX, IDC_HOSTNAME, m_hostnameControl);
+	DDX_Control(pDX, IDC_USERNAME, m_usernameControl);
+	DDX_Control(pDX, IDC_PASSWORD, m_passwordControl);
+	DDX_Control(pDX, IDC_ADVERTISE_SERVICES, m_advertiseServices);
+}
+
+BEGIN_MESSAGE_MAP(CRegistrationPage, CPropertyPage)
+	//{{AFX_MSG_MAP(CRegistrationPage)
+	//}}AFX_MSG_MAP
+	ON_EN_CHANGE(IDC_HOSTNAME, OnEnChangeHostname)
+	ON_EN_CHANGE(IDC_USERNAME, OnEnChangeUsername)
+	ON_EN_CHANGE(IDC_PASSWORD, OnEnChangePassword)
+	ON_BN_CLICKED(IDC_ADVERTISE_SERVICES, OnBnClickedAdvertiseServices)
+END_MESSAGE_MAP()
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CRegistrationPage::OnEnChangedHostname
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CRegistrationPage::OnEnChangeHostname()
+{
+	if ( !m_ignoreChanges )
+	{
+		SetModified( TRUE );
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CRegistrationPage::OnEnChangedUsername
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CRegistrationPage::OnEnChangeUsername()
+{
+	if ( !m_ignoreChanges )
+	{
+		SetModified( TRUE );
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CRegistrationPage::OnEnChangedPassword
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CRegistrationPage::OnEnChangePassword()
+{
+	if ( !m_ignoreChanges )
+	{
+		SetModified( TRUE );
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CRegistrationPage::OnBnClickedAdvertiseServices
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CRegistrationPage::OnBnClickedAdvertiseServices()
+{
+	if ( !m_ignoreChanges )
+	{
+		SetModified( TRUE );
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CRegistrationPage::SetModified
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CRegistrationPage::SetModified( BOOL bChanged )
+{
+	m_modified = bChanged ? true : false;
+
+	CPropertyPage::SetModified( bChanged );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CRegistrationPage::OnSetActive
+//---------------------------------------------------------------------------------------------------------------------------
+
+BOOL
+CRegistrationPage::OnSetActive()
+{
+	TCHAR	name[kDNSServiceMaxDomainName + 1];
+	DWORD	nameLen = ( kDNSServiceMaxDomainName + 1 ) * sizeof( TCHAR );
+	DWORD	err;
+
+	BOOL b = CPropertyPage::OnSetActive();
+
+	m_ignoreChanges = true;
+	m_modified = FALSE;
+	
+	if ( m_hostnameSetupKey )
+	{
+		err = RegQueryValueEx( m_hostnameSetupKey, L"", NULL, NULL, (LPBYTE) name, &nameLen );
+
+		if ( !err )
+		{
+			char	hostnameUTF8[ 256 ];
+			char	outDomain[ 256 ];
+			char	outUsername[ 256 ];
+			char	outPassword[ 256 ];
+			CString hostname = name;
+			CString username;
+			CString password;
+
+			m_hostnameControl.SetWindowText( hostname );
+
+			StringObjectToUTF8String( hostname, hostnameUTF8, sizeof( hostnameUTF8 ) );
+
+			if ( LsaGetSecret( hostnameUTF8, outDomain, sizeof( outDomain ) / sizeof( TCHAR ), outUsername, sizeof( outUsername ) / sizeof( TCHAR ), outPassword, sizeof( outPassword ) / sizeof( TCHAR ) ) )
+			{
+				username = outUsername;
+				m_usernameControl.SetWindowText( username );
+
+				password = outPassword;
+				m_passwordControl.SetWindowText( password );
+			}
+		}
+	}
+
+	m_advertiseServices.SetCheck( 0 );
+
+	if ( m_registrationSetupKey )
+	{
+		HKEY		subKey = NULL;
+		DWORD		dwSize;
+		DWORD		enabled = 0;
+		TCHAR		subKeyName[MAX_KEY_LENGTH];
+		DWORD		cSubKeys = 0;
+		DWORD		cbMaxSubKey;
+		DWORD		cchMaxClass;
+		OSStatus	err;
+
+		err = RegQueryInfoKey( m_registrationSetupKey, NULL, NULL, NULL, &cSubKeys, &cbMaxSubKey, &cchMaxClass, NULL, NULL, NULL, NULL, NULL );       
+		if ( !err )
+		{
+			if ( cSubKeys > 0 )
+			{	
+				dwSize = MAX_KEY_LENGTH;
+	            
+				err = RegEnumKeyEx( m_registrationSetupKey, 0, subKeyName, &dwSize, NULL, NULL, NULL, NULL );
+				if ( !err )
+				{
+					err = RegOpenKey( m_registrationSetupKey, subKeyName, &subKey );
+					if ( !err )
+					{
+						dwSize = sizeof( DWORD );
+						err = RegQueryValueEx( subKey, L"Enabled", NULL, NULL, (LPBYTE) &enabled, &dwSize );
+						if ( !err && enabled )
+						{
+							m_advertiseServices.SetCheck( enabled );
+						}
+
+						RegCloseKey( subKey );
+						subKey = NULL;
+					}
+				}
+			}
+		}
+	}
+
+	m_ignoreChanges = false;
+
+	return b;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CRegistrationPage::OnOK
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CRegistrationPage::OnOK()
+{
+	if ( m_modified )
+	{
+		Commit();
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CRegistrationPage::Commit
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CRegistrationPage::Commit()
+{
+	CString	hostname;
+	char	hostnameUTF8[ 256 ];
+	CString username;
+	char	usernameUTF8[ 256 ];
+	CString password;
+	char	passwordUTF8[ 256 ];
+	DWORD	enabled = 1;
+	BOOL	secret = FALSE;
+	DWORD	err;
+
+	m_hostnameControl.GetWindowText( hostname );
+	hostname.MakeLower();
+	hostname.TrimRight( '.' );
+	StringObjectToUTF8String( hostname, hostnameUTF8, sizeof( hostnameUTF8 ) );
+	
+	m_usernameControl.GetWindowText( username );
+	m_passwordControl.GetWindowText( password );
+	
+	if ( username.GetLength() && password.GetLength() )
+	{
+		StringObjectToUTF8String( username, usernameUTF8, sizeof( usernameUTF8 ) );	
+		StringObjectToUTF8String( password, passwordUTF8, sizeof( passwordUTF8 ) );
+		secret = TRUE;
+	}
+
+	if ( m_hostnameSetupKey != NULL )
+	{
+		err = RegSetValueEx( m_hostnameSetupKey, L"", 0, REG_SZ, (LPBYTE) (LPCTSTR) hostname, ( hostname.GetLength() + 1 ) * sizeof( TCHAR ) );
+		require_noerr( err, exit );
+		
+		err = RegSetValueEx( m_hostnameSetupKey, L"Enabled", 0, REG_DWORD, (LPBYTE) &enabled, sizeof( DWORD ) );
+		require_noerr( err, exit );
+
+		if ( secret )
+		{
+			LsaSetSecret( hostnameUTF8, usernameUTF8, passwordUTF8 );
+		}
+	}
+
+	if ( m_registrationSetupKey != NULL )
+	{
+		TCHAR		subKeyName[MAX_KEY_LENGTH];
+		DWORD		cSubKeys = 0;
+		DWORD		cbMaxSubKey;
+		DWORD		cchMaxClass;
+		DWORD		dwSize;
+		int			i;
+		OSStatus	err = kNoErr;
+
+		// First, remove all the entries that are there
+
+		err = RegQueryInfoKey( m_registrationSetupKey, NULL, NULL, NULL, &cSubKeys, &cbMaxSubKey, &cchMaxClass, NULL, NULL, NULL, NULL, NULL );       
+		if ( !err )
+		{
+			for ( i = 0; i < (int) cSubKeys; i++ )
+			{	
+				dwSize = MAX_KEY_LENGTH;
+		            
+				err = RegEnumKeyEx( m_registrationSetupKey, 0, subKeyName, &dwSize, NULL, NULL, NULL, NULL );
+				require_noerr( err, exit );
+					
+				err = RegDeleteKey( m_registrationSetupKey, subKeyName );
+				require_noerr( err, exit );
+			}
+		}
+
+		if ( m_advertiseServices.GetCheck() )
+		{
+			const char	* domainUTF8;
+			CString		  domain;
+			char		  label[ 64 ];
+			HKEY		  subKey = NULL;
+
+			domainUTF8	= GetNextLabel( hostnameUTF8, label );
+			domain		= domainUTF8;
+
+			err = RegCreateKeyEx( m_registrationSetupKey, domain, 0,
+									 NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &subKey, NULL );
+			if ( !err )
+			{
+				err = RegSetValueEx( subKey, L"Enabled", 0, REG_DWORD, (LPBYTE) &enabled, sizeof( DWORD ) );
+				check_noerr( err );
+
+				RegCloseKey( subKey );
+				subKey = NULL;
+			}
+
+			if ( secret )
+			{
+				LsaSetSecret( domainUTF8, usernameUTF8, passwordUTF8 );
+			}
+		}
+	}
+
+exit:
+
+	return;
+}
diff --git a/mDNSWindows/ControlPanel/RegistrationPage.h b/mDNSWindows/ControlPanel/RegistrationPage.h
new file mode 100755
index 0000000..935a418
--- /dev/null
+++ b/mDNSWindows/ControlPanel/RegistrationPage.h
@@ -0,0 +1,75 @@
+/* -*- 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.
+ */
+
+#pragma once
+
+#include "stdafx.h"
+#include "resource.h"
+#include <DebugServices.h>
+#include "afxwin.h"
+
+    
+//---------------------------------------------------------------------------------------------------------------------------
+//	CRegistrationPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+class CRegistrationPage : public CPropertyPage
+{
+public:
+	CRegistrationPage();
+	~CRegistrationPage();
+
+protected:
+	//{{AFX_DATA(CRegistrationPage)
+	enum { IDD = IDR_APPLET_PAGE1 };
+	//}}AFX_DATA
+
+	//{{AFX_VIRTUAL(CRegistrationPage)
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+	DECLARE_DYNCREATE(CRegistrationPage)
+
+	//{{AFX_MSG(CRegistrationPage)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+
+private:
+
+	afx_msg BOOL	OnSetActive();
+	afx_msg void	OnOK();
+
+	void			SetModified( BOOL bChanged = TRUE );
+	void			Commit();
+
+	CEdit			m_hostnameControl;
+	CEdit			m_usernameControl;
+	CEdit			m_passwordControl;
+	CButton			m_advertiseServices;
+	bool			m_ignoreChanges;
+	bool			m_modified;
+	HKEY			m_hostnameSetupKey;
+	HKEY			m_registrationSetupKey;
+	HKEY			m_statusKey;
+	
+public:
+	
+	afx_msg void OnEnChangeHostname();
+	afx_msg void OnEnChangeUsername();
+	afx_msg void OnEnChangePassword();
+	afx_msg void OnBnClickedAdvertiseServices();
+};
diff --git a/mDNSWindows/ControlPanel/SecondPage.cpp b/mDNSWindows/ControlPanel/SecondPage.cpp
new file mode 100755
index 0000000..d3bc133
--- /dev/null
+++ b/mDNSWindows/ControlPanel/SecondPage.cpp
@@ -0,0 +1,544 @@
+/* -*- 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 "SecondPage.h"
+#include "resource.h"
+
+#include "ConfigPropertySheet.h"
+#include "SharedSecret.h"
+
+#include <WinServices.h>
+    
+#define MAX_KEY_LENGTH 255
+
+IMPLEMENT_DYNCREATE(CSecondPage, CPropertyPage)
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::CSecondPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+CSecondPage::CSecondPage()
+:
+	CPropertyPage(CSecondPage::IDD),
+	m_setupKey( NULL )
+{
+	//{{AFX_DATA_INIT(CSecondPage)
+	//}}AFX_DATA_INIT
+
+	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 );
+	check_noerr( err );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::~CSecondPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+CSecondPage::~CSecondPage()
+{
+	if ( m_setupKey )
+	{
+		RegCloseKey( m_setupKey );
+		m_setupKey = NULL;
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::DoDataExchange
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CSecondPage::DoDataExchange(CDataExchange* pDX)
+{
+	CPropertyPage::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CSecondPage)
+	//}}AFX_DATA_MAP
+	DDX_Control(pDX, IDC_CHECK1, m_advertiseServicesButton);
+	DDX_Control(pDX, IDC_BUTTON1, m_sharedSecretButton);
+	DDX_Control(pDX, IDC_COMBO2, m_regDomainsBox);
+}
+
+BEGIN_MESSAGE_MAP(CSecondPage, CPropertyPage)
+	//{{AFX_MSG_MAP(CSecondPage)
+	//}}AFX_MSG_MAP
+	ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedSharedSecret)
+	ON_BN_CLICKED(IDC_CHECK1, OnBnClickedAdvertise)
+	ON_CBN_SELCHANGE(IDC_COMBO1, OnCbnSelChange)
+	ON_CBN_EDITCHANGE(IDC_COMBO1, OnCbnEditChange)
+	ON_CBN_EDITCHANGE(IDC_COMBO2, OnCbnEditChange)
+	ON_CBN_SELCHANGE(IDC_COMBO2, OnCbnSelChange)
+	
+END_MESSAGE_MAP()
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::SetModified
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CSecondPage::SetModified( BOOL bChanged )
+{
+	m_modified = bChanged;
+
+	CPropertyPage::SetModified( bChanged );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::OnSetActive
+//---------------------------------------------------------------------------------------------------------------------------
+
+BOOL
+CSecondPage::OnSetActive()
+{
+	CConfigPropertySheet	*	psheet;
+	DWORD						err;
+	BOOL						b = CPropertyPage::OnSetActive();
+
+	psheet = reinterpret_cast<CConfigPropertySheet*>(GetParent());
+	require_quiet( psheet, exit );
+	
+	m_modified = FALSE;
+
+	// Clear out what's there
+
+	EmptyComboBox( m_regDomainsBox );
+
+	// Now populate the registration domain box
+
+	err = Populate( m_regDomainsBox, m_setupKey, psheet->m_regDomains );
+	check_noerr( err );
+
+exit:
+
+	return b;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::OnOK
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CSecondPage::OnOK()
+{
+	if ( m_modified )
+	{
+		Commit();
+	}
+}
+
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::Commit
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CSecondPage::Commit()
+{
+	DWORD err;
+
+	if ( m_setupKey != NULL )
+	{
+		err = Commit( m_regDomainsBox, m_setupKey, m_advertiseServicesButton.GetCheck() == BST_CHECKED );
+		check_noerr( err );
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::Commit
+//---------------------------------------------------------------------------------------------------------------------------
+
+OSStatus
+CSecondPage::Commit( CComboBox & box, HKEY key, DWORD enabled )
+{
+	CString		selected;
+	HKEY		subKey	= NULL;
+	TCHAR		subKeyName[MAX_KEY_LENGTH];
+	DWORD		cSubKeys = 0;
+	DWORD		cbMaxSubKey;
+	DWORD		cchMaxClass;
+	DWORD		dwSize;
+	int			i;
+	OSStatus	err = kNoErr;
+
+	// First, remove all the entries that are there
+
+    err = RegQueryInfoKey( key, NULL, NULL, NULL, &cSubKeys, &cbMaxSubKey, &cchMaxClass, NULL, NULL, NULL, NULL, NULL );       
+	require_noerr( err, exit );
+
+	for ( i = 0; i < (int) cSubKeys; i++ )
+	{	
+		dwSize = MAX_KEY_LENGTH;
+            
+		err = RegEnumKeyEx( key, 0, subKeyName, &dwSize, NULL, NULL, NULL, NULL );
+		require_noerr( err, exit );
+			
+		err = RegDeleteKey( key, subKeyName );
+		require_noerr( err, exit );
+	}
+
+	// Get selected text
+	
+	box.GetWindowText( selected );
+	
+	// If we haven't seen this string before, add the string to the box and
+	// the registry
+	
+	if ( ( selected.GetLength() > 0 ) && ( box.FindStringExact( -1, selected ) == CB_ERR ) )
+	{
+		CString string;
+
+		box.AddString( selected );
+
+		err = RegQueryString( key, L"UserDefined", string );
+		check_noerr( err );
+
+		if ( string.GetLength() )
+		{
+			string += L"," + selected;
+		}
+		else
+		{
+			string = selected;
+		}
+
+		err = RegSetValueEx( key, L"UserDefined", 0, REG_SZ, (LPBYTE) (LPCTSTR) string, ( string.GetLength() + 1) * sizeof( TCHAR ) );
+		check_noerr ( err );
+	}
+
+	// Save selected text in registry.  This will trigger mDNSResponder to setup
+	// DynDNS config again
+
+	err = RegCreateKeyEx( key, selected, 0,
+	                      NULL, REG_OPTION_NON_VOLATILE, KEY_READ|KEY_WRITE|KEY_WOW64_32KEY, NULL, &subKey, NULL );
+	require_noerr( err, exit );
+
+	err = RegSetValueEx( subKey, L"Enabled", 0, REG_DWORD, (LPBYTE) &enabled, sizeof( DWORD ) );
+	check_noerr( err );
+
+exit:
+
+	if ( subKey )
+	{
+		RegCloseKey( subKey );
+		subKey = NULL;
+	}
+
+	return err;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::OnBnClickedSharedSecret
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CSecondPage::OnBnClickedSharedSecret()
+{
+	CString name;
+
+	m_regDomainsBox.GetWindowText( name );
+
+	CSharedSecret dlg;
+
+	dlg.Load( name );
+
+	if ( dlg.DoModal() == IDOK )
+	{
+		DWORD		wakeup = 0;
+		DWORD		dwSize = sizeof( DWORD );
+		OSStatus	err;
+
+		dlg.Commit( name );
+
+		// We have now updated the secret, however the system service
+		// doesn't know about it yet.  So we're going to update the
+		// registry with a dummy value which will cause the system
+		// service to re-initialize it's DynDNS setup
+		//
+
+		RegQueryValueEx( m_setupKey, L"Wakeup", NULL, NULL, (LPBYTE) &wakeup, &dwSize );      
+
+		wakeup++;
+		
+		err = RegSetValueEx( m_setupKey, L"Wakeup", 0, REG_DWORD, (LPBYTE) &wakeup, sizeof( DWORD ) );
+		require_noerr( err, exit );
+	}
+
+exit:
+
+	return;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::OnBnClickedAdvertise
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CSecondPage::OnBnClickedAdvertise()
+{
+	int state;
+
+	state = m_advertiseServicesButton.GetCheck();
+
+	m_regDomainsBox.EnableWindow( state );
+	m_sharedSecretButton.EnableWindow( state );
+
+	SetModified( TRUE );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::OnCbnSelChange
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CSecondPage::OnCbnSelChange()
+{
+	SetModified( TRUE );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::OnCbnEditChange
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CSecondPage::OnCbnEditChange()
+{
+	SetModified( TRUE );
+}
+
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::OnAddRegistrationDomain
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CSecondPage::OnAddRegistrationDomain( CString & domain )
+{
+	int index = m_regDomainsBox.FindStringExact( -1, domain );
+
+	if ( index == CB_ERR )
+	{
+		m_regDomainsBox.AddString( domain );
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::OnRemoveRegistrationDomain
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CSecondPage::OnRemoveRegistrationDomain( CString & domain )
+{
+	int index = m_regDomainsBox.FindStringExact( -1, domain );
+
+	if ( index != CB_ERR )
+	{
+		m_regDomainsBox.DeleteString( index );
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::EmptyComboBox
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CSecondPage::EmptyComboBox( CComboBox & box )
+{
+	while ( box.GetCount() > 0 )
+	{
+		box.DeleteString( 0 );
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::Populate
+//---------------------------------------------------------------------------------------------------------------------------
+
+OSStatus
+CSecondPage::Populate( CComboBox & box, HKEY key, StringList & l )
+{
+	CString		string;
+	HKEY		subKey = NULL;
+	DWORD		dwSize;
+	DWORD		enabled = 0;
+	TCHAR		subKeyName[MAX_KEY_LENGTH];
+	DWORD		cSubKeys = 0;
+	DWORD		cbMaxSubKey;
+	DWORD		cchMaxClass;
+	OSStatus	err;
+
+	err = RegQueryString( key, L"UserDefined", string );
+
+	if ( !err && string.GetLength() )
+	{
+		bool done = false;
+
+		while ( !done )
+		{
+			CString tok;
+
+			tok = string.SpanExcluding( L"," );
+
+			box.AddString( tok );
+
+			if ( tok != string )
+			{
+				// Get rid of that string and comma
+
+				string = string.Right( string.GetLength() - tok.GetLength() - 1 );
+			}
+			else
+			{
+				done = true;
+			}
+		}
+	}
+
+	StringList::iterator it;
+
+	for ( it = l.begin(); it != l.end(); it++ )
+	{
+		if ( box.FindStringExact( -1, *it ) == CB_ERR )
+		{
+			box.AddString( *it );
+		}
+	}
+
+	err = RegQueryInfoKey( key, NULL, NULL, NULL, &cSubKeys, &cbMaxSubKey, &cchMaxClass, NULL, NULL, NULL, NULL, NULL );       
+	require_noerr( err, exit );
+
+	if ( cSubKeys > 0 )
+	{	
+		dwSize = MAX_KEY_LENGTH;
+            
+		err = RegEnumKeyEx( key, 0, subKeyName, &dwSize, NULL, NULL, NULL, NULL );
+		require_noerr( err, exit );
+
+		err = RegOpenKey( key, subKeyName, &subKey );
+		require_noerr( err, exit );
+
+		dwSize = sizeof( DWORD );
+		err = RegQueryValueEx( subKey, L"Enabled", NULL, NULL, (LPBYTE) &enabled, &dwSize );
+		require_noerr( err, exit );
+
+		// See if it's there
+
+		if ( box.SelectString( -1, subKeyName ) == CB_ERR )
+		{
+			// If not, add it
+
+			box.AddString( subKeyName );
+		}
+
+		box.SelectString( -1, subKeyName );
+
+		RegCloseKey( subKey );
+		subKey = NULL;
+	}
+
+exit:
+
+	m_advertiseServicesButton.SetCheck( ( !err && enabled ) ? BST_CHECKED : BST_UNCHECKED );
+	m_regDomainsBox.EnableWindow( ( !err && enabled ) );
+	m_sharedSecretButton.EnableWindow( (!err && enabled ) );
+
+	return err;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::CreateKey
+//---------------------------------------------------------------------------------------------------------------------------
+
+OSStatus
+CSecondPage::CreateKey( CString & name, DWORD enabled )
+{
+	HKEY		key = NULL;
+	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 );
+	require_noerr( err, exit );
+
+	err = RegSetValueEx( key, L"Enabled", 0, REG_DWORD, (LPBYTE) &enabled, sizeof( DWORD ) );
+	check_noerr( err );
+
+exit:
+
+	if ( key )
+	{
+		RegCloseKey( key );
+	}
+
+	return err;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage::RegQueryString
+//---------------------------------------------------------------------------------------------------------------------------
+
+OSStatus
+CSecondPage::RegQueryString( HKEY key, CString valueName, CString & value )
+{
+	TCHAR	*	string;
+	DWORD		stringLen;
+	int			i;
+	OSStatus	err;
+
+	stringLen	= 1024;
+	string		= NULL;
+	i			= 0;
+
+	do
+	{
+		if ( string )
+		{
+			free( string );
+		}
+
+		string = (TCHAR*) malloc( stringLen );
+		require_action( string, exit, err = kUnknownErr );
+		*string = '\0';
+
+		err = RegQueryValueEx( key, valueName, 0, NULL, (LPBYTE) string, &stringLen );
+
+		i++;
+	}
+	while ( ( err == ERROR_MORE_DATA ) && ( i < 100 ) );
+
+	value = string;
+
+exit:
+
+	if ( string )
+	{
+		free( string );
+	}
+
+	return err;
+}
diff --git a/mDNSWindows/ControlPanel/SecondPage.h b/mDNSWindows/ControlPanel/SecondPage.h
new file mode 100755
index 0000000..3bd9e74
--- /dev/null
+++ b/mDNSWindows/ControlPanel/SecondPage.h
@@ -0,0 +1,107 @@
+/* -*- 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.
+ */
+
+#pragma once
+
+#include "stdafx.h"
+#include "resource.h"
+
+#include <DebugServices.h>
+#include <list>
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSecondPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+class CSecondPage : public CPropertyPage
+{
+public:
+	CSecondPage();
+	~CSecondPage();
+
+protected:
+
+	//{{AFX_DATA(CSecondPage)
+	enum { IDD = IDR_APPLET_PAGE2 };
+	//}}AFX_DATA
+
+	//{{AFX_VIRTUAL(CSecondPage)
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+	DECLARE_DYNCREATE(CSecondPage)
+
+	//{{AFX_MSG(CSecondPage)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+public:
+	
+	afx_msg void	OnBnClickedSharedSecret();
+	afx_msg void	OnBnClickedAdvertise();
+
+	void			OnAddRegistrationDomain( CString & domain );
+	void			OnRemoveRegistrationDomain( CString & domain );
+	
+private:
+	
+	typedef std::list<CString> StringList;
+
+	afx_msg BOOL
+	OnSetActive();
+	
+	afx_msg void
+	OnOK();
+
+	void
+	EmptyComboBox
+			(
+			CComboBox	&	box
+			);
+
+	OSStatus
+	Populate(
+			CComboBox	&	box,
+			HKEY			key,
+			StringList	&	l
+			);
+	
+	void
+	SetModified( BOOL bChanged = TRUE );
+	
+	void
+	Commit();
+
+	OSStatus
+	Commit( CComboBox & box, HKEY key, DWORD enabled );
+
+	OSStatus
+	CreateKey( CString & name, DWORD enabled );
+
+	OSStatus
+	RegQueryString( HKEY key, CString valueName, CString & value );
+
+	CComboBox		m_regDomainsBox;
+	CButton			m_advertiseServicesButton;
+	CButton			m_sharedSecretButton;
+	BOOL			m_modified;
+	HKEY			m_setupKey;
+
+public:
+	afx_msg void OnCbnSelChange();
+	afx_msg void OnCbnEditChange();
+}; 
diff --git a/mDNSWindows/ControlPanel/ServicesPage.cpp b/mDNSWindows/ControlPanel/ServicesPage.cpp
new file mode 100755
index 0000000..e087157
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ServicesPage.cpp
@@ -0,0 +1,273 @@
+/* -*- 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 "ServicesPage.h"
+#include "resource.h"
+
+#include "ControlPanelExe.h"
+#include "ConfigPropertySheet.h"
+
+#include <WinServices.h>
+    
+#define MAX_KEY_LENGTH 255
+
+
+IMPLEMENT_DYNCREATE(CServicesPage, CPropertyPage)
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CServicesPage::CServicesPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+CServicesPage::CServicesPage()
+:
+	CPropertyPage(CServicesPage::IDD)
+{
+	//{{AFX_DATA_INIT(CServicesPage)
+	//}}AFX_DATA_INIT
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CServicesPage::~CServicesPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+CServicesPage::~CServicesPage()
+{
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CServicesPage::DoDataExchange
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CServicesPage::DoDataExchange(CDataExchange* pDX)
+{
+	CPropertyPage::DoDataExchange(pDX);
+	//{{AFX_DATA_MAP(CServicesPage)
+	//}}AFX_DATA_MAP
+	DDX_Control(pDX, IDC_ADVERTISE_SMB, m_SMBCheckBox);
+	DDX_Control(pDX, IDC_POWER_MANAGEMENT, m_powerManagementCheckBox);
+}
+
+BEGIN_MESSAGE_MAP(CServicesPage, CPropertyPage)
+	//{{AFX_MSG_MAP(CServicesPage)
+	//}}AFX_MSG_MAP
+
+	ON_BN_CLICKED(IDC_ADVERTISE_SMB, &CServicesPage::OnBnClickedAdvertiseSMB)
+	ON_BN_CLICKED(IDC_POWER_MANAGEMENT, &CServicesPage::OnBnClickedPowerManagement)
+
+END_MESSAGE_MAP()
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CServicesPage::SetModified
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CServicesPage::SetModified( BOOL bChanged )
+{
+	m_modified = bChanged;
+
+	CPropertyPage::SetModified( bChanged );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CServicesPage::OnSetActive
+//---------------------------------------------------------------------------------------------------------------------------
+
+BOOL
+CServicesPage::OnSetActive()
+{
+	CConfigPropertySheet	*	psheet;
+	HKEY						key = NULL;
+	DWORD						dwSize;
+	DWORD						enabled;
+	DWORD						err;
+	BOOL						b = CPropertyPage::OnSetActive();
+
+	psheet = reinterpret_cast<CConfigPropertySheet*>(GetParent());
+	require_quiet( psheet, exit );
+
+	m_SMBCheckBox.SetCheck( 0 );
+
+	// 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 );
+	require_noerr( err, exit );
+
+	dwSize = sizeof( DWORD );
+	err = RegQueryValueEx( key, L"Advertise", NULL, NULL, (LPBYTE) &enabled, &dwSize );
+	require_noerr( err, exit );
+
+	m_SMBCheckBox.SetCheck( enabled );
+
+	RegCloseKey( key );
+	key = NULL;
+
+	m_powerManagementCheckBox.SetCheck( 0 );
+
+	// 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 );
+	require_noerr( err, exit );
+
+	dwSize = sizeof( DWORD );
+	err = RegQueryValueEx( key, L"Enabled", NULL, NULL, (LPBYTE) &enabled, &dwSize );
+	require_noerr( err, exit );
+
+	m_powerManagementCheckBox.SetCheck( enabled );
+ 
+exit:
+
+	if ( key )
+	{
+		RegCloseKey( key );
+	}
+
+	return b;
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CServicesPage::OnOK
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CServicesPage::OnOK()
+{
+	if ( m_modified )
+	{
+		Commit();
+	}
+}
+
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CServicesPage::Commit
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CServicesPage::Commit()
+{
+	HKEY		key		= NULL;
+	DWORD		enabled;
+	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 );
+	require_noerr( err, exit );
+
+	enabled = m_SMBCheckBox.GetCheck();
+	err = RegSetValueEx( key, L"Advertise", NULL, REG_DWORD, (LPBYTE) &enabled, sizeof( enabled ) );
+	require_noerr( err, exit );
+
+	RegCloseKey( key );
+	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 );
+	require_noerr( err, exit );
+
+	enabled = m_powerManagementCheckBox.GetCheck();
+	err = RegSetValueEx( key, L"Enabled", NULL, REG_DWORD, (LPBYTE) &enabled, sizeof( enabled ) );
+	require_noerr( err, exit );
+	
+exit:
+
+	if ( key )
+	{
+		RegCloseKey( key );
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CServicesPage::OnBnClickedAdvertiseSMB
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CServicesPage::OnBnClickedAdvertiseSMB()
+{
+	SetModified( TRUE );
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CServicesPage::OnBnClickedPowerManagement
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CServicesPage::OnBnClickedPowerManagement()
+{
+	SetModified( TRUE );
+
+	if ( m_powerManagementCheckBox.GetCheck() )
+	{
+		CPowerManagementWarning dlg( GetParent() );
+
+		dlg.DoModal();
+	}
+}
+
+
+// CPowerManagementWarning dialog
+
+IMPLEMENT_DYNAMIC(CPowerManagementWarning, CDialog)
+CPowerManagementWarning::CPowerManagementWarning(CWnd* pParent /*=NULL*/)
+	: CDialog(CPowerManagementWarning::IDD, pParent)
+{
+}
+
+CPowerManagementWarning::~CPowerManagementWarning()
+{
+}
+
+void CPowerManagementWarning::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	DDX_Control(pDX, IDC_ENERGY_SAVER, m_energySaverIcon);
+}
+
+
+BOOL
+CPowerManagementWarning::OnInitDialog()
+{	
+	BOOL b = CDialog::OnInitDialog();
+
+	const HICON hIcon = ( HICON ) ::LoadImage( GetNonLocalizedResources(), MAKEINTRESOURCE( IDI_ENERGY_SAVER ), IMAGE_ICON, 0, 0, 0);
+	
+	if ( hIcon )
+	{
+		m_energySaverIcon.SetIcon( hIcon );
+	}
+
+	return b;
+}
+
+
+void
+CPowerManagementWarning::OnOK()
+{
+	CDialog::OnOK();
+}
+
+
+BEGIN_MESSAGE_MAP(CPowerManagementWarning, CDialog)
+END_MESSAGE_MAP()
+
diff --git a/mDNSWindows/ControlPanel/ServicesPage.h b/mDNSWindows/ControlPanel/ServicesPage.h
new file mode 100755
index 0000000..d593a72
--- /dev/null
+++ b/mDNSWindows/ControlPanel/ServicesPage.h
@@ -0,0 +1,123 @@
+/* -*- 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.
+ */
+
+#pragma once
+
+#include "stdafx.h"
+#include "resource.h"
+
+#include <DebugServices.h>
+#include <list>
+#include "afxcmn.h"
+
+#include "afxwin.h"
+
+
+
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CServicesPage
+//---------------------------------------------------------------------------------------------------------------------------
+
+class CServicesPage : public CPropertyPage
+{
+public:
+	CServicesPage();
+	~CServicesPage();
+
+protected:
+
+	//{{AFX_DATA(CServicesPage)
+	enum { IDD = IDR_APPLET_PAGE5 };
+	//}}AFX_DATA
+
+	//{{AFX_VIRTUAL(CServicesPage)
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+	//}}AFX_VIRTUAL
+
+	DECLARE_DYNCREATE(CServicesPage)
+
+	//{{AFX_MSG(CServicesPage)
+	//}}AFX_MSG
+	DECLARE_MESSAGE_MAP()
+	
+private:
+	
+	typedef std::list<CString> StringList;
+
+	afx_msg BOOL
+	OnSetActive();
+	
+	afx_msg void
+	OnOK();
+	
+	void
+	SetModified( BOOL bChanged = TRUE );
+	
+	void
+	Commit();
+
+	BOOL			m_modified;
+
+public:
+private:
+
+	CButton m_SMBCheckBox;
+	CButton m_powerManagementCheckBox;
+
+public:
+
+
+	afx_msg void OnBnClickedAdvertiseSMB();
+	afx_msg void OnBnClickedPowerManagement();
+};
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CPowerManagementWarning
+//---------------------------------------------------------------------------------------------------------------------------
+
+class CPowerManagementWarning : public CDialog
+{
+	DECLARE_DYNAMIC(CPowerManagementWarning)
+
+public:
+
+	CPowerManagementWarning(CWnd* pParent = NULL);   // standard constructor
+
+	virtual ~CPowerManagementWarning();
+
+// Dialog Data
+
+	enum { IDD = IDR_POWER_MANAGEMENT_WARNING };
+
+protected:
+
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+
+	virtual BOOL OnInitDialog();
+
+	virtual void OnOK();
+
+	DECLARE_MESSAGE_MAP()
+
+public:
+
+	CStatic m_energySaverIcon;
+};
+
diff --git a/mDNSWindows/ControlPanel/SharedSecret.cpp b/mDNSWindows/ControlPanel/SharedSecret.cpp
new file mode 100644
index 0000000..3d19295
--- /dev/null
+++ b/mDNSWindows/ControlPanel/SharedSecret.cpp
@@ -0,0 +1,115 @@
+/* -*- 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.
+ */
+
+    
+// SharedSecret.cpp : implementation file
+//
+
+
+#include <Secret.h>
+#include "stdafx.h"
+#include "SharedSecret.h"
+#include <WinServices.h>
+
+#include <DebugServices.h>
+
+
+// SharedSecret dialog
+
+IMPLEMENT_DYNAMIC(CSharedSecret, CDialog)
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSharedSecret::CSharedSecret
+//---------------------------------------------------------------------------------------------------------------------------
+
+CSharedSecret::CSharedSecret(CWnd* pParent /*=NULL*/)
+	: CDialog(CSharedSecret::IDD, pParent)
+	, m_key(_T(""))
+	, m_secret(_T(""))
+{
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSharedSecret::~CSharedSecret
+//---------------------------------------------------------------------------------------------------------------------------
+
+CSharedSecret::~CSharedSecret()
+{
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSharedSecret::DoDataExchange
+//---------------------------------------------------------------------------------------------------------------------------
+
+void CSharedSecret::DoDataExchange(CDataExchange* pDX)
+{
+	CDialog::DoDataExchange(pDX);
+	DDX_Text(pDX, IDC_KEY, m_key );
+	DDX_Text(pDX, IDC_SECRET, m_secret );
+}
+
+
+BEGIN_MESSAGE_MAP(CSharedSecret, CDialog)
+END_MESSAGE_MAP()
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSharedSecret::Load
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CSharedSecret::Load( CString zone )
+{
+	char	zoneUTF8[ 256 ];
+	char	outDomain[ 256 ];
+	char	outKey[ 256 ];
+	char	outSecret[ 256 ];
+
+	StringObjectToUTF8String( zone, zoneUTF8, sizeof( zoneUTF8 ) );
+
+	if ( LsaGetSecret( zoneUTF8, outDomain, sizeof( outDomain ) / sizeof( TCHAR ), outKey, sizeof( outKey ) / sizeof( TCHAR ), outSecret, sizeof( outSecret ) / sizeof( TCHAR ) ) )
+	{
+		m_key		= outKey;
+		m_secret	= outSecret;
+	}
+	else
+	{
+		m_key = zone;
+	}
+}
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSharedSecret::Commit
+//---------------------------------------------------------------------------------------------------------------------------
+
+void
+CSharedSecret::Commit( CString zone )
+{
+	char	zoneUTF8[ 256 ];
+	char	keyUTF8[ 256 ];
+	char	secretUTF8[ 256 ];
+
+	StringObjectToUTF8String( zone, zoneUTF8, sizeof( zoneUTF8 ) );
+	StringObjectToUTF8String( m_key, keyUTF8, sizeof( keyUTF8 ) );
+	StringObjectToUTF8String( m_secret, secretUTF8, sizeof( secretUTF8 ) );
+
+	LsaSetSecret( zoneUTF8, keyUTF8, secretUTF8 );
+}
diff --git a/mDNSWindows/ControlPanel/SharedSecret.h b/mDNSWindows/ControlPanel/SharedSecret.h
new file mode 100644
index 0000000..be82d8b
--- /dev/null
+++ b/mDNSWindows/ControlPanel/SharedSecret.h
@@ -0,0 +1,54 @@
+/* -*- 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.
+ */
+
+    
+#pragma once
+
+#include "resource.h"
+
+
+//---------------------------------------------------------------------------------------------------------------------------
+//	CSharedSecret
+//---------------------------------------------------------------------------------------------------------------------------
+
+class CSharedSecret : public CDialog
+{
+	DECLARE_DYNAMIC(CSharedSecret)
+
+public:
+	CSharedSecret(CWnd* pParent = NULL);   // standard constructor
+	virtual ~CSharedSecret();
+
+// Dialog Data
+	enum { IDD = IDR_SECRET };
+
+	void
+	Load( CString zone );
+
+	void
+	Commit( CString zone );
+
+protected:
+	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+
+	DECLARE_MESSAGE_MAP()
+
+public:
+
+	CString m_key;
+	CString m_secret;
+};
diff --git a/mDNSWindows/ControlPanel/res/ControlPanel.dll.manifest b/mDNSWindows/ControlPanel/res/ControlPanel.dll.manifest
new file mode 100644
index 0000000..903b02b
--- /dev/null
+++ b/mDNSWindows/ControlPanel/res/ControlPanel.dll.manifest
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+	<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Apple.Bonjour.ControlPanel" type="win32"/>
+	<description>Control Panel applet for configuring Wide-Area Bonjour.</description>
+	<dependency>
+		<dependentAssembly>
+			<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" />
+		</dependentAssembly>
+	</dependency>
+</assembly>
diff --git a/mDNSWindows/ControlPanel/res/ControlPanel.exe.manifest b/mDNSWindows/ControlPanel/res/ControlPanel.exe.manifest
new file mode 100644
index 0000000..4879215
--- /dev/null
+++ b/mDNSWindows/ControlPanel/res/ControlPanel.exe.manifest
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+	<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Apple.Bonjour.ControlPanel" type="win32"/>
+	<description>Control Panel applet for configuring Wide-Area Bonjour.</description>
+	<dependency>
+		<dependentAssembly>
+			<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" />
+		</dependentAssembly>
+	</dependency>
+	<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+		<security>
+			<requestedPrivileges>
+				<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
+			</requestedPrivileges>
+		</security>
+	</trustInfo>
+</assembly>
diff --git a/mDNSWindows/ControlPanel/res/ControlPanel.manifest b/mDNSWindows/ControlPanel/res/ControlPanel.manifest
new file mode 100644
index 0000000..4879215
--- /dev/null
+++ b/mDNSWindows/ControlPanel/res/ControlPanel.manifest
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+	<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Apple.Bonjour.ControlPanel" type="win32"/>
+	<description>Control Panel applet for configuring Wide-Area Bonjour.</description>
+	<dependency>
+		<dependentAssembly>
+			<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*" />
+		</dependentAssembly>
+	</dependency>
+	<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+		<security>
+			<requestedPrivileges>
+				<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
+			</requestedPrivileges>
+		</security>
+	</trustInfo>
+</assembly>
diff --git a/mDNSWindows/ControlPanel/res/ControlPanel.rc2 b/mDNSWindows/ControlPanel/res/ControlPanel.rc2
new file mode 100755
index 0000000..e3f7422
--- /dev/null
+++ b/mDNSWindows/ControlPanel/res/ControlPanel.rc2
@@ -0,0 +1,13 @@
+//

+// CPL_PP.RC2 - resources Microsoft Visual C++ does not edit directly

+//

+

+#ifdef APSTUDIO_INVOKED

+	#error this file is not editable by Microsoft Visual C++

+#endif //APSTUDIO_INVOKED

+

+

+/////////////////////////////////////////////////////////////////////////////

+// Add manually edited resources here...

+

+/////////////////////////////////////////////////////////////////////////////

diff --git a/mDNSWindows/ControlPanel/res/ControlPanel64.manifest b/mDNSWindows/ControlPanel/res/ControlPanel64.manifest
new file mode 100644
index 0000000..a47a4e2
--- /dev/null
+++ b/mDNSWindows/ControlPanel/res/ControlPanel64.manifest
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+	<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Apple.Bonjour.ControlPanel" type="win32"/>
+	<description>Control Panel applet for configuring Wide-Area Bonjour.</description>
+	<dependency>
+		<dependentAssembly>
+			<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df" language="*" />
+		</dependentAssembly>
+	</dependency>
+	<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+		<security>
+			<requestedPrivileges>
+				<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
+			</requestedPrivileges>
+		</security>
+	</trustInfo>
+</assembly>
diff --git a/mDNSWindows/ControlPanel/res/EnergySaver.ico b/mDNSWindows/ControlPanel/res/EnergySaver.ico
new file mode 100755
index 0000000..c2b935b
--- /dev/null
+++ b/mDNSWindows/ControlPanel/res/EnergySaver.ico
Binary files differ
diff --git a/mDNSWindows/ControlPanel/res/controlpanel.ico b/mDNSWindows/ControlPanel/res/controlpanel.ico
new file mode 100755
index 0000000..7ef6ebb
--- /dev/null
+++ b/mDNSWindows/ControlPanel/res/controlpanel.ico
Binary files differ
diff --git a/mDNSWindows/ControlPanel/res/failure.ico b/mDNSWindows/ControlPanel/res/failure.ico
new file mode 100755
index 0000000..f0b8f2b
--- /dev/null
+++ b/mDNSWindows/ControlPanel/res/failure.ico
Binary files differ
diff --git a/mDNSWindows/ControlPanel/res/success.ico b/mDNSWindows/ControlPanel/res/success.ico
new file mode 100755
index 0000000..9b97584
--- /dev/null
+++ b/mDNSWindows/ControlPanel/res/success.ico
Binary files differ
diff --git a/mDNSWindows/ControlPanel/resource.h b/mDNSWindows/ControlPanel/resource.h
new file mode 100644
index 0000000..fec673f
--- /dev/null
+++ b/mDNSWindows/ControlPanel/resource.h
@@ -0,0 +1,56 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by ControlPanel.rc
+//
+#define IDR_APPLET                      131
+#define IDR_APPLET_PAGE1                131
+#define IDS_APPLET_DESCRIPTION          132
+#define IDR_APPLET_PAGE2                132
+#define IDR_SECRET                      133
+#define IDR_APPLET_PAGE3                134
+#define IDR_APPLET_PAGE4                135
+#define IDR_APPLET_PAGE5                136
+#define IDI_FAILURE                     140
+#define IDI_SUCCESS                     141
+#define IDI_ENERGY_SAVER				142
+#define IDR_ADD_BROWSE_DOMAIN           143
+#define IDR_POWER_MANAGEMENT_WARNING	144
+#define IDS_REINSTALL					145
+#define IDS_REINSTALL_CAPTION			146
+#define IDS_APPLET_NAME					147
+#define IDS_APPLET_TOOLTIP				148
+#define IDC_HOSTNAME                    1000
+#define IDC_USERNAME					1001
+#define IDC_PASSWORD					1002
+#define IDC_ADVERTISE_SERVICES			1003
+#define IDC_BUTTON1                     1004
+#define IDC_COMBO1                      1005
+#define IDC_CHECK1                      1006
+#define IDC_COMBO2                      1007
+#define IDC_EDIT2                       1008
+#define IDC_SECRET                      1009
+#define IDC_COMBO3                      1010
+#define IDC_FAILURE                     1011
+#define IDC_SUCCESS                     1012
+#define IDC_SECRET_NAME                 1013
+#define IDC_NAME                        1014
+#define IDC_KEY                         1015
+#define IDC_LIST1                       1016
+#define IDC_BROWSE_LIST                 1017
+#define IDC_BUTTON2                     1018
+#define IDC_REMOVE_BROWSE_DOMAIN        1019
+#define IDC_ADD_BROWSE_DOMAIN           1020
+#define IDC_POWER_MANAGEMENT            1021
+#define IDC_ADVERTISE_SMB	            1022
+#define IDC_ENERGY_SAVER				1023
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        149
+#define _APS_NEXT_COMMAND_VALUE         32771
+#define _APS_NEXT_CONTROL_VALUE         1024
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff --git a/mDNSWindows/ControlPanel/stdafx.cpp b/mDNSWindows/ControlPanel/stdafx.cpp
new file mode 100755
index 0000000..e05ec3d
--- /dev/null
+++ b/mDNSWindows/ControlPanel/stdafx.cpp
@@ -0,0 +1,20 @@
+/* -*- 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 "stdafx.h"
+
+
diff --git a/mDNSWindows/ControlPanel/stdafx.h b/mDNSWindows/ControlPanel/stdafx.h
new file mode 100755
index 0000000..246752e
--- /dev/null
+++ b/mDNSWindows/ControlPanel/stdafx.h
@@ -0,0 +1,64 @@
+/* -*- 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.
+ */
+
+#pragma once
+
+#ifndef VC_EXTRALEAN
+#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers
+#endif
+
+// Modify the following defines if you have to target a platform prior to the ones specified below.
+// Refer to MSDN for the latest info on corresponding values for different platforms.
+#ifndef WINVER				// Allow use of features specific to Windows 95 and Windows NT 4 or later.
+#define WINVER 0x0400		// Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
+#endif
+
+#ifndef _WIN32_WINNT		// Allow use of features specific to Windows NT 4 or later.
+#define _WIN32_WINNT 0x0400	// Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
+#endif						
+
+#ifndef _WIN32_WINDOWS		// Allow use of features specific to Windows 98 or later.
+#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
+#endif
+
+// Step 3: We want to see one image, but not a tile
+#ifndef _WIN32_IE			// Allow use of features specific to IE 4.0 or later.
+#define _WIN32_IE 0x0500	// Change this to the appropriate value to target IE 5.0 or later.
+#endif
+
+#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS	// some CString constructors will be explicit
+
+// turns off MFC's hiding of some common and often safely ignored warning messages
+#define _AFX_ALL_WARNINGS
+
+#if !defined(_WSPIAPI_COUNTOF)
+#	define _WSPIAPI_COUNTOF(_Array) (sizeof(_Array) / sizeof(_Array[0]))
+#endif
+
+#include <afxwin.h>         // MFC core and standard components
+#include <afxext.h>         // MFC extensions
+#include <afxdisp.h>        // MFC Automation classes
+
+#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h>			// MFC support for Windows Common Controls
+#endif // _AFX_NO_AFXCMN_SUPPORT
+#include <afxdlgs.h>
+
+#include <cpl.h>            // Control Panel Applet functions and defines
+
+#include <afxtempl.h>       // MFC Template support
diff --git a/mDNSWindows/DLL.NET/AssemblyInfo.cpp b/mDNSWindows/DLL.NET/AssemblyInfo.cpp
new file mode 100755
index 0000000..40f0b5d
--- /dev/null
+++ b/mDNSWindows/DLL.NET/AssemblyInfo.cpp
@@ -0,0 +1,84 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2003-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 "stdafx.h"
+#include "WinVersRes.h"
+
+using namespace System;
+using namespace System::Reflection;
+using namespace System::Runtime::CompilerServices;
+using namespace System::Runtime::InteropServices;
+using namespace System::Security::Permissions;
+
+//
+// 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:AssemblyTitleAttribute("dnssd.NET")];
+[assembly:AssemblyDescriptionAttribute(".NET wrapper for DNS-SD services")];
+[assembly:AssemblyConfigurationAttribute("")];
+[assembly:AssemblyCompanyAttribute("Apple Inc.")];
+[assembly:AssemblyProductAttribute("")];
+[assembly:AssemblyCopyrightAttribute("Apple Inc.")];
+[assembly:AssemblyTrademarkAttribute("")];
+[assembly:AssemblyCultureAttribute("")];		
+
+//
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the value or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+
+[assembly:AssemblyVersionAttribute(MASTER_PROD_VERS_STR2)];
+
+//
+// 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 directory.
+//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+//       documentation for more information on this.
+//
+[assembly:AssemblyDelaySignAttribute(false)];
+[assembly:AssemblyKeyFileAttribute("dnssd_NET.snk")];
+[assembly:AssemblyKeyNameAttribute("")];
+
+[assembly:ComVisible(false)];
+[assembly:CLSCompliantAttribute(true)];
+[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)];
diff --git a/mDNSWindows/DLL.NET/PString.h b/mDNSWindows/DLL.NET/PString.h
new file mode 100755
index 0000000..0249c05
--- /dev/null
+++ b/mDNSWindows/DLL.NET/PString.h
@@ -0,0 +1,70 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2003-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.
+ */
+    
+#pragma once
+
+using namespace System;
+using namespace System::Text;
+
+namespace Apple
+{
+	__gc class PString
+	{
+	public:
+
+		PString(String* string)
+		{
+			if (string != NULL)
+			{
+				Byte unicodeBytes[] = Encoding::Unicode->GetBytes(string);
+				Byte utf8Bytes[] = Encoding::Convert(Encoding::Unicode, Encoding::UTF8, unicodeBytes);
+				m_p = Marshal::AllocHGlobal(utf8Bytes->Length + 1);
+
+				Byte __pin * p = &utf8Bytes[0];
+				char * hBytes = static_cast<char*>(m_p.ToPointer());
+				memcpy(hBytes, p, utf8Bytes->Length);
+				hBytes[utf8Bytes->Length] = '\0';
+			}
+			else
+			{
+				m_p = NULL;
+			}
+		}
+
+		~PString()
+		{
+			Marshal::FreeHGlobal(m_p);
+		}
+
+		const char*
+		c_str()
+		{
+			if (m_p != NULL)
+			{
+				return static_cast<const char*>(m_p.ToPointer());
+			}
+			else
+			{
+				return NULL;
+			}
+		}
+		
+	protected:
+
+		IntPtr m_p;
+	};
+}
diff --git a/mDNSWindows/DLL.NET/Stdafx.cpp b/mDNSWindows/DLL.NET/Stdafx.cpp
new file mode 100755
index 0000000..ef03e21
--- /dev/null
+++ b/mDNSWindows/DLL.NET/Stdafx.cpp
@@ -0,0 +1,22 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2003-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.
+ */
+    
+// stdafx.cpp : source file that includes just the standard includes
+// dotNET.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
diff --git a/mDNSWindows/DLL.NET/Stdafx.h b/mDNSWindows/DLL.NET/Stdafx.h
new file mode 100755
index 0000000..d2e5c1a
--- /dev/null
+++ b/mDNSWindows/DLL.NET/Stdafx.h
@@ -0,0 +1,33 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2003-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.
+ */
+    
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently,
+// but are changed infrequently
+
+#pragma once
+
+#if !defined(_WSPIAPI_COUNTOF)
+#	define _WSPIAPI_COUNTOF(_Array) (sizeof(_Array) / sizeof(_Array[0]))
+#endif
+
+#using <mscorlib.dll>
+#using <System.dll>
+
+struct _DNSServiceRef_t {};
+struct _DNSRecordRef_t {};
+
diff --git a/mDNSWindows/DLL.NET/dnssd_NET.cpp b/mDNSWindows/DLL.NET/dnssd_NET.cpp
new file mode 100755
index 0000000..3e22146
--- /dev/null
+++ b/mDNSWindows/DLL.NET/dnssd_NET.cpp
@@ -0,0 +1,1234 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2003-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.
+ */
+    
+// This is the main DLL file.
+
+#include "stdafx.h"
+
+#include "dnssd_NET.h"
+#include "DebugServices.h"
+#include "PString.h"
+
+
+using namespace System::Net::Sockets;
+using namespace System::Diagnostics;
+using namespace Apple;
+using namespace Apple::DNSSD;
+
+
+//===========================================================================================================================
+//	Constants
+//===========================================================================================================================
+
+#define	DEBUG_NAME	"[dnssd.NET] "
+
+//
+// ConvertToString
+//
+static String*
+ConvertToString(const char * utf8String)
+{
+	return __gc new String(utf8String, 0, strlen(utf8String), __gc new UTF8Encoding(true, true));
+}
+
+
+//
+// class ServiceRef
+//
+// ServiceRef serves as the base class for all DNSService operations.
+//
+// It manages the DNSServiceRef, and implements processing the
+// result
+//
+ServiceRef::ServiceRef(Object * callback)
+:
+	m_bDisposed(false),
+	m_callback(callback),
+	m_thread(NULL)
+{
+	m_impl = new ServiceRefImpl(this);
+}
+
+
+ServiceRef::~ServiceRef()
+{
+}
+
+
+//
+// StartThread
+//
+// Starts the main processing thread
+//
+void
+ServiceRef::StartThread()
+{
+	check( m_impl != NULL );
+
+	m_impl->SetupEvents();
+
+	m_thread		=	new Thread(new ThreadStart(this, &Apple::DNSSD::ServiceRef::ProcessingThread));
+	m_thread->Name	=	S"DNSService Thread";
+	m_thread->IsBackground = true;
+	
+	m_thread->Start();
+}
+
+
+//
+// ProcessingThread
+//
+// The Thread class can only invoke methods in MC++ types.  So we
+// make a ProcessingThread method that forwards to the impl
+//
+void
+ServiceRef::ProcessingThread()
+{
+	m_impl->ProcessingThread();
+}
+
+
+//
+// Dispose
+//
+// Calls impl-Dispose().  This ultimately will call DNSServiceRefDeallocate()
+//
+void
+ServiceRef::Dispose()
+{
+	check(m_impl != NULL);
+	check(m_bDisposed == false);
+
+	if (!m_bDisposed)
+	{
+		m_bDisposed = true;
+
+		//
+		// Call Dispose.  This won't call DNSServiceRefDeallocate()
+		// necessarily. It depends on what thread this is being
+		// called in.
+		//
+		m_impl->Dispose();
+		m_impl = NULL;
+
+		m_thread = NULL;
+
+		GC::SuppressFinalize(this);  
+	}
+}
+
+
+//
+// EnumerateDomainsDispatch
+//
+// Dispatch a reply to the delegate.
+//
+void
+ServiceRef::EnumerateDomainsDispatch
+						(
+						ServiceFlags	flags,
+						int				interfaceIndex,
+						ErrorCode		errorCode,
+						String		*	replyDomain
+						)
+{
+	if ((m_callback != NULL) && (m_impl != NULL))
+	{
+		DNSService::EnumerateDomainsReply * OnEnumerateDomainsReply = static_cast<DNSService::EnumerateDomainsReply*>(m_callback);
+		OnEnumerateDomainsReply(this, flags, interfaceIndex, errorCode, replyDomain);
+	}
+}
+
+
+//
+// RegisterDispatch
+//
+// Dispatch a reply to the delegate.
+//
+void
+ServiceRef::RegisterDispatch
+				(
+				ServiceFlags	flags,
+				ErrorCode		errorCode,
+ 				String		*	name,
+				String		*	regtype,
+				String		*	domain
+				)
+{
+	if ((m_callback != NULL) && (m_impl != NULL))
+	{
+		DNSService::RegisterReply * OnRegisterReply = static_cast<DNSService::RegisterReply*>(m_callback);
+		OnRegisterReply(this, flags, errorCode, name, regtype, domain);
+	}
+}
+
+
+//
+// BrowseDispatch
+//
+// Dispatch a reply to the delegate.
+//
+void
+ServiceRef::BrowseDispatch
+			(
+			ServiceFlags	flags,
+			int				interfaceIndex,
+			ErrorCode		errorCode,
+			String		*	serviceName,
+			String		*	regtype,
+			String		*	replyDomain
+			)
+{
+	if ((m_callback != NULL) && (m_impl != NULL))
+	{
+		DNSService::BrowseReply * OnBrowseReply = static_cast<DNSService::BrowseReply*>(m_callback);
+		OnBrowseReply(this, flags, interfaceIndex, errorCode, serviceName, regtype, replyDomain);
+	}
+}
+
+
+//
+// ResolveDispatch
+//
+// Dispatch a reply to the delegate.
+//
+void
+ServiceRef::ResolveDispatch
+			(
+			ServiceFlags	flags,
+			int				interfaceIndex,
+			ErrorCode		errorCode,
+			String		*	fullname,
+			String		*	hosttarget,
+			int				port,
+			Byte			txtRecord[]
+			)
+{
+	if ((m_callback != NULL) && (m_impl != NULL))
+	{
+		DNSService::ResolveReply * OnResolveReply = static_cast<DNSService::ResolveReply*>(m_callback);
+		OnResolveReply(this, flags, interfaceIndex, errorCode, fullname, hosttarget, port, txtRecord);
+	}
+}
+
+
+//
+// RegisterRecordDispatch
+//
+// Dispatch a reply to the delegate.
+//
+void
+ServiceRef::RegisterRecordDispatch
+				(
+				ServiceFlags	flags,
+				ErrorCode		errorCode,
+				RecordRef	*	record
+				)
+{
+	if ((m_callback != NULL) && (m_impl != NULL))
+	{
+		DNSService::RegisterRecordReply * OnRegisterRecordReply = static_cast<DNSService::RegisterRecordReply*>(m_callback);
+		OnRegisterRecordReply(this, flags, errorCode, record);
+	}
+}
+
+
+//
+// QueryRecordDispatch
+//
+// Dispatch a reply to the delegate.
+//
+void
+ServiceRef::QueryRecordDispatch
+					(
+					ServiceFlags	flags,
+					int				interfaceIndex,
+					ErrorCode		errorCode,
+					String		*	fullname,
+					int				rrtype,
+					int				rrclass,
+					Byte			rdata[],
+					int				ttl
+					)
+{
+	if ((m_callback != NULL) && (m_impl != NULL))
+	{
+		DNSService::QueryRecordReply * OnQueryRecordReply = static_cast<DNSService::QueryRecordReply*>(m_callback);
+		OnQueryRecordReply(this, flags, interfaceIndex, errorCode, fullname, rrtype, rrclass, rdata, ttl);
+	}
+}
+
+
+//
+// ServiceRefImpl::ServiceRefImpl()
+//
+// Constructs a new ServiceRefImpl.  We save the pointer to our enclosing
+// class in a gcroot handle.  This satisfies the garbage collector as
+// the outer class is a managed type
+//
+ServiceRef::ServiceRefImpl::ServiceRefImpl(ServiceRef * outer)
+:
+	m_socketEvent(NULL),
+	m_stopEvent(NULL),
+	m_disposed(false),
+	m_outer(outer),
+	m_ref(NULL)
+{
+	m_threadId = GetCurrentThreadId();
+}
+
+
+//
+// ServiceRefImpl::~ServiceRefImpl()
+//
+// Deallocate all resources associated with the ServiceRefImpl
+//
+ServiceRef::ServiceRefImpl::~ServiceRefImpl()
+{
+	if (m_socketEvent != NULL)
+	{
+		CloseHandle(m_socketEvent);
+		m_socketEvent = NULL;
+	}
+
+	if (m_stopEvent != NULL)
+	{
+		CloseHandle(m_stopEvent);
+		m_stopEvent = NULL;
+	}
+
+	if (m_ref != NULL)
+	{
+		DNSServiceRefDeallocate(m_ref);
+		m_ref = NULL;
+	}
+}
+
+
+//
+// ServiceRefImpl::SetupEvents()
+//
+// Setup the events necessary to manage multi-threaded dispatch
+// of DNSService Events
+//
+void
+ServiceRef::ServiceRefImpl::SetupEvents()
+{
+	check(m_ref != NULL);
+
+	m_socket		=	(SOCKET) DNSServiceRefSockFD(m_ref);
+	check(m_socket != INVALID_SOCKET);
+
+	m_socketEvent	=	CreateEvent(NULL, 0, 0, NULL);
+
+	if (m_socketEvent == NULL)
+	{
+		throw new DNSServiceException(Unknown);
+	}
+
+	int err = WSAEventSelect(m_socket, m_socketEvent, FD_READ|FD_CLOSE);
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(Unknown);
+	}
+
+	m_stopEvent = CreateEvent(NULL, 0, 0, NULL);
+
+	if (m_stopEvent == NULL)
+	{
+		throw new DNSServiceException(Unknown);
+	}
+}
+
+
+//
+// ServiceRefImpl::ProcessingThread()
+//
+// Wait for socket events on the DNSServiceRefSockFD().  Also wait
+// for stop events
+//
+void
+ServiceRef::ServiceRefImpl::ProcessingThread()
+{
+	check( m_socketEvent != NULL );
+	check( m_stopEvent != NULL );
+	check( m_ref != NULL );
+	
+	HANDLE handles[2];
+
+	handles[0] = m_socketEvent;
+	handles[1] = m_stopEvent;
+
+	while (m_disposed == false)
+	{
+		int ret = WaitForMultipleObjects(2, handles, FALSE, INFINITE);
+
+		//
+		// it's a socket event
+		//
+		if (ret == WAIT_OBJECT_0)
+		{
+			DNSServiceProcessResult(m_ref);
+		}
+		//
+		// else it's a stop event
+		//
+		else if (ret == WAIT_OBJECT_0 + 1)
+		{
+			break;
+		}
+		else
+		{
+			//
+			// unexpected wait result
+			//
+			dlog( kDebugLevelWarning, DEBUG_NAME "%s: unexpected wait result (result=0x%08X)\n", __ROUTINE__, ret );
+		}
+	}
+
+	delete this;
+}
+
+
+//
+// ServiceRefImpl::Dispose()
+//
+// Calls DNSServiceRefDeallocate()
+//
+void
+ServiceRef::ServiceRefImpl::Dispose()
+{
+	OSStatus	err;
+	BOOL		ok;
+
+	check(m_disposed == false);
+
+	m_disposed = true;
+
+	ok = SetEvent(m_stopEvent);
+	err = translate_errno( ok, (OSStatus) GetLastError(), kUnknownErr );
+	require_noerr( err, exit );
+
+exit:
+
+	return;
+}
+
+
+//
+// ServiceRefImpl::EnumerateDomainsCallback()
+//
+// This is the callback from dnssd.dll.  We pass this up to our outer, managed type
+//
+void DNSSD_API
+ServiceRef::ServiceRefImpl::EnumerateDomainsCallback
+											(
+											DNSServiceRef			sdRef,
+											DNSServiceFlags			flags,
+											uint32_t				interfaceIndex,
+											DNSServiceErrorType		errorCode,
+											const char			*	replyDomain,
+											void				*	context
+											)
+{
+	ServiceRef::ServiceRefImpl * self = static_cast<ServiceRef::ServiceRefImpl*>(context);
+
+	check( self != NULL );
+	check( self->m_outer != NULL );
+
+	if (self->m_disposed == false)
+	{
+		self->m_outer->EnumerateDomainsDispatch((ServiceFlags) flags, interfaceIndex, (ErrorCode) errorCode, ConvertToString(replyDomain));
+	}
+}
+
+
+//
+// ServiceRefImpl::RegisterCallback()
+//
+// This is the callback from dnssd.dll.  We pass this up to our outer, managed type
+//
+void DNSSD_API
+ServiceRef::ServiceRefImpl::RegisterCallback
+							(
+							DNSServiceRef			sdRef,
+							DNSServiceFlags			flags,
+							DNSServiceErrorType		errorCode,
+							const char			*	name,
+							const char			*	regtype,
+							const char			*	domain,
+							void				*	context
+							)
+{
+	ServiceRef::ServiceRefImpl * self = static_cast<ServiceRef::ServiceRefImpl*>(context);
+
+	check( self != NULL );
+	check( self->m_outer != NULL );
+	
+	if (self->m_disposed == false)
+	{
+		self->m_outer->RegisterDispatch((ServiceFlags) flags, (ErrorCode) errorCode, ConvertToString(name), ConvertToString(regtype), ConvertToString(domain));
+	}
+}
+
+
+//
+// ServiceRefImpl::BrowseCallback()
+//
+// This is the callback from dnssd.dll.  We pass this up to our outer, managed type
+//
+void DNSSD_API
+ServiceRef::ServiceRefImpl::BrowseCallback
+							(
+							DNSServiceRef			sdRef,
+   							DNSServiceFlags			flags,
+							uint32_t				interfaceIndex,
+							DNSServiceErrorType		errorCode,
+							const char			*	serviceName,
+							const char			*	regtype,
+							const char			*	replyDomain,
+							void				*	context
+							)
+{
+	ServiceRef::ServiceRefImpl * self = static_cast<ServiceRef::ServiceRefImpl*>(context);
+
+	check( self != NULL );
+	check( self->m_outer != NULL );
+	
+	if (self->m_disposed == false)
+	{
+		self->m_outer->BrowseDispatch((ServiceFlags) flags, interfaceIndex, (ErrorCode) errorCode, ConvertToString(serviceName), ConvertToString(regtype), ConvertToString(replyDomain));
+	}
+}
+
+
+//
+// ServiceRefImpl::ResolveCallback()
+//
+// This is the callback from dnssd.dll.  We pass this up to our outer, managed type
+//
+void DNSSD_API
+ServiceRef::ServiceRefImpl::ResolveCallback
+							(
+							DNSServiceRef			sdRef,
+							DNSServiceFlags			flags,
+							uint32_t				interfaceIndex,
+							DNSServiceErrorType		errorCode,
+							const char			*	fullname,
+							const char			*	hosttarget,
+							uint16_t				notAnIntPort,
+							uint16_t				txtLen,
+							const char			*	txtRecord,
+							void				*	context
+							)
+{
+	ServiceRef::ServiceRefImpl * self = static_cast<ServiceRef::ServiceRefImpl*>(context);
+
+	check( self != NULL );
+	check( self->m_outer != NULL );
+	
+	if (self->m_disposed == false)
+	{
+		Byte txtRecordBytes[];
+
+		txtRecordBytes = NULL;
+
+		if (txtLen > 0)
+		{
+			//
+			// copy raw memory into managed byte array
+			//
+			txtRecordBytes		=	new Byte[txtLen];
+			Byte __pin	*	p	=	&txtRecordBytes[0];
+			memcpy(p, txtRecord, txtLen);
+		}
+
+		self->m_outer->ResolveDispatch((ServiceFlags) flags, interfaceIndex, (ErrorCode) errorCode, ConvertToString(fullname), ConvertToString(hosttarget), ntohs(notAnIntPort), txtRecordBytes);
+	}	
+}
+
+
+//
+// ServiceRefImpl::RegisterRecordCallback()
+//
+// This is the callback from dnssd.dll.  We pass this up to our outer, managed type
+//
+void DNSSD_API
+ServiceRef::ServiceRefImpl::RegisterRecordCallback
+								(
+								DNSServiceRef		sdRef,
+								DNSRecordRef		rrRef,
+								DNSServiceFlags		flags,
+								DNSServiceErrorType	errorCode,
+								void			*	context
+								)
+{
+	ServiceRef::ServiceRefImpl * self = static_cast<ServiceRef::ServiceRefImpl*>(context);
+
+	check( self != NULL );
+	check( self->m_outer != NULL );
+	
+	if (self->m_disposed == false)
+	{
+		RecordRef * record = NULL;
+
+		if (errorCode == 0)
+		{
+			record = new RecordRef;
+
+			record->m_impl->m_ref = rrRef;
+		}
+
+		self->m_outer->RegisterRecordDispatch((ServiceFlags) flags, (ErrorCode) errorCode, record);
+	}
+}
+
+
+//
+// ServiceRefImpl::QueryRecordCallback()
+//
+// This is the callback from dnssd.dll.  We pass this up to our outer, managed type
+//
+void DNSSD_API
+ServiceRef::ServiceRefImpl::QueryRecordCallback
+								(
+								DNSServiceRef			DNSServiceRef,
+								DNSServiceFlags			flags,
+								uint32_t				interfaceIndex,
+								DNSServiceErrorType		errorCode,
+								const char			*	fullname,
+								uint16_t				rrtype,
+								uint16_t				rrclass,
+								uint16_t				rdlen,
+								const void			*	rdata,
+								uint32_t				ttl,
+								void				*	context
+								)
+{
+	ServiceRef::ServiceRefImpl * self = static_cast<ServiceRef::ServiceRefImpl*>(context);
+
+	check( self != NULL );
+	check( self->m_outer != NULL );
+	
+	if (self->m_disposed == false)
+	{
+		Byte rdataBytes[];
+
+		if (rdlen)
+		{
+			rdataBytes			=	new Byte[rdlen];
+			Byte __pin * p		=	&rdataBytes[0];
+			memcpy(p, rdata, rdlen);
+		}
+
+		self->m_outer->QueryRecordDispatch((ServiceFlags) flags, (int) interfaceIndex, (ErrorCode) errorCode, ConvertToString(fullname), rrtype, rrclass, rdataBytes, ttl);
+	}
+}
+
+
+/*
+ * EnumerateDomains()
+ *
+ * This maps to DNSServiceEnumerateDomains().  Returns an
+ * initialized ServiceRef on success, throws an exception
+ * on failure.
+ */
+ServiceRef*
+DNSService::EnumerateDomains
+		(
+		int							flags,
+		int							interfaceIndex,
+		EnumerateDomainsReply	*	callback
+		)
+{
+	ServiceRef * sdRef = new ServiceRef(callback);
+	int			 err;
+
+	err = DNSServiceEnumerateDomains(&sdRef->m_impl->m_ref, flags, interfaceIndex, ServiceRef::ServiceRefImpl::EnumerateDomainsCallback, sdRef->m_impl);
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(err);
+	}
+
+	sdRef->StartThread();
+
+	return sdRef;
+}
+
+
+/*
+ * Register()
+ *
+ * This maps to DNSServiceRegister().  Returns an
+ * initialized ServiceRef on success, throws an exception
+ * on failure.
+ */
+ServiceRef*
+DNSService::Register
+				(
+				int					flags,
+				int					interfaceIndex,
+				String			*	name,
+				String			*	regtype,
+				String			*	domain,
+				String			*	host,
+				int					port,
+				Byte				txtRecord[],
+				RegisterReply	*	callback
+				)
+{
+	ServiceRef	*	sdRef	=	new ServiceRef(callback);
+	PString		*	pName	=	new PString(name);
+	PString		*	pType	=	new PString(regtype);
+	PString		*	pDomain =	new PString(domain);
+	PString		*	pHost	=	new PString(host);
+	int				len		=	0;
+	Byte __pin	*	p		=	NULL;
+	void		*	v		=	NULL;
+
+	if ((txtRecord != NULL) && (txtRecord->Length > 0))
+	{
+		len		= txtRecord->Length;
+		p		= &txtRecord[0];
+		v		= (void*) p;
+	}
+
+	int err = DNSServiceRegister(&sdRef->m_impl->m_ref, flags, interfaceIndex, pName->c_str(), pType->c_str(), pDomain->c_str(), pHost->c_str(), htons(port), len, v, ServiceRef::ServiceRefImpl::RegisterCallback, sdRef->m_impl );
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(err);
+	}
+
+	sdRef->StartThread();
+
+	return sdRef;
+}
+
+
+/*
+ * AddRecord()
+ *
+ * This maps to DNSServiceAddRecord().  Returns an
+ * initialized ServiceRef on success, throws an exception
+ * on failure.
+ */
+RecordRef*
+DNSService::AddRecord
+				(
+				ServiceRef	*	sdRef,
+				int				flags,
+				int				rrtype,
+				Byte			rdata[],
+				int				ttl
+				)
+{
+	int				len		=	0;
+	Byte __pin	*	p		=	NULL;
+	void		*	v		=	NULL;
+
+	if ((rdata != NULL) && (rdata->Length > 0))
+	{
+		len = rdata->Length;
+		p	= &rdata[0];
+		v	= (void*) p;
+	}
+
+	RecordRef * record = new RecordRef;
+
+	int err = DNSServiceAddRecord(sdRef->m_impl->m_ref, &record->m_impl->m_ref, flags, rrtype, len, v, ttl);
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(err);
+	}
+
+	return record;
+}
+
+
+/*
+ * UpdateRecord()
+ *
+ * This maps to DNSServiceUpdateRecord().  Returns an
+ * initialized ServiceRef on success, throws an exception
+ * on failure.
+ */
+void
+DNSService::UpdateRecord
+				(
+				ServiceRef	*	sdRef,
+				RecordRef	*	record,
+				int				flags,
+				Byte			rdata[],
+				int				ttl
+				)
+{
+	int				len		=	0;
+	Byte __pin	*	p		=	NULL;
+	void		*	v		=	NULL;
+
+	if ((rdata != NULL) && (rdata->Length > 0))
+	{
+		len	= rdata->Length;
+		p	= &rdata[0];
+		v	= (void*) p;
+	}
+
+	int err = DNSServiceUpdateRecord(sdRef->m_impl->m_ref, record ? record->m_impl->m_ref : NULL, flags, len, v, ttl);
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(err);
+	}
+}
+
+
+/*
+ * RemoveRecord()
+ *
+ * This maps to DNSServiceRemoveRecord().  Returns an
+ * initialized ServiceRef on success, throws an exception
+ * on failure.
+ */
+void
+DNSService::RemoveRecord
+		(
+		ServiceRef	*	sdRef,
+		RecordRef	*	record,
+		int				flags
+		)
+{
+	int err = DNSServiceRemoveRecord(sdRef->m_impl->m_ref, record->m_impl->m_ref, flags);
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(err);
+	}
+}	
+
+
+/*
+ * Browse()
+ *
+ * This maps to DNSServiceBrowse().  Returns an
+ * initialized ServiceRef on success, throws an exception
+ * on failure.
+ */
+ServiceRef*
+DNSService::Browse
+	(
+	int				flags,
+	int				interfaceIndex,
+	String		*	regtype,
+	String		*	domain,
+	BrowseReply	*	callback
+	)
+{
+	ServiceRef	*	sdRef	= new ServiceRef(callback);
+	PString		*	pType	= new PString(regtype);
+	PString		*	pDomain	= new PString(domain);
+
+	int err = DNSServiceBrowse(&sdRef->m_impl->m_ref, flags, interfaceIndex, pType->c_str(), pDomain->c_str(),(DNSServiceBrowseReply) ServiceRef::ServiceRefImpl::BrowseCallback, sdRef->m_impl);
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(err);
+	}
+
+	sdRef->StartThread();
+
+	return sdRef;
+}
+
+
+/*
+ * Resolve()
+ *
+ * This maps to DNSServiceResolve().  Returns an
+ * initialized ServiceRef on success, throws an exception
+ * on failure.
+ */
+ServiceRef*
+DNSService::Resolve
+	(
+	int					flags,
+	int					interfaceIndex,
+	String			*	name,
+	String			*	regtype,
+	String			*	domain,
+	ResolveReply	*	callback	
+	)
+{
+	ServiceRef	*	sdRef	= new ServiceRef(callback);
+	PString		*	pName	= new PString(name);
+	PString		*	pType	= new PString(regtype);
+	PString		*	pDomain	= new PString(domain);
+
+	int err = DNSServiceResolve(&sdRef->m_impl->m_ref, flags, interfaceIndex, pName->c_str(), pType->c_str(), pDomain->c_str(),(DNSServiceResolveReply) ServiceRef::ServiceRefImpl::ResolveCallback, sdRef->m_impl);
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(err);
+	}
+
+	sdRef->StartThread();
+
+	return sdRef;
+}
+
+
+/*
+ * CreateConnection()
+ *
+ * This maps to DNSServiceCreateConnection().  Returns an
+ * initialized ServiceRef on success, throws an exception
+ * on failure.
+ */
+ServiceRef*
+DNSService::CreateConnection
+			(
+			RegisterRecordReply * callback
+			)
+{
+	ServiceRef * sdRef = new ServiceRef(callback);
+
+	int err = DNSServiceCreateConnection(&sdRef->m_impl->m_ref);
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(err);
+	}
+
+	sdRef->StartThread();
+
+	return sdRef;
+}
+
+
+/*
+ * RegisterRecord()
+ *
+ * This maps to DNSServiceRegisterRecord().  Returns an
+ * initialized ServiceRef on success, throws an exception
+ * on failure.
+ */
+
+RecordRef*
+DNSService::RegisterRecord
+			(
+			ServiceRef			*	sdRef,
+			ServiceFlags			flags,
+			int						interfaceIndex,
+			String				*	fullname,
+			int						rrtype,
+			int						rrclass,
+			Byte					rdata[],
+			int						ttl
+			)
+{
+	RecordRef	*	record	= new RecordRef;
+	int				len		= 0;
+	Byte __pin	*	p		= NULL;
+	void		*	v		= NULL;
+
+	PString * pFullname = new PString(fullname);
+
+	if ((rdata != NULL) && (rdata->Length > 0))
+	{
+		len		= rdata->Length;
+		p		= &rdata[0];
+		v		= (void*) p;
+	}
+
+	int err = DNSServiceRegisterRecord(sdRef->m_impl->m_ref, &record->m_impl->m_ref, flags, interfaceIndex, pFullname->c_str(), rrtype, rrclass, len, v, ttl, (DNSServiceRegisterRecordReply) ServiceRef::ServiceRefImpl::RegisterRecordCallback, sdRef->m_impl);
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(err);
+	}
+
+	return record;
+}
+
+/*
+ * QueryRecord()
+ *
+ * This maps to DNSServiceQueryRecord().  Returns an
+ * initialized ServiceRef on success, throws an exception
+ * on failure.
+ */
+ServiceRef*
+DNSService::QueryRecord
+		(
+		ServiceFlags			flags,
+		int						interfaceIndex,
+		String				*	fullname,
+		int						rrtype,
+		int						rrclass,
+		QueryRecordReply	*	callback
+		)
+{
+	ServiceRef	*	sdRef		= new ServiceRef(callback);
+	PString		*	pFullname	= new PString(fullname);
+
+	int err = DNSServiceQueryRecord(&sdRef->m_impl->m_ref, flags, interfaceIndex, pFullname->c_str(), rrtype, rrclass, (DNSServiceQueryRecordReply) ServiceRef::ServiceRefImpl::QueryRecordCallback, sdRef->m_impl);
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(err);
+	}
+
+	sdRef->StartThread();
+
+	return sdRef;
+}
+
+
+/*
+ * ReconfirmRecord()
+ *
+ * This maps to DNSServiceReconfirmRecord().  Returns an
+ * initialized ServiceRef on success, throws an exception
+ * on failure.
+ */
+void
+DNSService::ReconfirmRecord
+		(
+		ServiceFlags	flags,
+		int				interfaceIndex,
+		String		*	fullname,
+		int				rrtype,
+		int				rrclass,
+		Byte			rdata[]
+		)
+{
+	int				len	= 0;
+	Byte __pin	*	p	= NULL;
+	void		*	v	= NULL;
+
+	PString * pFullname = new PString(fullname);
+
+	if ((rdata != NULL) && (rdata->Length > 0))
+	{
+		len	= rdata->Length;
+		p	= &rdata[0];
+		v	= (void*) p;
+	}
+
+	DNSServiceReconfirmRecord(flags, interfaceIndex, pFullname->c_str(), rrtype, rrclass, len, v);
+}
+
+
+void
+TextRecord::SetValue
+		(
+		String	*	key,
+		Byte		value[]            /* may be NULL */
+		)
+{
+	PString			*	pKey = new PString(key);
+	int					len		=	0;
+	Byte __pin		*	p		=	NULL;
+	void			*	v		=	NULL;
+	DNSServiceErrorType	err;
+
+	if (value && (value->Length > 0))
+	{
+		len	=	value->Length;
+		p	=	&value[0];
+		v	=	(void*) p;
+	}
+
+	err = TXTRecordSetValue(&m_impl->m_ref, pKey->c_str(), len, v);
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(err);
+	}
+}
+
+
+void
+TextRecord::RemoveValue
+		(
+		String	*	key
+		)
+{
+	PString			*	pKey = new PString(key);
+	DNSServiceErrorType	err;
+
+	err = TXTRecordRemoveValue(&m_impl->m_ref, pKey->c_str());
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(err);
+	}
+}
+
+
+int
+TextRecord::GetLength
+		(
+		)
+{
+	return TXTRecordGetLength(&m_impl->m_ref);
+}
+
+
+Byte
+TextRecord::GetBytes
+		(
+		) __gc[]
+{
+	const void	*	noGCBytes = NULL;
+	Byte			gcBytes[] = NULL;		
+
+	noGCBytes		=	TXTRecordGetBytesPtr(&m_impl->m_ref);
+	int			len	=	GetLength();
+
+	if (noGCBytes && len)
+	{
+		gcBytes				=	new Byte[len];
+		Byte __pin	*	p	=	&gcBytes[0];
+		memcpy(p, noGCBytes, len);
+	}
+
+	return gcBytes;
+}
+
+
+bool
+TextRecord::ContainsKey
+		(
+		Byte		txtRecord[],
+		String	*	key
+		)
+{
+	PString		*	pKey	= new PString(key);
+	Byte __pin	*	p		= &txtRecord[0];
+	
+	return (TXTRecordContainsKey(txtRecord->Length, p, pKey->c_str()) > 0) ? true : false;
+}
+
+
+Byte
+TextRecord::GetValueBytes
+		(
+		Byte		txtRecord[],
+		String	*	key
+		) __gc[]
+{
+	uint8_t			valueLen;
+	Byte			ret[]	= NULL;
+	PString		*	pKey	= new PString(key);
+	Byte __pin	*	p1		= &txtRecord[0];
+	const void	*	v;
+
+	v = TXTRecordGetValuePtr(txtRecord->Length, p1, pKey->c_str(), &valueLen);
+
+	if (v != NULL)
+	{
+		ret					= new Byte[valueLen];
+		Byte __pin	*	p2	= &ret[0];
+
+		memcpy(p2, v, valueLen);
+	}
+
+	return ret;
+}
+
+
+int
+TextRecord::GetCount
+		(
+		Byte txtRecord[]
+		)
+{
+	Byte __pin	*	p	= &txtRecord[0];
+
+	return TXTRecordGetCount(txtRecord->Length, p);
+}
+
+
+Byte
+TextRecord::GetItemAtIndex
+		(
+		Byte				txtRecord[],
+		int					index,
+		[Out] String	**	key
+		) __gc[]
+{
+	char				keyBuf[255];
+	uint8_t				keyBufLen = 255;
+	uint8_t				valueLen;
+	void			*	value;
+	Byte				ret[]	= NULL;
+	DNSServiceErrorType	err;
+	Byte __pin		*	p1		= &txtRecord[0];
+	
+
+	err = TXTRecordGetItemAtIndex(txtRecord->Length, p1, index, keyBufLen, keyBuf, &valueLen, (const void**) &value);
+
+	if (err != 0)
+	{
+		throw new DNSServiceException(err);
+	}
+
+	*key = ConvertToString(keyBuf);
+
+	if (valueLen)
+	{
+		ret					= new Byte[valueLen];
+		Byte __pin	*	p2	= &ret[0];
+
+		memcpy(p2, value, valueLen);
+	}
+
+	return ret;
+}
+
+
+//
+// DNSServiceException::DNSServiceException()
+//
+// Constructs an exception with an error code
+//
+DNSServiceException::DNSServiceException
+				(
+				int _err
+				)
+:
+	err(_err)
+{
+}
+
+
+//
+// This version of the constructor is useful for instances in which
+// an inner exception is thrown, caught, and then a new exception
+// is thrown in it's place
+//
+DNSServiceException::DNSServiceException
+				(	
+				String				*	message,
+				System::Exception	*	innerException
+				)
+{
+}
diff --git a/mDNSWindows/DLL.NET/dnssd_NET.h b/mDNSWindows/DLL.NET/dnssd_NET.h
new file mode 100755
index 0000000..3e0196d
--- /dev/null
+++ b/mDNSWindows/DLL.NET/dnssd_NET.h
@@ -0,0 +1,1392 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2003-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.
+
+ * 
+ * NOTE:
+ * 
+ * These .Net APIs are a work in progress, currently being discussed and refined.
+ * If you plan to build an application based on these APIs, you may wish to
+ * statically link this code into your application, or otherwise distribute
+ * the DLL so that it installs into the same folder as your application
+ * (not into any common system area where it might interfere with other
+ * applications using a future completed version of these APIs).
+ * If you plan to do this, please be sure to inform us by sending email
+ * to bonjour@apple.com to let us know.
+ * You may want to discuss what you're doing on the Bonjour mailing
+ * list to see if others in similar positions have any suggestions for you:
+ * 
+ * <http://lists.apple.com/bonjour-dev/>
+ * 
+ */
+    
+#pragma once
+
+#include <dns_sd.h>
+#include <vcclr.h>
+#include <memory>
+#include <winsock2.h>
+
+using namespace System;
+using namespace System::Net;
+using namespace System::Runtime::InteropServices;
+using namespace System::Threading;
+using namespace System::Collections;
+
+
+namespace Apple
+{
+	namespace DNSSD
+	{
+		public __gc class ServiceRef;
+
+		public __value enum ServiceFlags : int
+		{
+			MoreComing			=	1,
+			/* MoreComing indicates to a callback that at least one more result is
+				* queued and will be delivered following immediately after this one.
+				* Applications should not update their UI to display browse
+				* results when the MoreComing flag is set, because this would
+				* result in a great deal of ugly flickering on the screen.
+				* Applications should instead wait until until MoreComing is not set,
+				* and then update their UI.
+				* When MoreComing is not set, that doesn't mean there will be no more
+				* answers EVER, just that there are no more answers immediately
+				* available right now at this instant. If more answers become available
+				* in the future they will be delivered as usual.
+				*/
+
+			Add					=	2,
+			Default				=	4,
+			/* Flags for domain enumeration and browse/query reply callbacks.
+				* "Default" applies only to enumeration and is only valid in
+				* conjuction with "Add".  An enumeration callback with the "Add"
+				* flag NOT set indicates a "Remove", i.e. the domain is no longer
+				* valid.
+				*/
+
+			NoAutoRename		=	8,
+			/* Flag for specifying renaming behavior on name conflict when registering
+				* non-shared records. By default, name conflicts are automatically handled
+				* by renaming the service.  NoAutoRename overrides this behavior - with this
+				* flag set, name conflicts will result in a callback.  The NoAutorename flag
+				* is only valid if a name is explicitly specified when registering a service
+				* (i.e. the default name is not used.)
+				*/
+
+			Shared				=	16,
+			Unique				=	32,
+			/* Flag for registering individual records on a connected
+				* DNSServiceRef.  Shared indicates that there may be multiple records
+				* with this name on the network (e.g. PTR records).  Unique indicates that
+	the
+				* record's name is to be unique on the network (e.g. SRV records).
+				*/
+
+			BrowseDomains		=	64,
+			RegistrationDomains	=	128,
+			/* Flags for specifying domain enumeration type in DNSServiceEnumerateDomain
+	s.
+				* BrowseDomains enumerates domains recommended for browsing, RegistrationDo
+	mains
+				* enumerates domains recommended for registration.
+				*/
+		};
+
+
+		public __value enum ErrorCode : int
+		{
+			NoError				=	0,
+			Unknown				=	-65537,
+			NoSuchName			=	-65538,
+			NoMemory			=	-65539,
+			BadParam			=	-65540,
+			BadReference		=	-65541,
+			BadState			=	-65542,
+			BadFlags			=	-65543,
+			Unsupported			=	-65544,
+			AlreadyRegistered	=	-65547,
+			NameConflict		=	-65548,
+			Invalid				=	-65549,
+			Incompatible		=	-65551,
+			BadinterfaceIndex	=	-65552
+
+			/*
+				* mDNS Error codes are in the range
+				* FFFE FF00 (-65792) to FFFE FFFF (-65537)
+				*/
+		};
+
+		public __gc class DNSServiceException
+		:
+			public Exception
+		{
+		public:
+
+			DNSServiceException
+				(
+				int err
+				);
+
+			DNSServiceException
+				(	
+				String				*	message,
+				System::Exception	*	innerException
+				);
+
+			int err;
+		};
+
+
+		/*
+		* class RecordRef
+		*
+		* This is a thin MC++ class facade on top of a DNSRecordRef
+		*/
+		public __gc class RecordRef
+		{
+		public:
+
+			RecordRef()
+			{
+				m_impl = new RecordRefImpl;
+				m_impl->m_ref = NULL;
+			}
+
+			~RecordRef()
+			{
+				delete m_impl;
+			}
+
+			__nogc class RecordRefImpl
+			{
+			public:
+
+				DNSRecordRef m_ref;
+			};
+
+			RecordRefImpl * m_impl;
+		};			
+
+
+		/*
+		* class ServiceRef
+		*
+		* This is a thin MC++ class facade on top of a DNSServiceRef
+		*/
+		public __gc class ServiceRef : public IDisposable
+		{
+		public:
+
+			ServiceRef(Object * callback);
+
+			~ServiceRef();
+
+			/*
+			* This does an underlying DNSServiceRefDeallocate().  After
+			* calling Dispose, the ServiceRef is no longer usable.
+			*/
+			void
+			Dispose();
+
+			/*
+			* Internal - Dispatch an EnumerateDomains callback
+			*/
+			void
+			EnumerateDomainsDispatch
+				(
+				ServiceFlags	flags,
+				int				interfaceIndex,
+				ErrorCode		errorCode,
+				String		*	replyDomain
+				);
+
+			/*
+			* Internal - Dispatch a Register callback
+			*/
+			void
+			RegisterDispatch
+				(
+				ServiceFlags	flags,
+				ErrorCode		errorCode,
+ 				String		*	name,
+				String		*	regtype,
+				String		*	domain
+				);
+
+			/*
+			* Internal - Dispatch a Browse callback
+			*/
+			void
+			BrowseDispatch
+				(
+				ServiceFlags	flags,
+				int				interfaceIndex,
+				ErrorCode		errorCode,
+				String		*	serviceName,
+				String		*	regtype,
+				String		*	replyDomain
+				);
+
+			/*
+			* Internal - Dispatch a Resolve callback
+			*/
+			void
+			ResolveDispatch
+				(
+				ServiceFlags	flags,
+				int				interfaceIndex,
+				ErrorCode		errorCode,
+				String		*	fullname,
+				String		*	hosttarget,
+				int				port,
+				Byte			txtRecord[]
+				);
+			
+			/*
+			* Internal - Dispatch a RegisterRecord callback
+			*/
+			void
+			RegisterRecordDispatch
+				(
+				ServiceFlags	flags,
+				ErrorCode		errorCode,
+				RecordRef	*	record
+				);
+
+			/*
+			* Internal - Dispatch a QueryRecord callback
+			*/
+			void
+			QueryRecordDispatch
+				(
+				ServiceFlags	flags,
+				int				interfaceIndex,
+				ErrorCode		errorCode,
+				String		*	fullname,
+				int				rrtype,
+				int				rrclass,
+				Byte			rdata[],
+				int				ttl
+				);
+
+			/*
+			* Internal - A non managed class to wrap a DNSServiceRef
+			*/
+			__nogc class ServiceRefImpl
+			{
+			public:
+
+				ServiceRefImpl
+					(
+					ServiceRef * outer
+					);
+
+				~ServiceRefImpl();
+
+				/*
+				* Sets up events for threaded operation
+				*/
+				void
+				SetupEvents();
+
+				/*
+				* Main processing thread
+				*/
+				void
+				ProcessingThread();
+
+				/*
+				* Calls DNSServiceRefDeallocate()
+				*/
+				void
+				Dispose();
+
+				/*
+				* Called from dnssd.dll
+				*/
+				static void DNSSD_API
+				EnumerateDomainsCallback
+					(
+					DNSServiceRef			sdRef,
+					DNSServiceFlags			flags,
+					uint32_t				interfaceIndex,
+					DNSServiceErrorType		errorCode,
+					const char			*	replyDomain,
+					void				*	context
+					);
+
+				static void DNSSD_API
+				RegisterCallback
+					(
+					DNSServiceRef			ref,
+					DNSServiceFlags			flags,
+					DNSServiceErrorType		errorCode,
+ 					const char			*	name,
+					const char			*	regtype,
+					const char			*	domain,
+					void				*	context
+					);
+
+				static void DNSSD_API
+				BrowseCallback
+					(
+					DNSServiceRef			sdRef,
+   					DNSServiceFlags			flags,
+					uint32_t				interfaceIndex,
+					DNSServiceErrorType		errorCode,
+					const char			*	serviceName,
+					const char			*	regtype,
+					const char			*	replyDomain,
+					void				*	context
+					);
+
+				static void DNSSD_API
+				ResolveCallback
+					(
+					DNSServiceRef			sdRef,
+					DNSServiceFlags			flags,
+					uint32_t				interfaceIndex,
+					DNSServiceErrorType		errorCode,
+					const char			*	fullname,
+					const char			*	hosttarget,
+					uint16_t				notAnIntPort,
+					uint16_t				txtLen,
+					const char			*	txtRecord,
+					void				*	context
+					);
+
+				static void DNSSD_API
+				RegisterRecordCallback
+					( 
+					DNSServiceRef		sdRef,
+					DNSRecordRef		RecordRef,
+					DNSServiceFlags		flags,
+					DNSServiceErrorType	errorCode,
+					void			*	context
+					);
+
+				static void DNSSD_API
+				QueryRecordCallback
+					(
+					DNSServiceRef			DNSServiceRef,
+					DNSServiceFlags			flags,
+					uint32_t				interfaceIndex,
+					DNSServiceErrorType		errorCode,
+					const char			*	fullname,
+					uint16_t				rrtype,
+					uint16_t				rrclass,
+					uint16_t				rdlen,
+					const void			*	rdata,
+					uint32_t				ttl,
+					void				*	context
+					);
+
+				SOCKET				m_socket;
+				HANDLE				m_socketEvent;
+				HANDLE				m_stopEvent;
+				DWORD				m_threadId;
+				bool				m_disposed;
+				DNSServiceRef		m_ref;
+				gcroot<ServiceRef*> m_outer;
+			};
+
+			void
+			StartThread();
+
+			void
+			ProcessingThread();
+
+			bool				m_bDisposed;
+			Object			*	m_callback;
+			Thread			*	m_thread;
+			ServiceRefImpl	*	m_impl;
+		};
+			
+		/*********************************************************************************************
+		*
+		*   TXT Record Construction Functions
+		*
+		*********************************************************************************************/
+
+		/*
+		* A typical calling sequence for TXT record construction is something like:
+		*
+		* DNSService.TextRecord tr = new DNSService.TextRecord(1024);
+		* tr.SetValue();
+		* tr.SetValue();
+		* tr.SetValue();
+		* ...
+		* DNSServiceRegister( ... tr.GetLength(), tr.GetBytes() ... );
+		*/
+
+
+		/* TextRecord
+		*
+		* Opaque internal data type.
+		* Note: Represents a DNS-SD TXT record.
+		*/
+
+
+		/* TextRecord::TextRecord()
+		*
+		* Creates a new empty TextRecord .
+		*
+		*/
+
+		public __gc class TextRecord
+		{
+		public:
+
+			TextRecord()
+			{
+				m_impl = new TextRecordImpl();
+				TXTRecordCreate(&m_impl->m_ref, 0, NULL);
+			}
+
+			~TextRecord()
+			{
+				TXTRecordDeallocate(&m_impl->m_ref);
+				delete m_impl;
+			}
+
+			__nogc class TextRecordImpl
+			{
+			public:
+
+				TXTRecordRef m_ref;
+			};
+
+			TextRecordImpl * m_impl;
+
+
+			/* SetValue()
+			*
+			* Adds a key (optionally with value) to a TextRecord. If the "key" already
+			* exists in the TextRecord, then the current value will be replaced with
+			* the new value.
+			* Keys may exist in four states with respect to a given TXT record:
+			*  - Absent (key does not appear at all)
+			*  - Present with no value ("key" appears alone)
+			*  - Present with empty value ("key=" appears in TXT record)
+			*  - Present with non-empty value ("key=value" appears in TXT record)
+			* For more details refer to "Data Syntax for DNS-SD TXT Records" in
+			* <http://files.dns-sd.org/draft-cheshire-dnsext-dns-sd.txt>
+			*
+			* key:             A null-terminated string which only contains printable ASCII
+			*                  values (0x20-0x7E), excluding '=' (0x3D). Keys should be
+			*                  14 characters or less (not counting the terminating null).
+			*
+			* value:           Any binary value. For values that represent
+			*                  textual data, UTF-8 is STRONGLY recommended.
+			*                  For values that represent textual data, valueSize
+			*                  should NOT include the terminating null (if any)
+			*                  at the end of the string.
+			*                  If NULL, then "key" will be added with no value.
+			*                  If non-NULL but valueSize is zero, then "key=" will be
+			*                  added with empty value.
+			*
+			* exceptions:      Throws kDNSServiceErr_Invalid if the "key" string contains
+			*                  illegal characters.
+			*                  Throws kDNSServiceErr_NoMemory if adding this key would
+			*                  exceed the available storage.
+			*/
+
+			void
+			SetValue
+				(
+				String	*	key,
+				Byte		value[]  /* may be NULL */
+				);
+
+
+			/* RemoveValue()
+			*
+			* Removes a key from a TextRecord.  The "key" must be an
+			* ASCII string which exists in the TextRecord.
+			*
+			* key:             A key name which exists in the TextRecord.
+			*
+			* exceptions:      Throws kDNSServiceErr_NoSuchKey if the "key" does not
+			*                  exist in the TextRecord.
+			*
+			*/
+
+			void
+			RemoveValue
+				(
+				String	*	key
+				);
+
+
+			/* GetLength()
+			*
+			* Allows you to determine the length of the raw bytes within a TextRecord.
+			*
+			* return value :     Returns the size of the raw bytes inside a TextRecord
+			*                  which you can pass directly to DNSServiceRegister() or
+			*                  to DNSServiceUpdateRecord().
+			*                  Returns 0 if the TextRecord is empty.
+			*
+			*/
+
+			int
+			GetLength
+				(
+				);
+
+
+			/* GetBytes()
+			*
+			* Allows you to retrieve a pointer to the raw bytes within a TextRecord.
+			*
+			* return value:    Returns a pointer to the bytes inside the TextRecord
+			*                  which you can pass directly to DNSServiceRegister() or
+			*                  to DNSServiceUpdateRecord().
+			*
+			*/
+
+			Byte
+			GetBytes
+				(
+				) __gc[];
+
+
+			/*********************************************************************************************
+			*
+			*   TXT Record Parsing Functions
+			*
+			*********************************************************************************************/
+
+			/*
+			* A typical calling sequence for TXT record parsing is something like:
+			*
+			* Receive TXT record data in DNSServiceResolve() callback
+			* if (TXTRecordContainsKey(txtLen, txtRecord, "key")) then do something
+			* val1ptr = DNSService.TextService.GetValue(txtRecord, "key1", &len1);
+			* val2ptr = DNSService.TextService.GetValue(txtRecord, "key2", &len2);
+			* ...
+			* return;
+			*
+			*/
+
+			/* ContainsKey()
+			*
+			* Allows you to determine if a given TXT Record contains a specified key.
+			*
+			* txtRecord:       Pointer to the received TXT Record bytes.
+			*
+			* key:             A null-terminated ASCII string containing the key name.
+			*
+			* return value:    Returns 1 if the TXT Record contains the specified key.
+			*                  Otherwise, it returns 0.
+			*
+			*/
+
+			static public bool
+			ContainsKey
+				(
+				Byte		txtRecord[],
+				String	*	key
+				);
+
+
+			/* GetValueBytes()
+			*
+			* Allows you to retrieve the value for a given key from a TXT Record.
+			*
+			* txtRecord:       Pointer to the received TXT Record bytes.
+			*
+			* key:             A null-terminated ASCII string containing the key name.
+			*
+			* return value:    Returns NULL if the key does not exist in this TXT record,
+			*                  or exists with no value (to differentiate between
+			*                  these two cases use ContainsKey()).
+			*                  Returns byte array 
+			*                  if the key exists with empty or non-empty value.
+			*                  For empty value, length of byte array will be zero.
+			*                  For non-empty value, it will be the length of value data.
+			*/
+
+			static public Byte
+			GetValueBytes
+				(
+				Byte		txtRecord[],
+				String	*	key
+				) __gc[];
+
+
+			/* GetCount()
+			*
+			* Returns the number of keys stored in the TXT Record.  The count
+			* can be used with TXTRecordGetItemAtIndex() to iterate through the keys.
+			*
+			* txtRecord:       Pointer to the received TXT Record bytes.
+			*
+			* return value:    Returns the total number of keys in the TXT Record.
+			*
+			*/
+
+			static public int
+			GetCount
+				(
+				Byte	txtRecord[]
+				);
+
+
+			/* GetItemAtIndex()
+			*
+			* Allows you to retrieve a key name and value pointer, given an index into
+			* a TXT Record.  Legal index values range from zero to TXTRecordGetCount()-1.
+			* It's also possible to iterate through keys in a TXT record by simply
+			* calling TXTRecordGetItemAtIndex() repeatedly, beginning with index zero
+			* and increasing until TXTRecordGetItemAtIndex() returns kDNSServiceErr_Invalid.
+			*
+			* On return:
+			* For keys with no value, *value is set to NULL and *valueLen is zero.
+			* For keys with empty value, *value is non-NULL and *valueLen is zero.
+			* For keys with non-empty value, *value is non-NULL and *valueLen is non-zero.
+			*
+			* txtRecord:       Pointer to the received TXT Record bytes.
+			*
+			* index:           An index into the TXT Record.
+			*
+			* key:             A string buffer used to store the key name.
+			*                  On return, the buffer contains a string
+			*                  giving the key name. DNS-SD TXT keys are usually
+			*                  14 characters or less. 
+			*
+			* return value:    Record bytes that holds the value data.
+			*
+			* exceptions:      Throws kDNSServiceErr_Invalid if index is greater than
+			*                  GetCount()-1.
+			*/
+
+			static public Byte
+			GetItemAtIndex
+				(
+				Byte				txtRecord[],
+				int					index,
+				[Out] String	**	key
+				) __gc[];
+		};
+
+
+		public __abstract __gc class DNSService
+		{
+		public:
+
+			/*********************************************************************************************
+			*
+			* Domain Enumeration
+			*
+			*********************************************************************************************/
+
+			/* DNSServiceEnumerateDomains()
+			*
+			* Asynchronously enumerate domains available for browsing and registration.
+			* Currently, the only domain returned is "local.", but other domains will be returned in future.
+			*
+			* The enumeration MUST be cancelled via DNSServiceRefDeallocate() when no more domains
+			* are to be found.
+			*
+			*
+			* EnumerateDomainsReply Delegate
+			*
+			* This Delegate is invoked upon a reply from an EnumerateDomains call.
+			*
+			* sdRef:           The DNSServiceRef initialized by DNSServiceEnumerateDomains().
+			*
+			* flags:           Possible values are:
+			*                  MoreComing
+			*                  Add
+			*                  Default
+			*
+			* interfaceIndex:  Specifies the interface on which the domain exists.  (The index for a given
+			*                  interface is determined via the if_nametoindex() family of calls.)
+			*
+			* errorCode:       Will be NoError (0) on success, otherwise indicates
+			*                  the failure that occurred (other parameters are undefined if errorCode is nonzero).
+			*
+			* replyDomain:     The name of the domain.
+			*
+			*/
+
+			__delegate void
+			EnumerateDomainsReply
+				(
+				ServiceRef	*	sdRef,
+				ServiceFlags	flags,
+				int				interfaceIndex,
+				ErrorCode		errorCode,
+				String		*	replyDomain
+				);
+
+			/* DNSServiceEnumerateDomains() Parameters:
+			*
+			*
+			* flags:           Possible values are:
+			*                  BrowseDomains to enumerate domains recommended for browsing.
+			*                  RegistrationDomains to enumerate domains recommended
+			*                  for registration.
+			*
+			* interfaceIndex:  If non-zero, specifies the interface on which to look for domains.
+			*                  (the index for a given interface is determined via the if_nametoindex()
+			*                  family of calls.)  Most applications will pass 0 to enumerate domains on
+			*                  all interfaces.
+			*
+			* callback:        The delegate to be called when a domain is found or the call asynchronously
+			*                  fails.
+			*
+			*
+			* return value:    Returns initialize ServiceRef on succeses (any subsequent, asynchronous
+			*                  errors are delivered to the delegate), otherwise throws an exception indicating
+			*                  the error that occurred (the callback is not invoked and the ServiceRef
+			*                  is not initialized.)
+			*/
+
+			static public ServiceRef*
+			EnumerateDomains
+				(
+				int							flags,
+				int							interfaceIndex,
+				EnumerateDomainsReply	*	callback
+				);
+
+			/*********************************************************************************************
+			*
+			*  Service Registration
+			*
+			*********************************************************************************************/
+
+			/* Register a service that is discovered via Browse() and Resolve() calls.
+			* 
+			* RegisterReply() Callback Parameters:
+			*
+			* sdRef:           The ServiceRef initialized by Register().
+			*
+			* flags:           Currently unused, reserved for future use.
+			*
+			* errorCode:       Will be NoError on success, otherwise will
+			*                  indicate the failure that occurred (including name conflicts, if the
+			*                  NoAutoRename flag was passed to the
+			*                  callout.)  Other parameters are undefined if errorCode is nonzero.
+			*
+			* name:            The service name registered (if the application did not specify a name in
+			*                  DNSServiceRegister(), this indicates what name was automatically chosen).
+			*
+			* regtype:         The type of service registered, as it was passed to the callout.
+			*
+			* domain:          The domain on which the service was registered (if the application did not
+			*                  specify a domain in Register(), this indicates the default domain
+			*                  on which the service was registered).
+			*
+			*/
+
+			__delegate void
+			RegisterReply
+				(
+				ServiceRef	*	sdRef,
+				ServiceFlags	flags,
+				ErrorCode		errorCode,
+				String		*	name,
+				String		*	regtype,
+				String		*	domain
+				);
+
+			/* Register()  Parameters:
+			*
+			* flags:           Indicates the renaming behavior on name conflict (most applications
+			*                  will pass 0).  See flag definitions above for details.
+			*
+			* interfaceIndex:  If non-zero, specifies the interface on which to register the service
+			*                  (the index for a given interface is determined via the if_nametoindex()
+			*                  family of calls.)  Most applications will pass 0 to register on all
+			*                  available interfaces.  Pass -1 to register a service only on the local
+			*                  machine (service will not be visible to remote hosts.)
+			*
+			* name:            If non-NULL, specifies the service name to be registered.
+			*                  Most applications will not specify a name, in which case the
+			*                  computer name is used (this name is communicated to the client via
+			*                  the callback).
+			*
+			* regtype:         The service type followed by the protocol, separated by a dot
+			*                  (e.g. "_ftp._tcp").  The transport protocol must be "_tcp" or "_udp".
+			*                  New service types should be registered at htp://www.dns-sd.org/ServiceTypes.html.
+			*
+			* domain:          If non-NULL, specifies the domain on which to advertise the service.
+			*                  Most applications will not specify a domain, instead automatically
+			*                  registering in the default domain(s).
+			*
+			* host:            If non-NULL, specifies the SRV target host name.  Most applications
+			*                  will not specify a host, instead automatically using the machine's
+			*                  default host name(s).  Note that specifying a non-NULL host does NOT
+			*                  create an address record for that host - the application is responsible
+			*                  for ensuring that the appropriate address record exists, or creating it
+			*                  via DNSServiceRegisterRecord().
+			*
+			* port:            The port, in host byte order, on which the service accepts connections.
+			*                  Pass 0 for a "placeholder" service (i.e. a service that will not be discovered
+			*                  by browsing, but will cause a name conflict if another client tries to
+			*                  register that same name).  Most clients will not use placeholder services.
+			*
+			* txtRecord:       The txt record rdata.  May be NULL.  Note that a non-NULL txtRecord
+			*                  MUST be a properly formatted DNS TXT record, i.e. <length byte> <data>
+			*                  <length byte> <data> ...
+			*
+			* callback:        The delegate to be called when the registration completes or asynchronously
+			*                  fails.  The client MAY pass NULL for the callback -  The client will NOT be notified
+			*                  of the default values picked on its behalf, and the client will NOT be notified of any
+			*                  asynchronous errors (e.g. out of memory errors, etc.) that may prevent the registration
+			*                  of the service.  The client may NOT pass the NoAutoRename flag if the callback is NULL.
+			*                  The client may still deregister the service at any time via DNSServiceRefDeallocate().
+			*
+			* return value:    Returns initialize ServiceRef (any subsequent, asynchronous
+			*                  errors are delivered to the callback), otherwise throws an exception indicating
+			*                  the error that occurred (the callback is never invoked and the DNSServiceRef
+			*                  is not initialized.)
+			*
+			*/
+			static public ServiceRef*
+			Register
+				(
+				int					flags,
+				int					interfaceIndex,
+				String			*	name,
+				String			*	regtype,
+				String			*	domain,
+				String			*	host,
+				int					port,
+				Byte				txtRecord[],
+				RegisterReply	*	callback
+				);
+
+			/* AddRecord()
+			*
+			* Add a record to a registered service.  The name of the record will be the same as the
+			* registered service's name.
+			* The record can later be updated or deregistered by passing the RecordRef initialized
+			* by this function to UpdateRecord() or RemoveRecord().
+			*
+			*
+			* Parameters;
+			*
+			* sdRef:           A ServiceRef initialized by Register().
+			*
+			* RecordRef:       A pointer to an uninitialized RecordRef.  Upon succesfull completion of this
+			*                  call, this ref may be passed to UpdateRecord() or RemoveRecord().
+			*                  If the above ServiceRef is disposed, RecordRef is also
+			*                  invalidated and may not be used further.
+			*
+			* flags:           Currently ignored, reserved for future use.
+			*
+			* rrtype:          The type of the record (e.g. TXT, SRV, etc), as defined in nameser.h.
+			*
+			* rdata:           The raw rdata to be contained in the added resource record.
+			*
+			* ttl:             The time to live of the resource record, in seconds.
+			*
+			* return value:    Returns initialized RecordRef, otherwise throws
+			*                  an exception indicating the error that occurred (the RecordRef is not initialized).
+			*/
+
+			static public RecordRef*
+			AddRecord
+				(
+				ServiceRef	*	sref,
+				int				flags,
+				int				rrtype,
+				Byte			rdata[],
+				int				ttl
+				);
+
+			/* UpdateRecord
+			*
+			* Update a registered resource record.  The record must either be:
+			*   - The primary txt record of a service registered via Register()
+			*   - A record added to a registered service via AddRecord()
+			*   - An individual record registered by RegisterRecord()
+			*
+			*
+			* Parameters:
+			*
+			* sdRef:           A ServiceRef that was initialized by Register()
+			*                  or CreateConnection().
+			*
+			* RecordRef:       A RecordRef initialized by AddRecord, or NULL to update the
+			*                  service's primary txt record.
+			*
+			* flags:           Currently ignored, reserved for future use.
+			*
+			* rdata:           The new rdata to be contained in the updated resource record.
+			*
+			* ttl:             The time to live of the updated resource record, in seconds.
+			*
+			* return value:    No return value on success, otherwise throws an exception
+			*                  indicating the error that occurred.
+			*/
+			static public void
+			UpdateRecord
+				(
+				ServiceRef	*	sref,
+				RecordRef	*	record,
+				int				flags,
+				Byte			rdata[],
+				int				ttl
+				);
+
+			/* RemoveRecord
+			*
+			* Remove a record previously added to a service record set via AddRecord(), or deregister
+			* an record registered individually via RegisterRecord().
+			*
+			* Parameters:
+			*
+			* sdRef:           A ServiceRef initialized by Register() (if the
+			*                  record being removed was registered via AddRecord()) or by
+			*                  CreateConnection() (if the record being removed was registered via
+			*                  RegisterRecord()).
+			*
+			* recordRef:       A RecordRef initialized by a successful call to AddRecord()
+			*                  or RegisterRecord().
+			*
+			* flags:           Currently ignored, reserved for future use.
+			*
+			* return value:    Nothing on success, otherwise throws an
+			*                  exception indicating the error that occurred.
+			*/
+
+			static public void
+			RemoveRecord
+							(
+							ServiceRef	*	sref,
+							RecordRef	*	record,	
+							int				flags
+							);
+
+			/*********************************************************************************************
+			*
+			*  Service Discovery
+			*
+			*********************************************************************************************/
+
+			/* Browse for instances of a service.
+			*
+			*
+			* BrowseReply() Parameters:
+			*
+			* sdRef:           The DNSServiceRef initialized by Browse().
+			*
+			* flags:           Possible values are MoreComing and Add.
+			*                  See flag definitions for details.
+			*
+			* interfaceIndex:  The interface on which the service is advertised.  This index should
+			*                  be passed to Resolve() when resolving the service.
+			*
+			* errorCode:       Will be NoError (0) on success, otherwise will
+			*                  indicate the failure that occurred.  Other parameters are undefined if
+			*                  the errorCode is nonzero.
+			*
+			* serviceName:     The service name discovered.
+			*
+			* regtype:         The service type, as passed in to Browse().
+			* 
+			* domain:          The domain on which the service was discovered (if the application did not
+			*                  specify a domain in Browse(), this indicates the domain on which the
+			*                  service was discovered.)
+			*
+			*/
+
+			__delegate void
+			BrowseReply
+				(
+				ServiceRef	*	sdRef,
+				ServiceFlags	flags,
+				int				interfaceIndex,
+				ErrorCode		errorCode,
+				String		*	name,
+				String		*	type,
+				String		*	domain
+				);
+
+			/* DNSServiceBrowse() Parameters:
+			*
+			* sdRef:           A pointer to an uninitialized ServiceRef.  Call ServiceRef.Dispose()
+			*                  to terminate the browse.
+			*
+			* flags:           Currently ignored, reserved for future use.
+			*
+			* interfaceIndex:  If non-zero, specifies the interface on which to browse for services
+			*                  (the index for a given interface is determined via the if_nametoindex()
+			*                  family of calls.)  Most applications will pass 0 to browse on all available
+			*                  interfaces.  Pass -1 to only browse for services provided on the local host.
+			*
+			* regtype:         The service type being browsed for followed by the protocol, separated by a
+			*                  dot (e.g. "_ftp._tcp").  The transport protocol must be "_tcp" or "_udp".
+			*
+			* domain:          If non-NULL, specifies the domain on which to browse for services.
+			*                  Most applications will not specify a domain, instead browsing on the
+			*                  default domain(s).
+			*
+			* callback:        The delegate to be called when an instance of the service being browsed for
+			*                  is found, or if the call asynchronously fails.
+			*
+			* return value:    Returns initialized ServiceRef on succeses (any subsequent, asynchronous
+			*                  errors are delivered to the callback), otherwise throws an exception indicating
+			*                  the error that occurred (the callback is not invoked and the ServiceRef
+			*                  is not initialized.)
+			*/
+
+			static public ServiceRef*
+			Browse
+				(
+				int				flags,
+				int				interfaceIndex,
+				String		*	regtype,
+				String		*	domain,
+				BrowseReply	*	callback
+				);
+
+			/* ResolveReply() Parameters:
+			*
+			* Resolve a service name discovered via Browse() to a target host name, port number, and
+			* txt record.
+			*
+			* Note: Applications should NOT use Resolve() solely for txt record monitoring - use
+			* QueryRecord() instead, as it is more efficient for this task.
+			*
+			* Note: When the desired results have been returned, the client MUST terminate the resolve by calling
+			* ServiceRef.Dispose().
+			*
+			* Note: Resolve() behaves correctly for typical services that have a single SRV record and
+			* a single TXT record (the TXT record may be empty.)  To resolve non-standard services with multiple
+			* SRV or TXT records, QueryRecord() should be used.
+			*
+			* ResolveReply Callback Parameters:
+			*
+			* sdRef:           The DNSServiceRef initialized by Resolve().
+			*
+			* flags:           Currently unused, reserved for future use.
+			*
+			* interfaceIndex:  The interface on which the service was resolved.
+			*
+			* errorCode:       Will be NoError (0) on success, otherwise will
+			*                  indicate the failure that occurred.  Other parameters are undefined if
+			*                  the errorCode is nonzero.
+			*
+			* fullname:        The full service domain name, in the form <servicename>.<protocol>.<domain>.
+			*                  (Any literal dots (".") are escaped with a backslash ("\."), and literal
+			*                  backslashes are escaped with a second backslash ("\\"), e.g. a web server
+			*                  named "Dr. Pepper" would have the fullname  "Dr\.\032Pepper._http._tcp.local.").
+			*                  This is the appropriate format to pass to standard system DNS APIs such as
+			*                  res_query(), or to the special-purpose functions included in this API that
+			*                  take fullname parameters.
+			*
+			* hosttarget:      The target hostname of the machine providing the service.  This name can
+			*                  be passed to functions like gethostbyname() to identify the host's IP address.
+			*
+			* port:            The port, in host byte order, on which connections are accepted for this service.
+			*
+			* txtRecord:       The service's primary txt record, in standard txt record format.
+			*
+			*/
+
+			__delegate void
+			ResolveReply
+				(	
+				ServiceRef	*	sdRef,  
+				ServiceFlags	flags,
+				int				interfaceIndex,
+				ErrorCode		errorCode,
+				String		*	fullName,
+				String		*	hostName,
+				int				port,
+				Byte			txtRecord[]
+				);
+
+			/* Resolve() Parameters
+			*
+			* flags:           Currently ignored, reserved for future use.
+			*
+			* interfaceIndex:  The interface on which to resolve the service.  The client should
+			*                  pass the interface on which the servicename was discovered, i.e.
+			*                  the interfaceIndex passed to the DNSServiceBrowseReply callback,
+			*                  or 0 to resolve the named service on all available interfaces.
+			*
+			* name:            The servicename to be resolved.
+			*
+			* regtype:         The service type being resolved followed by the protocol, separated by a
+			*                  dot (e.g. "_ftp._tcp").  The transport protocol must be "_tcp" or "_udp".
+			*
+			* domain:          The domain on which the service is registered, i.e. the domain passed
+			*                  to the DNSServiceBrowseReply callback.
+			*
+			* callback:        The delegate to be called when a result is found, or if the call
+			*                  asynchronously fails.
+			*
+			*
+			* return value:    Returns initialized ServiceRef on succeses (any subsequent, asynchronous
+			*                  errors are delivered to the callback), otherwise throws an exception indicating
+			*                  the error that occurred (the callback is never invoked and the DNSServiceRef
+			*                  is not initialized.)
+			*/
+
+			static public ServiceRef*
+			Resolve
+				(
+				int					flags,
+				int					interfaceIndex,
+				String			*	name,
+				String			*	regtype,
+				String			*	domain,
+				ResolveReply	*	callback
+				);
+
+			/*********************************************************************************************
+			*
+			*  Special Purpose Calls (most applications will not use these)
+			*
+			*********************************************************************************************/
+
+			/* CreateConnection/RegisterRecord
+			*
+			* Register an individual resource record on a connected ServiceRef.
+			*
+			* Note that name conflicts occurring for records registered via this call must be handled
+			* by the client in the callback.
+			*
+			*
+			* RecordReply() parameters:
+			*
+			* sdRef:           The connected ServiceRef initialized by
+			*                  CreateConnection().
+			*
+			* RecordRef:       The RecordRef initialized by RegisterRecord().  If the above
+			*                  ServiceRef.Dispose is called, this RecordRef is
+			*                  invalidated, and may not be used further.
+			*
+			* flags:           Currently unused, reserved for future use.
+			*
+			* errorCode:       Will be NoError on success, otherwise will
+			*                  indicate the failure that occurred (including name conflicts.)
+			*                  Other parameters are undefined if errorCode is nonzero.
+			*
+			*/
+
+			__delegate void
+			RegisterRecordReply
+				(
+				ServiceRef	*	sdRef,
+				ServiceFlags	flags,
+				ErrorCode		errorCode,
+				RecordRef	*	record
+				);
+
+			/* CreateConnection()
+			*
+			* Create a connection to the daemon allowing efficient registration of
+			* multiple individual records.
+			*
+			*
+			* Parameters:
+			*
+			* callback:        The delegate to be called when a result is found, or if the call
+			*                  asynchronously fails (e.g. because of a name conflict.)
+			*
+			* return value:    Returns initialize ServiceRef on success, otherwise throws
+			*                  an exception indicating the specific failure that occurred (in which
+			*                  case the ServiceRef is not initialized).
+			*/
+
+			static public ServiceRef*
+			CreateConnection
+				(
+				RegisterRecordReply * callback
+				);
+
+
+			/* RegisterRecord() Parameters:
+			*
+			* sdRef:           A ServiceRef initialized by CreateConnection().
+			*
+			* RecordRef:       A pointer to an uninitialized RecordRef.  Upon succesfull completion of this
+			*                  call, this ref may be passed to UpdateRecord() or RemoveRecord().
+			*                  (To deregister ALL records registered on a single connected ServiceRef
+			*                  and deallocate each of their corresponding RecordRefs, call
+			*                  ServiceRef.Dispose()).
+			*
+			* flags:           Possible values are Shared or Unique
+			*                  (see flag type definitions for details).
+			*
+			* interfaceIndex:  If non-zero, specifies the interface on which to register the record
+			*                  (the index for a given interface is determined via the if_nametoindex()
+			*                  family of calls.)  Passing 0 causes the record to be registered on all interfaces.
+			*                  Passing -1 causes the record to only be visible on the local host.
+			*
+			* fullname:        The full domain name of the resource record.
+			*
+			* rrtype:          The numerical type of the resource record (e.g. PTR, SRV, etc), as defined
+			*                  in nameser.h.
+			*
+			* rrclass:         The class of the resource record, as defined in nameser.h (usually 1 for the
+			*                  Internet class).
+			*
+			* rdata:           A pointer to the raw rdata, as it is to appear in the DNS record.
+			*
+			* ttl:             The time to live of the resource record, in seconds.
+			*
+			*
+			* return value:    Returns initialize RecordRef on succeses (any subsequent, asynchronous
+			*                  errors are delivered to the callback), otherwise throws an exception indicating
+			*                  the error that occurred (the callback is never invoked and the RecordRef is
+			*                  not initialized.)
+			*/
+			static public RecordRef*
+			RegisterRecord
+				(
+				ServiceRef			*	sdRef,
+				ServiceFlags			flags,
+				int						interfaceIndex,
+				String				*	fullname,
+				int						rrtype,
+				int						rrclass,
+				Byte					rdata[],
+				int						ttl
+				);
+
+
+			/* DNSServiceQueryRecord
+			*
+			* Query for an arbitrary DNS record.
+			*
+			*
+			* QueryRecordReply() Delegate Parameters:
+			*
+			* sdRef:           The ServiceRef initialized by QueryRecord().
+			*
+			* flags:           Possible values are MoreComing and
+			*                  Add.  The Add flag is NOT set for PTR records
+			*                  with a ttl of 0, i.e. "Remove" events.
+			*
+			* interfaceIndex:  The interface on which the query was resolved (the index for a given
+			*                  interface is determined via the if_nametoindex() family of calls).
+			*
+			* errorCode:       Will be kDNSServiceErr_NoError on success, otherwise will
+			*                  indicate the failure that occurred.  Other parameters are undefined if
+			*                  errorCode is nonzero.
+			*
+			* fullname:        The resource record's full domain name.
+			*
+			* rrtype:          The resource record's type (e.g. PTR, SRV, etc) as defined in nameser.h.
+			*
+			* rrclass:         The class of the resource record, as defined in nameser.h (usually 1).
+			*
+			* rdata:           The raw rdata of the resource record.
+			*
+			* ttl:             The resource record's time to live, in seconds.
+			*
+			*/
+
+			__delegate void
+			QueryRecordReply
+				(
+				ServiceRef	*	sdRef,
+				ServiceFlags	flags,
+				int				interfaceIndex,
+				ErrorCode		errorCode,	
+				String		*	fullName,
+				int				rrtype,
+				int				rrclass,
+				Byte			rdata[],
+				int				ttl
+				);
+
+			/* QueryRecord() Parameters:
+			*
+			* flags:           Pass LongLivedQuery to create a "long-lived" unicast
+			*                  query in a non-local domain.  Without setting this flag, unicast queries
+			*                  will be one-shot - that is, only answers available at the time of the call
+			*                  will be returned.  By setting this flag, answers (including Add and Remove
+			*                  events) that become available after the initial call is made will generate
+			*                  callbacks.  This flag has no effect on link-local multicast queries.
+			*
+			* interfaceIndex:  If non-zero, specifies the interface on which to issue the query
+			*                  (the index for a given interface is determined via the if_nametoindex()
+			*                  family of calls.)  Passing 0 causes the name to be queried for on all
+			*                  interfaces.  Passing -1 causes the name to be queried for only on the
+			*                  local host.
+			*
+			* fullname:        The full domain name of the resource record to be queried for.
+			*
+			* rrtype:          The numerical type of the resource record to be queried for (e.g. PTR, SRV, etc)
+			*                  as defined in nameser.h.
+			*
+			* rrclass:         The class of the resource record, as defined in nameser.h
+			*                  (usually 1 for the Internet class).
+			*
+			* callback:        The delegate to be called when a result is found, or if the call
+			*                  asynchronously fails.
+			*
+			*
+			* return value:    Returns initialized ServiceRef on succeses (any subsequent, asynchronous
+			*                  errors are delivered to the callback), otherwise throws an exception indicating
+			*                  the error that occurred (the callback is never invoked and the ServiceRef
+			*                  is not initialized.)
+			*/
+
+			static public ServiceRef*
+			QueryRecord
+				(
+				ServiceFlags			flags,
+				int						interfaceIndex,
+				String				*	fullname,
+				int						rrtype,
+				int						rrclass,
+				QueryRecordReply	*	callback
+				);
+
+			/* ReconfirmRecord
+			*
+			* Instruct the daemon to verify the validity of a resource record that appears to
+			* be out of date (e.g. because tcp connection to a service's target failed.)
+			* Causes the record to be flushed from the daemon's cache (as well as all other
+			* daemons' caches on the network) if the record is determined to be invalid.
+			*
+			* Parameters:
+			*
+			* flags:           Currently unused, reserved for future use.
+			*
+			* fullname:        The resource record's full domain name.
+			*
+			* rrtype:          The resource record's type (e.g. PTR, SRV, etc) as defined in nameser.h.
+			*
+			* rrclass:         The class of the resource record, as defined in nameser.h (usually 1).
+			*
+			* rdata:           The raw rdata of the resource record.
+			*
+			*/
+			static public void
+			ReconfirmRecord
+				(
+				ServiceFlags	flags,
+				int				interfaceIndex,
+				String		*	fullname,
+				int				rrtype,
+				int				rrclass,
+				Byte			rdata[]
+				);
+		};
+	}
+}
diff --git a/mDNSWindows/DLL.NET/dnssd_NET.ico b/mDNSWindows/DLL.NET/dnssd_NET.ico
new file mode 100755
index 0000000..3a5525f
--- /dev/null
+++ b/mDNSWindows/DLL.NET/dnssd_NET.ico
Binary files differ
diff --git a/mDNSWindows/DLL.NET/dnssd_NET.rc b/mDNSWindows/DLL.NET/dnssd_NET.rc
new file mode 100755
index 0000000..95df1cf
--- /dev/null
+++ b/mDNSWindows/DLL.NET/dnssd_NET.rc
@@ -0,0 +1,113 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+#include "WinVersRes.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+1                       ICON                    "dnssd_NET.ico"
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+    "\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION MASTER_PROD_VERS
+ PRODUCTVERSION MASTER_PROD_VERS
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904b0"
+        BEGIN
+            VALUE "CompanyName", MASTER_COMPANY_NAME
+            VALUE "FileDescription", "Bonjour.NET Client Library"
+            VALUE "FileVersion", MASTER_PROD_VERS_STR
+            VALUE "InternalName", "dnssd.NET.dll"
+            VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT
+            VALUE "OriginalFilename", "dnssd.NET.dll"
+            VALUE "ProductName", MASTER_PROD_NAME
+            VALUE "ProductVersion", MASTER_PROD_VERS_STR
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+#endif    // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/mDNSWindows/DLL.NET/dnssd_NET.vcproj b/mDNSWindows/DLL.NET/dnssd_NET.vcproj
new file mode 100755
index 0000000..98cc63b
--- /dev/null
+++ b/mDNSWindows/DLL.NET/dnssd_NET.vcproj
@@ -0,0 +1,446 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="8.00"

+	Name="DLL.NET"

+	ProjectGUID="{2A2FFA97-AF60-494F-9384-BBAA283AA3F2}"

+	RootNamespace="DLL2NET"

+	Keyword="ManagedCProj"

+	>

+	<Platforms>

+		<Platform

+			Name="Win32"

+		/>

+		<Platform

+			Name="x64"

+		/>

+	</Platforms>

+	<ToolFiles>

+	</ToolFiles>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			CharacterSet="1"

+			ManagedExtensions="4"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+				Description="Generating keypair..."

+				CommandLine="sn -k dnssd_NET.snk"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories="../;../../mDNSShared"

+				PreprocessorDefinitions="WIN32;_DEBUG;WIN32_LEAN_AND_MEAN"

+				RuntimeLibrary="3"

+				UsePrecompiledHeader="2"

+				WarningLevel="3"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalDependencies="../DLL/$(OutDir)/dnssd.lib ws2_32.lib"

+				OutputFile="$(OutDir)\dnssd.NET.dll"

+				LinkIncremental="2"

+				GenerateDebugInformation="true"

+				AssemblyDebug="1"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+				EmbedManifest="false"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			CharacterSet="1"

+			ManagedExtensions="4"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+				Description="Generating keypair..."

+				CommandLine="sn -k dnssd_NET.snk"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories="../;../../mDNSShared"

+				PreprocessorDefinitions="WIN32;_DEBUG;WIN32_LEAN_AND_MEAN"

+				RuntimeLibrary="3"

+				UsePrecompiledHeader="2"

+				WarningLevel="3"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalDependencies="../DLL/$(OutDir)/dnssd.lib ws2_32.lib"

+				OutputFile="$(OutDir)\dnssd.NET.dll"

+				LinkIncremental="2"

+				GenerateDebugInformation="true"

+				AssemblyDebug="1"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+				EmbedManifest="false"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			CharacterSet="1"

+			ManagedExtensions="4"

+			WholeProgramOptimization="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+				Description="Generating keypair..."

+				CommandLine="sn -k dnssd_NET.snk"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../;../../mDNSShared"

+				PreprocessorDefinitions="WIN32;NDEBUG;WIN32_LEAN_AND_MEAN"

+				RuntimeLibrary="2"

+				UsePrecompiledHeader="0"

+				WarningLevel="3"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalDependencies="../DLL/$(OutDir)/dnssd.lib ws2_32.lib"

+				OutputFile="$(OutDir)\dnssd.NET.dll"

+				LinkIncremental="1"

+				GenerateDebugInformation="true"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+				EmbedManifest="false"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			CharacterSet="1"

+			ManagedExtensions="4"

+			WholeProgramOptimization="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+				Description="Generating keypair..."

+				CommandLine="sn -k dnssd_NET.snk"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../;../../mDNSShared"

+				PreprocessorDefinitions="WIN32;NDEBUG;WIN32_LEAN_AND_MEAN"

+				RuntimeLibrary="2"

+				UsePrecompiledHeader="0"

+				WarningLevel="3"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalDependencies="../DLL/$(OutDir)/dnssd.lib ws2_32.lib"

+				OutputFile="$(OutDir)\dnssd.NET.dll"

+				LinkIncremental="1"

+				GenerateDebugInformation="true"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+				EmbedManifest="false"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+	</Configurations>

+	<References>

+		<AssemblyReference

+			RelativePath="System.dll"

+			AssemblyName="System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"

+		/>

+		<AssemblyReference

+			RelativePath="System.Data.dll"

+			AssemblyName="System.Data, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"

+		/>

+		<AssemblyReference

+			RelativePath="System.XML.dll"

+			AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"

+		/>

+	</References>

+	<Files>

+		<Filter

+			Name="Source Files"

+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"

+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"

+			>

+			<File

+				RelativePath=".\AssemblyInfo.cpp"

+				>

+			</File>

+			<File

+				RelativePath=".\dnssd_NET.cpp"

+				>

+			</File>

+			<File

+				RelativePath=".\Stdafx.cpp"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="1"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="1"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="1"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="1"

+					/>

+				</FileConfiguration>

+			</File>

+		</Filter>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl;inc;xsd"

+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"

+			>

+			<File

+				RelativePath=".\dnssd_NET.h"

+				>

+			</File>

+			<File

+				RelativePath=".\resource.h"

+				>

+			</File>

+			<File

+				RelativePath=".\Stdafx.h"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Resource Files"

+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"

+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"

+			>

+			<File

+				RelativePath=".\dnssd_NET.ico"

+				>

+			</File>

+			<File

+				RelativePath=".\dnssd_NET.rc"

+				>

+			</File>

+		</Filter>

+		<File

+			RelativePath=".\ReadMe.txt"

+			>

+		</File>

+	</Files>

+	<Globals>

+	</Globals>

+</VisualStudioProject>

diff --git a/mDNSWindows/DLL.NET/resource.h b/mDNSWindows/DLL.NET/resource.h
new file mode 100755
index 0000000..29338aa
--- /dev/null
+++ b/mDNSWindows/DLL.NET/resource.h
@@ -0,0 +1,3 @@
+//{{NO_DEPENDENCIES}}

+// Microsoft Visual C++ generated include file.

+// Used by dnssd_NET.rc

diff --git a/mDNSWindows/DLL/dll.aps b/mDNSWindows/DLL/dll.aps
new file mode 100644
index 0000000..31b4787
--- /dev/null
+++ b/mDNSWindows/DLL/dll.aps
Binary files differ
diff --git a/mDNSWindows/DLL/dll.rc b/mDNSWindows/DLL/dll.rc
new file mode 100644
index 0000000..e76fb30
--- /dev/null
+++ b/mDNSWindows/DLL/dll.rc
@@ -0,0 +1,102 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+#include "WinVersRes.h"
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "#include ""WinVersRes.h""\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION MASTER_PROD_VERS
+ PRODUCTVERSION MASTER_PROD_VERS
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904b0"
+        BEGIN
+            VALUE "CompanyName", MASTER_COMPANY_NAME
+            VALUE "FileDescription", "Bonjour Client Library"
+            VALUE "FileVersion", MASTER_PROD_VERS_STR
+            VALUE "InternalName", "dnssd.dll"
+            VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT
+            VALUE "OriginalFilename", "dnssd.dll"
+            VALUE "ProductName", MASTER_PROD_NAME
+            VALUE "ProductVersion", MASTER_PROD_VERS_STR
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+#endif    // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff --git a/mDNSWindows/DLL/dllmain.c b/mDNSWindows/DLL/dllmain.c
new file mode 100644
index 0000000..79f3bb7
--- /dev/null
+++ b/mDNSWindows/DLL/dllmain.c
@@ -0,0 +1,112 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 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 <windows.h>
+#include <DebugServices.h>
+
+BOOL APIENTRY	DllMain( HANDLE inModule, DWORD inReason, LPVOID inReserved )
+{
+	(void) inModule;
+	(void) inReserved;
+	
+	switch( inReason )
+	{
+		case DLL_PROCESS_ATTACH:
+		case DLL_THREAD_ATTACH:
+		case DLL_THREAD_DETACH:
+		case DLL_PROCESS_DETACH:
+			break;
+	}
+    return( TRUE );
+}
+
+
+BOOL
+IsSystemServiceDisabled()
+{
+	ENUM_SERVICE_STATUS	*	lpService = NULL;
+	SC_HANDLE					sc;
+	BOOL							ret = FALSE;
+	BOOL							ok;
+	DWORD							bytesNeeded = 0;
+	DWORD							srvCount;
+	DWORD							resumeHandle = 0;
+	DWORD							srvType;
+	DWORD							srvState;
+	DWORD							dwBytes = 0;
+	DWORD							i;
+	OSStatus						err;
+
+	sc = OpenSCManager( NULL, NULL, SC_MANAGER_ENUMERATE_SERVICE );
+	err = translate_errno( sc, GetLastError(), kUnknownErr );
+	require_noerr( err, exit );
+
+	srvType		=	SERVICE_WIN32;
+	srvState		=	SERVICE_STATE_ALL;
+
+	for ( ;; )
+	{
+		// Call EnumServicesStatus using the handle returned by OpenSCManager
+
+		ok = EnumServicesStatus ( sc, srvType, srvState, lpService, dwBytes, &bytesNeeded, &srvCount, &resumeHandle );
+
+		if ( ok || ( GetLastError() != ERROR_MORE_DATA ) )
+		{
+			break;
+		}
+
+		if ( lpService )
+		{
+			free( lpService );
+		}
+
+		dwBytes = bytesNeeded;
+
+		lpService = ( ENUM_SERVICE_STATUS* ) malloc( dwBytes );
+		require_action( lpService, exit, ret = FALSE );
+	}
+
+	err = translate_errno( ok, GetLastError(), kUnknownErr );
+	require_noerr( err, exit );
+
+	for ( i = 0; i < srvCount; i++ )
+	{
+		if ( strcmp( lpService[i].lpServiceName, "Bonjour Service" ) == 0 )
+		{
+			if ( ( lpService[i].ServiceStatus.dwCurrentState == SERVICE_PAUSED ) || ( lpService[i].ServiceStatus.dwCurrentState == SERVICE_STOPPED ) )
+			{
+				ret = TRUE;
+			}
+
+			break;
+		}
+	}
+
+exit:
+
+	if ( lpService )
+	{
+		free( lpService );
+	}
+
+	if ( sc )
+	{
+		CloseServiceHandle ( sc );
+	}
+
+	return ret;
+}
diff --git a/mDNSWindows/DLL/dnssd.def b/mDNSWindows/DLL/dnssd.def
new file mode 100644
index 0000000..160510b
--- /dev/null
+++ b/mDNSWindows/DLL/dnssd.def
@@ -0,0 +1,48 @@
+; -*- tab-width: 4 -*-
+;
+; Copyright (c) 2003-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.
+;
+
+LIBRARY		dnssd
+
+EXPORTS
+	DNSServiceRefSockFD
+	DNSServiceProcessResult
+	DNSServiceRefDeallocate
+	DNSServiceEnumerateDomains
+	DNSServiceRegister
+	DNSServiceAddRecord
+	DNSServiceUpdateRecord
+	DNSServiceRemoveRecord
+	DNSServiceBrowse
+	DNSServiceResolve
+	DNSServiceConstructFullName
+	DNSServiceCreateConnection
+	DNSServiceRegisterRecord
+	DNSServiceQueryRecord
+	DNSServiceReconfirmRecord
+	DNSServiceNATPortMappingCreate
+	DNSServiceGetAddrInfo
+	DNSServiceGetProperty
+	TXTRecordCreate
+	TXTRecordDeallocate
+	TXTRecordSetValue
+	TXTRecordRemoveValue
+	TXTRecordContainsKey
+	TXTRecordGetCount
+	TXTRecordGetLength
+	TXTRecordGetBytesPtr
+	TXTRecordGetValuePtr
+	TXTRecordGetItemAtIndex
diff --git a/mDNSWindows/DLL/dnssd.vcproj b/mDNSWindows/DLL/dnssd.vcproj
new file mode 100644
index 0000000..814a322
--- /dev/null
+++ b/mDNSWindows/DLL/dnssd.vcproj
@@ -0,0 +1,472 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="8.00"

+	Name="DLL"

+	ProjectGUID="{AB581101-18F0-46F6-B56A-83A6B1EA657E}"

+	RootNamespace="DLL"

+	Keyword="Win32Proj"

+	>

+	<Platforms>

+		<Platform

+			Name="Win32"

+		/>

+		<Platform

+			Name="x64"

+		/>

+	</Platforms>

+	<ToolFiles>

+	</ToolFiles>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories="../../mDNSCore;../../mDNSShared;../"

+				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"

+				StringPooling="true"

+				MinimalRebuild="true"

+				ExceptionHandling="0"

+				BasicRuntimeChecks="3"

+				SmallerTypeCheck="true"

+				RuntimeLibrary="1"

+				BufferSecurityCheck="true"

+				UsePrecompiledHeader="0"

+				AssemblerListingLocation="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\dnssd.dll.pdb"

+				WarningLevel="4"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+				CallingConvention="2"

+				CompileAs="0"

+				DisableSpecificWarnings="4127;4204"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"

+				AdditionalDependencies="ws2_32.lib iphlpapi.lib"

+				OutputFile="$(OutDir)/dnssd.dll"

+				LinkIncremental="2"

+				ModuleDefinitionFile="dnssd.def"

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)\dnssd.dll.pdb"

+				SubSystem="2"

+				BaseAddress="0x16000000"

+				ImportLibrary="$(OutDir)\dnssd.lib"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories="../../mDNSCore;../../mDNSShared;../"

+				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"

+				StringPooling="true"

+				MinimalRebuild="true"

+				ExceptionHandling="0"

+				BasicRuntimeChecks="3"

+				SmallerTypeCheck="true"

+				RuntimeLibrary="1"

+				BufferSecurityCheck="true"

+				UsePrecompiledHeader="0"

+				AssemblerListingLocation="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\dnssd.dll.pdb"

+				WarningLevel="4"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+				CallingConvention="2"

+				CompileAs="0"

+				DisableSpecificWarnings="4127;4204"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE"

+				AdditionalDependencies="ws2_32.lib iphlpapi.lib"

+				OutputFile="$(OutDir)/dnssd.dll"

+				LinkIncremental="2"

+				ModuleDefinitionFile="dnssd.def"

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)\dnssd.dll.pdb"

+				SubSystem="2"

+				BaseAddress="0x16000000"

+				ImportLibrary="$(OutDir)\dnssd.lib"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../../mDNSCore;../../mDNSShared;../"

+				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"

+				RuntimeLibrary="0"

+				UsePrecompiledHeader="0"

+				AssemblerListingLocation="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\dnssd.dll.pdb"

+				WarningLevel="4"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+				CallingConvention="2"

+				CompileAs="0"

+				DisableSpecificWarnings="4127;4204"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"

+				AdditionalDependencies="ws2_32.lib iphlpapi.lib"

+				OutputFile="$(OutDir)/dnssd.dll"

+				LinkIncremental="1"

+				ModuleDefinitionFile="dnssd.def"

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)\dnssd.dll.pdb"

+				SubSystem="2"

+				OptimizeReferences="2"

+				EnableCOMDATFolding="2"

+				BaseAddress="0x16000000"

+				ImportLibrary="$(OutDir)\dnssd.lib"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="if not &quot;%RC_XBS%&quot; == &quot;YES&quot; goto END&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;                     mkdir &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib&quot;                                     mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib\$(PlatformName)&quot;     mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib\$(PlatformName)&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\include&quot;                            mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\include&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\AppleInternal&quot;                                                                   mkdir &quot;$(DSTROOT)\AppleInternal&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\AppleInternal\bin&quot;                                                           mkdir &quot;$(DSTROOT)\AppleInternal\bin&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\AppleInternal\bin\$(PlatformName)&quot;                           mkdir &quot;$(DSTROOT)\AppleInternal\bin\$(PlatformName)&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot;                                                                                           &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(OutDir)\dnssd.dll.pdb&quot;                                                                          &quot;$(DSTROOT)\AppleInternal\bin\$(PlatformName)&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\..\mDNSShared\dns_sd.h&quot;                                             &quot;$(DSTROOT)\Program Files\Bonjour SDK\include&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

+			CharacterSet="2"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="../../mDNSCore;../../mDNSShared;../"

+				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"

+				RuntimeLibrary="0"

+				UsePrecompiledHeader="0"

+				AssemblerListingLocation="$(IntDir)\"

+				ProgramDataBaseFileName="$(IntDir)\dnssd.dll.pdb"

+				WarningLevel="4"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+				CallingConvention="2"

+				CompileAs="0"

+				DisableSpecificWarnings="4127;4204"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				AdditionalIncludeDirectories="../"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE"

+				AdditionalDependencies="ws2_32.lib iphlpapi.lib"

+				OutputFile="$(OutDir)/dnssd.dll"

+				LinkIncremental="1"

+				ModuleDefinitionFile="dnssd.def"

+				GenerateDebugInformation="true"

+				ProgramDatabaseFile="$(OutDir)\dnssd.dll.pdb"

+				SubSystem="2"

+				OptimizeReferences="2"

+				EnableCOMDATFolding="2"

+				BaseAddress="0x16000000"

+				ImportLibrary="$(OutDir)\dnssd.lib"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="if not &quot;%RC_XBS%&quot; == &quot;YES&quot; goto END&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;                     mkdir &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib&quot;                                     mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib\$(PlatformName)&quot;     mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib\$(PlatformName)&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\include&quot;                            mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\include&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\AppleInternal&quot;                                                                   mkdir &quot;$(DSTROOT)\AppleInternal&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\AppleInternal\bin&quot;                                                           mkdir &quot;$(DSTROOT)\AppleInternal\bin&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\AppleInternal\bin\$(PlatformName)&quot;                           mkdir &quot;$(DSTROOT)\AppleInternal\bin\$(PlatformName)&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot;                                                                                           &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(OutDir)\dnssd.dll.pdb&quot;                                                                         &quot;$(DSTROOT)\AppleInternal\bin\$(PlatformName)&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"

+			/>

+		</Configuration>

+	</Configurations>

+	<References>

+	</References>

+	<Files>

+		<Filter

+			Name="Source Files"

+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"

+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"

+			>

+			<File

+				RelativePath="..\..\mDNSShared\DebugServices.c"

+				>

+			</File>

+			<File

+				RelativePath=".\dllmain.c"

+				>

+			</File>

+			<File

+				RelativePath=".\dnssd.def"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\dnssd_clientlib.c"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\dnssd_clientstub.c"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\dnssd_ipc.c"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\GenLinkedList.c"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl;inc;xsd"

+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"

+			>

+			<File

+				RelativePath="..\..\mDNSShared\CommonServices.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\DebugServices.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\dns_sd.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\dnssd_ipc.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\GenLinkedList.h"

+				>

+			</File>

+			<File

+				RelativePath=".\resource.h"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Resource Files"

+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"

+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"

+			>

+			<File

+				RelativePath=".\dll.rc"

+				>

+			</File>

+		</Filter>

+	</Files>

+	<Globals>

+	</Globals>

+</VisualStudioProject>

diff --git a/mDNSWindows/DLL/resource.h b/mDNSWindows/DLL/resource.h
new file mode 100644
index 0000000..bdea251
--- /dev/null
+++ b/mDNSWindows/DLL/resource.h
@@ -0,0 +1,27 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by dll.rc
+//
+#define IDS_PROJNAME                    100
+#define IDR_WMDMLOGGER                  101
+#define IDS_LOG_SEV_INFO                201
+#define IDS_LOG_SEV_WARN                202
+#define IDS_LOG_SEV_ERROR               203
+#define IDS_LOG_DATETIME                204
+#define IDS_LOG_SRCNAME                 205
+#define IDS_DEF_LOGFILE                 301
+#define IDS_DEF_MAXSIZE                 302
+#define IDS_DEF_SHRINKTOSIZE            303
+#define IDS_DEF_LOGENABLED              304
+#define IDS_MUTEX_TIMEOUT               401
+
+// 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           101
+#endif
+#endif
diff --git a/mDNSWindows/DLLStub/DLLStub.cpp b/mDNSWindows/DLLStub/DLLStub.cpp
new file mode 100755
index 0000000..c39a747
--- /dev/null
+++ b/mDNSWindows/DLLStub/DLLStub.cpp
@@ -0,0 +1,693 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2009, Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright notice,
+ *     this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of its
+ *     contributors may be used to endorse or promote products derived from this
+ *     software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "DLLStub.h"
+
+static int		g_defaultErrorCode = kDNSServiceErr_Unknown;
+static DLLStub	g_glueLayer;
+
+
+// ------------------------------------------
+// DLLStub implementation
+// ------------------------------------------
+DLLStub * DLLStub::m_instance;
+
+DLLStub::DLLStub()
+:
+	m_library( LoadLibrary( TEXT( "dnssd.dll" ) ) )
+{
+	m_instance = this;
+}
+
+
+DLLStub::~DLLStub()
+{
+	if ( m_library != NULL )
+	{
+		FreeLibrary( m_library );
+		m_library = NULL;
+	}
+
+	m_instance = NULL;
+}
+
+
+bool
+DLLStub::GetProcAddress( FARPROC * func, LPCSTR lpProcName )
+{ 
+	if ( m_instance && m_instance->m_library )
+	{
+		// Only call ::GetProcAddress if *func is NULL. This allows
+		// the calling code to cache the funcptr value, and we get
+		// some performance benefit.
+
+		if ( *func == NULL )
+		{
+			*func = ::GetProcAddress( m_instance->m_library, lpProcName );
+		}
+	}
+	else
+	{
+		*func = NULL;
+	}
+
+	return ( *func != NULL );
+}
+
+
+int DNSSD_API
+DNSServiceRefSockFD(DNSServiceRef sdRef)
+{
+	typedef int (DNSSD_API * Func)(DNSServiceRef sdRef);
+	static Func func = NULL;
+	int ret = -1;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceProcessResult(DNSServiceRef sdRef)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef sdRef);
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef );
+	}
+	
+	return ret;
+}
+
+
+void DNSSD_API
+DNSServiceRefDeallocate(DNSServiceRef sdRef)
+{
+	typedef void (DNSSD_API * Func)(DNSServiceRef sdRef);
+	static Func func = NULL;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		func( sdRef );
+	}
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceEnumerateDomains
+		(
+		DNSServiceRef                       *sdRef,
+		DNSServiceFlags                     flags,
+		uint32_t                            interfaceIndex,
+		DNSServiceDomainEnumReply           callBack,
+		void                                *context
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef*, DNSServiceFlags, uint32_t, DNSServiceDomainEnumReply, void* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef, flags, interfaceIndex, callBack, context );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceRegister
+		(
+		DNSServiceRef                       *sdRef,
+		DNSServiceFlags                     flags,
+		uint32_t                            interfaceIndex,
+		const char                          *name,
+		const char                          *regtype,
+		const char                          *domain,
+		const char                          *host,
+		uint16_t                            port,
+		uint16_t                            txtLen,
+		const void                          *txtRecord,
+		DNSServiceRegisterReply             callBack,
+		void                                *context
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef*, DNSServiceFlags, uint32_t, const char*, const char*, const char*, const char*, uint16_t, uint16_t, const void*, DNSServiceRegisterReply, void* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef, flags, interfaceIndex, name, regtype, domain, host, port, txtLen, txtRecord, callBack, context );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceAddRecord
+		(
+		DNSServiceRef                       sdRef,
+		DNSRecordRef                        *RecordRef,
+		DNSServiceFlags                     flags,
+		uint16_t                            rrtype,
+		uint16_t                            rdlen,
+		const void                          *rdata,
+		uint32_t                            ttl
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef, DNSRecordRef*, DNSServiceFlags, uint16_t, uint16_t, const void*, uint32_t );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef, RecordRef, flags, rrtype, rdlen, rdata, ttl );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceUpdateRecord
+		(
+		DNSServiceRef                       sdRef,
+		DNSRecordRef                        RecordRef,     /* may be NULL */
+		DNSServiceFlags                     flags,
+		uint16_t                            rdlen,
+		const void                          *rdata,
+		uint32_t                            ttl
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef, DNSRecordRef, DNSServiceFlags, uint16_t, const void*, uint32_t );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef, RecordRef, flags, rdlen, rdata, ttl );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceRemoveRecord
+		(
+		DNSServiceRef                 sdRef,
+		DNSRecordRef                  RecordRef,
+		DNSServiceFlags               flags
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef, DNSRecordRef, DNSServiceFlags );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef, RecordRef, flags );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceBrowse
+		(
+		DNSServiceRef                       *sdRef,
+		DNSServiceFlags                     flags,
+		uint32_t                            interfaceIndex,
+		const char                          *regtype,
+		const char                          *domain,    /* may be NULL */
+		DNSServiceBrowseReply               callBack,
+		void                                *context    /* may be NULL */
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef*, DNSServiceFlags, uint32_t, const char*, const char*, DNSServiceBrowseReply, void* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef, flags, interfaceIndex, regtype, domain, callBack, context );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceResolve
+		(
+		DNSServiceRef                       *sdRef,
+		DNSServiceFlags                     flags,
+		uint32_t                            interfaceIndex,
+		const char                          *name,
+		const char                          *regtype,
+		const char                          *domain,
+		DNSServiceResolveReply              callBack,
+		void                                *context  /* may be NULL */
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef*, DNSServiceFlags, uint32_t, const char*, const char*, const char*, DNSServiceResolveReply, void* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef, flags, interfaceIndex, name, regtype, domain, callBack, context );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceConstructFullName
+		(
+		char                            *fullName,
+		const char                      *service,      /* may be NULL */
+		const char                      *regtype,
+		const char                      *domain
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)( char*, const char*, const char*, const char* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( fullName, service, regtype, domain );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceCreateConnection(DNSServiceRef *sdRef)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)( DNSServiceRef* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceRegisterRecord
+		(
+		DNSServiceRef                       sdRef,
+		DNSRecordRef                        *RecordRef,
+		DNSServiceFlags                     flags,
+		uint32_t                            interfaceIndex,
+		const char                          *fullname,
+		uint16_t                            rrtype,
+		uint16_t                            rrclass,
+		uint16_t                            rdlen,
+		const void                          *rdata,
+		uint32_t                            ttl,
+		DNSServiceRegisterRecordReply       callBack,
+		void                                *context    /* may be NULL */
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef, DNSRecordRef*, DNSServiceFlags, uint32_t, const char*, uint16_t, uint16_t, uint16_t, const void*, uint16_t, DNSServiceRegisterRecordReply, void* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef, RecordRef, flags, interfaceIndex, fullname, rrtype, rrclass, rdlen, rdata, ttl, callBack, context );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceQueryRecord
+		(
+		DNSServiceRef                       *sdRef,
+		DNSServiceFlags                     flags,
+		uint32_t                            interfaceIndex,
+		const char                          *fullname,
+		uint16_t                            rrtype,
+		uint16_t                            rrclass,
+		DNSServiceQueryRecordReply          callBack,
+		void                                *context  /* may be NULL */
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef*, DNSServiceFlags, uint32_t, const char*, uint16_t, uint16_t, DNSServiceQueryRecordReply, void* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef, flags, interfaceIndex, fullname, rrtype, rrclass, callBack, context );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceReconfirmRecord
+		(
+		DNSServiceFlags                    flags,
+		uint32_t                           interfaceIndex,
+		const char                         *fullname,
+		uint16_t                           rrtype,
+		uint16_t                           rrclass,
+		uint16_t                           rdlen,
+		const void                         *rdata
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)( DNSServiceFlags, uint32_t, const char*, uint16_t, uint16_t, uint16_t, const void* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( flags, interfaceIndex, fullname, rrtype, rrclass, rdlen, rdata );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceNATPortMappingCreate
+		(
+		DNSServiceRef                    *sdRef,
+		DNSServiceFlags                  flags,
+		uint32_t                         interfaceIndex,
+		DNSServiceProtocol               protocol,          /* TCP and/or UDP          */
+		uint16_t                         internalPort,      /* network byte order      */
+		uint16_t                         externalPort,      /* network byte order      */
+		uint32_t                         ttl,               /* time to live in seconds */
+		DNSServiceNATPortMappingReply    callBack,
+		void                             *context           /* may be NULL             */
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef*, DNSServiceFlags, uint32_t, DNSServiceProtocol, uint16_t, uint16_t, uint16_t, DNSServiceNATPortMappingReply, void* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef, flags, interfaceIndex, protocol, internalPort, externalPort, ttl, callBack, context );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceGetAddrInfo
+		(
+		DNSServiceRef                    *sdRef,
+		DNSServiceFlags                  flags,
+		uint32_t                         interfaceIndex,
+		DNSServiceProtocol               protocol,
+		const char                       *hostname,
+		DNSServiceGetAddrInfoReply       callBack,
+		void                             *context          /* may be NULL */
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)(DNSServiceRef*, DNSServiceFlags, uint32_t, DNSServiceProtocol, const char*, DNSServiceGetAddrInfoReply, void* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( sdRef, flags, interfaceIndex, protocol, hostname, callBack, context );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+DNSServiceGetProperty
+		(
+		const char *property,  /* Requested property (i.e. kDNSServiceProperty_DaemonVersion) */
+		void       *result,    /* Pointer to place to store result */
+		uint32_t   *size       /* size of result location */
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)( const char*, void*, uint32_t* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( property, result, size );
+	}
+	
+	return ret;
+}
+
+
+void DNSSD_API
+TXTRecordCreate
+		(
+		TXTRecordRef     *txtRecord,
+		uint16_t         bufferLen,
+		void             *buffer
+		)
+{
+	typedef void (DNSSD_API * Func)( TXTRecordRef*, uint16_t, void* );
+	static Func func = NULL;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		func( txtRecord, bufferLen, buffer );
+	}
+}
+
+
+void DNSSD_API
+TXTRecordDeallocate
+		(
+		TXTRecordRef     *txtRecord
+		)
+{
+	typedef void (DNSSD_API * Func)( TXTRecordRef* );
+	static Func func = NULL;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		func( txtRecord );
+	}
+}
+
+
+DNSServiceErrorType DNSSD_API
+TXTRecordSetValue
+		(
+		TXTRecordRef     *txtRecord,
+		const char       *key,
+		uint8_t          valueSize,        /* may be zero */
+		const void       *value            /* may be NULL */
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)( TXTRecordRef*, const char*, uint8_t, const void* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( txtRecord, key, valueSize, value );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+TXTRecordRemoveValue
+		(
+		TXTRecordRef     *txtRecord,
+		const char       *key
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)( TXTRecordRef*, const char* );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( txtRecord, key );
+	}
+	
+	return ret;
+}
+
+
+int DNSSD_API
+TXTRecordContainsKey
+		(
+		uint16_t         txtLen,
+		const void       *txtRecord,
+		const char       *key
+		)
+{
+	typedef int (DNSSD_API * Func)( uint16_t, const void*, const char* );
+	static Func func = NULL;
+	int ret = 0;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( txtLen, txtRecord, key );
+	}
+	
+	return ret;
+}
+
+
+uint16_t DNSSD_API
+TXTRecordGetCount
+		(
+		uint16_t         txtLen,
+		const void       *txtRecord
+		)
+{
+	typedef uint16_t (DNSSD_API * Func)( uint16_t, const void* );
+	static Func func = NULL;
+	uint16_t ret = 0;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( txtLen, txtRecord );
+	}
+	
+	return ret;
+}
+
+
+uint16_t DNSSD_API
+TXTRecordGetLength
+		(
+		const TXTRecordRef *txtRecord
+		)
+{
+	typedef uint16_t (DNSSD_API * Func)( const TXTRecordRef* );
+	static Func func = NULL;
+	uint16_t ret = 0;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( txtRecord );
+	}
+	
+	return ret;
+}
+
+
+const void * DNSSD_API
+TXTRecordGetBytesPtr
+		(
+		const TXTRecordRef *txtRecord
+		)
+{
+	typedef const void* (DNSSD_API * Func)( const TXTRecordRef* );
+	static Func func = NULL;
+	const void* ret = NULL;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( txtRecord );
+	}
+	
+	return ret;
+}
+
+
+const void * DNSSD_API
+TXTRecordGetValuePtr
+		(
+		uint16_t         txtLen,
+		const void       *txtRecord,
+		const char       *key,
+		uint8_t          *valueLen
+		)
+{
+	typedef const void* (DNSSD_API * Func)( uint16_t, const void*, const char*, uint8_t* );
+	static Func func = NULL;
+	const void* ret = NULL;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( txtLen, txtRecord, key, valueLen );
+	}
+	
+	return ret;
+}
+
+
+DNSServiceErrorType DNSSD_API
+TXTRecordGetItemAtIndex
+		(
+		uint16_t         txtLen,
+		const void       *txtRecord,
+		uint16_t         itemIndex,
+		uint16_t         keyBufLen,
+		char             *key,
+		uint8_t          *valueLen,
+		const void       **value
+		)
+{
+	typedef DNSServiceErrorType (DNSSD_API * Func)( uint16_t, const void*, uint16_t, uint16_t, char*, uint8_t*, const void** );
+	static Func func = NULL;
+	DNSServiceErrorType ret = g_defaultErrorCode;
+
+	if ( DLLStub::GetProcAddress( ( FARPROC* ) &func, __FUNCTION__ ) )
+	{
+		ret = func( txtLen, txtRecord, itemIndex, keyBufLen, key, valueLen, value );
+	}
+	
+	return ret;
+}
\ No newline at end of file
diff --git a/mDNSWindows/DLLStub/DLLStub.h b/mDNSWindows/DLLStub/DLLStub.h
new file mode 100755
index 0000000..44f57d1
--- /dev/null
+++ b/mDNSWindows/DLLStub/DLLStub.h
@@ -0,0 +1,52 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2009, Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright notice,
+ *     this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright notice,
+ *     this list of conditions and the following disclaimer in the documentation
+ *     and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of its
+ *     contributors may be used to endorse or promote products derived from this
+ *     software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _DLLStub_h
+#define _DLLStub_h
+
+#include <windows.h>
+#include <dns_sd.h>
+
+class DLLStub
+{
+public:
+
+	DLLStub();
+	~DLLStub();
+
+	static bool
+	GetProcAddress( FARPROC * func, LPCSTR lpProcName );
+
+private:
+
+	static DLLStub	*	m_instance;
+	HMODULE				m_library;
+};
+
+
+#endif
\ No newline at end of file
diff --git a/mDNSWindows/DLLStub/DLLStub.vcproj b/mDNSWindows/DLLStub/DLLStub.vcproj
new file mode 100755
index 0000000..dc68289
--- /dev/null
+++ b/mDNSWindows/DLLStub/DLLStub.vcproj
@@ -0,0 +1,324 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="8.00"

+	Name="DLLStub"

+	ProjectGUID="{3A2B6325-3053-4236-84BD-AA9BE2E323E5}"

+	RootNamespace="DLLStub"

+	Keyword="Win32Proj"

+	>

+	<Platforms>

+		<Platform

+			Name="Win32"

+		/>

+		<Platform

+			Name="x64"

+		/>

+	</Platforms>

+	<ToolFiles>

+	</ToolFiles>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="4"

+			UseOfATL="0"

+			CharacterSet="1"

+			WholeProgramOptimization="0"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories="..\..\mDNSShared;..\..\mDNSWindows"

+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				MinimalRebuild="false"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				UsePrecompiledHeader="0"

+				ProgramDataBaseFileName="$(IntDir)\dnssd.pdb"

+				WarningLevel="3"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="$(OutDir)\dnssdStatic.lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="4"

+			UseOfATL="0"

+			CharacterSet="1"

+			WholeProgramOptimization="0"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories="..\..\mDNSShared;..\..\mDNSWindows"

+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				MinimalRebuild="false"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				UsePrecompiledHeader="0"

+				ProgramDataBaseFileName="$(IntDir)\dnssd.pdb"

+				WarningLevel="3"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="$(OutDir)\dnssdStatic.lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="4"

+			UseOfATL="0"

+			CharacterSet="1"

+			WholeProgramOptimization="0"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="..\..\mDNSShared;..\..\mDNSWindows"

+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				RuntimeLibrary="0"

+				UsePrecompiledHeader="0"

+				ProgramDataBaseFileName="$(IntDir)\dnssd.lib.pdb"

+				WarningLevel="3"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="$(OutDir)\dnssdStatic.lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="if not &quot;%RC_XBS%&quot; == &quot;YES&quot; goto END&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib\$(PlatformName)&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib\$(PlatformName)&quot;&#x0D;&#x0A;echo F | xcopy /Y &quot;$(OutDir)\dnssdStatic.lib&quot;                                                        &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib\$(PlatformName)\dnssd.lib&quot;&#x0D;&#x0A;xcopy /Y &quot;$(OutDir)\dnssd.lib.pdb&quot;                                                                         &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib\$(PlatformName)&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="4"

+			UseOfATL="0"

+			CharacterSet="1"

+			WholeProgramOptimization="0"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				TargetEnvironment="3"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="..\..\mDNSShared;..\..\mDNSWindows"

+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				RuntimeLibrary="0"

+				UsePrecompiledHeader="0"

+				ProgramDataBaseFileName="$(IntDir)\dnssd.lib.pdb"

+				WarningLevel="3"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLibrarianTool"

+				OutputFile="$(OutDir)\dnssdStatic.lib"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="if not &quot;%RC_XBS%&quot; == &quot;YES&quot; goto END&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib\$(PlatformName)&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib\$(PlatformName)&quot;&#x0D;&#x0A;echo F | xcopy /I/Y &quot;$(OutDir)\dnssdStatic.lib&quot;                                                     &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib\$(PlatformName)\dnssd.lib&quot;&#x0D;&#x0A;xcopy /Y &quot;$(OutDir)\dnssd.lib.pdb&quot;                                                                         &quot;$(DSTROOT)\Program Files\Bonjour SDK\lib\$(PlatformName)&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"

+			/>

+		</Configuration>

+	</Configurations>

+	<References>

+	</References>

+	<Files>

+		<Filter

+			Name="Source Files"

+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"

+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"

+			>

+			<File

+				RelativePath=".\DLLStub.cpp"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl;inc;xsd"

+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"

+			>

+			<File

+				RelativePath=".\DLLStub.h"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Resource Files"

+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"

+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"

+			>

+		</Filter>

+		<File

+			RelativePath=".\ReadMe.txt"

+			>

+		</File>

+	</Files>

+	<Globals>

+	</Globals>

+</VisualStudioProject>

diff --git a/mDNSWindows/DLLX/DLLX.cpp b/mDNSWindows/DLLX/DLLX.cpp
new file mode 100755
index 0000000..77883cc
--- /dev/null
+++ b/mDNSWindows/DLLX/DLLX.cpp
@@ -0,0 +1,208 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2009 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 "stdafx.h"
+
+#include "resource.h"
+
+#include "DLLX.h"
+
+#include "dlldatax.h"
+
+#include <DebugServices.h>
+
+
+
+
+
+class CDLLComponentModule : public CAtlDllModuleT< CDLLComponentModule >
+
+{
+
+public :
+
+	DECLARE_LIBID(LIBID_Bonjour)
+
+	DECLARE_REGISTRY_APPID_RESOURCEID(IDR_DLLX, "{56608F9C-223B-4CB6-813D-85EDCCADFB4B}")
+
+};
+
+
+
+CDLLComponentModule _AtlModule;
+
+
+
+
+
+#ifdef _MANAGED
+
+#pragma managed(push, off)
+
+#endif
+
+
+
+// DLL Entry Point
+
+extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+
+{
+
+	debug_initialize( kDebugOutputTypeWindowsDebugger );
+	debug_set_property( kDebugPropertyTagPrintLevel, kDebugLevelVerbose );
+
+
+
+#ifdef _MERGE_PROXYSTUB
+
+    if (!PrxDllMain(hInstance, dwReason, lpReserved))
+
+        return FALSE;
+
+#endif
+
+	hInstance;
+
+    return _AtlModule.DllMain(dwReason, lpReserved); 
+
+}
+
+
+
+#ifdef _MANAGED
+
+#pragma managed(pop)
+
+#endif
+
+
+
+
+
+
+
+
+
+// Used to determine whether the DLL can be unloaded by OLE
+
+STDAPI DllCanUnloadNow(void)
+
+{
+
+#ifdef _MERGE_PROXYSTUB
+
+    HRESULT hr = PrxDllCanUnloadNow();
+
+    if (hr != S_OK)
+
+        return hr;
+
+#endif
+
+    return _AtlModule.DllCanUnloadNow();
+
+}
+
+
+
+
+
+// Returns a class factory to create an object of the requested type
+
+STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
+
+{
+
+#ifdef _MERGE_PROXYSTUB
+
+    if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK)
+
+        return S_OK;
+
+#endif
+
+    return _AtlModule.DllGetClassObject(rclsid, riid, ppv);
+
+}
+
+
+
+
+
+// DllRegisterServer - Adds entries to the system registry
+
+STDAPI DllRegisterServer(void)
+
+{
+
+    // registers object, typelib and all interfaces in typelib
+
+    HRESULT hr = _AtlModule.DllRegisterServer();
+
+#ifdef _MERGE_PROXYSTUB
+
+    if (FAILED(hr))
+
+        return hr;
+
+    hr = PrxDllRegisterServer();
+
+#endif
+
+	return hr;
+
+}
+
+
+
+
+
+// DllUnregisterServer - Removes entries from the system registry
+
+STDAPI DllUnregisterServer(void)
+
+{
+
+	HRESULT hr = _AtlModule.DllUnregisterServer();
+
+#ifdef _MERGE_PROXYSTUB
+
+    if (FAILED(hr))
+
+        return hr;
+
+    hr = PrxDllRegisterServer();
+
+    if (FAILED(hr))
+
+        return hr;
+
+    hr = PrxDllUnregisterServer();
+
+#endif
+
+	return hr;
+
+}
+
+
+
diff --git a/mDNSWindows/DLLX/DLLX.def b/mDNSWindows/DLLX/DLLX.def
new file mode 100755
index 0000000..698b172
--- /dev/null
+++ b/mDNSWindows/DLLX/DLLX.def
@@ -0,0 +1,35 @@
+; -*- Mode: C; tab-width: 4 -*-
+;
+; Copyright (c) 2009 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.
+;
+
+
+
+
+
+LIBRARY      "dnssdX.DLL"
+
+
+
+EXPORTS
+
+	DllCanUnloadNow		PRIVATE
+
+	DllGetClassObject	PRIVATE
+
+	DllRegisterServer	PRIVATE
+
+	DllUnregisterServer	PRIVATE
+
diff --git a/mDNSWindows/DLLX/DLLX.idl b/mDNSWindows/DLLX/DLLX.idl
new file mode 100755
index 0000000..475558e
--- /dev/null
+++ b/mDNSWindows/DLLX/DLLX.idl
@@ -0,0 +1,491 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2009 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.
+ */
+
+
+
+// This file will be processed by the MIDL tool to
+
+// produce the type library (DLLComponent.tlb) and marshalling code.
+
+
+
+typedef [ uuid(4085DD59-D0E1-4efe-B6EE-DDBF7631B9C0) ]
+
+enum DNSSDFlags
+
+{
+
+	kDNSSDFlagsMoreComing			= 0x0001,
+
+	kDNSSDFlagsDefault				= 0x0004,
+
+	kDNSSDFlagsNoAutoRename			= 0x0008,
+
+	kDNSSDFlagsShared				= 0x0010,
+
+	kDNSSDFlagsUnique				= 0x0020,
+
+	kDNSSDFlagsBrowseDomains		= 0x0040,
+
+	kDNSSDFlagsRegistrationDomains	= 0x0080,
+
+	kDNSSDFlagsLongLivedQuery		= 0x0100,
+
+	kDNSSDFlagsAllowRemoteQuery		= 0x0200,
+
+	kDNSSDFlagsForceMulticast		= 0x0400,
+
+	kDNSSDFlagsForce				= 0x0800,
+
+	kDNSSDFlagsReturnIntermediates	= 0x1000,
+
+	kDNSSDFlagsNonBrowsable			= 0x2000
+
+} DNSSDFlags;
+
+
+
+
+
+typedef [ uuid(30CDF335-CA52-4b17-AFF2-E83C64C450D4) ]
+
+enum DNSSDAddressFamily
+
+{
+
+	kDNSSDAddressFamily_IPv4 = 0x1,
+
+	kDNSSDAddressFamily_IPv6 = 0x2
+
+} DNSSDAddressFamily;
+
+
+
+
+
+typedef [ uuid(98FB4702-7374-4b16-A8DB-AD35BFB8364D) ]
+
+enum DNSSDProtocol
+
+{
+
+	kDNSSDProtocol_UDP	= 0x10,
+
+	kDNSSDProtocol_TCP	= 0x20
+
+} DNSSDProtocol;
+
+
+
+
+
+typedef [ uuid(72BF3EC3-19BC-47e5-8D95-3B73FF37D893) ]
+
+enum DNSSDRRClass
+
+{
+
+	kDNSSDClass_IN = 1
+
+} DNSSDRRClass;
+
+
+
+
+
+typedef [ uuid(08E362DF-5468-4c9a-AC66-FD4747B917BD) ]
+
+enum DNSSDRRType
+
+{
+
+	kDNSSDType_A         = 1,
+    kDNSSDType_NS        = 2,
+    kDNSSDType_MD        = 3,
+    kDNSSDType_MF        = 4,
+    kDNSSDType_CNAME     = 5,
+    kDNSSDType_SOA       = 6,
+    kDNSSDType_MB        = 7,
+    kDNSSDType_MG        = 8,
+    kDNSSDType_MR        = 9,
+    kDNSSDType_NULL      = 10,
+    kDNSSDType_WKS       = 11,
+    kDNSSDType_PTR       = 12,
+    kDNSSDType_HINFO     = 13,
+    kDNSSDType_MINFO     = 14,
+    kDNSSDType_MX        = 15,
+    kDNSSDType_TXT       = 16,
+    kDNSSDType_RP        = 17,
+    kDNSSDType_AFSDB     = 18,
+    kDNSSDType_X25       = 19,
+    kDNSSDType_ISDN      = 20,
+    kDNSSDType_RT        = 21,
+    kDNSSDType_NSAP      = 22,
+    kDNSSDType_NSAP_PTR  = 23,
+    kDNSSDType_SIG       = 24,
+    kDNSSDType_KEY       = 25,
+    kDNSSDType_PX        = 26,
+    kDNSSDType_GPOS      = 27,
+    kDNSSDType_AAAA      = 28,
+    kDNSSDType_LOC       = 29,
+    kDNSSDType_NXT       = 30,
+    kDNSSDType_EID       = 31,
+    kDNSSDType_NIMLOC    = 32,
+    kDNSSDType_SRV       = 33,
+    kDNSSDType_ATMA      = 34,
+    kDNSSDType_NAPTR     = 35,
+    kDNSSDType_KX        = 36,
+    kDNSSDType_CERT      = 37,
+    kDNSSDType_A6        = 38,
+    kDNSSDType_DNAME     = 39,
+    kDNSSDType_SINK      = 40,
+    kDNSSDType_OPT       = 41,
+    kDNSSDType_APL       = 42,
+    kDNSSDType_DS        = 43,
+    kDNSSDType_SSHFP     = 44,
+    kDNSSDType_IPSECKEY  = 45,
+    kDNSSDType_RRSIG     = 46,
+    kDNSSDType_NSEC      = 47,
+    kDNSSDType_DNSKEY    = 48,
+    kDNSSDType_DHCID     = 49,
+    kDNSSDType_NSEC3     = 50,
+    kDNSSDType_NSEC3PARAM= 51,
+    kDNSSDType_HIP       = 55,
+    kDNSSDType_SPF       = 99,
+    kDNSSDType_UINFO     = 100,
+    kDNSSDType_UID       = 101,
+    kDNSSDType_GID       = 102,
+    kDNSSDType_UNSPEC    = 103,
+    kDNSSDType_TKEY      = 249,
+    kDNSSDType_TSIG      = 250,
+    kDNSSDType_IXFR      = 251,
+    kDNSSDType_AXFR      = 252,
+    kDNSSDType_MAILB     = 253,
+    kDNSSDType_MAILA     = 254,
+    kDNSSDType_ANY       = 255
+
+} DNSSDRRType;
+
+
+
+
+
+typedef [ uuid(3B0059E7-5297-4301-9AAB-1522F31EC8A7) ]
+
+enum DNSSDError
+{
+	kDNSSDError_NoError                   = 0,
+	kDNSSDError_Unknown                   = -65537,
+	kDNSSDError_NoSuchName                = -65538,
+    kDNSSDError_NoMemory                  = -65539,
+    kDNSSDError_BadParam                  = -65540,
+    kDNSSDError_BadReference              = -65541,
+    kDNSSDError_BadState                  = -65542,
+    kDNSSDError_BadFlags                  = -65543,
+    kDNSSDError_Unsupported               = -65544,
+    kDNSSDError_NotInitialized            = -65545,
+    kDNSSDError_AlreadyRegistered         = -65547,
+    kDNSSDError_NameConflict              = -65548,
+    kDNSSDError_Invalid                   = -65549,
+    kDNSSDError_Firewall                  = -65550,
+    kDNSSDError_Incompatible              = -65551,
+    kDNSSDError_BadInterfaceIndex         = -65552,
+    kDNSSDError_Refused                   = -65553,
+    kDNSSDError_NoSuchRecord              = -65554,
+    kDNSSDError_NoAuth                    = -65555,
+    kDNSSDError_NoSuchKey                 = -65556,
+    kDNSSDError_NATTraversal              = -65557,
+    kDNSSDError_DoubleNAT                 = -65558,
+    kDNSSDError_BadTime                   = -65559,
+    kDNSSDError_BadSig                    = -65560,
+    kDNSSDError_BadKey                    = -65561,
+    kDNSSDError_Transient                 = -65562,
+    kDNSSDError_ServiceNotRunning         = -65563,  /* Background daemon not running */
+    kDNSSDError_NATPortMappingUnsupported = -65564,  /* NAT doesn't support NAT-PMP or UPnP */
+    kDNSSDError_NATPortMappingDisabled    = -65565,  /* NAT supports NAT-PMP or UPnP but it's disabled by the administrator */
+    kDNSSDError_NoRouter                  = -65566,  /* No router currently configured (probably no network connectivity) */
+    kDNSSDError_PollingMode               = -65567
+} DNSSDError;
+
+
+
+import "oaidl.idl";
+
+import "ocidl.idl";
+
+
+
+
+
+[
+
+	object,
+
+	uuid(8FA0889C-5973-4FC9-970B-EC15C925D0CE),
+
+	dual,
+
+	nonextensible,
+
+	helpstring("ITXTRecord Interface"),
+
+	pointer_default(unique)
+
+]
+
+interface ITXTRecord : IDispatch{
+
+	[id(1), helpstring("method SetValue")] HRESULT SetValue([in] BSTR key, [in] VARIANT value);
+
+	[id(2), helpstring("method RemoveValue")] HRESULT RemoveValue([in] BSTR key);
+
+	[id(3), helpstring("method ContainsKey")] HRESULT ContainsKey([in] BSTR key, [out,retval] VARIANT_BOOL* retval);
+
+	[id(4), helpstring("method GetValueForKey")] HRESULT GetValueForKey([in] BSTR key, [out,retval] VARIANT* value);
+
+	[id(5), helpstring("method GetCount")] HRESULT GetCount([out,retval] ULONG* count);
+
+	[id(6), helpstring("method GetKeyAtIndex")] HRESULT GetKeyAtIndex([in] ULONG index, [out,retval] BSTR* retval);
+
+	[id(7), helpstring("method GetValueAtIndex")] HRESULT GetValueAtIndex([in] ULONG index, [out,retval] VARIANT* retval);
+
+};
+
+[
+
+	object,
+
+	uuid(9CE603A0-3365-4DA0-86D1-3F780ECBA110),
+
+	dual,
+
+	nonextensible,
+
+	helpstring("IDNSSDRecord Interface"),
+
+	pointer_default(unique)
+
+]
+
+interface IDNSSDRecord : IDispatch{
+
+	[id(1), helpstring("method Update")] HRESULT Update([in] DNSSDFlags flags, [in] VARIANT rdata, [in] ULONG ttl);
+
+	[id(2), helpstring("method Remove")] HRESULT Remove([in] DNSSDFlags flags);
+
+};
+
+[
+
+	object,
+
+	uuid(7FD72324-63E1-45AD-B337-4D525BD98DAD),
+
+	dual,
+
+	nonextensible,
+
+	helpstring("IDNSSDEventManager Interface"),
+
+	pointer_default(unique)
+
+]
+
+interface IDNSSDEventManager : IDispatch{
+
+};
+
+[
+
+	object,
+
+	uuid(29DE265F-8402-474F-833A-D4653B23458F),
+
+	dual,
+
+	nonextensible,
+
+	helpstring("IDNSSDService Interface"),
+
+	pointer_default(unique)
+
+]
+
+interface IDNSSDService : IDispatch{
+
+	[id(1), helpstring("method EnumerateDomains")] HRESULT EnumerateDomains([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** service);
+
+	[id(2), helpstring("method Browse"), local] HRESULT Browse([in] DNSSDFlags flags, [in] ULONG interfaceIndex, [in] BSTR regtype, [in] BSTR domain, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** sdref);
+
+	[id(3), helpstring("method Resolve")] HRESULT Resolve([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR serviceName, [in] BSTR regType, [in] BSTR domain, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** service);
+
+	[id(4), helpstring("method Register")] HRESULT Register([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR name, [in] BSTR regType, [in] BSTR domain, [in] BSTR host, [in] USHORT port, [in] ITXTRecord* record, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** service);
+
+	[id(5), helpstring("method QueryRecord")] HRESULT QueryRecord([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR fullname, [in] DNSSDRRType rrtype, [in] DNSSDRRClass rrclass, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** service);
+
+	[id(6), helpstring("method RegisterRecord")] HRESULT RegisterRecord([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR fullname, [in] DNSSDRRType rrtype, [in] DNSSDRRClass rrclass, [in] VARIANT rdata, [in] ULONG ttl, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDRecord** record);
+
+	[id(7), helpstring("method AddRecord")] HRESULT AddRecord([in] DNSSDFlags flags, [in] DNSSDRRType rrtype, [in] VARIANT rdata, [in] ULONG ttl, [out,retval] IDNSSDRecord** record);
+
+	[id(8), helpstring("method ReconfirmRecord")] HRESULT ReconfirmRecord([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR fullname, [in] DNSSDRRType rrtype, [in] DNSSDRRClass rrclass, [in] VARIANT rdata);
+
+	[id(9), helpstring("method GetProperty")] HRESULT GetProperty([in] BSTR prop, [in,out] VARIANT * value );	
+
+	[id(10), helpstring("method GetAddrInfo")] HRESULT GetAddrInfo([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] DNSSDAddressFamily addressFamily, [in] BSTR hostname, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** service);
+
+	[id(11), helpstring("method NATPortMappingCreate")] HRESULT NATPortMappingCreate([in] DNSSDFlags flags, [in] ULONG ifIndex, [in] DNSSDAddressFamily addressFamily, [in] DNSSDProtocol protocol, [in] USHORT internalPort, [in] USHORT externalPort, [in] ULONG ttl, [in] IDNSSDEventManager* eventManager, [out,retval] IDNSSDService** service);
+
+	[id(12), helpstring("method Stop"), local] HRESULT Stop(void);
+
+};
+
+[
+
+	uuid(18FBED6D-F2B7-4EC8-A4A4-46282E635308),
+
+	version(1.0),
+
+	helpstring("Apple Bonjour Library 1.0")
+
+]
+
+library Bonjour
+
+{
+
+	importlib("stdole2.tlb");
+
+	[
+
+		uuid(21AE8D7F-D5FE-45cf-B632-CFA2C2C6B498),
+
+		helpstring("_IDNSSDEvents Interface")
+
+	]
+
+	dispinterface _IDNSSDEvents
+
+	{
+
+		properties:
+
+		methods:
+
+		[id(1), helpstring("method DomainFound")] void DomainFound([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR domain);
+
+		[id(2), helpstring("method DomainLost")] void DomainLost([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR domain);
+
+		[id(3), helpstring("method ServiceFound")] void ServiceFound([in] IDNSSDService* browser, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR serviceName, [in] BSTR regType, [in] BSTR domain);
+
+		[id(4), helpstring("method ServiceLost")] void ServiceLost([in] IDNSSDService* browser, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR serviceName, [in] BSTR regType, [in] BSTR domain);
+
+		[id(5), helpstring("method ServiceResolved")] void ServiceResolved([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR fullName, [in] BSTR hostName, [in] USHORT port, [in] ITXTRecord* record);
+
+		[id(6), helpstring("method ServiceRegistered")] void ServiceRegistered([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] BSTR name, [in] BSTR regType, [in] BSTR domain);
+
+		[id(7), helpstring("method QueryRecordAnswered")] void QueryRecordAnswered([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR fullName, [in] DNSSDRRType rrtype, [in] DNSSDRRClass rrclass, [in] VARIANT rdata, [in] ULONG ttl);
+
+		[id(8), helpstring("method RecordRegistered")] void RecordRegistered([in] IDNSSDRecord* record, [in] DNSSDFlags flags);
+
+		[id(9), helpstring("method AddressFound")] void AddressFound([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] BSTR hostname, [in] DNSSDAddressFamily addressFamily, [in] BSTR address, [in] ULONG ttl);
+
+		[id(10), helpstring("method MappingCreated")] void MappingCreated([in] IDNSSDService* service, [in] DNSSDFlags flags, [in] ULONG ifIndex, [in] ULONG externalAddress, [in] DNSSDAddressFamily addressFamily, [in] DNSSDProtocol protocol, [in] USHORT internalPort, [in] USHORT externalPort, [in] ULONG ttl);
+
+		[id(11), helpstring("method OperationFailed")] void OperationFailed([in] IDNSSDService* service, [in] DNSSDError error);
+
+	};
+
+	[
+
+		uuid(24CD4DE9-FF84-4701-9DC1-9B69E0D1090A),
+
+		helpstring("DNSSDService Class")
+
+	]
+
+	coclass DNSSDService
+
+	{
+
+		[default] interface IDNSSDService;
+
+	};
+
+	[
+
+		uuid(AFEE063C-05BA-4248-A26E-168477F49734),
+
+		helpstring("TXTRecord Class")
+
+	]
+
+	coclass TXTRecord
+
+	{
+
+		[default] interface ITXTRecord;
+
+	};
+
+	[
+
+		uuid(5E93C5A9-7516-4259-A67B-41A656F6E01C),
+
+		helpstring("DNSSDRecord Class")
+
+	]
+
+	coclass DNSSDRecord
+
+	{
+
+		[default] interface IDNSSDRecord;
+
+	};
+
+	[
+
+		uuid(BEEB932A-8D4A-4619-AEFE-A836F988B221),
+
+		helpstring("DNSSDEventManager Class")
+
+	]
+
+	coclass DNSSDEventManager
+
+	{
+
+		[default] interface IDNSSDEventManager;
+
+		[default, source] dispinterface _IDNSSDEvents;
+
+	};
+
+	enum DNSSDFlags;
+
+	enum DNSSDAddressFamily;
+
+	enum DNSSDProtocol;
+
+	enum DNSSDRRClass;
+
+	enum DNSSDRRType;
+
+	enum DNSSDError;
+
+};
+
diff --git a/mDNSWindows/DLLX/DLLX.rc b/mDNSWindows/DLLX/DLLX.rc
new file mode 100755
index 0000000..4299b5a
--- /dev/null
+++ b/mDNSWindows/DLLX/DLLX.rc
@@ -0,0 +1,126 @@
+// Microsoft Visual C++ generated resource script.

+//

+#include "resource.h"

+

+#define APSTUDIO_READONLY_SYMBOLS

+/////////////////////////////////////////////////////////////////////////////

+//

+// Generated from the TEXTINCLUDE 2 resource.

+//

+#include "winres.h"

+#include "WinVersRes.h"

+

+/////////////////////////////////////////////////////////////////////////////

+#undef APSTUDIO_READONLY_SYMBOLS

+

+/////////////////////////////////////////////////////////////////////////////

+// English (U.S.) resources

+

+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

+#ifdef _WIN32

+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

+#pragma code_page(1252)

+#endif //_WIN32

+

+#ifdef APSTUDIO_INVOKED

+/////////////////////////////////////////////////////////////////////////////

+//

+// TEXTINCLUDE

+//

+

+1 TEXTINCLUDE 

+BEGIN

+    "resource.h\0"

+END

+

+2 TEXTINCLUDE 

+BEGIN

+    "#include ""winres.h""\r\n"

+    "#include ""WinVersRes.h""\r\n"

+    "\0"

+END

+

+3 TEXTINCLUDE 

+BEGIN

+    "1 TYPELIB ""BonjourLib.tlb""\r\n"

+    "\0"

+END

+

+#endif    // APSTUDIO_INVOKED

+

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// Version

+//

+

+VS_VERSION_INFO VERSIONINFO

+ FILEVERSION MASTER_PROD_VERS

+ PRODUCTVERSION MASTER_PROD_VERS

+ FILEFLAGSMASK 0x3fL

+#ifdef _DEBUG

+ FILEFLAGS 0x1L

+#else

+ FILEFLAGS 0x0L

+#endif

+ FILEOS 0x4L

+ FILETYPE 0x2L

+ FILESUBTYPE 0x0L

+BEGIN

+    BLOCK "StringFileInfo"

+    BEGIN

+        BLOCK "040904e4"

+        BEGIN

+            VALUE "CompanyName", MASTER_COMPANY_NAME

+            VALUE "FileDescription", "Bonjour COM Component Library"

+            VALUE "FileVersion", MASTER_PROD_VERS_STR

+            VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT

+            VALUE "InternalName", "dnssdX.dll"

+            VALUE "OriginalFilename", "dnssdX.dll"

+            VALUE "ProductName", MASTER_PROD_NAME

+            VALUE "ProductVersion", MASTER_PROD_VERS_STR

+        END

+    END

+    BLOCK "VarFileInfo"

+    BEGIN

+        VALUE "Translation", 0x409, 1252

+    END

+END

+

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// REGISTRY

+//

+

+IDR_DLLX		        REGISTRY                "DLLX.rgs"

+IDR_DNSSDSERVICE        REGISTRY                "DNSSDService.rgs"

+IDR_TXTRECORD           REGISTRY                "TXTRecord.rgs"

+IDR_DNSSDRECORD         REGISTRY                "DNSSDRecord.rgs"

+IDR_DNSSDEVENTMANAGER   REGISTRY                "DNSSDEventManager.rgs"

+

+/////////////////////////////////////////////////////////////////////////////

+//

+// String Table

+//

+

+STRINGTABLE 

+BEGIN

+    IDS_PROJNAME            "BonjourLib"

+END

+

+#endif    // English (U.S.) resources

+/////////////////////////////////////////////////////////////////////////////

+

+

+

+#ifndef APSTUDIO_INVOKED

+/////////////////////////////////////////////////////////////////////////////

+//

+// Generated from the TEXTINCLUDE 3 resource.

+//

+1 TYPELIB "dnssdX.tlb"

+

+/////////////////////////////////////////////////////////////////////////////

+#endif    // not APSTUDIO_INVOKED

+

diff --git a/mDNSWindows/DLLX/DLLX.rgs b/mDNSWindows/DLLX/DLLX.rgs
new file mode 100755
index 0000000..c55ee8d
--- /dev/null
+++ b/mDNSWindows/DLLX/DLLX.rgs
@@ -0,0 +1,11 @@
+HKCR

+{

+	NoRemove AppID

+	{

+		'%APPID%' = s 'Bonjour'

+		'Bonjour.DLL'

+		{

+			val AppID = s '%APPID%'

+		}

+	}

+}

diff --git a/mDNSWindows/DLLX/DLLX.vcproj b/mDNSWindows/DLLX/DLLX.vcproj
new file mode 100755
index 0000000..7c58b0a
--- /dev/null
+++ b/mDNSWindows/DLLX/DLLX.vcproj
@@ -0,0 +1,625 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="8.00"

+	Name="DLLX"

+	ProjectGUID="{78FBFCC5-2873-4AE2-9114-A08082F71124}"

+	RootNamespace="DLLX"

+	Keyword="AtlProj"

+	>

+	<Platforms>

+		<Platform

+			Name="Win32"

+		/>

+		<Platform

+			Name="x64"

+		/>

+	</Platforms>

+	<ToolFiles>

+	</ToolFiles>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			UseOfMFC="0"

+			UseOfATL="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="_DEBUG"

+				MkTypLibCompatible="false"

+				TargetEnvironment="1"

+				GenerateStublessProxies="true"

+				TypeLibraryName="$(IntDir)/dnssdX.tlb"

+				HeaderFileName="DLLX.h"

+				DLLDataFileName=""

+				InterfaceIdentifierFileName="DLLX_i.c"

+				ProxyFileName="DLLX_p.c"

+				ValidateParameters="false"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories="..\..\mDNSShared;..\..\mDNSWindows"

+				PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_MERGE_PROXYSTUB;DEBUG=1;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				MinimalRebuild="true"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				UsePrecompiledHeader="0"

+				WarningLevel="3"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories="..;&quot;$(IntDir)&quot;"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				RegisterOutput="true"

+				IgnoreImportLibrary="true"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"

+				AdditionalDependencies="ws2_32.lib ../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib"

+				OutputFile="$(OutDir)\dnssdX.dll"

+				LinkIncremental="2"

+				ModuleDefinitionFile=".\DLLX.def"

+				GenerateDebugInformation="true"

+				SubSystem="2"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Debug|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			UseOfMFC="0"

+			UseOfATL="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="_DEBUG"

+				MkTypLibCompatible="false"

+				TargetEnvironment="3"

+				GenerateStublessProxies="true"

+				TypeLibraryName="$(IntDir)/dnssdX.tlb"

+				HeaderFileName="DLLX.h"

+				DLLDataFileName=""

+				InterfaceIdentifierFileName="DLLX_i.c"

+				ProxyFileName="DLLX_p.c"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				AdditionalIncludeDirectories="..\..\mDNSShared;..\..\mDNSWindows"

+				PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUG;_USRDLL;_MERGE_PROXYSTUB;DEBUG=1;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				MinimalRebuild="true"

+				BasicRuntimeChecks="3"

+				RuntimeLibrary="1"

+				UsePrecompiledHeader="0"

+				WarningLevel="3"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="_DEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories="..;&quot;$(IntDir)&quot;"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				RegisterOutput="true"

+				IgnoreImportLibrary="true"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE"

+				AdditionalDependencies="ws2_32.lib ../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib"

+				OutputFile="$(OutDir)\dnssdX.dll"

+				LinkIncremental="2"

+				ModuleDefinitionFile=".\DLLX.def"

+				GenerateDebugInformation="true"

+				SubSystem="2"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			UseOfATL="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="NDEBUG"

+				MkTypLibCompatible="false"

+				TargetEnvironment="1"

+				GenerateStublessProxies="true"

+				TypeLibraryName="$(IntDir)/dnssdX.tlb"

+				HeaderFileName="DLLX.h"

+				DLLDataFileName=""

+				InterfaceIdentifierFileName="DLLX_i.c"

+				ProxyFileName="DLLX_p.c"

+				ValidateParameters="false"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="2"

+				AdditionalIncludeDirectories="..\..\mDNSShared;..\..\mDNSWindows"

+				PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_MERGE_PROXYSTUB;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				RuntimeLibrary="0"

+				UsePrecompiledHeader="0"

+				WarningLevel="3"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories="..;&quot;$(IntDir)&quot;"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				RegisterOutput="false"

+				IgnoreImportLibrary="true"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"

+				AdditionalDependencies="ws2_32.lib ../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib"

+				OutputFile="$(OutDir)\dnssdX.dll"

+				LinkIncremental="1"

+				ModuleDefinitionFile=".\DLLX.def"

+				GenerateDebugInformation="true"

+				SubSystem="2"

+				OptimizeReferences="2"

+				EnableCOMDATFolding="2"

+				TargetMachine="1"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="if not &quot;%RC_XBS%&quot; == &quot;YES&quot; goto END&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;             mkdir &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot;                                                                            &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"

+			/>

+		</Configuration>

+		<Configuration

+			Name="Release|x64"

+			OutputDirectory="$(PlatformName)\$(ConfigurationName)"

+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"

+			ConfigurationType="2"

+			UseOfATL="1"

+			ATLMinimizesCRunTimeLibraryUsage="false"

+			CharacterSet="1"

+			>

+			<Tool

+				Name="VCPreBuildEventTool"

+			/>

+			<Tool

+				Name="VCCustomBuildTool"

+			/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"

+			/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"

+			/>

+			<Tool

+				Name="VCMIDLTool"

+				PreprocessorDefinitions="NDEBUG"

+				MkTypLibCompatible="false"

+				TargetEnvironment="3"

+				GenerateStublessProxies="true"

+				TypeLibraryName="$(IntDir)/dnssdX.tlb"

+				HeaderFileName="DLLX.h"

+				DLLDataFileName=""

+				InterfaceIdentifierFileName="DLLX_i.c"

+				ProxyFileName="DLLX_p.c"

+			/>

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="2"

+				AdditionalIncludeDirectories="..\..\mDNSShared;..\..\mDNSWindows"

+				PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_MERGE_PROXYSTUB;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"

+				RuntimeLibrary="0"

+				UsePrecompiledHeader="0"

+				WarningLevel="3"

+				Detect64BitPortabilityProblems="true"

+				DebugInformationFormat="3"

+			/>

+			<Tool

+				Name="VCManagedResourceCompilerTool"

+			/>

+			<Tool

+				Name="VCResourceCompilerTool"

+				PreprocessorDefinitions="NDEBUG"

+				Culture="1033"

+				AdditionalIncludeDirectories="..;&quot;$(IntDir)&quot;"

+			/>

+			<Tool

+				Name="VCPreLinkEventTool"

+			/>

+			<Tool

+				Name="VCLinkerTool"

+				RegisterOutput="false"

+				IgnoreImportLibrary="true"

+				AdditionalOptions="/NXCOMPAT /DYNAMICBASE"

+				AdditionalDependencies="ws2_32.lib ../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib"

+				OutputFile="$(OutDir)\dnssdX.dll"

+				LinkIncremental="1"

+				ModuleDefinitionFile=".\DLLX.def"

+				GenerateDebugInformation="true"

+				SubSystem="2"

+				OptimizeReferences="2"

+				EnableCOMDATFolding="2"

+				TargetMachine="17"

+			/>

+			<Tool

+				Name="VCALinkTool"

+			/>

+			<Tool

+				Name="VCManifestTool"

+			/>

+			<Tool

+				Name="VCXDCMakeTool"

+			/>

+			<Tool

+				Name="VCBscMakeTool"

+			/>

+			<Tool

+				Name="VCFxCopTool"

+			/>

+			<Tool

+				Name="VCAppVerifierTool"

+			/>

+			<Tool

+				Name="VCWebDeploymentTool"

+			/>

+			<Tool

+				Name="VCPostBuildEventTool"

+				CommandLine="if not &quot;%RC_XBS%&quot; == &quot;YES&quot; goto END&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;             mkdir &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot;                                                                            &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"

+			/>

+		</Configuration>

+	</Configurations>

+	<References>

+	</References>

+	<Files>

+		<Filter

+			Name="Source Files"

+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"

+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"

+			>

+			<File

+				RelativePath=".\dlldatax.c"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+			</File>

+			<File

+				RelativePath=".\DLLX.cpp"

+				>

+			</File>

+			<File

+				RelativePath=".\DLLX.def"

+				>

+			</File>

+			<File

+				RelativePath=".\DLLX.idl"

+				>

+			</File>

+			<File

+				RelativePath=".\DNSSDEventManager.cpp"

+				>

+			</File>

+			<File

+				RelativePath=".\DNSSDRecord.cpp"

+				>

+			</File>

+			<File

+				RelativePath=".\DNSSDService.cpp"

+				>

+			</File>

+			<File

+				RelativePath=".\TXTRecord.cpp"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl;inc;xsd"

+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"

+			>

+			<File

+				RelativePath=".\_IDNSSDEvents_CP.H"

+				>

+			</File>

+			<File

+				RelativePath=".\dlldatax.h"

+				>

+			</File>

+			<File

+				RelativePath=".\DNSSDEventManager.h"

+				>

+			</File>

+			<File

+				RelativePath=".\DNSSDRecord.h"

+				>

+			</File>

+			<File

+				RelativePath=".\DNSSDService.h"

+				>

+			</File>

+			<File

+				RelativePath=".\Resource.h"

+				>

+			</File>

+			<File

+				RelativePath=".\stdafx.h"

+				>

+			</File>

+			<File

+				RelativePath=".\TXTRecord.h"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Resource Files"

+			Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"

+			UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"

+			>

+			<File

+				RelativePath=".\DLLX.rc"

+				>

+			</File>

+			<File

+				RelativePath=".\DLLX.rgs"

+				>

+			</File>

+			<File

+				RelativePath=".\DNSSDEventManager.rgs"

+				>

+			</File>

+			<File

+				RelativePath=".\DNSSDRecord.rgs"

+				>

+			</File>

+			<File

+				RelativePath=".\DNSSDService.rgs"

+				>

+			</File>

+			<File

+				RelativePath=".\TXTRecord.rgs"

+				>

+			</File>

+		</Filter>

+		<Filter

+			Name="Generated Files"

+			SourceControlFiles="false"

+			>

+			<File

+				RelativePath=".\DLLX.h"

+				>

+			</File>

+			<File

+				RelativePath=".\DLLX_i.c"

+				>

+				<FileConfiguration

+					Name="Debug|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Debug|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|Win32"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+				<FileConfiguration

+					Name="Release|x64"

+					>

+					<Tool

+						Name="VCCLCompilerTool"

+						UsePrecompiledHeader="0"

+					/>

+				</FileConfiguration>

+			</File>

+		</Filter>

+		<Filter

+			Name="Support Files"

+			>

+			<File

+				RelativePath="..\..\mDNSShared\CommonServices.h"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\DebugServices.c"

+				>

+			</File>

+			<File

+				RelativePath="..\..\mDNSShared\DebugServices.h"

+				>

+			</File>

+			<File

+				RelativePath=".\StringServices.cpp"

+				>

+			</File>

+			<File

+				RelativePath=".\StringServices.h"

+				>

+			</File>

+		</Filter>

+	</Files>

+	<Globals>

+	</Globals>

+</VisualStudioProject>

diff --git a/mDNSWindows/DLLX/DNSSD.cpp b/mDNSWindows/DLLX/DNSSD.cpp
new file mode 100755
index 0000000..84a8206
--- /dev/null
+++ b/mDNSWindows/DLLX/DNSSD.cpp
@@ -0,0 +1,892 @@
+// 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
+    (
+    DNSServiceRef                       sdRef,
+    DNSServiceFlags                     flags,
+    uint32_t                            ifIndex,
+    DNSServiceErrorType                 errorCode,
+    const char                          *replyDomainUTF8,
+    void                                *context
+    )

+{

+	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
+		(
+		DNSServiceRef                       sdRef,
+		DNSServiceFlags                     flags,
+		uint32_t                            ifIndex,
+		DNSServiceErrorType                 errorCode,
+		const char                          *serviceNameUTF8,
+		const char                          *regTypeUTF8,
+		const char                          *replyDomainUTF8,
+		void                                *context
+		)

+{

+	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,
+		uint32_t                            ifIndex,
+		DNSServiceErrorType                 errorCode,
+		const char                          *fullNameUTF8,
+		const char                          *hostNameUTF8,
+		uint16_t                            port,
+		uint16_t                            txtLen,
+		const unsigned char                 *txtRecord,
+		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
+		(
+		DNSServiceRef                       sdRef,
+		DNSServiceFlags                     flags,
+		DNSServiceErrorType                 errorCode,
+		const char                          *serviceNameUTF8,
+		const char                          *regTypeUTF8,
+		const char                          *domainUTF8,
+		void                                *context
+		)

+{

+	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
+		(
+		DNSServiceRef                       sdRef,
+		DNSServiceFlags                     flags,
+		uint32_t                            ifIndex,
+		DNSServiceErrorType                 errorCode,
+		const char                          *fullNameUTF8,
+		uint16_t                            rrtype,
+		uint16_t                            rrclass,
+		uint16_t                            rdlen,
+		const void                          *rdata,
+		uint32_t                            ttl,
+		void                                *context
+		)

+{

+	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
+		(
+		DNSServiceRef                    sdRef,
+		DNSServiceFlags                  flags,
+		uint32_t                         ifIndex,
+		DNSServiceErrorType              errorCode,
+		const char                       *hostNameUTF8,
+		const struct sockaddr            *rawAddress,
+		uint32_t                         ttl,
+		void                             *context
+		)

+{

+	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
+    (
+    DNSServiceRef                    sdRef,
+    DNSServiceFlags                  flags,
+    uint32_t                         ifIndex,
+    DNSServiceErrorType              errorCode,
+    uint32_t                         externalAddress,   /* four byte IPv4 address in network byte order */
+    DNSServiceProtocol               protocol,
+    uint16_t                         internalPort,
+    uint16_t                         externalPort,      /* may be different than the requested port     */
+    uint32_t                         ttl,               /* may be different than the requested ttl      */
+    void                             *context
+    )

+{

+	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;

+}

+

diff --git a/mDNSWindows/DLLX/DNSSDEventManager.cpp b/mDNSWindows/DLLX/DNSSDEventManager.cpp
new file mode 100755
index 0000000..310ced0
--- /dev/null
+++ b/mDNSWindows/DLLX/DNSSDEventManager.cpp
@@ -0,0 +1,31 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2009 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 "stdafx.h"
+
+#include "DNSSDEventManager.h"
+
+
+
+
+
+// CDNSSDEventManager
+
+
+
diff --git a/mDNSWindows/DLLX/DNSSDEventManager.h b/mDNSWindows/DLLX/DNSSDEventManager.h
new file mode 100755
index 0000000..70aedfc
--- /dev/null
+++ b/mDNSWindows/DLLX/DNSSDEventManager.h
@@ -0,0 +1,133 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2009 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.
+ */
+
+
+
+#pragma once
+
+#include "resource.h"       // main symbols
+
+
+
+#include "DLLX.h"
+
+#include "_IDNSSDEvents_CP.H"
+
+
+
+
+
+#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
+
+#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
+
+#endif
+
+
+
+
+
+
+
+// CDNSSDEventManager
+
+
+
+class ATL_NO_VTABLE CDNSSDEventManager :
+
+	public CComObjectRootEx<CComSingleThreadModel>,
+
+	public CComCoClass<CDNSSDEventManager, &CLSID_DNSSDEventManager>,
+
+	public IConnectionPointContainerImpl<CDNSSDEventManager>,
+
+	public CProxy_IDNSSDEvents<CDNSSDEventManager>,
+
+	public IDispatchImpl<IDNSSDEventManager, &IID_IDNSSDEventManager, &LIBID_Bonjour, /*wMajor =*/ 1, /*wMinor =*/ 0>
+
+{
+
+public:
+
+	CDNSSDEventManager()
+
+	{
+
+	}
+
+
+
+DECLARE_REGISTRY_RESOURCEID(IDR_DNSSDEVENTMANAGER)
+
+
+
+
+
+BEGIN_COM_MAP(CDNSSDEventManager)
+
+	COM_INTERFACE_ENTRY(IDNSSDEventManager)
+
+	COM_INTERFACE_ENTRY(IDispatch)
+
+	COM_INTERFACE_ENTRY(IConnectionPointContainer)
+
+END_COM_MAP()
+
+
+
+BEGIN_CONNECTION_POINT_MAP(CDNSSDEventManager)
+
+	CONNECTION_POINT_ENTRY(__uuidof(_IDNSSDEvents))
+
+END_CONNECTION_POINT_MAP()
+
+
+
+
+
+	DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+
+
+	HRESULT FinalConstruct()
+
+	{
+
+		return S_OK;
+
+	}
+
+
+
+	void FinalRelease()
+
+	{
+
+	}
+
+
+
+public:
+
+
+
+};
+
+
+
+OBJECT_ENTRY_AUTO(__uuidof(DNSSDEventManager), CDNSSDEventManager)
+
diff --git a/mDNSWindows/DLLX/DNSSDEventManager.rgs b/mDNSWindows/DLLX/DNSSDEventManager.rgs
new file mode 100755
index 0000000..9103512
--- /dev/null
+++ b/mDNSWindows/DLLX/DNSSDEventManager.rgs
@@ -0,0 +1,27 @@
+HKCR

+{

+	Bonjour.DNSSDEventManager.1 = s 'DNSSDEventManager Class'

+	{

+		CLSID = s '{BEEB932A-8D4A-4619-AEFE-A836F988B221}'

+	}

+	Bonjour.DNSSDEventManager = s 'DNSSDEventManager Class'

+	{

+		CLSID = s '{BEEB932A-8D4A-4619-AEFE-A836F988B221}'

+		CurVer = s 'Bonjour.DNSSDEventManager.1'

+	}

+	NoRemove CLSID

+	{

+		ForceRemove {BEEB932A-8D4A-4619-AEFE-A836F988B221} = s 'DNSSDEventManager Class'

+		{

+			ProgID = s 'Bonjour.DNSSDEventManager.1'

+			VersionIndependentProgID = s 'Bonjour.DNSSDEventManager'

+			ForceRemove 'Programmable'

+			InprocServer32 = s '%MODULE%'

+			{

+				val ThreadingModel = s 'Apartment'

+			}

+			val AppID = s '%APPID%'

+			'TypeLib' = s '{18FBED6D-F2B7-4EC8-A4A4-46282E635308}'

+		}

+	}

+}

diff --git a/mDNSWindows/DLLX/DNSSDRecord.cpp b/mDNSWindows/DLLX/DNSSDRecord.cpp
new file mode 100755
index 0000000..a272720
--- /dev/null
+++ b/mDNSWindows/DLLX/DNSSDRecord.cpp
@@ -0,0 +1,101 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2009 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 "stdafx.h"
+
+#include "DNSSDRecord.h"
+
+#include "StringServices.h"
+
+#include <DebugServices.h>
+
+
+
+
+
+// CDNSSDRecord
+
+
+
+STDMETHODIMP CDNSSDRecord::Update(DNSSDFlags flags, VARIANT rdata, ULONG ttl)
+
+{
+
+	std::vector< BYTE >	byteArray;
+
+	const void		*	byteArrayPtr	= NULL;
+
+	DNSServiceErrorType	err				= 0;
+
+	HRESULT				hr				= 0;
+
+	BOOL				ok;
+
+
+
+	// Convert the VARIANT
+
+	ok = VariantToByteArray( &rdata, byteArray );
+
+	require_action( ok, exit, err = kDNSServiceErr_Unknown );
+
+
+
+	err = DNSServiceUpdateRecord( m_serviceObject->GetSubordRef(), m_rref, flags, ( uint16_t ) byteArray.size(), byteArray.size() > 0 ? &byteArray[ 0 ] : NULL, ttl );
+
+	require_noerr( err, exit );
+
+
+
+exit:
+
+
+
+	return err;
+
+}
+
+
+
+
+
+STDMETHODIMP CDNSSDRecord::Remove(DNSSDFlags flags)
+
+{
+
+	DNSServiceErrorType	err = 0;
+
+
+
+	err = DNSServiceRemoveRecord( m_serviceObject->GetSubordRef(), m_rref, flags );
+
+	require_noerr( err, exit );
+
+
+
+exit:
+
+
+
+	return err;
+
+}
+
+
+
diff --git a/mDNSWindows/DLLX/DNSSDRecord.h b/mDNSWindows/DLLX/DNSSDRecord.h
new file mode 100755
index 0000000..bdedda5
--- /dev/null
+++ b/mDNSWindows/DLLX/DNSSDRecord.h
@@ -0,0 +1,185 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2009 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.
+ */
+
+
+
+#pragma once
+
+#include "resource.h"       // main symbols
+
+
+
+#include "DLLX.h"
+
+#include "DNSSDService.h"
+
+#include <dns_sd.h>
+
+
+
+
+
+#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
+
+#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
+
+#endif
+
+
+
+
+
+
+
+// CDNSSDRecord
+
+
+
+class ATL_NO_VTABLE CDNSSDRecord :
+
+	public CComObjectRootEx<CComSingleThreadModel>,
+
+	public CComCoClass<CDNSSDRecord, &CLSID_DNSSDRecord>,
+
+	public IDispatchImpl<IDNSSDRecord, &IID_IDNSSDRecord, &LIBID_Bonjour, /*wMajor =*/ 1, /*wMinor =*/ 0>
+
+{
+
+public:
+
+	CDNSSDRecord()
+
+	{
+
+	}
+
+
+
+DECLARE_REGISTRY_RESOURCEID(IDR_DNSSDRECORD)
+
+
+
+
+
+BEGIN_COM_MAP(CDNSSDRecord)
+
+	COM_INTERFACE_ENTRY(IDNSSDRecord)
+
+	COM_INTERFACE_ENTRY(IDispatch)
+
+END_COM_MAP()
+
+
+
+
+
+
+
+	DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+
+
+	HRESULT FinalConstruct()
+
+	{
+
+		return S_OK;
+
+	}
+
+
+
+	void FinalRelease()
+
+	{
+
+	}
+
+
+
+	inline CDNSSDService*
+
+	GetServiceObject()
+
+	{
+
+		return m_serviceObject;
+
+	}
+
+
+
+	inline void
+
+	SetServiceObject( CDNSSDService * serviceObject )
+
+	{
+
+		m_serviceObject = serviceObject;
+
+	}
+
+
+
+	inline DNSRecordRef
+
+	GetRecordRef()
+
+	{
+
+		return m_rref;
+
+	}
+
+
+
+	inline void
+
+	SetRecordRef( DNSRecordRef rref )
+
+	{
+
+		m_rref = rref;
+
+	}
+
+
+
+public:
+
+
+
+	STDMETHOD(Update)(DNSSDFlags flags, VARIANT rdata, ULONG ttl);
+
+	STDMETHOD(Remove)(DNSSDFlags flags);
+
+
+
+private:
+
+
+
+	CDNSSDService *	m_serviceObject;
+
+	DNSRecordRef	m_rref;
+
+};
+
+
+
+OBJECT_ENTRY_AUTO(__uuidof(DNSSDRecord), CDNSSDRecord)
+
diff --git a/mDNSWindows/DLLX/DNSSDRecord.rgs b/mDNSWindows/DLLX/DNSSDRecord.rgs
new file mode 100755
index 0000000..ee0a5a2
--- /dev/null
+++ b/mDNSWindows/DLLX/DNSSDRecord.rgs
@@ -0,0 +1,27 @@
+HKCR

+{

+	Bonjour.DNSSDRecord.1 = s 'DNSSDRecord Class'

+	{

+		CLSID = s '{5E93C5A9-7516-4259-A67B-41A656F6E01C}'

+	}

+	Bonjour.DNSSDRecord = s 'DNSSDRecord Class'

+	{

+		CLSID = s '{5E93C5A9-7516-4259-A67B-41A656F6E01C}'

+		CurVer = s 'Bonjour.DNSSDRecord.1'

+	}

+	NoRemove CLSID

+	{

+		ForceRemove {5E93C5A9-7516-4259-A67B-41A656F6E01C} = s 'DNSSDRecord Class'

+		{

+			ProgID = s 'Bonjour.DNSSDRecord.1'

+			VersionIndependentProgID = s 'Bonjour.DNSSDRecord'

+			ForceRemove 'Programmable'

+			InprocServer32 = s '%MODULE%'

+			{

+				val ThreadingModel = s 'Apartment'

+			}

+			val AppID = s '%APPID%'

+			'TypeLib' = s '{18FBED6D-F2B7-4EC8-A4A4-46282E635308}'

+		}

+	}

+}

diff --git a/mDNSWindows/DLLX/DNSSDService.cpp b/mDNSWindows/DLLX/DNSSDService.cpp
new file mode 100755
index 0000000..b8ce49b
--- /dev/null
+++ b/mDNSWindows/DLLX/DNSSDService.cpp
@@ -0,0 +1,2095 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2009 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.
+ */
+
+
+
+#pragma warning(disable:4995)
+
+
+
+#include "stdafx.h"
+
+#include <strsafe.h>
+
+#include "DNSSDService.h"
+
+#include "DNSSDEventManager.h"
+
+#include "DNSSDRecord.h"
+
+#include "TXTRecord.h"
+
+#include "StringServices.h"