summaryrefslogtreecommitdiffstats
path: root/mDNSResponder/Clients
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-01-30 13:52:13 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-01-30 16:23:04 +0100
commit9449f151d0ccf3ac755d5f2bd9b4057ae2b03157 (patch)
treeada21dc6aa0b146c62a7561a08fb51fe4a8922ee /mDNSResponder/Clients
parentDHCPCD(8): Add MASTER_ONLY option (diff)
downloadrtems-libbsd-9449f151d0ccf3ac755d5f2bd9b4057ae2b03157.tar.bz2
mDNS: Import
The sources can be obtained via: http://opensource.apple.com/tarballs/mDNSResponder/mDNSResponder-544.tar.gz
Diffstat (limited to 'mDNSResponder/Clients')
-rw-r--r--mDNSResponder/Clients/BonjourExample/BonjourExample.cpp199
-rw-r--r--mDNSResponder/Clients/BonjourExample/BonjourExample.sln21
-rw-r--r--mDNSResponder/Clients/BonjourExample/BonjourExample.vcproj156
-rw-r--r--mDNSResponder/Clients/BonjourExample/stdafx.cpp20
-rw-r--r--mDNSResponder/Clients/BonjourExample/stdafx.h30
-rw-r--r--mDNSResponder/Clients/ClientCommon.c75
-rw-r--r--mDNSResponder/Clients/ClientCommon.h41
-rw-r--r--mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD.manifest12
-rw-r--r--mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD64.manifest12
-rwxr-xr-xmDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.rc103
-rwxr-xr-xmDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.rc102
-rwxr-xr-xmDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.vcproj408
-rwxr-xr-xmDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcproj408
-rwxr-xr-xmDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj272
-rwxr-xr-xmDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj.filters38
-rwxr-xr-xmDNSResponder/Clients/DNS-SD.VisualStudio/resource.h14
-rw-r--r--mDNSResponder/Clients/DNS-SD.xcodeproj/project.pbxproj737
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser-Info.plist30
-rwxr-xr-xmDNSResponder/Clients/DNSServiceBrowser.NET/App.icobin0 -> 1078 bytes
-rwxr-xr-xmDNSResponder/Clients/DNSServiceBrowser.NET/AssemblyInfo.cs75
-rwxr-xr-xmDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.NET.csproj119
-rwxr-xr-xmDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.cs734
-rwxr-xr-xmDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.resx102
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.Designer.vb206
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.VB.vbproj121
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.resx120
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.vb196
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.Designer.vb38
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.myapp10
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/AssemblyInfo.vb35
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.Designer.vb62
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.resx117
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.Designer.vb73
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.settings7
-rwxr-xr-xmDNSResponder/Clients/DNSServiceBrowser.m679
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.nib/classes.nib37
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.nib/info.nib22
-rw-r--r--mDNSResponder/Clients/DNSServiceBrowser.nib/objects.nibbin0 -> 9008 bytes
-rw-r--r--mDNSResponder/Clients/DNSServiceReg-Info.plist30
-rw-r--r--mDNSResponder/Clients/DNSServiceReg.m274
-rw-r--r--mDNSResponder/Clients/DNSServiceReg.nib/classes.nib30
-rw-r--r--mDNSResponder/Clients/DNSServiceReg.nib/info.nib22
-rw-r--r--mDNSResponder/Clients/DNSServiceReg.nib/objects.nibbin0 -> 9113 bytes
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/About.cpp90
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/About.h28
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/ClassFactory.cpp177
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/ClassFactory.h51
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.cpp659
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.h104
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.cpp794
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.h264
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.cpp600
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.def24
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.h47
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.rc122
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcproj595
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj402
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj.filters106
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.rc213
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcproj487
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj397
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj.filters23
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.rc140
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcproj518
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj399
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj.filters52
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/LoginDialog.cpp111
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/LoginDialog.h53
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/ReadMe.txt9
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/Resource.h28
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/StdAfx.cpp18
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/StdAfx.h41
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin.manifest22
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin64.manifest22
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/res/about.bmpbin0 -> 137944 bytes
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/res/button-2k.icobin0 -> 10342 bytes
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/res/button-xp.icobin0 -> 5342 bytes
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/res/cold.icobin0 -> 10342 bytes
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/res/hot.icobin0 -> 10342 bytes
-rw-r--r--mDNSResponder/Clients/ExplorerPlugin/res/logo.bmpbin0 -> 822 bytes
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/resource_dll.h26
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/resource_loc_res.h32
-rwxr-xr-xmDNSResponder/Clients/ExplorerPlugin/resource_res.h30
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/CDNSSDService.cpp394
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/CDNSSDService.h104
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/CDNSSDServiceModule.cpp37
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/DNSSDService.sln20
-rw-r--r--mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.rc102
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcproj282
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj179
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj.filters47
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/IDNSSDService.h263
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/IDNSSDService.idl50
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/chrome.manifest6
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/components/IDNSSDService.xptbin0 -> 376 bytes
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/content/_internal_bonjour4firefox.pngbin0 -> 1589 bytes
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/content/_internal_listImage.pngbin0 -> 3417 bytes
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.css16
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.xul222
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/content/browserOverlay.xul32
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/content/overlay.js21
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/defaults/preferences/bonjour4firefox.js2
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/install.rdf19
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/locale/en-US/bonjour4firefox.dtd6
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/locale/en-US/bonjour4firefox.properties4
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/readme.txt21
-rw-r--r--mDNSResponder/Clients/FirefoxExtension/extension/skin-darwin/_internal_toobar-button.pngbin0 -> 6798 bytes
-rw-r--r--mDNSResponder/Clients/FirefoxExtension/extension/skin-darwin/overlay.css17
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/skin/_internal_toobar-button.pngbin0 -> 5022 bytes
-rwxr-xr-xmDNSResponder/Clients/FirefoxExtension/extension/skin/overlay.css21
-rw-r--r--mDNSResponder/Clients/FirefoxExtension/readme.txt16
-rw-r--r--mDNSResponder/Clients/FirefoxExtension/resource.h27
-rw-r--r--mDNSResponder/Clients/Java/BrowserApp.java420
-rw-r--r--mDNSResponder/Clients/Java/BrowserApp.manifest2
-rw-r--r--mDNSResponder/Clients/Java/DNSSDUnitTest.java334
-rwxr-xr-xmDNSResponder/Clients/Java/JavaSamples.vcproj111
-rwxr-xr-xmDNSResponder/Clients/Java/JavaSamples.vcxproj116
-rw-r--r--mDNSResponder/Clients/Java/SimpleChat.java333
-rw-r--r--mDNSResponder/Clients/Java/SimpleChat.manifest2
-rw-r--r--mDNSResponder/Clients/Java/SwingBrowseListener.java124
-rw-r--r--mDNSResponder/Clients/Java/SwingDomainListener.java116
-rw-r--r--mDNSResponder/Clients/Java/SwingQueryListener.java108
-rw-r--r--mDNSResponder/Clients/Java/nmakefile109
-rwxr-xr-xmDNSResponder/Clients/Makefile54
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/About.cpp31
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/About.h21
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/FirstPage.cpp98
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/FirstPage.h50
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/FourthPage.cpp212
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/FourthPage.h61
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/Logger.cpp85
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/Logger.h63
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.ncb1
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.rc157
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcproj638
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj365
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj.filters145
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardApp.cpp172
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardApp.h48
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.rc310
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcproj441
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj345
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj.filters29
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.rc173
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcproj465
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj347
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj.filters47
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardSheet.cpp1949
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardSheet.h352
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/ReadMe.txt94
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/SecondPage.cpp513
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/SecondPage.h105
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/ThirdPage.cpp1583
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/ThirdPage.h159
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/UtilTypes.h280
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/res/Info.icobin0 -> 23558 bytes
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/res/NetworkPrinter.icobin0 -> 287934 bytes
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/res/Print.icobin0 -> 82726 bytes
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.icobin0 -> 77214 bytes
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.manifest17
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.rc213
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard64.manifest17
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizardLocRes.rc213
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizardRes.rc213
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/res/Thumbs.dbbin0 -> 6144 bytes
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/res/about.bmpbin0 -> 254802 bytes
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/res/banner_icon.bmpbin0 -> 7308 bytes
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/res/watermark.bmpbin0 -> 162908 bytes
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/resource.h29
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/resource_exe.h94
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/resource_loc_res.h95
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/resource_res.h94
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/stdafx.cpp20
-rw-r--r--mDNSResponder/Clients/PrinterSetupWizard/stdafx.h61
-rwxr-xr-xmDNSResponder/Clients/PrinterSetupWizard/tcpxcv.h107
-rw-r--r--mDNSResponder/Clients/ReadMe.txt25
-rwxr-xr-xmDNSResponder/Clients/SimpleChat.NET/App.icobin0 -> 1078 bytes
-rwxr-xr-xmDNSResponder/Clients/SimpleChat.NET/AssemblyInfo.cs75
-rwxr-xr-xmDNSResponder/Clients/SimpleChat.NET/SimpleChat.NET.csproj116
-rwxr-xr-xmDNSResponder/Clients/SimpleChat.NET/SimpleChat.cs601
-rwxr-xr-xmDNSResponder/Clients/SimpleChat.NET/SimpleChat.resx102
-rw-r--r--mDNSResponder/Clients/SimpleChat.VB/My Project/Application.Designer.vb38
-rw-r--r--mDNSResponder/Clients/SimpleChat.VB/My Project/Application.myapp10
-rw-r--r--mDNSResponder/Clients/SimpleChat.VB/My Project/AssemblyInfo.vb35
-rw-r--r--mDNSResponder/Clients/SimpleChat.VB/My Project/Resources.Designer.vb63
-rw-r--r--mDNSResponder/Clients/SimpleChat.VB/My Project/Resources.resx117
-rw-r--r--mDNSResponder/Clients/SimpleChat.VB/My Project/Settings.Designer.vb73
-rw-r--r--mDNSResponder/Clients/SimpleChat.VB/My Project/Settings.settings7
-rw-r--r--mDNSResponder/Clients/SimpleChat.VB/SimpleChat.Designer.vb102
-rw-r--r--mDNSResponder/Clients/SimpleChat.VB/SimpleChat.VB.vbproj121
-rw-r--r--mDNSResponder/Clients/SimpleChat.VB/SimpleChat.resx120
-rw-r--r--mDNSResponder/Clients/SimpleChat.VB/SimpleChat.vb157
-rw-r--r--mDNSResponder/Clients/dns-sd.c1815
-rw-r--r--mDNSResponder/Clients/dnsctl.c177
-rwxr-xr-xmDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.manifest12
-rw-r--r--mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.rc103
-rwxr-xr-xmDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcproj296
-rwxr-xr-xmDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj241
-rwxr-xr-xmDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj.filters110
-rw-r--r--mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/resource.h14
200 files changed, 30650 insertions, 0 deletions
diff --git a/mDNSResponder/Clients/BonjourExample/BonjourExample.cpp b/mDNSResponder/Clients/BonjourExample/BonjourExample.cpp
new file mode 100644
index 00000000..f517456c
--- /dev/null
+++ b/mDNSResponder/Clients/BonjourExample/BonjourExample.cpp
@@ -0,0 +1,199 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2005 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 <assert.h>
+#include <stdio.h>
+
+#include "dns_sd.h"
+
+// Constants
+
+#define BONJOUR_EVENT ( WM_USER + 0x100 ) // Message sent to the Window when a Bonjour event occurs.
+
+// Prototypes
+
+static LRESULT CALLBACK WndProc( HWND inWindow, UINT inMsg, WPARAM inWParam, LPARAM inLParam );
+
+static void DNSSD_API
+ BrowserCallBack(
+ DNSServiceRef inServiceRef,
+ DNSServiceFlags inFlags,
+ uint32_t inIFI,
+ DNSServiceErrorType inError,
+ const char * inName,
+ const char * inType,
+ const char * inDomain,
+ void * inContext );
+
+// Globals
+
+DNSServiceRef gServiceRef = NULL;
+
+// Main entry point for application.
+
+int _tmain( int argc, _TCHAR *argv[] )
+{
+ HINSTANCE instance;
+ WNDCLASSEX wcex;
+ HWND wind;
+ MSG msg;
+ DNSServiceErrorType err;
+
+ (void) argc; // Unused
+ (void) argv; // Unused
+
+ // Create the window. This window won't actually be shown, but it demonstrates how to use Bonjour
+ // with Windows GUI applications by having Bonjour events processed as messages to a Window.
+
+ instance = GetModuleHandle( NULL );
+ assert( instance );
+
+ wcex.cbSize = sizeof( wcex );
+ wcex.style = 0;
+ wcex.lpfnWndProc = (WNDPROC) WndProc;
+ wcex.cbClsExtra = 0;
+ wcex.cbWndExtra = 0;
+ wcex.hInstance = instance;
+ wcex.hIcon = NULL;
+ wcex.hCursor = NULL;
+ wcex.hbrBackground = NULL;
+ wcex.lpszMenuName = NULL;
+ wcex.lpszClassName = TEXT( "BonjourExample" );
+ wcex.hIconSm = NULL;
+ RegisterClassEx( &wcex );
+
+ wind = CreateWindow( wcex.lpszClassName, wcex.lpszClassName, 0, CW_USEDEFAULT, 0, CW_USEDEFAULT,
+ 0, NULL, NULL, instance, NULL );
+ assert( wind );
+
+ // Start browsing for services and associate the Bonjour browser with our window using the
+ // WSAAsyncSelect mechanism. Whenever something related to the Bonjour browser occurs, our
+ // private Windows message will be sent to our window so we can give Bonjour a chance to
+ // process it. This allows Bonjour to avoid using a secondary thread (and all the issues
+ // with synchronization that would introduce), but still process everything asynchronously.
+ // This also simplifies app code because Bonjour will only run when we explicitly call it.
+
+ err = DNSServiceBrowse(
+ &gServiceRef, // Receives reference to Bonjour browser object.
+ 0, // No flags.
+ kDNSServiceInterfaceIndexAny, // Browse on all network interfaces.
+ "_http._tcp", // Browse for HTTP service types.
+ NULL, // Browse on the default domain (e.g. local.).
+ BrowserCallBack, // Callback function when Bonjour events occur.
+ NULL ); // No callback context needed.
+ assert( err == kDNSServiceErr_NoError );
+
+ err = WSAAsyncSelect( (SOCKET) DNSServiceRefSockFD( gServiceRef ), wind, BONJOUR_EVENT, FD_READ | FD_CLOSE );
+ assert( err == kDNSServiceErr_NoError );
+
+ fprintf( stderr, "Browsing for _http._tcp\n" );
+
+ // Main event loop for the application. All Bonjour events are dispatched while in this loop.
+
+ while( GetMessage( &msg, NULL, 0, 0 ) )
+ {
+ TranslateMessage( &msg );
+ DispatchMessage( &msg );
+ }
+
+ // Clean up Bonjour. This is not strictly necessary since the normal process cleanup will
+ // close Bonjour socket(s) and release memory, but it's here to demonstrate how to do it.
+
+ if( gServiceRef )
+ {
+ WSAAsyncSelect( (SOCKET) DNSServiceRefSockFD( gServiceRef ), wind, BONJOUR_EVENT, 0 );
+ DNSServiceRefDeallocate( gServiceRef );
+ }
+ return( 0 );
+}
+
+// Callback for the Window. Bonjour events are delivered here.
+
+static LRESULT CALLBACK WndProc( HWND inWindow, UINT inMsg, WPARAM inWParam, LPARAM inLParam )
+{
+ LRESULT result;
+ DNSServiceErrorType err;
+
+ switch( inMsg )
+ {
+ case BONJOUR_EVENT:
+
+ // Process the Bonjour event. All Bonjour callbacks occur from within this function.
+ // If an error occurs while trying to process the result, it most likely means that
+ // something serious has gone wrong with Bonjour, such as it being terminated. This
+ // does not normally occur, but code should be prepared to handle it. If the error
+ // is ignored, the window will receive a constant stream of BONJOUR_EVENT messages so
+ // if an error occurs, we disassociate the DNSServiceRef from the window, deallocate
+ // it, and invalidate the reference so we don't try to deallocate it again on quit.
+ // Since this is a simple example app, if this error occurs, we quit the app too.
+
+ err = DNSServiceProcessResult( gServiceRef );
+ if( err != kDNSServiceErr_NoError )
+ {
+ fprintf( stderr, "### ERROR! serious Bonjour error: %d\n", err );
+
+ WSAAsyncSelect( (SOCKET) DNSServiceRefSockFD( gServiceRef ), inWindow, BONJOUR_EVENT, 0 );
+ DNSServiceRefDeallocate( gServiceRef );
+ gServiceRef = NULL;
+
+ PostQuitMessage( 0 );
+ }
+ result = 0;
+ break;
+
+ default:
+ result = DefWindowProc( inWindow, inMsg, inWParam, inLParam );
+ break;
+ }
+ return( result );
+}
+
+// Callback for Bonjour browser events. Called when services are added or removed.
+
+static void DNSSD_API
+ BrowserCallBack(
+ DNSServiceRef inServiceRef,
+ DNSServiceFlags inFlags,
+ uint32_t inIFI,
+ DNSServiceErrorType inError,
+ const char * inName,
+ const char * inType,
+ const char * inDomain,
+ void * inContext )
+{
+ (void) inServiceRef; // Unused
+ (void) inContext; // Unused
+
+ if( inError == kDNSServiceErr_NoError )
+ {
+ const char * action;
+ const char * more;
+
+ if( inFlags & kDNSServiceFlagsAdd ) action = "ADD";
+ else action = "RMV";
+ if( inFlags & kDNSServiceFlagsMoreComing ) more = " (MORE)";
+ else more = "";
+
+ fprintf( stderr, "%s %30s.%s%s on interface %d%s\n", action, inName, inType, inDomain, (int) inIFI, more );
+ }
+ else
+ {
+ fprintf( stderr, "Bonjour browser error occurred: %d\n", inError );
+ }
+}
diff --git a/mDNSResponder/Clients/BonjourExample/BonjourExample.sln b/mDNSResponder/Clients/BonjourExample/BonjourExample.sln
new file mode 100644
index 00000000..fb803309
--- /dev/null
+++ b/mDNSResponder/Clients/BonjourExample/BonjourExample.sln
@@ -0,0 +1,21 @@
+Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BonjourExample", "BonjourExample.vcproj", "{0A842379-799E-414C-BF1F-BF11A8D3A8A8}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {0A842379-799E-414C-BF1F-BF11A8D3A8A8}.Debug.ActiveCfg = Debug|Win32
+ {0A842379-799E-414C-BF1F-BF11A8D3A8A8}.Debug.Build.0 = Debug|Win32
+ {0A842379-799E-414C-BF1F-BF11A8D3A8A8}.Release.ActiveCfg = Release|Win32
+ {0A842379-799E-414C-BF1F-BF11A8D3A8A8}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/mDNSResponder/Clients/BonjourExample/BonjourExample.vcproj b/mDNSResponder/Clients/BonjourExample/BonjourExample.vcproj
new file mode 100644
index 00000000..b58f3b16
--- /dev/null
+++ b/mDNSResponder/Clients/BonjourExample/BonjourExample.vcproj
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="BonjourExample"
+ ProjectGUID="{0A842379-799E-414C-BF1F-BF11A8D3A8A8}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="1">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../mDNSShared"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ StringPooling="TRUE"
+ MinimalRebuild="TRUE"
+ ExceptionHandling="FALSE"
+ BasicRuntimeChecks="3"
+ SmallerTypeCheck="TRUE"
+ RuntimeLibrary="5"
+ BufferSecurityCheck="TRUE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="3"
+ BrowseInformation="1"
+ WarningLevel="4"
+ WarnAsError="TRUE"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib"
+ OutputFile="$(OutDir)/BonjourExample.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/BonjourExample.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="1">
+ <Tool
+ Name="VCCLCompilerTool"
+ GlobalOptimizations="TRUE"
+ OmitFramePointers="TRUE"
+ AdditionalIncludeDirectories="../../mDNSShared"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ StringPooling="TRUE"
+ RuntimeLibrary="4"
+ BufferSecurityCheck="FALSE"
+ ForceConformanceInForLoopScope="TRUE"
+ UsePrecompiledHeader="3"
+ WarningLevel="4"
+ WarnAsError="TRUE"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"
+ CompileAs="2"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="ws2_32.lib"
+ OutputFile="$(OutDir)/BonjourExample.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <File
+ RelativePath=".\BonjourExample.cpp">
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\Dll\release\dnssd.lib">
+ </File>
+ <File
+ RelativePath=".\stdafx.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"/>
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\stdafx.h">
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/mDNSResponder/Clients/BonjourExample/stdafx.cpp b/mDNSResponder/Clients/BonjourExample/stdafx.cpp
new file mode 100644
index 00000000..a28f2b5b
--- /dev/null
+++ b/mDNSResponder/Clients/BonjourExample/stdafx.cpp
@@ -0,0 +1,20 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2005 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.
+ */
+
+// Standard source file to build the pre-compiled header.
+
+#include "stdafx.h"
diff --git a/mDNSResponder/Clients/BonjourExample/stdafx.h b/mDNSResponder/Clients/BonjourExample/stdafx.h
new file mode 100644
index 00000000..d820f4ab
--- /dev/null
+++ b/mDNSResponder/Clients/BonjourExample/stdafx.h
@@ -0,0 +1,30 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2005 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.
+ */
+
+// Standard Windows pre-compiled header file.
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+
+#include <windows.h>
+#include <winsock2.h>
+
+#include <stdlib.h>
+#include <malloc.h>
+#include <memory.h>
+#include <tchar.h>
diff --git a/mDNSResponder/Clients/ClientCommon.c b/mDNSResponder/Clients/ClientCommon.c
new file mode 100644
index 00000000..68f354cc
--- /dev/null
+++ b/mDNSResponder/Clients/ClientCommon.c
@@ -0,0 +1,75 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2008 Apple Inc. All rights reserved.
+ *
+ * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
+ * ("Apple") in consideration of your agreement to the following terms, and your
+ * use, installation, modification or redistribution of this Apple software
+ * constitutes acceptance of these terms. If you do not agree with these terms,
+ * please do not use, install, modify or redistribute this Apple software.
+ *
+ * In consideration of your agreement to abide by the following terms, and subject
+ * to these terms, Apple grants you a personal, non-exclusive license, under Apple's
+ * copyrights in this original Apple software (the "Apple Software"), to use,
+ * reproduce, modify and redistribute the Apple Software, with or without
+ * modifications, in source and/or binary forms; provided that if you redistribute
+ * the Apple Software in its entirety and without modifications, you must retain
+ * this notice and the following text and disclaimers in all such redistributions of
+ * the Apple Software. Neither the name, trademarks, service marks or logos of
+ * Apple Computer, Inc. may be used to endorse or promote products derived from the
+ * Apple Software without specific prior written permission from Apple. Except as
+ * expressly stated in this notice, no other rights or licenses, express or implied,
+ * are granted by Apple herein, including but not limited to any patent rights that
+ * may be infringed by your derivative works or by other works in which the Apple
+ * Software may be incorporated.
+ *
+ * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
+ * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ * COMBINATION WITH YOUR PRODUCTS.
+ *
+ * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
+ * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
+ * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <ctype.h>
+#include <stdio.h> // For stdout, stderr
+
+#include "ClientCommon.h"
+
+const char *GetNextLabel(const char *cstr, char label[64])
+{
+ char *ptr = label;
+ while (*cstr && *cstr != '.') // While we have characters in the label...
+ {
+ char c = *cstr++;
+ if (c == '\\' && *cstr) // If we have a backslash, and it's not the last character of the string
+ {
+ c = *cstr++;
+ if (isdigit(cstr[-1]) && isdigit(cstr[0]) && isdigit(cstr[1]))
+ {
+ int v0 = cstr[-1] - '0'; // then interpret as three-digit decimal
+ int v1 = cstr[ 0] - '0';
+ int v2 = cstr[ 1] - '0';
+ int val = v0 * 100 + v1 * 10 + v2;
+ // If valid three-digit decimal value, use it
+ // Note that although ascii nuls are possible in DNS labels
+ // we're building a C string here so we have no way to represent that
+ if (val == 0) val = '-';
+ if (val <= 255) { c = (char)val; cstr += 2; }
+ }
+ }
+ *ptr++ = c;
+ if (ptr >= label+64) { label[63] = 0; return(NULL); } // Illegal label more than 63 bytes
+ }
+ *ptr = 0; // Null-terminate label text
+ if (ptr == label) return(NULL); // Illegal empty label
+ if (*cstr) cstr++; // Skip over the trailing dot (if present)
+ return(cstr);
+}
diff --git a/mDNSResponder/Clients/ClientCommon.h b/mDNSResponder/Clients/ClientCommon.h
new file mode 100644
index 00000000..afe5b7a5
--- /dev/null
+++ b/mDNSResponder/Clients/ClientCommon.h
@@ -0,0 +1,41 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2008 Apple Inc. All rights reserved.
+ *
+ * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
+ * ("Apple") in consideration of your agreement to the following terms, and your
+ * use, installation, modification or redistribution of this Apple software
+ * constitutes acceptance of these terms. If you do not agree with these terms,
+ * please do not use, install, modify or redistribute this Apple software.
+ *
+ * In consideration of your agreement to abide by the following terms, and subject
+ * to these terms, Apple grants you a personal, non-exclusive license, under Apple's
+ * copyrights in this original Apple software (the "Apple Software"), to use,
+ * reproduce, modify and redistribute the Apple Software, with or without
+ * modifications, in source and/or binary forms; provided that if you redistribute
+ * the Apple Software in its entirety and without modifications, you must retain
+ * this notice and the following text and disclaimers in all such redistributions of
+ * the Apple Software. Neither the name, trademarks, service marks or logos of
+ * Apple Computer, Inc. may be used to endorse or promote products derived from the
+ * Apple Software without specific prior written permission from Apple. Except as
+ * expressly stated in this notice, no other rights or licenses, express or implied,
+ * are granted by Apple herein, including but not limited to any patent rights that
+ * may be infringed by your derivative works or by other works in which the Apple
+ * Software may be incorporated.
+ *
+ * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
+ * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ * COMBINATION WITH YOUR PRODUCTS.
+ *
+ * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
+ * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
+ * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+extern const char *GetNextLabel(const char *cstr, char label[64]);
diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD.manifest b/mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD.manifest
new file mode 100644
index 00000000..9e0b08ae
--- /dev/null
+++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD.manifest
@@ -0,0 +1,12 @@
+<?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.DNS-SD" type="win32"/>
+ <description>Command line utility.</description>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+</assembly>
diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD64.manifest b/mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD64.manifest
new file mode 100644
index 00000000..caa49dff
--- /dev/null
+++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/DNS-SD64.manifest
@@ -0,0 +1,12 @@
+<?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="amd64" name="Apple.Bonjour.DNS-SD" type="win32"/>
+ <description>Command Line Utility</description>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+</assembly>
diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.rc b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.rc
new file mode 100755
index 00000000..79df1bac
--- /dev/null
+++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.rc
@@ -0,0 +1,103 @@
+// 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"
+ "\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 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", MASTER_COMPANY_NAME
+ VALUE "FileDescription", "Bonjour Console Utility"
+ VALUE "FileVersion", MASTER_PROD_VERS_STR
+ VALUE "InternalName", "dns-sd.exe"
+ VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT
+ VALUE "OriginalFilename", "dns-sd.exe"
+ 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/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.rc b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.rc
new file mode 100755
index 00000000..9274716c
--- /dev/null
+++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.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"
+
+/////////////////////////////////////////////////////////////////////////////
+#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"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,0,0,0
+ PRODUCTVERSION 1,0,0,0
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "Apple Inc."
+ VALUE "FileDescription", "Bonjour Console Utility"
+ VALUE "FileVersion", "1.0.0.0"
+ VALUE "InternalName", "dns-sd.exe"
+ VALUE "LegalCopyright", "Copyright (C) 2010 Apple Inc."
+ VALUE "OriginalFilename", "dns-sd.exe"
+ VALUE "ProductName", "Bonjour"
+ VALUE "ProductVersion", "1.0.0.0"
+ 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/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.vcproj b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.vcproj
new file mode 100755
index 00000000..41daa815
--- /dev/null
+++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.sdk.vcproj
@@ -0,0 +1,408 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="dns-sd"
+ ProjectGUID="{AA230639-E115-4A44-AA5A-44A61235BA50}"
+ Keyword="Win32Proj"
+ >
+ <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"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="$(BONJOUR_SDK_HOME)/Include"
+ PreprocessorDefinitions="WIN32;_WIN32;_DEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"
+ AdditionalDependencies="&quot;$(BONJOUR_SDK_HOME)/Lib/$(PlatformName)/dnssd.lib&quot; ws2_32.lib"
+ OutputFile="$(OutDir)/dns-sd.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/dns-sd.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="DNS-SD.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"
+ 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="$(BONJOUR_SDK_HOME)/Include"
+ PreprocessorDefinitions="WIN32;_WIN32;_DEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE"
+ AdditionalDependencies="&quot;$(BONJOUR_SDK_HOME)/Lib/$(PlatformName)/dnssd.lib&quot; ws2_32.lib"
+ OutputFile="$(OutDir)/dns-sd.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/dns-sd.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="DNS-SD64.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"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="$(BONJOUR_SDK_HOME)/Include"
+ PreprocessorDefinitions="WIN32;_WIN32;NDEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"
+ AdditionalDependencies="&quot;$(BONJOUR_SDK_HOME)/Lib/$(PlatformName)/dnssd.lib&quot; ws2_32.lib"
+ OutputFile="$(OutDir)/dns-sd.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="DNS-SD.manifest"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ 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="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="$(BONJOUR_SDK_HOME)/Include"
+ PreprocessorDefinitions="WIN32;_WIN32;NDEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE"
+ AdditionalDependencies="&quot;$(BONJOUR_SDK_HOME)/Lib/$(PlatformName)/dnssd.lib&quot; ws2_32.lib"
+ OutputFile="$(OutDir)/dns-sd.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="DNS-SD64.manifest"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine=""
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+ >
+ <File
+ RelativePath=".\ClientCommon.c"
+ >
+ </File>
+ <File
+ RelativePath=".\dns-sd.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc"
+ >
+ <File
+ RelativePath=".\ClientCommon.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"
+ >
+ <File
+ RelativePath="dns-sd.rc"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcproj b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcproj
new file mode 100755
index 00000000..58e79e46
--- /dev/null
+++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcproj
@@ -0,0 +1,408 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="dns-sd"
+ ProjectGUID="{AA230639-E115-4A44-AA5A-44A61235BA50}"
+ Keyword="Win32Proj"
+ >
+ <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"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../mDNSShared"
+ PreprocessorDefinitions="WIN32;_WIN32;_DEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"
+ AdditionalDependencies="../../mDNSWindows/DLL/$(PlatformName)/$(ConfigurationName)/dnssd.lib ws2_32.lib"
+ OutputFile="$(OutDir)/dns-sd.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/dns-sd.pdb"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="DNS-SD.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"
+ 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="../../mDNSShared"
+ PreprocessorDefinitions="WIN32;_WIN32;_DEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE"
+ AdditionalDependencies="../../mDNSWindows/DLL/$(PlatformName)/$(ConfigurationName)/dnssd.lib ws2_32.lib"
+ OutputFile="$(OutDir)/dns-sd.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/dns-sd.pdb"
+ SubSystem="1"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="DNS-SD64.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"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="../../mDNSShared"
+ PreprocessorDefinitions="WIN32;_WIN32;NDEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"
+ AdditionalDependencies="../../mDNSWindows/DLL/$(PlatformName)/$(ConfigurationName)/dnssd.lib ws2_32.lib"
+ OutputFile="$(OutDir)/dns-sd.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="DNS-SD.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)\WINDOWS\system32\$(PlatformName)&quot; mkdir &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser\My Project&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser\My Project&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\SimpleChat&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\SimpleChat&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot; &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\dns-sd.c&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\ClientCommon.c&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\ClientCommon.h&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)resource.h&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)DNS-SD.manifest&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)DNS-SD64.manifest&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)dns-sd.sdk.rc&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C&quot;&#x0D;&#x0A;move /Y &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.sdk.rc&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.rc&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)dns-sd.sdk.vcproj&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C&quot;&#x0D;&#x0A;move /Y &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.sdk.vcproj&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.vcproj&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\DNSServiceBrowser.NET\App.ico&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\DNSServiceBrowser.NET\AssemblyInfo.cs&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\DNSServiceBrowser.NET\DNSServiceBrowser.NET.csproj&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\DNSServiceBrowser.NET\DNSServiceBrowser.cs&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\DNSServiceBrowser.NET\DNSServiceBrowser.resx&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\SimpleChat.NET\App.ico&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\SimpleChat.NET\AssemblyInfo.cs&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\SimpleChat.NET\SimpleChat.NET.csproj&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\SimpleChat.NET\SimpleChat.cs&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\SimpleChat.NET\SimpleChat.resx&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.Designer.vb&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.VB.vbproj&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.resx&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.vb&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser&quot;&#x0D;&#x0A;xcopy /E/Y &quot;$(ProjectDir)..\DNSServiceBrowser.VB\My Project&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser\My Project&quot;&#x0D;&#x0A;xcopy /E/Y &quot;$(ProjectDir)..\SimpleChat.VB&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\SimpleChat&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ 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="2"
+ InlineFunctionExpansion="1"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="../../mDNSShared"
+ PreprocessorDefinitions="WIN32;_WIN32;NDEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE"
+ AdditionalDependencies="../../mDNSWindows/DLL/$(PlatformName)/$(ConfigurationName)/dnssd.lib ws2_32.lib"
+ OutputFile="$(OutDir)/dns-sd.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="DNS-SD64.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)\WINDOWS\system32\$(PlatformName)&quot; mkdir &quot;$(DSTROOT)\WINDOWS\system32\$(PlatformName)&quot;&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\Samples\C&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;cxx;def;odl;idl;hpj;bat;asm"
+ >
+ <File
+ RelativePath="..\ClientCommon.c"
+ >
+ </File>
+ <File
+ RelativePath="..\dns-sd.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc"
+ >
+ <File
+ RelativePath="..\ClientCommon.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"
+ >
+ <File
+ RelativePath="dns-sd.rc"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj
new file mode 100755
index 00000000..8ed154a9
--- /dev/null
+++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj
@@ -0,0 +1,272 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{AA230639-E115-4A44-AA5A-44A61235BA50}</ProjectGuid>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WIN32;_DEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>../../mDNSWindows/DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)dns-sd.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)dns-sd.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>DNS-SD.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WIN32;_DEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>../../mDNSWindows/DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)dns-sd.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)dns-sd.pdb</ProgramDatabaseFile>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>DNS-SD64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WIN32;NDEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>../../mDNSWindows/DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)dns-sd.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>DNS-SD.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\WINDOWS\system32\$(Platform)" mkdir "$(DSTROOT)\WINDOWS\system32\$(Platform)"
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS"
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser"
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat"
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB"
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser"
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser\My Project" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser\My Project"
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\SimpleChat" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\SimpleChat"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\WINDOWS\system32\$(Platform)"
+xcopy /I/Y "$(ProjectDir)..\dns-sd.c" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"
+xcopy /I/Y "$(ProjectDir)..\ClientCommon.c" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"
+xcopy /I/Y "$(ProjectDir)..\ClientCommon.h" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"
+xcopy /I/Y "$(ProjectDir)resource.h" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"
+xcopy /I/Y "$(ProjectDir)DNS-SD.manifest" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"
+xcopy /I/Y "$(ProjectDir)DNS-SD64.manifest" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"
+xcopy /I/Y "$(ProjectDir)dns-sd.sdk.rc" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"
+move /Y "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.sdk.rc" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.rc"
+xcopy /I/Y "$(ProjectDir)dns-sd.sdk.vcproj" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"
+move /Y "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.sdk.vcproj" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C\dns-sd.vcproj"
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\App.ico" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser"
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\AssemblyInfo.cs" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser"
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\DNSServiceBrowser.NET.csproj" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser"
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\DNSServiceBrowser.cs" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser"
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.NET\DNSServiceBrowser.resx" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\DNSServiceBrowser"
+xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\App.ico" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat"
+xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\AssemblyInfo.cs" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat"
+xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\SimpleChat.NET.csproj" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat"
+xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\SimpleChat.cs" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat"
+xcopy /I/Y "$(ProjectDir)..\SimpleChat.NET\SimpleChat.resx" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\CS\SimpleChat"
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.Designer.vb" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser"
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.VB.vbproj" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser"
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.resx" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser"
+xcopy /I/Y "$(ProjectDir)..\DNSServiceBrowser.VB\DNSServiceBrowser.vb" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser"
+xcopy /E/Y "$(ProjectDir)..\DNSServiceBrowser.VB\My Project" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\DNSServiceBrowser\My Project"
+xcopy /E/Y "$(ProjectDir)..\SimpleChat.VB" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\VB\SimpleChat"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WIN32;NDEBUG;_CONSOLE;NOT_HAVE_GETOPT;NOT_HAVE_SETLINEBUF;WIN32_LEAN_AND_MEAN;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>../../mDNSWindows/DLL/$(Platform)/$(Configuration)/dnssd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)dns-sd.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>DNS-SD64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\WINDOWS\system32\$(Platform)" mkdir "$(DSTROOT)\WINDOWS\system32\$(Platform)"
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\C"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\WINDOWS\system32\$(Platform)"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\ClientCommon.c" />
+ <ClCompile Include="..\dns-sd.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\ClientCommon.h" />
+ <ClInclude Include="resource.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="dns-sd.rc" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj.filters b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj.filters
new file mode 100755
index 00000000..78299c04
--- /dev/null
+++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/dns-sd.vcxproj.filters
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{663cbcf4-ce8e-49eb-9826-0676fba94350}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{f5fcca0d-918b-46ba-bb91-2f2f9d9ddbba}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{a7d985ec-3f36-4554-a707-5256b2e719b6}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\ClientCommon.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\dns-sd.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\ClientCommon.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="dns-sd.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/DNS-SD.VisualStudio/resource.h b/mDNSResponder/Clients/DNS-SD.VisualStudio/resource.h
new file mode 100755
index 00000000..593b5f9f
--- /dev/null
+++ b/mDNSResponder/Clients/DNS-SD.VisualStudio/resource.h
@@ -0,0 +1,14 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by dns-sd.rc
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 101
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/mDNSResponder/Clients/DNS-SD.xcodeproj/project.pbxproj b/mDNSResponder/Clients/DNS-SD.xcodeproj/project.pbxproj
new file mode 100644
index 00000000..f2d54f04
--- /dev/null
+++ b/mDNSResponder/Clients/DNS-SD.xcodeproj/project.pbxproj
@@ -0,0 +1,737 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXAggregateTarget section */
+ FFF520490671177900DA3D49 /* Build All */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = 21D91E890B12A03D003981D9 /* Build configuration list for PBXAggregateTarget "Build All" */;
+ buildPhases = (
+ );
+ dependencies = (
+ FF383826067117F300FEF615 /* PBXTargetDependency */,
+ FF383828067117F600FEF615 /* PBXTargetDependency */,
+ FF1E351806711B6A003DD5BC /* PBXTargetDependency */,
+ );
+ name = "Build All";
+ productName = "Build All";
+ };
+/* End PBXAggregateTarget section */
+
+/* Begin PBXBuildFile section */
+ 8DD76F770486A8DE00D96B5E /* dns-sd.c in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* dns-sd.c */; settings = {ATTRIBUTES = (); }; };
+ FF1B6915067114AF002304DD /* DNSServiceBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = FF1B6914067114AF002304DD /* DNSServiceBrowser.m */; };
+ FF1E351C06711BCF003DD5BC /* DNSServiceReg.m in Sources */ = {isa = PBXBuildFile; fileRef = FF1E351B06711BCF003DD5BC /* DNSServiceReg.m */; };
+ FF1E352606711BD6003DD5BC /* DNSServiceReg.nib in Resources */ = {isa = PBXBuildFile; fileRef = FF1E352506711BD6003DD5BC /* DNSServiceReg.nib */; };
+ FF2704F90F12A60900299571 /* ClientCommon.c in Sources */ = {isa = PBXBuildFile; fileRef = FF2704F80F12A60900299571 /* ClientCommon.c */; };
+ FF964AA10671153B0099215A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FF964AA00671153B0099215A /* Foundation.framework */; };
+ FF964CAA0671155C0099215A /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = FF964CA90671155C0099215A /* AppKit.framework */; };
+ FF964DAC067115710099215A /* DNSServiceBrowser.nib in Resources */ = {isa = PBXBuildFile; fileRef = FF964DAB067115710099215A /* DNSServiceBrowser.nib */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ FF1E351706711B6A003DD5BC /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = FF1E351206711B5C003DD5BC;
+ remoteInfo = DNSServiceReg;
+ };
+ FF383825067117F300FEF615 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 8DD76F740486A8DE00D96B5E;
+ remoteInfo = "dns-sd";
+ };
+ FF383827067117F600FEF615 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = FF1B691006711383002304DD;
+ remoteInfo = "DNS Service Browser";
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 8DD76F7B0486A8DE00D96B5E /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 8;
+ dstPath = /usr/share/man/man1/;
+ dstSubfolderSpec = 0;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 08FB7796FE84155DC02AAC07 /* dns-sd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "dns-sd.c"; sourceTree = "<group>"; };
+ 8DD76F7E0486A8DE00D96B5E /* dns-sd */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "compiled.mach-o.executable"; path = "dns-sd"; sourceTree = BUILT_PRODUCTS_DIR; };
+ FF1B691106711383002304DD /* DNS Service Browser.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DNS Service Browser.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ FF1B6914067114AF002304DD /* DNSServiceBrowser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DNSServiceBrowser.m; sourceTree = "<group>"; };
+ FF1E351306711B5C003DD5BC /* DNS Service Registration.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "DNS Service Registration.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ FF1E351B06711BCF003DD5BC /* DNSServiceReg.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DNSServiceReg.m; sourceTree = "<group>"; };
+ FF1E352506711BD6003DD5BC /* DNSServiceReg.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = DNSServiceReg.nib; sourceTree = "<group>"; };
+ FF2704F80F12A60900299571 /* ClientCommon.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ClientCommon.c; sourceTree = "<group>"; };
+ FF964AA00671153B0099215A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ FF964CA90671155C0099215A /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
+ FF964DAB067115710099215A /* DNSServiceBrowser.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = DNSServiceBrowser.nib; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8DD76F780486A8DE00D96B5E /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FF1B690F06711383002304DD /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FF964AA10671153B0099215A /* Foundation.framework in Frameworks */,
+ FF964CAA0671155C0099215A /* AppKit.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FF1E351106711B5C003DD5BC /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 08FB7794FE84155DC02AAC07 /* mDNS */ = {
+ isa = PBXGroup;
+ children = (
+ 08FB7795FE84155DC02AAC07 /* Source */,
+ 21D91EBD0B12A2B6003981D9 /* Resources */,
+ 08FB779DFE84155DC02AAC07 /* Frameworks */,
+ 19C28FBDFE9D53C911CA2CBB /* Products */,
+ );
+ name = mDNS;
+ sourceTree = "<group>";
+ };
+ 08FB7795FE84155DC02AAC07 /* Source */ = {
+ isa = PBXGroup;
+ children = (
+ 08FB7796FE84155DC02AAC07 /* dns-sd.c */,
+ FF2704F80F12A60900299571 /* ClientCommon.c */,
+ FF1B6914067114AF002304DD /* DNSServiceBrowser.m */,
+ FF1E351B06711BCF003DD5BC /* DNSServiceReg.m */,
+ );
+ name = Source;
+ sourceTree = "<group>";
+ };
+ 08FB779DFE84155DC02AAC07 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ FF964CA90671155C0099215A /* AppKit.framework */,
+ FF964AA00671153B0099215A /* Foundation.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 19C28FBDFE9D53C911CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8DD76F7E0486A8DE00D96B5E /* dns-sd */,
+ FF1B691106711383002304DD /* DNS Service Browser.app */,
+ FF1E351306711B5C003DD5BC /* DNS Service Registration.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 21D91EBD0B12A2B6003981D9 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ FF964DAB067115710099215A /* DNSServiceBrowser.nib */,
+ FF1E352506711BD6003DD5BC /* DNSServiceReg.nib */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 8DD76F750486A8DE00D96B5E /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FF1B690C06711383002304DD /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FF1E350E06711B5C003DD5BC /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 8DD76F740486A8DE00D96B5E /* dns-sd */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 21D91E7D0B12A03D003981D9 /* Build configuration list for PBXNativeTarget "dns-sd" */;
+ buildPhases = (
+ 8DD76F750486A8DE00D96B5E /* Headers */,
+ 8DD76F760486A8DE00D96B5E /* Sources */,
+ 8DD76F780486A8DE00D96B5E /* Frameworks */,
+ 8DD76F7A0486A8DE00D96B5E /* Rez */,
+ 8DD76F7B0486A8DE00D96B5E /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "dns-sd";
+ productInstallPath = "$(HOME)/bin";
+ productName = mDNS;
+ productReference = 8DD76F7E0486A8DE00D96B5E /* dns-sd */;
+ productType = "com.apple.product-type.tool";
+ };
+ FF1B691006711383002304DD /* DNS Service Browser */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 21D91E810B12A03D003981D9 /* Build configuration list for PBXNativeTarget "DNS Service Browser" */;
+ buildPhases = (
+ FF1B690C06711383002304DD /* Headers */,
+ FF1B690D06711383002304DD /* Resources */,
+ FF1B690E06711383002304DD /* Sources */,
+ FF1B690F06711383002304DD /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "DNS Service Browser";
+ productName = "DNS Service Browser";
+ productReference = FF1B691106711383002304DD /* DNS Service Browser.app */;
+ productType = "com.apple.product-type.application";
+ };
+ FF1E351206711B5C003DD5BC /* DNS Service Registration */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 21D91E850B12A03D003981D9 /* Build configuration list for PBXNativeTarget "DNS Service Registration" */;
+ buildPhases = (
+ FF1E350E06711B5C003DD5BC /* Headers */,
+ FF1E350F06711B5C003DD5BC /* Resources */,
+ FF1E351006711B5C003DD5BC /* Sources */,
+ FF1E351106711B5C003DD5BC /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "DNS Service Registration";
+ productName = "DNS Service Registration";
+ productReference = FF1E351306711B5C003DD5BC /* DNS Service Registration.app */;
+ productType = "com.apple.product-type.application";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 08FB7793FE84155DC02AAC07 /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = 21D91E8D0B12A03D003981D9 /* Build configuration list for PBXProject "DNS-SD" */;
+ hasScannedForEncodings = 1;
+ mainGroup = 08FB7794FE84155DC02AAC07 /* mDNS */;
+ projectDirPath = "";
+ targets = (
+ FFF520490671177900DA3D49 /* Build All */,
+ 8DD76F740486A8DE00D96B5E /* dns-sd */,
+ FF1B691006711383002304DD /* DNS Service Browser */,
+ FF1E351206711B5C003DD5BC /* DNS Service Registration */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ FF1B690D06711383002304DD /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FF964DAC067115710099215A /* DNSServiceBrowser.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FF1E350F06711B5C003DD5BC /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FF1E352606711BD6003DD5BC /* DNSServiceReg.nib in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXRezBuildPhase section */
+ 8DD76F7A0486A8DE00D96B5E /* Rez */ = {
+ isa = PBXRezBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXRezBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8DD76F760486A8DE00D96B5E /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 8DD76F770486A8DE00D96B5E /* dns-sd.c in Sources */,
+ FF2704F90F12A60900299571 /* ClientCommon.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FF1B690E06711383002304DD /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FF1B6915067114AF002304DD /* DNSServiceBrowser.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ FF1E351006711B5C003DD5BC /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ FF1E351C06711BCF003DD5BC /* DNSServiceReg.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ FF1E351806711B6A003DD5BC /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = FF1E351206711B5C003DD5BC /* DNS Service Registration */;
+ targetProxy = FF1E351706711B6A003DD5BC /* PBXContainerItemProxy */;
+ };
+ FF383826067117F300FEF615 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 8DD76F740486A8DE00D96B5E /* dns-sd */;
+ targetProxy = FF383825067117F300FEF615 /* PBXContainerItemProxy */;
+ };
+ FF383828067117F600FEF615 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = FF1B691006711383002304DD /* DNS Service Browser */;
+ targetProxy = FF383827067117F600FEF615 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 21D91E7E0B12A03D003981D9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEBUGGING_SYMBOLS = YES;
+ FRAMEWORK_SEARCH_PATHS = "";
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_ENABLE_TRIGRAPHS = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = NO;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = NO;
+ HEADER_SEARCH_PATHS = ../mDNSShared;
+ INSTALL_PATH = "$(HOME)/bin";
+ LIBRARY_SEARCH_PATHS = "";
+ OPTIMIZATION_CFLAGS = "-O0";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "dns-sd";
+ REZ_EXECUTABLE = YES;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ ZERO_LINK = NO;
+ };
+ name = Development;
+ };
+ 21D91E7F0B12A03D003981D9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ FRAMEWORK_SEARCH_PATHS = "";
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_ENABLE_TRIGRAPHS = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = NO;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = NO;
+ HEADER_SEARCH_PATHS = ../mDNSShared;
+ INSTALL_PATH = "$(HOME)/bin";
+ LIBRARY_SEARCH_PATHS = "";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "dns-sd";
+ REZ_EXECUTABLE = YES;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ ZERO_LINK = NO;
+ };
+ name = Deployment;
+ };
+ 21D91E800B12A03D003981D9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ FRAMEWORK_SEARCH_PATHS = "";
+ GCC_ENABLE_TRIGRAPHS = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = NO;
+ GCC_WARN_ABOUT_MISSING_PROTOTYPES = NO;
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = NO;
+ HEADER_SEARCH_PATHS = ../mDNSShared;
+ INSTALL_PATH = "$(HOME)/bin";
+ LIBRARY_SEARCH_PATHS = "";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "dns-sd";
+ REZ_EXECUTABLE = YES;
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ ZERO_LINK = NO;
+ };
+ name = Default;
+ };
+ 21D91E820B12A03D003981D9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEBUGGING_SYMBOLS = YES;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = NO;
+ HEADER_SEARCH_PATHS = ../mDNSShared;
+ INFOPLIST_FILE = "DNSServiceBrowser-Info.plist";
+ INSTALL_PATH = "$(USER_APPS_DIR)";
+ OPTIMIZATION_CFLAGS = "-O0";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ AppKit,
+ );
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "DNS Service Browser";
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost";
+ ZERO_LINK = NO;
+ };
+ name = Development;
+ };
+ 21D91E830B12A03D003981D9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = NO;
+ HEADER_SEARCH_PATHS = ../mDNSShared;
+ INFOPLIST_FILE = "DNSServiceBrowser-Info.plist";
+ INSTALL_PATH = "$(USER_APPS_DIR)";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ AppKit,
+ );
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "DNS Service Browser";
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost";
+ ZERO_LINK = NO;
+ };
+ name = Deployment;
+ };
+ 21D91E840B12A03D003981D9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = NO;
+ HEADER_SEARCH_PATHS = ../mDNSShared;
+ INFOPLIST_FILE = "DNSServiceBrowser-Info.plist";
+ INSTALL_PATH = "$(USER_APPS_DIR)";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ AppKit,
+ );
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "DNS Service Browser";
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost";
+ };
+ name = Default;
+ };
+ 21D91E860B12A03D003981D9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEBUGGING_SYMBOLS = YES;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = NO;
+ HEADER_SEARCH_PATHS = ../mDNSShared;
+ INFOPLIST_FILE = "DNSServiceReg-Info.plist";
+ INSTALL_PATH = "$(USER_APPS_DIR)";
+ OPTIMIZATION_CFLAGS = "-O0";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ AppKit,
+ );
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "DNS Service Registration";
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost";
+ ZERO_LINK = NO;
+ };
+ name = Development;
+ };
+ 21D91E870B12A03D003981D9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = NO;
+ HEADER_SEARCH_PATHS = ../mDNSShared;
+ INFOPLIST_FILE = "DNSServiceReg-Info.plist";
+ INSTALL_PATH = "$(USER_APPS_DIR)";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ AppKit,
+ );
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "DNS Service Registration";
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost";
+ ZERO_LINK = NO;
+ };
+ name = Deployment;
+ };
+ 21D91E880B12A03D003981D9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";
+ GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
+ GCC_WARN_UNKNOWN_PRAGMAS = NO;
+ HEADER_SEARCH_PATHS = ../mDNSShared;
+ INFOPLIST_FILE = "DNSServiceReg-Info.plist";
+ INSTALL_PATH = "$(USER_APPS_DIR)";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = (
+ "-framework",
+ Foundation,
+ "-framework",
+ AppKit,
+ );
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "DNS Service Registration";
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = "-Wmost";
+ };
+ name = Default;
+ };
+ 21D91E8A0B12A03D003981D9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = NO;
+ DEBUGGING_SYMBOLS = YES;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ OPTIMIZATION_CFLAGS = "-O0";
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "Build All";
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ ZERO_LINK = NO;
+ };
+ name = Development;
+ };
+ 21D91E8B0B12A03D003981D9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COPY_PHASE_STRIP = YES;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "Build All";
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ ZERO_LINK = NO;
+ };
+ name = Deployment;
+ };
+ 21D91E8C0B12A03D003981D9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ OTHER_CFLAGS = "";
+ OTHER_LDFLAGS = "";
+ OTHER_REZFLAGS = "";
+ PRODUCT_NAME = "Build All";
+ SECTORDER_FLAGS = "";
+ WARNING_CFLAGS = (
+ "-Wmost",
+ "-Wno-four-char-constants",
+ "-Wno-unknown-pragmas",
+ );
+ };
+ name = Default;
+ };
+ 21D91E8E0B12A03D003981D9 /* Development */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PREBINDING = NO;
+ SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ };
+ name = Development;
+ };
+ 21D91E8F0B12A03D003981D9 /* Deployment */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PREBINDING = NO;
+ SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ };
+ name = Deployment;
+ };
+ 21D91E900B12A03D003981D9 /* Default */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ PREBINDING = NO;
+ SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+ };
+ name = Default;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 21D91E7D0B12A03D003981D9 /* Build configuration list for PBXNativeTarget "dns-sd" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 21D91E7E0B12A03D003981D9 /* Development */,
+ 21D91E7F0B12A03D003981D9 /* Deployment */,
+ 21D91E800B12A03D003981D9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 21D91E810B12A03D003981D9 /* Build configuration list for PBXNativeTarget "DNS Service Browser" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 21D91E820B12A03D003981D9 /* Development */,
+ 21D91E830B12A03D003981D9 /* Deployment */,
+ 21D91E840B12A03D003981D9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 21D91E850B12A03D003981D9 /* Build configuration list for PBXNativeTarget "DNS Service Registration" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 21D91E860B12A03D003981D9 /* Development */,
+ 21D91E870B12A03D003981D9 /* Deployment */,
+ 21D91E880B12A03D003981D9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 21D91E890B12A03D003981D9 /* Build configuration list for PBXAggregateTarget "Build All" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 21D91E8A0B12A03D003981D9 /* Development */,
+ 21D91E8B0B12A03D003981D9 /* Deployment */,
+ 21D91E8C0B12A03D003981D9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+ 21D91E8D0B12A03D003981D9 /* Build configuration list for PBXProject "DNS-SD" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 21D91E8E0B12A03D003981D9 /* Development */,
+ 21D91E8F0B12A03D003981D9 /* Deployment */,
+ 21D91E900B12A03D003981D9 /* Default */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Default;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
+}
diff --git a/mDNSResponder/Clients/DNSServiceBrowser-Info.plist b/mDNSResponder/Clients/DNSServiceBrowser-Info.plist
new file mode 100644
index 00000000..093d7b4d
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser-Info.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>DNS Service Browser</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.DNSServiceBrowser</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0</string>
+ <key>NSMainNibFile</key>
+ <string>DNSServiceBrowser</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.NET/App.ico b/mDNSResponder/Clients/DNSServiceBrowser.NET/App.ico
new file mode 100755
index 00000000..3a5525fd
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.NET/App.ico
Binary files differ
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.NET/AssemblyInfo.cs b/mDNSResponder/Clients/DNSServiceBrowser.NET/AssemblyInfo.cs
new file mode 100755
index 00000000..da6a08c9
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.NET/AssemblyInfo.cs
@@ -0,0 +1,75 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.NET.csproj b/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.NET.csproj
new file mode 100755
index 00000000..c78e314a
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.NET.csproj
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <ProjectType>Local</ProjectType>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{DE8DB97E-37A3-43ED-9A5E-CCC5F6DE9CB4}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ApplicationIcon>
+ </ApplicationIcon>
+ <AssemblyKeyContainerName>
+ </AssemblyKeyContainerName>
+ <AssemblyName>DNSServiceBrowser_NET</AssemblyName>
+ <AssemblyOriginatorKeyFile>
+ </AssemblyOriginatorKeyFile>
+ <DefaultClientScript>JScript</DefaultClientScript>
+ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
+ <DefaultTargetSchema>IE50</DefaultTargetSchema>
+ <DelaySign>false</DelaySign>
+ <OutputType>WinExe</OutputType>
+ <RootNamespace>DNSServiceBrowser_NET</RootNamespace>
+ <StartupObject>
+ </StartupObject>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <OldToolsVersion>2.0</OldToolsVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>bin\Debug\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <Optimize>false</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>full</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>bin\Release\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>TRACE</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>false</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <Optimize>true</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>none</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System">
+ <Name>System</Name>
+ </Reference>
+ <Reference Include="System.Data">
+ <Name>System.Data</Name>
+ </Reference>
+ <Reference Include="System.Drawing">
+ <Name>System.Drawing</Name>
+ </Reference>
+ <Reference Include="System.Windows.Forms">
+ <Name>System.Windows.Forms</Name>
+ </Reference>
+ <Reference Include="System.Xml">
+ <Name>System.XML</Name>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="App.ico" />
+ <Compile Include="AssemblyInfo.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="DNSServiceBrowser.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <EmbeddedResource Include="DNSServiceBrowser.resx">
+ <DependentUpon>DNSServiceBrowser.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <COMReference Include="Bonjour">
+ <Guid>{18FBED6D-F2B7-4EC8-A4A4-46282E635308}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ </COMReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PreBuildEvent>
+ </PreBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.cs b/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.cs
new file mode 100755
index 00000000..df880844
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.cs
@@ -0,0 +1,734 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Data;
+using System.Text;
+using Bonjour;
+
+namespace DNSServiceBrowser_NET
+{
+ /// <summary>
+ /// Summary description for Form1.
+ /// </summary>
+ public class Form1 : System.Windows.Forms.Form
+ {
+ private System.Windows.Forms.ComboBox typeBox;
+ private System.Windows.Forms.ListBox browseList;
+ private Bonjour.DNSSDEventManager eventManager = null;
+ private Bonjour.DNSSDService service = null;
+ private Bonjour.DNSSDService browser = null;
+ private Bonjour.DNSSDService resolver = null;
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.Container components = null;
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.Label label4;
+ private System.Windows.Forms.TextBox nameField;
+ private System.Windows.Forms.TextBox typeField;
+ private System.Windows.Forms.TextBox domainField;
+ private System.Windows.Forms.TextBox hostField;
+ private System.Windows.Forms.TextBox portField;
+ private System.Windows.Forms.Label label5;
+ private System.Windows.Forms.ListBox serviceTextField;
+
+ public Form1()
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ this.Load += new System.EventHandler(this.Form1_Load);
+
+ //
+ // Create the DNSSDEventManager. You can then associate event handlers
+ // with the instance that will be invoked when the event occurs
+ //
+ // In this example, we're associating ServiceFound, ServiceLost,
+ // ServiceResolved, and OperationFailed event handlers with the
+ // event manager instance.
+ //
+ eventManager = new DNSSDEventManager();
+ eventManager.ServiceFound += new _IDNSSDEvents_ServiceFoundEventHandler(this.ServiceFound);
+ eventManager.ServiceLost += new _IDNSSDEvents_ServiceLostEventHandler(this.ServiceLost);
+ eventManager.ServiceResolved += new _IDNSSDEvents_ServiceResolvedEventHandler(this.ServiceResolved);
+ eventManager.OperationFailed += new _IDNSSDEvents_OperationFailedEventHandler(this.OperationFailed);
+
+ service = new DNSSDService();
+ }
+
+ private void Form1_Load(object sender, EventArgs e)
+ {
+ typeBox.SelectedItem = "_http._tcp";
+ }
+
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ protected override void Dispose( bool disposing )
+ {
+ if( disposing )
+ {
+ if (components != null)
+ {
+ components.Dispose();
+ }
+
+ //
+ // Clean up
+ //
+ if (resolver != null)
+ {
+ resolver.Stop();
+ }
+
+ if (browser != null)
+ {
+ browser.Stop();
+ }
+
+ if (service != null)
+ {
+ service.Stop();
+ }
+
+ eventManager.ServiceFound -= new _IDNSSDEvents_ServiceFoundEventHandler(this.ServiceFound);
+ eventManager.ServiceLost -= new _IDNSSDEvents_ServiceLostEventHandler(this.ServiceLost);
+ eventManager.ServiceResolved -= new _IDNSSDEvents_ServiceResolvedEventHandler(this.ServiceResolved);
+ eventManager.OperationFailed -= new _IDNSSDEvents_OperationFailedEventHandler(this.OperationFailed);
+ }
+ base.Dispose( disposing );
+ }
+
+ #region Windows Form Designer generated code
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.browseList = new System.Windows.Forms.ListBox();
+ this.typeBox = new System.Windows.Forms.ComboBox();
+ this.label1 = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this.label3 = new System.Windows.Forms.Label();
+ this.label4 = new System.Windows.Forms.Label();
+ this.nameField = new System.Windows.Forms.TextBox();
+ this.typeField = new System.Windows.Forms.TextBox();
+ this.domainField = new System.Windows.Forms.TextBox();
+ this.hostField = new System.Windows.Forms.TextBox();
+ this.portField = new System.Windows.Forms.TextBox();
+ this.label5 = new System.Windows.Forms.Label();
+ this.serviceTextField = new System.Windows.Forms.ListBox();
+ this.SuspendLayout();
+ //
+ // browseList
+ //
+ this.browseList.Location = new System.Drawing.Point(8, 48);
+ this.browseList.Name = "browseList";
+ this.browseList.Size = new System.Drawing.Size(488, 147);
+ this.browseList.TabIndex = 0;
+ this.browseList.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
+ //
+ // typeBox
+ //
+ this.typeBox.Items.AddRange(new object[]
+ {
+ "_accessone._tcp",
+ "_accountedge._tcp",
+ "_actionitems._tcp",
+ "_addressbook._tcp",
+ "_aecoretech._tcp",
+ "_afpovertcp._tcp",
+ "_airport._tcp",
+ "_animolmd._tcp",
+ "_animobserver._tcp",
+ "_apple-sasl._tcp",
+ "_aquamon._tcp",
+ "_async._tcp",
+ "_auth._tcp",
+ "_beep._tcp",
+ "_bfagent._tcp",
+ "_bootps._udp",
+ "_bousg._tcp",
+ "_bsqdea._tcp",
+ "_cheat._tcp",
+ "_chess._tcp",
+ "_clipboard._tcp",
+ "_collection._tcp",
+ "_contactserver._tcp",
+ "_cvspserver._tcp",
+ "_cytv._tcp",
+ "_daap._tcp",
+ "_difi._tcp",
+ "_distcc._tcp",
+ "_dossier._tcp",
+ "_dpap._tcp",
+ "_earphoria._tcp",
+ "_ebms._tcp",
+ "_ebreg._tcp",
+ "_ecbyesfsgksc._tcp",
+ "_eheap._tcp",
+ "_embrace._tcp",
+ "_eppc._tcp",
+ "_eventserver._tcp",
+ "_exec._tcp",
+ "_facespan._tcp",
+ "_faxstfx._tcp",
+ "_fish._tcp",
+ "_fjork._tcp",
+ "_fmpro-internal._tcp",
+ "_ftp._tcp",
+ "_ftpcroco._tcp",
+ "_gbs-smp._tcp",
+ "_gbs-stp._tcp",
+ "_grillezvous._tcp",
+ "_h323._tcp",
+ "_http._tcp",
+ "_hotwayd._tcp",
+ "_hydra._tcp",
+ "_ica-networking._tcp",
+ "_ichalkboard._tcp",
+ "_ichat._tcp",
+ "_iconquer._tcp",
+ "_ifolder._tcp",
+ "_ilynx._tcp",
+ "_imap._tcp",
+ "_imidi._tcp",
+ "_ipbroadcaster._tcp",
+ "_ipp._tcp",
+ "_isparx._tcp",
+ "_ispq-vc._tcp",
+ "_ishare._tcp",
+ "_isticky._tcp",
+ "_istorm._tcp",
+ "_iwork._tcp",
+ "_lan2p._tcp",
+ "_ldap._tcp",
+ "_liaison._tcp",
+ "_login._tcp",
+ "_lontalk._tcp",
+ "_lonworks._tcp",
+ "_macfoh-remote._tcp",
+ "_macminder._tcp",
+ "_moneyworks._tcp",
+ "_mp3sushi._tcp",
+ "_mttp._tcp",
+ "_ncbroadcast._tcp",
+ "_ncdirect._tcp",
+ "_ncsyncserver._tcp",
+ "_net-assistant._tcp",
+ "_newton-dock._tcp",
+ "_nfs._udp",
+ "_nssocketport._tcp",
+ "_odabsharing._tcp",
+ "_omni-bookmark._tcp",
+ "_openbase._tcp",
+ "_p2pchat._udp",
+ "_pdl-datastream._tcp",
+ "_poch._tcp",
+ "_pop3._tcp",
+ "_postgresql._tcp",
+ "_presence._tcp",
+ "_printer._tcp",
+ "_ptp._tcp",
+ "_quinn._tcp",
+ "_raop._tcp",
+ "_rce._tcp",
+ "_realplayfavs._tcp",
+ "_riousbprint._tcp",
+ "_rfb._tcp",
+ "_rtsp._tcp",
+ "_safarimenu._tcp",
+ "_sallingclicker._tcp",
+ "_scone._tcp",
+ "_sdsharing._tcp",
+ "_see._tcp",
+ "_seeCard._tcp",
+ "_serendipd._tcp",
+ "_servermgr._tcp",
+ "_shell._tcp",
+ "_shout._tcp",
+ "_shoutcast._tcp",
+ "_soap._tcp",
+ "_spike._tcp",
+ "_spincrisis._tcp",
+ "_spl-itunes._tcp",
+ "_spr-itunes._tcp",
+ "_ssh._tcp",
+ "_ssscreenshare._tcp",
+ "_strateges._tcp",
+ "_sge-exec._tcp",
+ "_sge-qmaster._tcp",
+ "_stickynotes._tcp",
+ "_sxqdea._tcp",
+ "_sybase-tds._tcp",
+ "_teamlist._tcp",
+ "_teleport._udp",
+ "_telnet._tcp",
+ "_tftp._udp",
+ "_ticonnectmgr._tcp",
+ "_tinavigator._tcp",
+ "_tryst._tcp",
+ "_upnp._tcp",
+ "_utest._tcp",
+ "_vue4rendercow._tcp",
+ "_webdav._tcp",
+ "_whamb._tcp",
+ "_wired._tcp",
+ "_workstation._tcp",
+ "_wormhole._tcp",
+ "_workgroup._tcp",
+ "_ws._tcp",
+ "_xserveraid._tcp",
+ "_xsync._tcp",
+ "_xtshapro._tcp"
+ });
+
+ this.typeBox.Location = new System.Drawing.Point(8, 16);
+ this.typeBox.Name = "typeBox";
+ this.typeBox.Size = new System.Drawing.Size(192, 21);
+ this.typeBox.Sorted = true;
+ this.typeBox.TabIndex = 3;
+ this.typeBox.SelectedIndexChanged += new System.EventHandler(this.typeBox_SelectedIndexChanged);
+ //
+ // label1
+ //
+ this.label1.Location = new System.Drawing.Point(8, 208);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(48, 16);
+ this.label1.TabIndex = 4;
+ this.label1.Text = "Name:";
+ this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // label2
+ //
+ this.label2.Location = new System.Drawing.Point(8, 240);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(48, 16);
+ this.label2.TabIndex = 5;
+ this.label2.Text = "Type:";
+ this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // label3
+ //
+ this.label3.Location = new System.Drawing.Point(8, 272);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(48, 16);
+ this.label3.TabIndex = 6;
+ this.label3.Text = "Domain:";
+ this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // label4
+ //
+ this.label4.Location = new System.Drawing.Point(8, 304);
+ this.label4.Name = "label4";
+ this.label4.Size = new System.Drawing.Size(48, 16);
+ this.label4.TabIndex = 7;
+ this.label4.Text = "Host:";
+ this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // nameField
+ //
+ this.nameField.Location = new System.Drawing.Point(56, 208);
+ this.nameField.Name = "nameField";
+ this.nameField.ReadOnly = true;
+ this.nameField.Size = new System.Drawing.Size(168, 20);
+ this.nameField.TabIndex = 8;
+ this.nameField.Text = "";
+ //
+ // typeField
+ //
+ this.typeField.Location = new System.Drawing.Point(56, 240);
+ this.typeField.Name = "typeField";
+ this.typeField.ReadOnly = true;
+ this.typeField.Size = new System.Drawing.Size(168, 20);
+ this.typeField.TabIndex = 9;
+ this.typeField.Text = "";
+ //
+ // domainField
+ //
+ this.domainField.Location = new System.Drawing.Point(56, 272);
+ this.domainField.Name = "domainField";
+ this.domainField.ReadOnly = true;
+ this.domainField.Size = new System.Drawing.Size(168, 20);
+ this.domainField.TabIndex = 10;
+ this.domainField.Text = "";
+ //
+ // hostField
+ //
+ this.hostField.Location = new System.Drawing.Point(56, 304);
+ this.hostField.Name = "hostField";
+ this.hostField.ReadOnly = true;
+ this.hostField.Size = new System.Drawing.Size(168, 20);
+ this.hostField.TabIndex = 11;
+ this.hostField.Text = "";
+
+ //
+ // portField
+ //
+ this.portField.Location = new System.Drawing.Point(56, 336);
+ this.portField.Name = "portField";
+ this.portField.ReadOnly = true;
+ this.portField.Size = new System.Drawing.Size(168, 20);
+ this.portField.TabIndex = 12;
+ this.portField.Text = "";
+ //
+ // label5
+ //
+ this.label5.Location = new System.Drawing.Point(8, 336);
+ this.label5.Name = "label5";
+ this.label5.Size = new System.Drawing.Size(48, 16);
+ this.label5.TabIndex = 14;
+ this.label5.Text = "Port:";
+ this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // serviceTextField
+ //
+ this.serviceTextField.HorizontalScrollbar = true;
+ this.serviceTextField.Location = new System.Drawing.Point(264, 208);
+ this.serviceTextField.Name = "serviceTextField";
+ this.serviceTextField.Size = new System.Drawing.Size(232, 147);
+ this.serviceTextField.TabIndex = 16;
+ //
+ // Form1
+ //
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(512, 365);
+ this.Controls.AddRange(new System.Windows.Forms.Control[] {
+ this.serviceTextField,
+ this.label5,
+ this.portField,
+ this.hostField,
+ this.domainField,
+ this.typeField,
+ this.nameField,
+ this.label4,
+ this.label3,
+ this.label2,
+ this.label1,
+ this.typeBox,
+ this.browseList});
+ this.Name = "Form1";
+ this.Text = "DNSServices Browser";
+ this.ResumeLayout(false);
+
+ }
+ #endregion
+
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ static void Main()
+ {
+ Application.Run(new Form1());
+ }
+ //
+ // BrowseData
+ //
+ // This class is used to store data associated
+ // with a DNSService.Browse() operation
+ //
+ public class BrowseData
+ {
+ public uint InterfaceIndex;
+ public String Name;
+ public String Type;
+ public String Domain;
+ public int Refs;
+
+ public override String
+ ToString()
+ {
+ return Name;
+ }
+
+ public override bool
+ Equals(object other)
+ {
+ bool result = false;
+
+ if (other != null)
+ {
+ result = (this.Name == other.ToString());
+ }
+
+ return result;
+ }
+
+ public override int
+ GetHashCode()
+ {
+ return Name.GetHashCode();
+ }
+ };
+
+
+ //
+ // ResolveData
+ //
+ // This class is used to store data associated
+ // with a DNSService.Resolve() operation
+ //
+ public class ResolveData
+ {
+ public uint InterfaceIndex;
+ public String FullName;
+ public String HostName;
+ public int Port;
+ public TXTRecord TxtRecord;
+
+ public override String
+ ToString()
+ {
+ return FullName;
+ }
+ };
+
+ //
+ // Populate()
+ //
+ // Populate this form with data associated with a
+ // DNSService.Resolve() call
+ //
+ public void
+ Populate(BrowseData browseData, ResolveData resolveData)
+ {
+ nameField.Text = browseData.Name;
+ typeField.Text = browseData.Type;
+ domainField.Text = browseData.Domain;
+ hostField.Text = resolveData.HostName;
+ portField.Text = resolveData.Port.ToString();
+
+ serviceTextField.Items.Clear();
+
+ //
+ // When we print the text record, we're going to assume that every value
+ // is a string.
+ //
+ if (resolveData.TxtRecord != null)
+ {
+ for (uint idx = 0; idx < resolveData.TxtRecord.GetCount(); idx++)
+ {
+ String key;
+ Byte[] bytes;
+
+ key = resolveData.TxtRecord.GetKeyAtIndex(idx);
+ bytes = (Byte[])resolveData.TxtRecord.GetValueAtIndex(idx);
+
+ if (key.Length > 0)
+ {
+ String val = "";
+
+ if (bytes != null)
+ {
+ val = Encoding.ASCII.GetString(bytes, 0, bytes.Length);
+ }
+
+ serviceTextField.Items.Add(key + "=" + val);
+ }
+ }
+ }
+ }
+
+ //
+ // called when the type field changes
+ //
+ private void typeBox_SelectedIndexChanged(object sender, System.EventArgs e)
+ {
+ browseList.Items.Clear();
+
+ //
+ // Stop the current browse operation
+ //
+ if (browser != null)
+ {
+ browser.Stop();
+ }
+
+ nameField.Text = "";
+ typeField.Text = "";
+ domainField.Text = "";
+ hostField.Text = "";
+ portField.Text = "";
+ serviceTextField.Items.Clear();
+
+ try
+ {
+ //
+ // Selecting a service type will start a new browse operation.
+ //
+ browser = service.Browse( 0, 0, typeBox.SelectedItem.ToString(), null, eventManager );
+ }
+ catch
+ {
+ MessageBox.Show("Browse Failed", "Error");
+ Application.Exit();
+ }
+ }
+
+ private void listBox1_SelectedIndexChanged(object sender, System.EventArgs e)
+ {
+ if (resolver != null)
+ {
+ resolver.Stop();
+ resolver = null;
+ }
+
+ if (browseList.SelectedItem != null)
+ {
+ try
+ {
+ BrowseData data = (BrowseData) browseList.SelectedItem;
+
+ //
+ // Clicking on a service instance results in starting a resolve operation
+ // that will call us back with information about the service
+ //
+ resolver = service.Resolve(0, data.InterfaceIndex, data.Name, data.Type, data.Domain, eventManager);
+ }
+ catch
+ {
+ MessageBox.Show("Resolve Failed", "Error");
+ Application.Exit();
+ }
+ }
+ }
+
+ //
+ // ServiceFound
+ //
+ // This call is invoked by the DNSService core. We create
+ // a BrowseData object and invoked the appropriate method
+ // in the GUI thread so we can update the UI
+ //
+ public void ServiceFound
+ (
+ DNSSDService sref,
+ DNSSDFlags flags,
+ uint ifIndex,
+ String serviceName,
+ String regType,
+ String domain
+ )
+ {
+ int index = browseList.Items.IndexOf(serviceName);
+
+ //
+ // Check to see if we've seen this service before. If the machine has multiple
+ // interfaces, we could potentially get called back multiple times for the
+ // same service. Implementing a simple reference counting scheme will address
+ // the problem of the same service showing up more than once in the browse list.
+ //
+ if (index == -1)
+ {
+ BrowseData data = new BrowseData();
+
+ data.InterfaceIndex = ifIndex;
+ data.Name = serviceName;
+ data.Type = regType;
+ data.Domain = domain;
+ data.Refs = 1;
+
+ browseList.Items.Add(data);
+ browseList.Invalidate();
+ }
+ else
+ {
+ BrowseData data = (BrowseData) browseList.Items[index];
+ data.Refs++;
+ }
+ }
+
+ public void ServiceLost
+ (
+ DNSSDService sref,
+ DNSSDFlags flags,
+ uint ifIndex,
+ String serviceName,
+ String regType,
+ String domain
+ )
+ {
+ int index = browseList.Items.IndexOf(serviceName);
+
+ //
+ // See above comment in ServiceFound about reference counting
+ //
+ if (index != -1)
+ {
+ BrowseData data = (BrowseData) browseList.Items[index];
+
+ data.Refs--;
+
+ if (data.Refs == 0)
+ {
+ browseList.Items.Remove(data);
+ browseList.Invalidate();
+ }
+ }
+ }
+
+ public void ServiceResolved
+ (
+ DNSSDService sref,
+ DNSSDFlags flags,
+ uint ifIndex,
+ String fullName,
+ String hostName,
+ ushort port,
+ TXTRecord txtRecord
+ )
+ {
+ ResolveData data = new ResolveData();
+
+ data.InterfaceIndex = ifIndex;
+ data.FullName = fullName;
+ data.HostName = hostName;
+ data.Port = port;
+ data.TxtRecord = txtRecord;
+
+ //
+ // Don't forget to stop the resolver. This eases the burden on the network
+ //
+ resolver.Stop();
+ resolver = null;
+
+ Populate((BrowseData) browseList.SelectedItem, data);
+ }
+
+ public void OperationFailed
+ (
+ DNSSDService sref,
+ DNSSDError error
+ )
+ {
+ MessageBox.Show("Operation failed: error code: " + error, "Error");
+ }
+ }
+}
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.resx b/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.resx
new file mode 100755
index 00000000..e5b5a111
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.NET/DNSServiceBrowser.resx
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 1.3
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">1.3</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1">this is my long string</data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ [base64 mime encoded serialized .NET Framework object]
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ [base64 mime encoded string representing a byte array form of the .NET Framework object]
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>1.3</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="$this.Name">
+ <value>Form1</value>
+ </data>
+</root> \ No newline at end of file
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.Designer.vb b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.Designer.vb
new file mode 100644
index 00000000..0c6280b0
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.Designer.vb
@@ -0,0 +1,206 @@
+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
+Partial Class DNSServiceBrowser
+ Inherits System.Windows.Forms.Form
+
+ 'Form overrides dispose to clean up the component list.
+ <System.Diagnostics.DebuggerNonUserCode()> _
+ Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+ Try
+ If disposing AndAlso components IsNot Nothing Then
+ components.Dispose()
+ End If
+ Finally
+ MyBase.Dispose(disposing)
+ End Try
+ End Sub
+
+ 'Required by the Windows Form Designer
+ Private components As System.ComponentModel.IContainer
+
+ 'NOTE: The following procedure is required by the Windows Form Designer
+ 'It can be modified using the Windows Form Designer.
+ 'Do not modify it using the code editor.
+ <System.Diagnostics.DebuggerStepThrough()> _
+ Private Sub InitializeComponent()
+ Me.ComboBox1 = New System.Windows.Forms.ComboBox
+ Me.ServiceNames = New System.Windows.Forms.ListBox
+ Me.Label1 = New System.Windows.Forms.Label
+ Me.Label2 = New System.Windows.Forms.Label
+ Me.Label3 = New System.Windows.Forms.Label
+ Me.Label4 = New System.Windows.Forms.Label
+ Me.Label5 = New System.Windows.Forms.Label
+ Me.NameField = New System.Windows.Forms.TextBox
+ Me.PortField = New System.Windows.Forms.TextBox
+ Me.HostField = New System.Windows.Forms.TextBox
+ Me.DomainField = New System.Windows.Forms.TextBox
+ Me.TypeField = New System.Windows.Forms.TextBox
+ Me.TextRecord = New System.Windows.Forms.ListBox
+ Me.SuspendLayout()
+ '
+ 'ComboBox1
+ '
+ Me.ComboBox1.FormattingEnabled = True
+ Me.ComboBox1.Items.AddRange(New Object() {"_accessone._tcp", "_accountedge._tcp", "_actionitems._tcp", "_addressbook._tcp", "_aecoretech._tcp", "_afpovertcp._tcp", "_airport._tcp", "_animobserver._tcp", "_animolmd._tcp", "_apple-sasl._tcp", "_aquamon._tcp", "_async._tcp", "_auth._tcp", "_beep._tcp", "_bfagent._tcp", "_bootps._udp", "_bousg._tcp", "_bsqdea._tcp", "_cheat._tcp", "_chess._tcp", "_clipboard._tcp", "_collection._tcp", "_contactserver._tcp", "_cvspserver._tcp", "_cytv._tcp", "_daap._tcp", "_difi._tcp", "_distcc._tcp", "_dossier._tcp", "_dpap._tcp", "_earphoria._tcp", "_ebms._tcp", "_ebreg._tcp", "_ecbyesfsgksc._tcp", "_eheap._tcp", "_embrace._tcp", "_eppc._tcp", "_eventserver._tcp", "_exec._tcp", "_facespan._tcp", "_faxstfx._tcp", "_fish._tcp", "_fjork._tcp", "_fmpro-internal._tcp", "_ftp._tcp", "_ftpcroco._tcp", "_gbs-smp._tcp", "_gbs-stp._tcp", "_grillezvous._tcp", "_h323._tcp", "_hotwayd._tcp", "_http._tcp", "_hydra._tcp", "_ica-networking._tcp", "_ichalkboard._tcp", "_ichat._tcp", "_iconquer._tcp", "_ifolder._tcp", "_ilynx._tcp", "_imap._tcp", "_imidi._tcp", "_ipbroadcaster._tcp", "_ipp._tcp", "_ishare._tcp", "_isparx._tcp", "_ispq-vc._tcp", "_isticky._tcp", "_istorm._tcp", "_iwork._tcp", "_lan2p._tcp", "_ldap._tcp", "_liaison._tcp", "_login._tcp", "_lontalk._tcp", "_lonworks._tcp", "_macfoh-remote._tcp", "_macminder._tcp", "_moneyworks._tcp", "_mp3sushi._tcp", "_mttp._tcp", "_ncbroadcast._tcp", "_ncdirect._tcp", "_ncsyncserver._tcp", "_net-assistant._tcp", "_newton-dock._tcp", "_nfs._udp", "_nssocketport._tcp", "_odabsharing._tcp", "_omni-bookmark._tcp", "_openbase._tcp", "_p2pchat._udp", "_pdl-datastream._tcp", "_poch._tcp", "_pop3._tcp", "_postgresql._tcp", "_presence._tcp", "_printer._tcp", "_ptp._tcp", "_quinn._tcp", "_raop._tcp", "_rce._tcp", "_realplayfavs._tcp", "_rfb._tcp", "_riousbprint._tcp", "_rtsp._tcp", "_safarimenu._tcp", "_sallingclicker._tcp", "_scone._tcp", "_sdsharing._tcp", "_see._tcp", "_seeCard._tcp", "_serendipd._tcp", "_servermgr._tcp", "_sge-exec._tcp", "_sge-qmaster._tcp", "_shell._tcp", "_shout._tcp", "_shoutcast._tcp", "_soap._tcp", "_spike._tcp", "_spincrisis._tcp", "_spl-itunes._tcp", "_spr-itunes._tcp", "_ssh._tcp", "_ssscreenshare._tcp", "_stickynotes._tcp", "_strateges._tcp", "_sxqdea._tcp", "_sybase-tds._tcp", "_teamlist._tcp", "_teleport._udp", "_telnet._tcp", "_tftp._udp", "_ticonnectmgr._tcp", "_tinavigator._tcp", "_tryst._tcp", "_upnp._tcp", "_utest._tcp", "_vue4rendercow._tcp", "_webdav._tcp", "_whamb._tcp", "_wired._tcp", "_workgroup._tcp", "_workstation._tcp", "_wormhole._tcp", "_ws._tcp", "_xserveraid._tcp", "_xsync._tcp", "_xtshapro._tcp"})
+ Me.ComboBox1.Location = New System.Drawing.Point(13, 13)
+ Me.ComboBox1.Name = "ComboBox1"
+ Me.ComboBox1.Size = New System.Drawing.Size(252, 21)
+ Me.ComboBox1.Sorted = True
+ Me.ComboBox1.TabIndex = 0
+ '
+ 'ServiceNames
+ '
+ Me.ServiceNames.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
+ Or System.Windows.Forms.AnchorStyles.Left) _
+ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+ Me.ServiceNames.FormattingEnabled = True
+ Me.ServiceNames.Location = New System.Drawing.Point(13, 41)
+ Me.ServiceNames.Name = "ServiceNames"
+ Me.ServiceNames.Size = New System.Drawing.Size(662, 251)
+ Me.ServiceNames.Sorted = True
+ Me.ServiceNames.TabIndex = 1
+ '
+ 'Label1
+ '
+ Me.Label1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+ Me.Label1.AutoSize = True
+ Me.Label1.Location = New System.Drawing.Point(16, 311)
+ Me.Label1.Name = "Label1"
+ Me.Label1.Size = New System.Drawing.Size(38, 13)
+ Me.Label1.TabIndex = 2
+ Me.Label1.Text = "Name:"
+ '
+ 'Label2
+ '
+ Me.Label2.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+ Me.Label2.AutoSize = True
+ Me.Label2.Location = New System.Drawing.Point(16, 439)
+ Me.Label2.Name = "Label2"
+ Me.Label2.Size = New System.Drawing.Size(29, 13)
+ Me.Label2.TabIndex = 3
+ Me.Label2.Text = "Port:"
+ '
+ 'Label3
+ '
+ Me.Label3.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+ Me.Label3.AutoSize = True
+ Me.Label3.Location = New System.Drawing.Point(16, 407)
+ Me.Label3.Name = "Label3"
+ Me.Label3.Size = New System.Drawing.Size(32, 13)
+ Me.Label3.TabIndex = 4
+ Me.Label3.Text = "Host:"
+ '
+ 'Label4
+ '
+ Me.Label4.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+ Me.Label4.AutoSize = True
+ Me.Label4.Location = New System.Drawing.Point(16, 374)
+ Me.Label4.Name = "Label4"
+ Me.Label4.Size = New System.Drawing.Size(46, 13)
+ Me.Label4.TabIndex = 5
+ Me.Label4.Text = "Domain:"
+ '
+ 'Label5
+ '
+ Me.Label5.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+ Me.Label5.AutoSize = True
+ Me.Label5.Location = New System.Drawing.Point(16, 342)
+ Me.Label5.Name = "Label5"
+ Me.Label5.Size = New System.Drawing.Size(34, 13)
+ Me.Label5.TabIndex = 6
+ Me.Label5.Text = "Type:"
+ '
+ 'NameField
+ '
+ Me.NameField.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+ Me.NameField.Location = New System.Drawing.Point(69, 309)
+ Me.NameField.Name = "NameField"
+ Me.NameField.ReadOnly = True
+ Me.NameField.Size = New System.Drawing.Size(195, 20)
+ Me.NameField.TabIndex = 7
+ '
+ 'PortField
+ '
+ Me.PortField.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+ Me.PortField.Location = New System.Drawing.Point(69, 436)
+ Me.PortField.Name = "PortField"
+ Me.PortField.ReadOnly = True
+ Me.PortField.Size = New System.Drawing.Size(195, 20)
+ Me.PortField.TabIndex = 8
+ '
+ 'HostField
+ '
+ Me.HostField.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+ Me.HostField.Location = New System.Drawing.Point(69, 403)
+ Me.HostField.Name = "HostField"
+ Me.HostField.ReadOnly = True
+ Me.HostField.Size = New System.Drawing.Size(195, 20)
+ Me.HostField.TabIndex = 9
+ '
+ 'DomainField
+ '
+ Me.DomainField.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+ Me.DomainField.Location = New System.Drawing.Point(69, 371)
+ Me.DomainField.Name = "DomainField"
+ Me.DomainField.ReadOnly = True
+ Me.DomainField.Size = New System.Drawing.Size(195, 20)
+ Me.DomainField.TabIndex = 10
+ '
+ 'TypeField
+ '
+ Me.TypeField.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+ Me.TypeField.Location = New System.Drawing.Point(69, 340)
+ Me.TypeField.Name = "TypeField"
+ Me.TypeField.ReadOnly = True
+ Me.TypeField.Size = New System.Drawing.Size(195, 20)
+ Me.TypeField.TabIndex = 11
+ '
+ 'TextRecord
+ '
+ Me.TextRecord.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
+ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+ Me.TextRecord.FormattingEnabled = True
+ Me.TextRecord.Location = New System.Drawing.Point(278, 309)
+ Me.TextRecord.Name = "TextRecord"
+ Me.TextRecord.SelectionMode = System.Windows.Forms.SelectionMode.None
+ Me.TextRecord.Size = New System.Drawing.Size(397, 147)
+ Me.TextRecord.TabIndex = 12
+ '
+ 'Form1
+ '
+ Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+ Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+ Me.ClientSize = New System.Drawing.Size(690, 480)
+ Me.Controls.Add(Me.TextRecord)
+ Me.Controls.Add(Me.TypeField)
+ Me.Controls.Add(Me.DomainField)
+ Me.Controls.Add(Me.HostField)
+ Me.Controls.Add(Me.PortField)
+ Me.Controls.Add(Me.NameField)
+ Me.Controls.Add(Me.Label5)
+ Me.Controls.Add(Me.Label4)
+ Me.Controls.Add(Me.Label3)
+ Me.Controls.Add(Me.Label2)
+ Me.Controls.Add(Me.Label1)
+ Me.Controls.Add(Me.ServiceNames)
+ Me.Controls.Add(Me.ComboBox1)
+ Me.Name = "Form1"
+ Me.Text = "Bonjour Browser"
+ Me.ResumeLayout(False)
+ Me.PerformLayout()
+
+ End Sub
+ Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
+ Friend WithEvents ServiceNames As System.Windows.Forms.ListBox
+ Friend WithEvents Label1 As System.Windows.Forms.Label
+ Friend WithEvents Label2 As System.Windows.Forms.Label
+ Friend WithEvents Label3 As System.Windows.Forms.Label
+ Friend WithEvents Label4 As System.Windows.Forms.Label
+ Friend WithEvents Label5 As System.Windows.Forms.Label
+ Friend WithEvents NameField As System.Windows.Forms.TextBox
+ Friend WithEvents PortField As System.Windows.Forms.TextBox
+ Friend WithEvents HostField As System.Windows.Forms.TextBox
+ Friend WithEvents DomainField As System.Windows.Forms.TextBox
+ Friend WithEvents TypeField As System.Windows.Forms.TextBox
+ Friend WithEvents TextRecord As System.Windows.Forms.ListBox
+
+End Class
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.VB.vbproj b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.VB.vbproj
new file mode 100644
index 00000000..52beedd4
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.VB.vbproj
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{FB79E297-5703-435C-A829-51AA51CD71C2}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
+ <StartupObject>DNSServiceBrowser.VB.My.MyApplication</StartupObject>
+ <RootNamespace>DNSServiceBrowser.VB</RootNamespace>
+ <AssemblyName>DNSServiceBrowser.VB</AssemblyName>
+ <MyType>WindowsForms</MyType>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <OldToolsVersion>2.0</OldToolsVersion>
+ <UpgradeBackupLocation />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <DefineDebug>true</DefineDebug>
+ <DefineTrace>true</DefineTrace>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DocumentationFile>DNSServiceBrowser.VB.xml</DocumentationFile>
+ <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <DefineDebug>false</DefineDebug>
+ <DefineTrace>true</DefineTrace>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DocumentationFile>DNSServiceBrowser.VB.xml</DocumentationFile>
+ <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Deployment" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Import Include="Microsoft.VisualBasic" />
+ <Import Include="System" />
+ <Import Include="System.Collections" />
+ <Import Include="System.Collections.Generic" />
+ <Import Include="System.Data" />
+ <Import Include="System.Drawing" />
+ <Import Include="System.Diagnostics" />
+ <Import Include="System.Windows.Forms" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="DNSServiceBrowser.vb">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="DNSServiceBrowser.Designer.vb">
+ <DependentUpon>DNSServiceBrowser.vb</DependentUpon>
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="My Project\AssemblyInfo.vb" />
+ <Compile Include="My Project\Application.Designer.vb">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Application.myapp</DependentUpon>
+ </Compile>
+ <Compile Include="My Project\Resources.Designer.vb">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ <Compile Include="My Project\Settings.Designer.vb">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="DNSServiceBrowser.resx">
+ <SubType>Designer</SubType>
+ <DependentUpon>DNSServiceBrowser.vb</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="My Project\Resources.resx">
+ <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.vb</LastGenOutput>
+ <CustomToolNamespace>My.Resources</CustomToolNamespace>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="My Project\Application.myapp">
+ <Generator>MyApplicationCodeGenerator</Generator>
+ <LastGenOutput>Application.Designer.vb</LastGenOutput>
+ </None>
+ <None Include="My Project\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <CustomToolNamespace>My</CustomToolNamespace>
+ <LastGenOutput>Settings.Designer.vb</LastGenOutput>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <COMReference Include="Bonjour">
+ <Guid>{18FBED6D-F2B7-4EC8-A4A4-46282E635308}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ </COMReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.resx b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.resx
new file mode 100644
index 00000000..ff31a6db
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ No newline at end of file
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.vb b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.vb
new file mode 100644
index 00000000..bb67adab
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/DNSServiceBrowser.vb
@@ -0,0 +1,196 @@
+'
+' Copyright (c) 2010 Apple Inc. All rights reserved.
+'
+' Licensed under the Apache License, Version 2.0 (the "License");
+' you may not use this file except in compliance with the License.
+' You may obtain a copy of the License at
+'
+' http://www.apache.org/licenses/LICENSE-2.0
+'
+' Unless required by applicable law or agreed to in writing, software
+' distributed under the License is distributed on an "AS IS" BASIS,
+' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+' See the License for the specific language governing permissions and
+' limitations under the License.
+'
+
+Public Class DNSServiceBrowser
+ Public WithEvents MyEventManager As New Bonjour.DNSSDEventManager
+
+ Private m_service As New Bonjour.DNSSDService
+ Private m_browser As Bonjour.DNSSDService
+ Private m_resolver As Bonjour.DNSSDService
+
+ Public Sub New()
+ MyBase.New()
+
+ 'This call is required by the Windows Form Designer.
+ InitializeComponent()
+
+ ComboBox1.SelectedIndex = 0
+ End Sub
+
+ 'Called when a service is found as a result of a browse operation
+ Public Sub MyEventManager_ServiceFound(ByVal browser As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal serviceName As String, ByVal regtype As String, ByVal domain As String) Handles MyEventManager.ServiceFound
+ Dim index As Integer
+ index = ServiceNames.Items.IndexOf(serviceName)
+ '
+ ' A simple reference counting scheme is implemented so that the same service
+ ' does not show up more than once in the browse list. This can happen
+ ' if the machine has more than one network interface.
+ '
+ ' If we have not seen this service before, then it is added to the browse list
+ ' Otherwise it's reference count is bumped up.
+ '
+ If index = -1 Then
+ Dim browseData As New BrowseData
+ browseData.ServiceName = serviceName
+ browseData.RegType = regtype
+ browseData.Domain = domain
+ browseData.Refs = 1
+ ServiceNames.Items.Add(browseData)
+ Else
+ Dim browseData As BrowseData
+ browseData = ServiceNames.Items([index])
+ browseData.Refs += 1
+ End If
+ End Sub
+
+ Public Sub MyEventManager_ServiceLost(ByVal browser As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal serviceName As String, ByVal regtype As String, ByVal domain As String) Handles MyEventManager.ServiceLost
+ Dim index As Integer
+ '
+ ' See the above about reference counting
+ '
+ index = ServiceNames.Items.IndexOf(serviceName)
+ If index <> -1 Then
+ Dim browseData As BrowseData
+ browseData = ServiceNames.Items([index])
+ browseData.Refs -= 1
+ If browseData.Refs = 0 Then
+ ServiceNames.Items.Remove(serviceName)
+ End If
+ End If
+ End Sub
+
+ Public Sub MyEventManager_ServiceResolved(ByVal resolver As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal fullname As String, ByVal hostname As String, ByVal port As UShort, ByVal record As Bonjour.TXTRecord) Handles MyEventManager.ServiceResolved
+ '
+ ' Once the service is resolved, the resolve operation is stopped. This reduces the burdne on the network
+ '
+ m_resolver.Stop()
+ m_resolver = Nothing
+ Dim browseData As BrowseData = ServiceNames.Items.Item(ServiceNames.SelectedIndex)
+ NameField.Text = browseData.ServiceName
+ TypeField.Text = browseData.RegType
+ DomainField.Text = browseData.Domain
+ HostField.Text = hostname
+ PortField.Text = port
+
+ '
+ ' The values found in the text record are assumed to be human readable strings.
+ '
+ If record IsNot Nothing Then
+ For i As UInteger = 0 To record.GetCount() - 1
+ Dim key As String = record.GetKeyAtIndex(i)
+ If key.Length() > 0 Then
+ TextRecord.Items.Add(key + "=" + System.Text.Encoding.ASCII.GetString(record.GetValueAtIndex(i)))
+ End If
+ Next i
+ End If
+ End Sub
+
+ Private Sub ClearServiceInfo()
+ TextRecord.Items.Clear()
+ NameField.Text = ""
+ TypeField.Text = ""
+ DomainField.Text = ""
+ HostField.Text = ""
+ PortField.Text = ""
+ End Sub
+
+ Private Sub ServiceNames_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ServiceNames.SelectedIndexChanged
+ If m_resolver IsNot Nothing Then
+ m_resolver.Stop()
+ End If
+ Me.ClearServiceInfo()
+ Dim browseData As BrowseData = ServiceNames.Items.Item(ServiceNames.SelectedIndex)
+
+ '
+ ' Selecting a service instance starts a new resolve operation
+ '
+ m_resolver = m_service.Resolve(0, 0, browseData.ServiceName, browseData.RegType, browseData.Domain, MyEventManager)
+ End Sub
+
+ Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
+ If m_browser IsNot Nothing Then
+ m_browser.Stop()
+ End If
+
+ ServiceNames.Items.Clear()
+ Me.ClearServiceInfo()
+
+ '
+ ' Selecting a service type start a new browse operation
+ '
+
+ m_browser = m_service.Browse(0, 0, ComboBox1.Items.Item(ComboBox1.SelectedIndex), "", MyEventManager)
+ End Sub
+
+ Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextRecord.SelectedIndexChanged
+
+ End Sub
+End Class
+Public Class BrowseData
+ Private m_serviceName As String
+ Private m_regType As String
+ Private m_domain As String
+ Private m_refs As Integer
+
+ Property ServiceName() As String
+ Get
+ Return m_serviceName
+ End Get
+ Set(ByVal Value As String)
+ m_serviceName = Value
+ End Set
+ End Property
+
+ Property RegType() As String
+ Get
+ Return m_regType
+ End Get
+ Set(ByVal Value As String)
+ m_regType = Value
+ End Set
+ End Property
+
+ Property Domain() As String
+ Get
+ Return m_domain
+ End Get
+ Set(ByVal Value As String)
+ m_domain = Value
+ End Set
+ End Property
+
+ Property Refs As Integer
+ Get
+ Return m_refs
+ End Get
+ Set(ByVal Value As Integer)
+ m_refs = Value
+ End Set
+ End Property
+
+ Public Overrides Function Equals(obj As Object) As Boolean
+ If obj Is Nothing Then
+ Return False
+ Else
+ Return m_serviceName.Equals(obj.ToString)
+ End If
+ End Function
+
+ Public Overrides Function ToString() As String
+ Return m_serviceName
+ End Function
+
+End Class
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.Designer.vb b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.Designer.vb
new file mode 100644
index 00000000..ad73d2ed
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.Designer.vb
@@ -0,0 +1,38 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+' This code was generated by a tool.
+' Runtime Version:2.0.50727.4918
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+ 'NOTE: This file is auto-generated; do not modify it directly. To make changes,
+ ' or if you encounter build errors in this file, go to the Project Designer
+ ' (go to Project Properties or double-click the My Project node in
+ ' Solution Explorer), and make changes on the Application tab.
+ '
+ Partial Friend Class MyApplication
+
+ <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
+ Public Sub New()
+ MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
+ Me.IsSingleInstance = false
+ Me.EnableVisualStyles = true
+ Me.SaveMySettingsOnExit = true
+ Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
+ End Sub
+
+ <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
+ Protected Overrides Sub OnCreateMainForm()
+ Me.MainForm = Global.DNSServiceBrowser.VB.DNSServiceBrowser
+ End Sub
+ End Class
+End Namespace
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.myapp b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.myapp
new file mode 100644
index 00000000..85cb2c94
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Application.myapp
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <MySubMain>true</MySubMain>
+ <MainForm>DNSServiceBrowser</MainForm>
+ <SingleInstance>false</SingleInstance>
+ <ShutdownMode>0</ShutdownMode>
+ <EnableVisualStyles>true</EnableVisualStyles>
+ <AuthenticationMode>0</AuthenticationMode>
+ <SaveMySettingsOnExit>true</SaveMySettingsOnExit>
+</MyApplicationData> \ No newline at end of file
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/AssemblyInfo.vb b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/AssemblyInfo.vb
new file mode 100644
index 00000000..32fd3b78
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/AssemblyInfo.vb
@@ -0,0 +1,35 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+
+' 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.
+
+' Review the values of the assembly attributes
+
+<Assembly: AssemblyTitle("VBTester")>
+<Assembly: AssemblyDescription("")>
+<Assembly: AssemblyCompany("Porchdog Software, Inc.")>
+<Assembly: AssemblyProduct("VBTester")>
+<Assembly: AssemblyCopyright("Copyright © Porchdog Software, Inc. 2009")>
+<Assembly: AssemblyTrademark("")>
+
+<Assembly: ComVisible(False)>
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+<Assembly: Guid("fa682747-1bdc-4ddb-962e-e3e3a9291b22")>
+
+' Version information for an assembly consists of the following four values:
+'
+' Major Version
+' Minor Version
+' Build Number
+' Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+' <Assembly: AssemblyVersion("1.0.*")>
+
+<Assembly: AssemblyVersion("1.0.0.0")>
+<Assembly: AssemblyFileVersion("1.0.0.0")>
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.Designer.vb b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.Designer.vb
new file mode 100644
index 00000000..1f3f960d
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.Designer.vb
@@ -0,0 +1,62 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+' This code was generated by a tool.
+' Runtime Version:2.0.50727.3082
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My.Resources
+
+ 'This class was auto-generated by the StronglyTypedResourceBuilder
+ 'class via a tool like ResGen or Visual Studio.
+ 'To add or remove a member, edit your .ResX file then rerun ResGen
+ 'with the /str option, or rebuild your VS project.
+ '<summary>
+ ' A strongly-typed resource class, for looking up localized strings, etc.
+ '</summary>
+ <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0"), _
+ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
+ Friend Module Resources
+
+ Private resourceMan As Global.System.Resources.ResourceManager
+
+ Private resourceCulture As Global.System.Globalization.CultureInfo
+
+ '<summary>
+ ' Returns the cached ResourceManager instance used by this class.
+ '</summary>
+ <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+ Get
+ If Object.ReferenceEquals(resourceMan, Nothing) Then
+ Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("VBTester.Resources", GetType(Resources).Assembly)
+ resourceMan = temp
+ End If
+ Return resourceMan
+ End Get
+ End Property
+
+ '<summary>
+ ' Overrides the current thread's CurrentUICulture property for all
+ ' resource lookups using this strongly typed resource class.
+ '</summary>
+ <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+ Friend Property Culture() As Global.System.Globalization.CultureInfo
+ Get
+ Return resourceCulture
+ End Get
+ Set(ByVal value As Global.System.Globalization.CultureInfo)
+ resourceCulture = value
+ End Set
+ End Property
+ End Module
+End Namespace
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.resx b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.resx
new file mode 100644
index 00000000..ffecec85
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Resources.resx
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ No newline at end of file
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.Designer.vb b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.Designer.vb
new file mode 100644
index 00000000..a8c15368
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.Designer.vb
@@ -0,0 +1,73 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+' This code was generated by a tool.
+' Runtime Version:2.0.50727.3082
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+ <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0"), _
+ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+ Partial Friend NotInheritable Class MySettings
+ Inherits Global.System.Configuration.ApplicationSettingsBase
+
+ Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+ Private Shared addedHandler As Boolean
+
+ Private Shared addedHandlerLockObject As New Object
+
+ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+ If My.Application.SaveMySettingsOnExit Then
+ My.Settings.Save()
+ End If
+ End Sub
+#End If
+#End Region
+
+ Public Shared ReadOnly Property [Default]() As MySettings
+ Get
+
+#If _MyType = "WindowsForms" Then
+ If Not addedHandler Then
+ SyncLock addedHandlerLockObject
+ If Not addedHandler Then
+ AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+ addedHandler = True
+ End If
+ End SyncLock
+ End If
+#End If
+ Return defaultInstance
+ End Get
+ End Property
+ End Class
+End Namespace
+
+Namespace My
+
+ <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
+ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
+ Friend Module MySettingsProperty
+
+ <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
+ Friend ReadOnly Property Settings() As Global.DNSServiceBrowser.VB.My.MySettings
+ Get
+ Return Global.DNSServiceBrowser.VB.My.MySettings.Default
+ End Get
+ End Property
+ End Module
+End Namespace
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.settings b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.settings
new file mode 100644
index 00000000..377f56d6
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.VB/My Project/Settings.settings
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
+ <Profiles>
+ <Profile Name="(Default)" />
+ </Profiles>
+ <Settings />
+</SettingsFile>
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.m b/mDNSResponder/Clients/DNSServiceBrowser.m
new file mode 100755
index 00000000..b4e04140
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.m
@@ -0,0 +1,679 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2002-2003 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.
+ */
+
+#import <Cocoa/Cocoa.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <net/if.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#include <sys/select.h>
+#include <netinet/in.h>
+#include <unistd.h>
+#include <dns_sd.h>
+
+@class ServiceController; // holds state corresponding to outstanding DNSServiceRef
+
+@interface BrowserController : NSObject
+{
+ IBOutlet id nameField;
+ IBOutlet id typeField;
+
+ IBOutlet id serviceDisplayTable;
+ IBOutlet id typeColumn;
+ IBOutlet id nameColumn;
+ IBOutlet id serviceTypeField;
+ IBOutlet id serviceNameField;
+
+ IBOutlet id hostField;
+ IBOutlet id ipAddressField;
+ IBOutlet id ip6AddressField;
+ IBOutlet id portField;
+ IBOutlet id interfaceField;
+ IBOutlet id textField;
+
+ NSMutableArray *_srvtypeKeys;
+ NSMutableArray *_srvnameKeys;
+ NSMutableArray *_sortedServices;
+ NSMutableDictionary *_servicesDict;
+
+ ServiceController *_serviceBrowser;
+ ServiceController *_serviceResolver;
+ ServiceController *_ipv4AddressResolver;
+ ServiceController *_ipv6AddressResolver;
+}
+
+- (void)notifyTypeSelectionChange:(NSNotification*)note;
+- (void)notifyNameSelectionChange:(NSNotification*)note;
+
+- (IBAction)connect:(id)sender;
+
+- (IBAction)handleTableClick:(id)sender;
+- (IBAction)removeSelected:(id)sender;
+- (IBAction)addNewService:(id)sender;
+
+- (IBAction)update:(NSString *)Type;
+
+- (void)updateBrowseWithName:(const char *)name type:(const char *)resulttype domain:(const char *)domain interface:(uint32_t)interface flags:(DNSServiceFlags)flags;
+- (void)resolveClientWitHost:(NSString *)host port:(uint16_t)port interfaceIndex:(uint32_t)interface txtRecord:(const char*)txtRecord txtLen:(uint16_t)txtLen;
+- (void)updateAddress:(uint16_t)rrtype addr:(const void *)buff addrLen:(uint16_t)addrLen host:(const char*)host interfaceIndex:(uint32_t)interface more:(boolean_t)moreToCome;
+
+- (void)_cancelPendingResolve;
+- (void)_clearResolvedInfo;
+
+@end
+
+// The ServiceController manages cleanup of DNSServiceRef & runloop info for an outstanding request
+@interface ServiceController : NSObject
+{
+ DNSServiceRef fServiceRef;
+ CFSocketRef fSocketRef;
+ CFRunLoopSourceRef fRunloopSrc;
+}
+
+- (id)initWithServiceRef:(DNSServiceRef)ref;
+- (void)addToCurrentRunLoop;
+- (DNSServiceRef)serviceRef;
+- (void)dealloc;
+
+@end // interface ServiceController
+
+
+static void
+ProcessSockData(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info)
+{
+ DNSServiceRef serviceRef = (DNSServiceRef)info;
+ DNSServiceErrorType err = DNSServiceProcessResult(serviceRef);
+ if (err != kDNSServiceErr_NoError) {
+ printf("DNSServiceProcessResult() returned an error! %d\n", err);
+ }
+}
+
+
+static void
+ServiceBrowseReply(DNSServiceRef sdRef, DNSServiceFlags servFlags, uint32_t interfaceIndex, DNSServiceErrorType errorCode,
+ const char *serviceName, const char *regtype, const char *replyDomain, void *context)
+{
+ if (errorCode == kDNSServiceErr_NoError) {
+ [(BrowserController*)context updateBrowseWithName:serviceName type:regtype domain:replyDomain interface:interfaceIndex flags:servFlags];
+ } else {
+ printf("ServiceBrowseReply got an error! %d\n", errorCode);
+ }
+}
+
+
+static void
+ServiceResolveReply(DNSServiceRef sdRef, DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode,
+ const char *fullname, const char *hosttarget, uint16_t port, uint16_t txtLen, const char *txtRecord, void *context)
+{
+ if (errorCode == kDNSServiceErr_NoError) {
+ [(BrowserController*)context resolveClientWitHost:[NSString stringWithUTF8String:hosttarget] port:port interfaceIndex:interfaceIndex txtRecord:txtRecord txtLen:txtLen];
+ } else {
+ printf("ServiceResolveReply got an error! %d\n", errorCode);
+ }
+}
+
+
+static void
+QueryRecordReply(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)
+{
+ if (errorCode == kDNSServiceErr_NoError) {
+ [(BrowserController*)context updateAddress:rrtype addr:rdata addrLen:rdlen host:fullname interfaceIndex:interfaceIndex more:(flags & kDNSServiceFlagsMoreComing)];
+ } else {
+ printf("QueryRecordReply got an error! %d\n", errorCode);
+ }
+}
+
+
+static void
+InterfaceIndexToName(uint32_t interface, char *interfaceName)
+{
+ assert(interfaceName);
+
+ if (interface == kDNSServiceInterfaceIndexAny) {
+ // All active network interfaces.
+ strlcpy(interfaceName, "all", IF_NAMESIZE);
+ } else if (interface == kDNSServiceInterfaceIndexLocalOnly) {
+ // Only available locally on this machine.
+ strlcpy(interfaceName, "local", IF_NAMESIZE);
+ } else if (interface == kDNSServiceInterfaceIndexP2P) {
+ // Peer-to-peer.
+ strlcpy(interfaceName, "p2p", IF_NAMESIZE);
+ } else {
+ // Converts interface index to interface name.
+ if_indextoname(interface, interfaceName);
+ }
+}
+
+
+@implementation BrowserController //Begin implementation of BrowserController methods
+
+- (void)registerDefaults
+{
+ NSMutableDictionary *regDict = [NSMutableDictionary dictionary];
+
+ NSArray *typeArray = [NSArray arrayWithObjects:@"_afpovertcp._tcp",
+ @"_smb._tcp",
+ @"_rfb._tcp",
+ @"_ssh._tcp",
+ @"_ftp._tcp",
+ @"_http._tcp",
+ @"_printer._tcp",
+ @"_ipp._tcp",
+ @"_airport._tcp",
+ @"_presence._tcp",
+ @"_daap._tcp",
+ @"_dpap._tcp",
+ nil];
+
+ NSArray *nameArray = [NSArray arrayWithObjects:@"AppleShare Servers",
+ @"Windows Sharing",
+ @"Screen Sharing",
+ @"Secure Shell",
+ @"FTP Servers",
+ @"Web Servers",
+ @"LPR Printers",
+ @"IPP Printers",
+ @"AirPort Base Stations",
+ @"iChat Buddies",
+ @"iTunes Libraries",
+ @"iPhoto Libraries",
+ nil];
+
+ [regDict setObject:typeArray forKey:@"SrvTypeKeys"];
+ [regDict setObject:nameArray forKey:@"SrvNameKeys"];
+
+ [[NSUserDefaults standardUserDefaults] registerDefaults:regDict];
+}
+
+
+- (id)init
+{
+ self = [super init];
+ if (self) {
+ _srvtypeKeys = nil;
+ _srvnameKeys = nil;
+ _serviceBrowser = nil;
+ _serviceResolver = nil;
+ _ipv4AddressResolver = nil;
+ _ipv6AddressResolver = nil;
+ _sortedServices = [[NSMutableArray alloc] init];
+ _servicesDict = [[NSMutableDictionary alloc] init];
+ }
+ return self;
+}
+
+
+- (void)awakeFromNib
+{
+ [typeField sizeLastColumnToFit];
+ [nameField sizeLastColumnToFit];
+ [nameField setDoubleAction:@selector(connect:)];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notifyTypeSelectionChange:) name:NSTableViewSelectionDidChangeNotification object:typeField];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notifyNameSelectionChange:) name:NSTableViewSelectionDidChangeNotification object:nameField];
+
+ _srvtypeKeys = [[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvTypeKeys"] mutableCopy];
+ _srvnameKeys = [[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvNameKeys"] mutableCopy];
+
+ if (!_srvtypeKeys || !_srvnameKeys) {
+ [_srvtypeKeys release];
+ [_srvnameKeys release];
+ [self registerDefaults];
+ _srvtypeKeys = [[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvTypeKeys"] mutableCopy];
+ _srvnameKeys = [[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvNameKeys"] mutableCopy];
+ }
+
+ [typeField reloadData];
+}
+
+
+- (void)dealloc
+{
+ [_srvtypeKeys release];
+ [_srvnameKeys release];
+ [_servicesDict release];
+ [_sortedServices release];
+ [super dealloc];
+}
+
+
+-(void)tableView:(NSTableView *)theTableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(int)row
+{
+ if (row < 0) return;
+}
+
+
+- (int)numberOfRowsInTableView:(NSTableView *)theTableView //Begin mandatory TableView methods
+{
+ if (theTableView == typeField) {
+ return [_srvnameKeys count];
+ }
+ if (theTableView == nameField) {
+ return [_servicesDict count];
+ }
+ if (theTableView == serviceDisplayTable) {
+ return [_srvnameKeys count];
+ }
+ return 0;
+}
+
+
+- (id)tableView:(NSTableView *)theTableView objectValueForTableColumn:(NSTableColumn *)theColumn row:(int)rowIndex
+{
+ if (theTableView == typeField) {
+ return [_srvnameKeys objectAtIndex:rowIndex];
+ }
+ if (theTableView == nameField) {
+ return [[_servicesDict objectForKey:[_sortedServices objectAtIndex:rowIndex]] name];
+ }
+ if (theTableView == serviceDisplayTable) {
+ if (theColumn == typeColumn) {
+ return [_srvtypeKeys objectAtIndex:rowIndex];
+ }
+ if (theColumn == nameColumn) {
+ return [_srvnameKeys objectAtIndex:rowIndex];
+ }
+ return nil;
+ }
+
+ return nil;
+}
+
+
+- (void)notifyTypeSelectionChange:(NSNotification*)note
+{
+ [self _cancelPendingResolve];
+
+ int index = [[note object] selectedRow];
+ if (index != -1) {
+ [self update:[_srvtypeKeys objectAtIndex:index]];
+ } else {
+ [self update:nil];
+ }
+}
+
+
+- (void)notifyNameSelectionChange:(NSNotification*)note
+{
+ [self _cancelPendingResolve];
+
+ int index = [[note object] selectedRow];
+ if (index == -1) {
+ return;
+ }
+
+ // Get the currently selected service
+ NSNetService *service = [_servicesDict objectForKey:[_sortedServices objectAtIndex:index]];
+
+ DNSServiceRef serviceRef;
+ DNSServiceErrorType err = DNSServiceResolve(&serviceRef,
+ (DNSServiceFlags)0,
+ kDNSServiceInterfaceIndexAny,
+ (const char *)[[service name] UTF8String],
+ (const char *)[[service type] UTF8String],
+ (const char *)[[service domain] UTF8String],
+ (DNSServiceResolveReply)ServiceResolveReply,
+ self);
+
+ if (kDNSServiceErr_NoError == err) {
+ _serviceResolver = [[ServiceController alloc] initWithServiceRef:serviceRef];
+ [_serviceResolver addToCurrentRunLoop];
+ }
+}
+
+
+- (IBAction)update:(NSString *)theType
+{
+ [_servicesDict removeAllObjects];
+ [_sortedServices removeAllObjects];
+ [nameField reloadData];
+
+ // get rid of the previous browser if one exists
+ if (_serviceBrowser != nil) {
+ [_serviceBrowser release];
+ _serviceBrowser = nil;
+ }
+
+ if (theType) {
+ DNSServiceRef serviceRef;
+ DNSServiceErrorType err = DNSServiceBrowse(&serviceRef, (DNSServiceFlags)0, 0, [theType UTF8String], NULL, ServiceBrowseReply, self);
+ if (kDNSServiceErr_NoError == err) {
+ _serviceBrowser = [[ServiceController alloc] initWithServiceRef:serviceRef];
+ [_serviceBrowser addToCurrentRunLoop];
+ }
+ }
+}
+
+
+- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)theApplication
+{
+ return YES;
+}
+
+
+- (void)updateBrowseWithName:(const char *)name type:(const char *)type domain:(const char *)domain interface:(uint32_t)interface flags:(DNSServiceFlags)flags
+{
+ NSString *key = [NSString stringWithFormat:@"%s.%s%s%d", name, type, domain, interface];
+ NSNetService *service = [[NSNetService alloc] initWithDomain:[NSString stringWithUTF8String:domain] type:[NSString stringWithUTF8String:type] name:[NSString stringWithUTF8String:name]];
+
+ if (flags & kDNSServiceFlagsAdd) {
+ [_servicesDict setObject:service forKey:key];
+ } else {
+ [_servicesDict removeObjectForKey:key];
+ }
+
+ // If not expecting any more data, then reload (redraw) TableView with newly found data
+ if (!(flags & kDNSServiceFlagsMoreComing)) {
+
+ // Save the current TableView selection
+ int index = [nameField selectedRow];
+ NSString *selected = (index != -1) ? [[_sortedServices objectAtIndex:index] copy] : nil;
+
+ [_sortedServices release];
+ _sortedServices = [[_servicesDict allKeys] mutableCopy];
+ [_sortedServices sortUsingSelector:@selector(caseInsensitiveCompare:)];
+ [nameField reloadData];
+
+ // Restore the previous TableView selection
+ index = selected ? [_sortedServices indexOfObject:selected] : NSNotFound;
+ if (index != NSNotFound) {
+ [nameField selectRowIndexes:[NSIndexSet indexSetWithIndex:index] byExtendingSelection:NO];
+ [nameField scrollRowToVisible:index];
+ }
+
+ [selected release];
+ }
+
+ [service release];
+
+ return;
+}
+
+
+- (void)resolveClientWitHost:(NSString *)host port:(uint16_t)port interfaceIndex:(uint32_t)interface txtRecord:(const char*)txtRecord txtLen:(uint16_t)txtLen
+{
+ DNSServiceRef serviceRef;
+
+ if (_ipv4AddressResolver) {
+ [_ipv4AddressResolver release];
+ _ipv4AddressResolver = nil;
+ }
+
+ if (_ipv6AddressResolver) {
+ [_ipv6AddressResolver release];
+ _ipv6AddressResolver = nil;
+ }
+
+ // Start an async lookup for IPv4 addresses
+ DNSServiceErrorType err = DNSServiceQueryRecord(&serviceRef, (DNSServiceFlags)0, interface, [host UTF8String], kDNSServiceType_A, kDNSServiceClass_IN, QueryRecordReply, self);
+ if (err == kDNSServiceErr_NoError) {
+ _ipv4AddressResolver = [[ServiceController alloc] initWithServiceRef:serviceRef];
+ [_ipv4AddressResolver addToCurrentRunLoop];
+ }
+
+ // Start an async lookup for IPv6 addresses
+ err = DNSServiceQueryRecord(&serviceRef, (DNSServiceFlags)0, interface, [host UTF8String], kDNSServiceType_AAAA, kDNSServiceClass_IN, QueryRecordReply, self);
+ if (err == kDNSServiceErr_NoError) {
+ _ipv6AddressResolver = [[ServiceController alloc] initWithServiceRef:serviceRef];
+ [_ipv6AddressResolver addToCurrentRunLoop];
+ }
+
+ char interfaceName[IF_NAMESIZE];
+ InterfaceIndexToName(interface, interfaceName);
+
+ [hostField setStringValue:host];
+ [interfaceField setStringValue:[NSString stringWithUTF8String:interfaceName]];
+ [portField setIntValue:ntohs(port)];
+
+ // kind of a hack: munge txtRecord so it's human-readable
+ if (txtLen > 0) {
+ char *readableText = (char*) malloc(txtLen);
+ if (readableText != nil) {
+ ByteCount index, subStrLen;
+ memcpy(readableText, txtRecord, txtLen);
+ for (index=0; index < txtLen - 1; index += subStrLen + 1) {
+ subStrLen = readableText[index];
+ readableText[index] = ' ';
+ }
+ [textField setStringValue:[NSString stringWithCString:&readableText[1] length:txtLen - 1]];
+ free(readableText);
+ }
+ }
+}
+
+
+- (void)updateAddress:(uint16_t)rrtype addr:(const void *)buff addrLen:(uint16_t)addrLen host:(const char*) host interfaceIndex:(uint32_t)interface more:(boolean_t)moreToCome
+{
+ char addrBuff[256];
+
+ if (rrtype == kDNSServiceType_A) {
+ inet_ntop(AF_INET, buff, addrBuff, sizeof(addrBuff));
+ if ([[ipAddressField stringValue] length] > 0) {
+ [ipAddressField setStringValue:[NSString stringWithFormat:@"%@, ", [ipAddressField stringValue]]];
+ }
+ [ipAddressField setStringValue:[NSString stringWithFormat:@"%@%s", [ipAddressField stringValue], addrBuff]];
+
+ if (!moreToCome) {
+ [_ipv4AddressResolver release];
+ _ipv4AddressResolver = nil;
+ }
+ } else if (rrtype == kDNSServiceType_AAAA) {
+ inet_ntop(AF_INET6, buff, addrBuff, sizeof(addrBuff));
+ if ([[ip6AddressField stringValue] length] > 0) {
+ [ip6AddressField setStringValue:[NSString stringWithFormat:@"%@, ", [ip6AddressField stringValue]]];
+ }
+ [ip6AddressField setStringValue:[NSString stringWithFormat:@"%@%s", [ip6AddressField stringValue], addrBuff]];
+
+ if (!moreToCome) {
+ [_ipv6AddressResolver release];
+ _ipv6AddressResolver = nil;
+ }
+ }
+}
+
+
+- (void)connect:(id)sender
+{
+ NSString *host = [hostField stringValue];
+ NSString *txtRecord = [textField stringValue];
+ int port = [portField intValue];
+
+ int index = [nameField selectedRow];
+ NSString *selected = (index >= 0) ? [_sortedServices objectAtIndex:index] : nil;
+ NSString *type = [[_servicesDict objectForKey:selected] type];
+
+ if ([type isEqual:@"_http._tcp."]) {
+ NSString *pathDelim = @"path=";
+ NSRange where;
+
+ // If the TXT record specifies a path, extract it.
+ where = [txtRecord rangeOfString:pathDelim options:NSCaseInsensitiveSearch];
+ if (where.length) {
+ NSRange targetRange = { where.location + where.length, [txtRecord length] - where.location - where.length };
+ NSRange endDelim = [txtRecord rangeOfString:@"\n" options:kNilOptions range:targetRange];
+
+ if (endDelim.length) // if a delimiter was found, truncate the target range
+ targetRange.length = endDelim.location - targetRange.location;
+
+ NSString *path = [txtRecord substringWithRange:targetRange];
+ [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@:%d%@", host, port, path]]];
+ } else {
+ [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://%@:%d", host, port]]];
+ }
+ }
+ else if ([type isEqual:@"_ftp._tcp."]) [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"ftp://%@:%d/", host, port]]];
+ else if ([type isEqual:@"_ssh._tcp."]) [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"ssh://%@:%d/", host, port]]];
+ else if ([type isEqual:@"_afpovertcp._tcp."]) [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"afp://%@:%d/", host, port]]];
+ else if ([type isEqual:@"_smb._tcp."]) [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"smb://%@:%d/", host, port]]];
+ else if ([type isEqual:@"_rfb._tcp."]) [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"vnc://%@:%d/", host, port]]];
+
+ return;
+}
+
+
+- (IBAction)handleTableClick:(id)sender
+{
+ //populate the text fields
+}
+
+
+- (IBAction)removeSelected:(id)sender
+{
+ // remove the selected row and force a refresh
+
+ int selectedRow = [serviceDisplayTable selectedRow];
+
+ if (selectedRow) {
+
+ [_srvtypeKeys removeObjectAtIndex:selectedRow];
+ [_srvnameKeys removeObjectAtIndex:selectedRow];
+
+ [[NSUserDefaults standardUserDefaults] setObject:_srvtypeKeys forKey:@"SrvTypeKeys"];
+ [[NSUserDefaults standardUserDefaults] setObject:_srvnameKeys forKey:@"SrvNameKeys"];
+
+ [typeField reloadData];
+ [serviceDisplayTable reloadData];
+ }
+}
+
+
+- (IBAction)addNewService:(id)sender
+{
+ // add new entries from the edit fields to the arrays for the defaults
+ NSString *newType = [serviceTypeField stringValue];
+ NSString *newName = [serviceNameField stringValue];
+
+ // 3282283: trim trailing '.' from service type field
+ if ([newType length] && [newType hasSuffix:@"."])
+ newType = [newType substringToIndex:[newType length] - 1];
+
+ if ([newType length] && [newName length]) {
+ [_srvtypeKeys addObject:newType];
+ [_srvnameKeys addObject:newName];
+
+ [[NSUserDefaults standardUserDefaults] setObject:_srvtypeKeys forKey:@"SrvTypeKeys"];
+ [[NSUserDefaults standardUserDefaults] setObject:_srvnameKeys forKey:@"SrvNameKeys"];
+
+ [typeField reloadData];
+ [serviceDisplayTable reloadData];
+ }
+}
+
+
+- (void)_cancelPendingResolve
+{
+ [_ipv4AddressResolver release];
+ _ipv4AddressResolver = nil;
+
+ [_ipv6AddressResolver release];
+ _ipv6AddressResolver = nil;
+
+ [_serviceResolver release];
+ _serviceResolver = nil;
+
+ [self _clearResolvedInfo];
+}
+
+
+- (void)_clearResolvedInfo
+{
+ [hostField setStringValue:@""];
+ [ipAddressField setStringValue:@""];
+ [ip6AddressField setStringValue:@""];
+ [portField setStringValue:@""];
+ [interfaceField setStringValue:@""];
+ [textField setStringValue:@""];
+}
+
+@end // implementation BrowserController
+
+
+@implementation ServiceController : NSObject
+{
+ DNSServiceRef fServiceRef;
+ CFSocketRef fSocketRef;
+ CFRunLoopSourceRef fRunloopSrc;
+}
+
+
+- (id)initWithServiceRef:(DNSServiceRef)ref
+{
+ self = [super init];
+ if (self) {
+ fServiceRef = ref;
+ fSocketRef = NULL;
+ fRunloopSrc = NULL;
+ }
+ return self;
+}
+
+
+- (void)addToCurrentRunLoop
+{
+ CFSocketContext context = { 0, (void*)fServiceRef, NULL, NULL, NULL };
+
+ fSocketRef = CFSocketCreateWithNative(kCFAllocatorDefault, DNSServiceRefSockFD(fServiceRef), kCFSocketReadCallBack, ProcessSockData, &context);
+ if (fSocketRef) {
+ // Prevent CFSocketInvalidate from closing DNSServiceRef's socket.
+ CFOptionFlags sockFlags = CFSocketGetSocketFlags(fSocketRef);
+ CFSocketSetSocketFlags(fSocketRef, sockFlags & (~kCFSocketCloseOnInvalidate));
+ fRunloopSrc = CFSocketCreateRunLoopSource(kCFAllocatorDefault, fSocketRef, 0);
+ }
+ if (fRunloopSrc) {
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), fRunloopSrc, kCFRunLoopDefaultMode);
+ } else {
+ printf("Could not listen to runloop socket\n");
+ }
+}
+
+
+- (DNSServiceRef)serviceRef
+{
+ return fServiceRef;
+}
+
+
+- (void)dealloc
+{
+ if (fSocketRef) {
+ CFSocketInvalidate(fSocketRef); // Note: Also closes the underlying socket
+ CFRelease(fSocketRef);
+
+ // Workaround that gives time to CFSocket's select thread so it can remove the socket from its
+ // FD set before we close the socket by calling DNSServiceRefDeallocate. <rdar://problem/3585273>
+ usleep(1000);
+ }
+
+ if (fRunloopSrc) {
+ CFRunLoopRemoveSource(CFRunLoopGetCurrent(), fRunloopSrc, kCFRunLoopDefaultMode);
+ CFRelease(fRunloopSrc);
+ }
+
+ DNSServiceRefDeallocate(fServiceRef);
+
+ [super dealloc];
+}
+
+
+@end // implementation ServiceController
+
+int main(int argc, const char *argv[])
+{
+ return NSApplicationMain(argc, argv);
+}
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.nib/classes.nib b/mDNSResponder/Clients/DNSServiceBrowser.nib/classes.nib
new file mode 100644
index 00000000..482d0aa7
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.nib/classes.nib
@@ -0,0 +1,37 @@
+{
+ IBClasses = (
+ {
+ ACTIONS = {
+ addNewService = id;
+ connect = id;
+ handleDomainClick = id;
+ handleNameClick = id;
+ handleTableClick = id;
+ handleTypeClick = id;
+ loadDomains = id;
+ removeSelected = id;
+ };
+ CLASS = BrowserController;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ domainField = id;
+ hostField = id;
+ interfaceField = id;
+ ip6AddressField = id;
+ ipAddressField = id;
+ nameColumn = id;
+ nameField = id;
+ portField = id;
+ serviceDisplayTable = id;
+ serviceNameField = id;
+ serviceTypeField = id;
+ textField = id;
+ typeColumn = id;
+ typeField = id;
+ };
+ SUPERCLASS = NSObject;
+ },
+ {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.nib/info.nib b/mDNSResponder/Clients/DNSServiceBrowser.nib/info.nib
new file mode 100644
index 00000000..34ca9f0e
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.nib/info.nib
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IBDocumentLocation</key>
+ <string>257 25 522 680 0 0 1280 1002 </string>
+ <key>IBEditorPositions</key>
+ <dict>
+ <key>29</key>
+ <string>22 474 271 44 0 0 1152 746 </string>
+ </dict>
+ <key>IBFramework Version</key>
+ <string>446.1</string>
+ <key>IBOpenObjects</key>
+ <array>
+ <integer>201</integer>
+ <integer>220</integer>
+ </array>
+ <key>IBSystem Version</key>
+ <string>8L2127</string>
+</dict>
+</plist>
diff --git a/mDNSResponder/Clients/DNSServiceBrowser.nib/objects.nib b/mDNSResponder/Clients/DNSServiceBrowser.nib/objects.nib
new file mode 100644
index 00000000..3f28e7a8
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceBrowser.nib/objects.nib
Binary files differ
diff --git a/mDNSResponder/Clients/DNSServiceReg-Info.plist b/mDNSResponder/Clients/DNSServiceReg-Info.plist
new file mode 100644
index 00000000..25699685
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceReg-Info.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>DNS Service Registration</string>
+ <key>CFBundleGetInfoString</key>
+ <string></string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.DNS_Service_Registration</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string></string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1.0.0d1</string>
+ <key>NSMainNibFile</key>
+ <string>DNSServiceReg</string>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/mDNSResponder/Clients/DNSServiceReg.m b/mDNSResponder/Clients/DNSServiceReg.m
new file mode 100644
index 00000000..3f2620fe
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceReg.m
@@ -0,0 +1,274 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2002-2003 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 "dns_sd.h"
+
+@interface RegistrationController : NSObject
+{
+ IBOutlet NSTableColumn *typeColumn;
+ IBOutlet NSTableColumn *nameColumn;
+ IBOutlet NSTableColumn *portColumn;
+ IBOutlet NSTableColumn *domainColumn;
+ IBOutlet NSTableColumn *textColumn;
+
+ IBOutlet NSTableView *serviceDisplayTable;
+
+ IBOutlet NSTextField *serviceTypeField;
+ IBOutlet NSTextField *serviceNameField;
+ IBOutlet NSTextField *servicePortField;
+ IBOutlet NSTextField *serviceDomainField;
+ IBOutlet NSTextField *serviceTextField;
+
+ NSMutableArray *srvtypeKeys;
+ NSMutableArray *srvnameKeys;
+ NSMutableArray *srvportKeys;
+ NSMutableArray *srvdomainKeys;
+ NSMutableArray *srvtextKeys;
+
+ NSMutableDictionary *registeredDict;
+}
+
+- (IBAction)registerService:(id)sender;
+- (IBAction)unregisterService:(id)sender;
+
+- (IBAction)addNewService:(id)sender;
+- (IBAction)removeSelected:(id)sender;
+
+@end
+
+void reg_reply
+ (
+ DNSServiceRef sdRef,
+ DNSServiceFlags flags,
+ DNSServiceErrorType errorCode,
+ const char *name,
+ const char *regtype,
+ const char *domain,
+ void *context
+ )
+{
+ // registration reply
+ printf("Got a reply from the server with error %d\n", errorCode);
+ return;
+}
+
+static void myCFSocketCallBack(CFSocketRef cfs, CFSocketCallBackType CallBackType, CFDataRef address, const void *data, void *context)
+ {
+ DNSServiceProcessResult((DNSServiceRef)context);
+ }
+
+static void addDNSServiceRefToRunLoop(DNSServiceRef ref)
+ {
+ int s = DNSServiceRefSockFD(ref);
+ CFSocketContext myCFSocketContext = { 0, ref, NULL, NULL, NULL };
+ CFSocketRef c = CFSocketCreateWithNative(kCFAllocatorDefault, s, kCFSocketReadCallBack, myCFSocketCallBack, &myCFSocketContext);
+ CFRunLoopSourceRef rls = CFSocketCreateRunLoopSource(kCFAllocatorDefault, c, 0);
+ CFRunLoopAddSource(CFRunLoopGetCurrent(), rls, kCFRunLoopDefaultMode);
+ CFRelease(rls);
+ }
+
+
+@implementation RegistrationController
+
+- (void)registerDefaults
+{
+ NSMutableDictionary *regDict = [NSMutableDictionary dictionary];
+
+ NSArray *typeArray = [NSArray arrayWithObjects:@"_ftp._tcp.", @"_ssh._tcp.", @"_tftp._tcp.", @"_http._tcp.", @"_printer._tcp.", @"_afpovertcp._tcp.", nil];
+ NSArray *nameArray = [NSArray arrayWithObjects:@"My ftp Server", @"My Computer", @"Testing Boot Image", @"A Web Server", @"Steve's Printer", @"Company AppleShare Server", nil];
+ NSArray *portArray = [NSArray arrayWithObjects:@"21", @"22", @"69", @"80", @"515", @"548", nil];
+ NSArray *domainArray = [NSArray arrayWithObjects:@"", @"", @"", @"", @"", @"", nil];
+ NSArray *textArray = [NSArray arrayWithObjects:@"", @"", @"image=mybootimage", @"path=/index.html", @"rn=lpt1", @"Vol=Public", nil];
+
+ [regDict setObject:typeArray forKey:@"SrvTypeKeys"];
+ [regDict setObject:nameArray forKey:@"SrvNameKeys"];
+ [regDict setObject:portArray forKey:@"SrvPortKeys"];
+ [regDict setObject:domainArray forKey:@"SrvDomainKeys"];
+ [regDict setObject:textArray forKey:@"SrvTextKeys"];
+
+ [[NSUserDefaults standardUserDefaults] registerDefaults:regDict];
+}
+
+- (id)init
+{
+ srvtypeKeys = [[NSMutableArray array] retain]; //Define arrays for Type, Domain, and Name
+ srvnameKeys = [[NSMutableArray array] retain];
+ srvportKeys = [[NSMutableArray array] retain];
+ srvdomainKeys = [[NSMutableArray array] retain];
+ srvtextKeys = [[NSMutableArray array] retain];
+
+ registeredDict = [[NSMutableDictionary alloc] init];
+
+ [self registerDefaults];
+ return [super init];
+}
+
+- (void)awakeFromNib //BrowserController startup procedure
+{
+ [srvtypeKeys addObjectsFromArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvTypeKeys"]];
+ [srvnameKeys addObjectsFromArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvNameKeys"]];
+ [srvportKeys addObjectsFromArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvPortKeys"]];
+ [srvdomainKeys addObjectsFromArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvDomainKeys"]];
+ [srvtextKeys addObjectsFromArray:[[NSUserDefaults standardUserDefaults] arrayForKey:@"SrvTextKeys"]];
+
+ [serviceDisplayTable reloadData]; //Reload (redraw) data in fields
+
+}
+
+
+
+ - (IBAction)registerService:(id)sender
+{
+ int selectedRow = [serviceDisplayTable selectedRow];
+ CFMachPortContext context;
+ DNSServiceRef dns_client;
+
+ if (selectedRow < 0) {
+ return;
+ }
+
+ NSString *key = [srvtypeKeys objectAtIndex:selectedRow];
+ if ([registeredDict objectForKey:key]) { printf("Already registered\n"); return; }
+
+ context.version = 1;
+ context.info = 0;
+ context.retain = NULL;
+ context.release = NULL;
+ context.copyDescription = NULL;
+ unsigned char txtbuffer[300];
+ strncpy(txtbuffer+1, [[srvtextKeys objectAtIndex:selectedRow] UTF8String], sizeof(txtbuffer)-1);
+ txtbuffer[0] = strlen(txtbuffer+1);
+
+ DNSServiceErrorType err = DNSServiceRegister
+ (
+ &dns_client, 0, 0,
+ [[srvnameKeys objectAtIndex:selectedRow] UTF8String],
+ [key UTF8String],
+ [[srvdomainKeys objectAtIndex:selectedRow] UTF8String],
+ NULL, htons([[srvportKeys objectAtIndex:selectedRow] intValue]),
+ txtbuffer[0]+1, txtbuffer,
+ reg_reply,
+ nil
+ );
+ if (err)
+ printf("DNSServiceRegister failed %d\n", err);
+ else
+ {
+ addDNSServiceRefToRunLoop(dns_client);
+ [registeredDict setObject:[NSNumber numberWithUnsignedInt:(unsigned int)dns_client] forKey:key];
+ }
+}
+
+- (IBAction)unregisterService:(id)sender
+{
+ int selectedRow = [serviceDisplayTable selectedRow];
+ NSString *key = [srvtypeKeys objectAtIndex:selectedRow];
+
+ NSNumber *refPtr = [registeredDict objectForKey:key];
+ DNSServiceRef ref = (DNSServiceRef)[refPtr unsignedIntValue];
+
+ if (ref) {
+ DNSServiceRefDeallocate(ref);
+ [registeredDict removeObjectForKey:key];
+ }
+}
+
+-(void)tableView:(NSTableView *)theTableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn row:(int)row
+{
+ if (row<0) return;
+}
+
+- (int)numberOfRowsInTableView:(NSTableView *)theTableView //Begin mandatory TableView methods
+{
+ return [srvtypeKeys count];
+}
+
+- (id)tableView:(NSTableView *)theTableView objectValueForTableColumn:(NSTableColumn *)theColumn row:(int)rowIndex
+{
+ if (theColumn == typeColumn) {
+ return [srvtypeKeys objectAtIndex:rowIndex];
+ }
+ if (theColumn == nameColumn) {
+ return [srvnameKeys objectAtIndex:rowIndex];
+ }
+ if (theColumn == portColumn) {
+ return [srvportKeys objectAtIndex:rowIndex];
+ }
+ if (theColumn == domainColumn) {
+ return [srvdomainKeys objectAtIndex:rowIndex];
+ }
+ if (theColumn == textColumn) {
+ return [srvtextKeys objectAtIndex:rowIndex];
+ }
+
+ return(0);
+} //End of mandatory TableView methods
+
+- (IBAction)removeSelected:(id)sender
+{
+ // remove the selected row and force a refresh
+
+ int selectedRow = [serviceDisplayTable selectedRow];
+
+ if (selectedRow) {
+
+ [srvtypeKeys removeObjectAtIndex:selectedRow];
+ [srvnameKeys removeObjectAtIndex:selectedRow];
+ [srvportKeys removeObjectAtIndex:selectedRow];
+ [srvdomainKeys removeObjectAtIndex:selectedRow];
+ [srvtextKeys removeObjectAtIndex:selectedRow];
+
+ [[NSUserDefaults standardUserDefaults] setObject:srvtypeKeys forKey:@"SrvTypeKeys"];
+ [[NSUserDefaults standardUserDefaults] setObject:srvnameKeys forKey:@"SrvNameKeys"];
+ [[NSUserDefaults standardUserDefaults] setObject:srvportKeys forKey:@"SrvPortKeys"];
+ [[NSUserDefaults standardUserDefaults] setObject:srvdomainKeys forKey:@"SrvDomainKeys"];
+ [[NSUserDefaults standardUserDefaults] setObject:srvtextKeys forKey:@"SrvTextKeys"];
+
+ [serviceDisplayTable reloadData];
+ }
+}
+
+- (IBAction)addNewService:(id)sender
+{
+ // add new entries from the edit fields to the arrays for the defaults
+
+ if ([[serviceTypeField stringValue] length] && [[serviceNameField stringValue] length] && [[serviceDomainField stringValue] length]&& [[servicePortField stringValue] length]) {
+ [srvtypeKeys addObject:[serviceTypeField stringValue]];
+ [srvnameKeys addObject:[serviceNameField stringValue]];
+ [srvportKeys addObject:[servicePortField stringValue]];
+ [srvdomainKeys addObject:[serviceDomainField stringValue]];
+ [srvtextKeys addObject:[serviceTextField stringValue]];
+
+ [[NSUserDefaults standardUserDefaults] setObject:srvtypeKeys forKey:@"SrvTypeKeys"];
+ [[NSUserDefaults standardUserDefaults] setObject:srvnameKeys forKey:@"SrvNameKeys"];
+ [[NSUserDefaults standardUserDefaults] setObject:srvportKeys forKey:@"SrvPortKeys"];
+ [[NSUserDefaults standardUserDefaults] setObject:srvdomainKeys forKey:@"SrvDomainKeys"];
+ [[NSUserDefaults standardUserDefaults] setObject:srvtextKeys forKey:@"SrvTextKeys"];
+
+ [serviceDisplayTable reloadData];
+ } else {
+ NSBeep();
+ }
+
+}
+
+@end
+
+int main(int argc, const char *argv[])
+{
+ return NSApplicationMain(argc, argv);
+}
diff --git a/mDNSResponder/Clients/DNSServiceReg.nib/classes.nib b/mDNSResponder/Clients/DNSServiceReg.nib/classes.nib
new file mode 100644
index 00000000..46f466c7
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceReg.nib/classes.nib
@@ -0,0 +1,30 @@
+{
+ IBClasses = (
+ {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
+ {
+ ACTIONS = {
+ addNewService = id;
+ registerService = id;
+ removeSelected = id;
+ unregisterService = id;
+ };
+ CLASS = RegistrationController;
+ LANGUAGE = ObjC;
+ OUTLETS = {
+ domainColumn = NSTableColumn;
+ nameColumn = NSTableColumn;
+ portColumn = NSTableColumn;
+ serviceDisplayTable = NSTableView;
+ serviceDomainField = NSTextField;
+ serviceNameField = NSTextField;
+ servicePortField = NSTextField;
+ serviceTextField = NSTextField;
+ serviceTypeField = NSTextField;
+ textColumn = NSTableColumn;
+ typeColumn = NSTableColumn;
+ };
+ SUPERCLASS = NSObject;
+ }
+ );
+ IBVersion = 1;
+} \ No newline at end of file
diff --git a/mDNSResponder/Clients/DNSServiceReg.nib/info.nib b/mDNSResponder/Clients/DNSServiceReg.nib/info.nib
new file mode 100644
index 00000000..9d2eb74f
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceReg.nib/info.nib
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>IBDocumentLocation</key>
+ <string>32 111 356 240 0 0 1152 746 </string>
+ <key>IBEditorPositions</key>
+ <dict>
+ <key>29</key>
+ <string>103 609 252 44 0 0 1152 746 </string>
+ </dict>
+ <key>IBFramework Version</key>
+ <string>273.0</string>
+ <key>IBOpenObjects</key>
+ <array>
+ <integer>243</integer>
+ <integer>21</integer>
+ </array>
+ <key>IBSystem Version</key>
+ <string>6C30</string>
+</dict>
+</plist>
diff --git a/mDNSResponder/Clients/DNSServiceReg.nib/objects.nib b/mDNSResponder/Clients/DNSServiceReg.nib/objects.nib
new file mode 100644
index 00000000..705e77d7
--- /dev/null
+++ b/mDNSResponder/Clients/DNSServiceReg.nib/objects.nib
Binary files differ
diff --git a/mDNSResponder/Clients/ExplorerPlugin/About.cpp b/mDNSResponder/Clients/ExplorerPlugin/About.cpp
new file mode 100644
index 00000000..4a63f2c2
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/About.cpp
@@ -0,0 +1,90 @@
+// About.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "ExplorerPlugin.h"
+#include "About.h"
+#include "WinVersRes.h"
+#include <DebugServices.h>
+
+
+// CAbout dialog
+
+IMPLEMENT_DYNAMIC(CAbout, CDialog)
+CAbout::CAbout(CWnd* pParent /*=NULL*/)
+ : CDialog(CAbout::IDD, pParent)
+{
+ // Initialize brush with the desired background color
+ m_bkBrush.CreateSolidBrush(RGB(255, 255, 255));
+}
+
+CAbout::~CAbout()
+{
+}
+
+void CAbout::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_COMPONENT, m_componentCtrl);
+ DDX_Control(pDX, IDC_LEGAL, m_legalCtrl);
+}
+
+
+BEGIN_MESSAGE_MAP(CAbout, CDialog)
+ON_WM_CTLCOLOR()
+END_MESSAGE_MAP()
+
+
+// CAbout message handlers
+BOOL
+CAbout::OnInitDialog()
+{
+ BOOL b = CDialog::OnInitDialog();
+
+ CStatic * control = (CStatic*) GetDlgItem( IDC_ABOUT_BACKGROUND );
+ check( control );
+
+ if ( control )
+ {
+ control->SetBitmap( ::LoadBitmap( GetNonLocalizedResources(), MAKEINTRESOURCE( IDB_ABOUT ) ) );
+ }
+
+ control = ( CStatic* ) GetDlgItem( IDC_COMPONENT_VERSION );
+ check( control );
+
+ if ( control )
+ {
+ control->SetWindowText( TEXT( MASTER_PROD_VERS_STR2 ) );
+ }
+
+ return b;
+}
+
+
+HBRUSH CAbout::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
+{
+ switch (nCtlColor)
+ {
+ case CTLCOLOR_STATIC:
+
+ if ( pWnd->GetDlgCtrlID() == IDC_COMPONENT )
+ {
+ pDC->SetTextColor(RGB(64, 64, 64));
+ }
+ else
+ {
+ pDC->SetTextColor(RGB(0, 0, 0));
+ }
+
+ pDC->SetBkColor(RGB(255, 255, 255));
+ return (HBRUSH)(m_bkBrush.GetSafeHandle());
+
+ case CTLCOLOR_DLG:
+
+ return (HBRUSH)(m_bkBrush.GetSafeHandle());
+
+ default:
+
+ return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
+ }
+}
diff --git a/mDNSResponder/Clients/ExplorerPlugin/About.h b/mDNSResponder/Clients/ExplorerPlugin/About.h
new file mode 100644
index 00000000..494d1f1e
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/About.h
@@ -0,0 +1,28 @@
+#pragma once
+
+#include "Resource.h"
+#include "afxwin.h"
+
+// CAbout dialog
+
+class CAbout : public CDialog
+{
+DECLARE_DYNAMIC(CAbout)
+
+public:
+CAbout(CWnd* pParent = NULL); // standard constructor
+virtual ~CAbout();
+
+// Dialog Data
+enum { IDD = IDD_ABOUT };
+
+protected:
+virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+virtual HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
+virtual BOOL OnInitDialog();
+DECLARE_MESSAGE_MAP()
+public:
+CStatic m_componentCtrl;
+CStatic m_legalCtrl;
+CBrush m_bkBrush;
+};
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ClassFactory.cpp b/mDNSResponder/Clients/ExplorerPlugin/ClassFactory.cpp
new file mode 100644
index 00000000..e578e239
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ClassFactory.cpp
@@ -0,0 +1,177 @@
+/* -*- 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 "DebugServices.h"
+
+#include "ExplorerBar.h"
+#include "ExplorerPlugin.h"
+
+#include "ClassFactory.h"
+
+// MFC Debugging
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+//===========================================================================================================================
+// ClassFactory
+//===========================================================================================================================
+
+ClassFactory::ClassFactory( CLSID inCLSID )
+{
+ mCLSIDObject = inCLSID;
+ mRefCount = 1;
+ ++gDLLRefCount;
+}
+
+//===========================================================================================================================
+// ~ClassFactory
+//===========================================================================================================================
+
+ClassFactory::~ClassFactory( void )
+{
+ check( gDLLRefCount > 0 );
+
+ --gDLLRefCount;
+}
+
+#if 0
+#pragma mark -
+#pragma mark == IUnknown methods ==
+#endif
+
+//===========================================================================================================================
+// QueryInterface
+//===========================================================================================================================
+
+STDMETHODIMP ClassFactory::QueryInterface( REFIID inID, LPVOID *outResult )
+{
+ HRESULT err;
+
+ check( outResult );
+
+ if( IsEqualIID( inID, IID_IUnknown ) )
+ {
+ *outResult = this;
+ }
+ else if( IsEqualIID( inID, IID_IClassFactory ) )
+ {
+ *outResult = (IClassFactory *) this;
+ }
+ else
+ {
+ *outResult = NULL;
+ err = E_NOINTERFACE;
+ goto exit;
+ }
+
+ ( *( (LPUNKNOWN *) outResult ) )->AddRef();
+ err = S_OK;
+
+exit:
+ return( err );
+}
+
+//===========================================================================================================================
+// AddRef
+//===========================================================================================================================
+
+STDMETHODIMP_( DWORD ) ClassFactory::AddRef( void )
+{
+ return( ++mRefCount );
+}
+
+//===========================================================================================================================
+// Release
+//===========================================================================================================================
+
+STDMETHODIMP_( DWORD ) ClassFactory::Release( void )
+{
+ DWORD count;
+
+ count = --mRefCount;
+ if( count == 0 )
+ {
+ delete this;
+ }
+ return( count );
+}
+
+#if 0
+#pragma mark -
+#pragma mark == IClassFactory methods ==
+#endif
+
+//===========================================================================================================================
+// CreateInstance
+//===========================================================================================================================
+
+STDMETHODIMP ClassFactory::CreateInstance( LPUNKNOWN inUnknown, REFIID inID, LPVOID *outObject )
+{
+ HRESULT err;
+ LPVOID obj;
+
+ check( outObject );
+
+ obj = NULL;
+ *outObject = NULL;
+ require_action( !inUnknown, exit, err = CLASS_E_NOAGGREGATION );
+
+ // Create the object based on the CLSID.
+
+ if( IsEqualCLSID( mCLSIDObject, CLSID_ExplorerBar ) )
+ {
+ try
+ {
+ obj = new ExplorerBar();
+ }
+ catch( ... )
+ {
+ // Don't let exception escape.
+ }
+ require_action( obj, exit, err = E_OUTOFMEMORY );
+ }
+ else
+ {
+ err = E_FAIL;
+ goto exit;
+ }
+
+ // Query for the specified interface. Release the factory since QueryInterface retains it.
+
+ err = ( (LPUNKNOWN ) obj )->QueryInterface( inID, outObject );
+ ( (LPUNKNOWN ) obj )->Release();
+
+exit:
+ return( err );
+}
+
+//===========================================================================================================================
+// LockServer
+//===========================================================================================================================
+
+STDMETHODIMP ClassFactory::LockServer( BOOL inLock )
+{
+ DEBUG_UNUSED( inLock );
+
+ return( E_NOTIMPL );
+}
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ClassFactory.h b/mDNSResponder/Clients/ExplorerPlugin/ClassFactory.h
new file mode 100644
index 00000000..cbf56302
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ClassFactory.h
@@ -0,0 +1,51 @@
+/* -*- 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.
+ */
+
+#ifndef __CLASS_FACTORY__
+#define __CLASS_FACTORY__
+
+#include "StdAfx.h"
+
+//===========================================================================================================================
+// ClassFactory
+//===========================================================================================================================
+
+class ClassFactory : public IClassFactory
+{
+protected:
+
+DWORD mRefCount;
+CLSID mCLSIDObject;
+
+public:
+
+ClassFactory( CLSID inCLSID );
+~ClassFactory( void );
+
+// IUnknown methods
+
+STDMETHODIMP QueryInterface( REFIID inID, LPVOID *outResult );
+STDMETHODIMP_( DWORD ) AddRef( void );
+STDMETHODIMP_( DWORD ) Release( void );
+
+// IClassFactory methods
+
+STDMETHODIMP CreateInstance( LPUNKNOWN inUnknown, REFIID inID, LPVOID *outObject );
+STDMETHODIMP LockServer( BOOL inLock );
+};
+
+#endif // __CLASS_FACTORY__
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.cpp b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.cpp
new file mode 100644
index 00000000..644515fe
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.cpp
@@ -0,0 +1,659 @@
+/* -*- 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 "comutil.h"
+#include "ShObjIdl.h"
+
+#include "DebugServices.h"
+
+#include "Resource.h"
+
+#include "ExplorerBar.h"
+
+#include "About.h"
+// MFC Debugging
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+//===========================================================================================================================
+// Constants
+//===========================================================================================================================
+#define LENGTHOF(a) (sizeof(a) == sizeof(&*a)) ? 0 : (sizeof(a) / sizeof(*a))
+#define MIN_SIZE_X 10
+#define MIN_SIZE_Y 10
+
+//===========================================================================================================================
+// ExplorerBar
+//===========================================================================================================================
+
+ExplorerBar::ExplorerBar( void )
+{
+ ++gDLLRefCount;
+
+ mRefCount = 1;
+ mSite = NULL;
+ mWebBrowser = NULL;
+ mParentWindow = NULL;
+ mFocus = FALSE;
+ mViewMode = 0;
+ mBandID = 0;
+}
+
+//===========================================================================================================================
+// ~ExplorerBar
+//===========================================================================================================================
+
+ExplorerBar::~ExplorerBar( void )
+{
+ if( mWebBrowser )
+ {
+ mWebBrowser->Release();
+ mWebBrowser = NULL;
+ }
+ if( mSite )
+ {
+ mSite->Release();
+ mSite = NULL;
+ }
+
+ --gDLLRefCount;
+}
+
+#if 0
+#pragma mark -
+#pragma mark == IUnknown implementation ==
+#endif
+
+//===========================================================================================================================
+// QueryInterface
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::QueryInterface( REFIID inID, LPVOID *outResult )
+{
+ HRESULT err;
+
+ if( IsEqualIID( inID, IID_IUnknown ) ) // IUnknown
+ {
+ *outResult = this;
+ }
+ else if( IsEqualIID( inID, IID_IOleWindow ) ) // IOleWindow
+ {
+ *outResult = (IOleWindow *) this;
+ }
+ else if( IsEqualIID( inID, IID_IDockingWindow ) ) // IDockingWindow
+ {
+ *outResult = (IDockingWindow *) this;
+ }
+ else if( IsEqualIID( inID, IID_IDeskBand ) ) // IDeskBand
+ {
+ *outResult = (IDeskBand *) this;
+ }
+ else if( IsEqualIID( inID, IID_IInputObject ) ) // IInputObject
+ {
+ *outResult = (IInputObject *) this;
+ }
+ else if( IsEqualIID( inID, IID_IObjectWithSite ) ) // IObjectWithSite
+ {
+ *outResult = (IObjectWithSite *) this;
+ }
+ else if( IsEqualIID( inID, IID_IPersistStream ) ) // IPersistStream
+ {
+ *outResult = (IPersistStream *) this;
+ }
+ else if( IsEqualIID( inID, IID_IContextMenu ) ) // IContextMenu
+ {
+ *outResult = (IContextMenu *) this;
+ }
+ else
+ {
+ *outResult = NULL;
+ err = E_NOINTERFACE;
+ goto exit;
+ }
+
+ ( *( (LPUNKNOWN *) outResult ) )->AddRef();
+ err = S_OK;
+
+exit:
+ return( err );
+}
+
+//===========================================================================================================================
+// AddRef
+//===========================================================================================================================
+
+STDMETHODIMP_( DWORD ) ExplorerBar::AddRef( void )
+{
+ return( ++mRefCount );
+}
+
+//===========================================================================================================================
+// Release
+//===========================================================================================================================
+
+STDMETHODIMP_( DWORD ) ExplorerBar::Release( void )
+{
+ DWORD count;
+
+ count = --mRefCount;
+ if( count == 0 )
+ {
+ delete this;
+ }
+ return( count );
+}
+
+#if 0
+#pragma mark -
+#pragma mark == IOleWindow implementation ==
+#endif
+
+//===========================================================================================================================
+// GetWindow
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::GetWindow( HWND *outWindow )
+{
+ *outWindow = mWindow.GetSafeHwnd();
+ return( S_OK );
+}
+
+//===========================================================================================================================
+// ContextSensitiveHelp
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::ContextSensitiveHelp( BOOL inEnterMode )
+{
+ DEBUG_UNUSED( inEnterMode );
+
+ return( E_NOTIMPL );
+}
+
+#if 0
+#pragma mark -
+#pragma mark == IDockingWindow implementation ==
+#endif
+
+//===========================================================================================================================
+// ShowDW
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::ShowDW( BOOL inShow )
+{
+ if( mWindow.GetSafeHwnd() )
+ {
+ mWindow.ShowWindow( inShow ? SW_SHOW : SW_HIDE );
+ }
+ return( S_OK );
+}
+
+//===========================================================================================================================
+// CloseDW
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::CloseDW( DWORD inReserved )
+{
+ DEBUG_UNUSED( inReserved );
+
+ ShowDW( FALSE );
+ if( mWindow.GetSafeHwnd() )
+ {
+ mWindow.SendMessage( WM_CLOSE );
+ }
+ return( S_OK );
+}
+
+//===========================================================================================================================
+// ResizeBorderDW
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::ResizeBorderDW( LPCRECT inBorder, IUnknown *inPunkSite, BOOL inReserved )
+{
+ DEBUG_UNUSED( inBorder );
+ DEBUG_UNUSED( inPunkSite );
+ DEBUG_UNUSED( inReserved );
+
+ return( E_NOTIMPL );
+}
+
+#if 0
+#pragma mark -
+#pragma mark == IDeskBand implementation ==
+#endif
+
+//===========================================================================================================================
+// GetBandInfo
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::GetBandInfo( DWORD inBandID, DWORD inViewMode, DESKBANDINFO *outInfo )
+{
+ HRESULT err;
+
+ require_action( outInfo, exit, err = E_INVALIDARG );
+
+ mBandID = inBandID;
+ mViewMode = inViewMode;
+
+ if( outInfo->dwMask & DBIM_MINSIZE )
+ {
+ outInfo->ptMinSize.x = 100;
+ outInfo->ptMinSize.y = 100;
+ }
+ if( outInfo->dwMask & DBIM_MAXSIZE )
+ {
+ // Unlimited max size.
+
+ outInfo->ptMaxSize.x = -1;
+ outInfo->ptMaxSize.y = -1;
+ }
+ if( outInfo->dwMask & DBIM_INTEGRAL )
+ {
+ outInfo->ptIntegral.x = 1;
+ outInfo->ptIntegral.y = 1;
+ }
+ if( outInfo->dwMask & DBIM_ACTUAL )
+ {
+ outInfo->ptActual.x = 0;
+ outInfo->ptActual.y = 0;
+ }
+ if( outInfo->dwMask & DBIM_TITLE )
+ {
+ CString s;
+ BOOL ok;
+
+ ok = s.LoadString( IDS_NAME );
+ require_action( ok, exit, err = kNoResourcesErr );
+
+ #ifdef UNICODE
+ lstrcpyn( outInfo->wszTitle, s, sizeof_array( outInfo->wszTitle ) );
+ #else
+ DWORD nChars;
+
+ nChars = MultiByteToWideChar( CP_ACP, 0, s, -1, outInfo->wszTitle, sizeof_array( outInfo->wszTitle ) );
+ err = translate_errno( nChars > 0, (OSStatus) GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+ #endif
+ }
+ if( outInfo->dwMask & DBIM_MODEFLAGS )
+ {
+ outInfo->dwModeFlags = DBIMF_NORMAL | DBIMF_VARIABLEHEIGHT;
+ }
+
+ // Force the default background color.
+
+ outInfo->dwMask &= ~DBIM_BKCOLOR;
+ err = S_OK;
+
+exit:
+ return( err );
+}
+
+#if 0
+#pragma mark -
+#pragma mark == IInputObject implementation ==
+#endif
+
+//===========================================================================================================================
+// UIActivateIO
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::UIActivateIO( BOOL inActivate, LPMSG inMsg )
+{
+ DEBUG_UNUSED( inMsg );
+
+ if( inActivate )
+ {
+ mWindow.SetFocus();
+ }
+ return( S_OK );
+}
+
+//===========================================================================================================================
+// HasFocusIO
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::HasFocusIO( void )
+{
+ if( mWindow.GetFocus()->GetSafeHwnd() == mWindow.GetSafeHwnd() )
+ {
+ return( S_OK );
+ }
+ return( S_FALSE );
+}
+
+//===========================================================================================================================
+// TranslateAcceleratorIO
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::TranslateAcceleratorIO( LPMSG inMsg )
+{
+ DEBUG_UNUSED( inMsg );
+
+ return( S_FALSE );
+}
+
+#if 0
+#pragma mark -
+#pragma mark == IObjectWithSite implementation ==
+#endif
+
+//===========================================================================================================================
+// SetSite
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::SetSite( IUnknown *inPunkSite )
+{
+ AFX_MANAGE_STATE( AfxGetStaticModuleState() );
+
+ HRESULT err;
+
+ // Release the old interfaces.
+
+ if( mWebBrowser )
+ {
+ mWebBrowser->Release();
+ mWebBrowser = NULL;
+ }
+ if( mSite )
+ {
+ mSite->Release();
+ mSite = NULL;
+ }
+
+ // A non-NULL site means we're setting the site. Otherwise, the site is being released (done above).
+
+ if( !inPunkSite )
+ {
+ err = S_OK;
+ goto exit;
+ }
+
+ // Get the parent window.
+
+ IOleWindow * oleWindow;
+
+ mParentWindow = NULL;
+ err = inPunkSite->QueryInterface( IID_IOleWindow, (LPVOID *) &oleWindow );
+ require( SUCCEEDED( err ), exit );
+
+ err = oleWindow->GetWindow( &mParentWindow );
+ oleWindow->Release();
+ require_noerr( err, exit );
+ require_action( mParentWindow, exit, err = E_FAIL );
+
+ // Get the IInputObject interface.
+
+ err = inPunkSite->QueryInterface( IID_IInputObjectSite, (LPVOID *) &mSite );
+ require( SUCCEEDED( err ), exit );
+ check( mSite );
+
+ // Get the IWebBrowser2 interface.
+
+ IOleCommandTarget * oleCommandTarget;
+
+ err = inPunkSite->QueryInterface( IID_IOleCommandTarget, (LPVOID *) &oleCommandTarget );
+ require( SUCCEEDED( err ), exit );
+
+ IServiceProvider * serviceProvider;
+
+ err = oleCommandTarget->QueryInterface( IID_IServiceProvider, (LPVOID *) &serviceProvider );
+ oleCommandTarget->Release();
+ require( SUCCEEDED( err ), exit );
+
+ err = serviceProvider->QueryService( SID_SWebBrowserApp, IID_IWebBrowser2, (LPVOID *) &mWebBrowser );
+ serviceProvider->Release();
+ require( SUCCEEDED( err ), exit );
+
+ // Create the main window.
+
+ err = SetupWindow();
+ require_noerr( err, exit );
+
+exit:
+ return( err );
+}
+
+//===========================================================================================================================
+// GetSite
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::GetSite( REFIID inID, LPVOID *outResult )
+{
+ HRESULT err;
+
+ *outResult = NULL;
+ require_action( mSite, exit, err = E_FAIL );
+
+ err = mSite->QueryInterface( inID, outResult );
+
+exit:
+ return( err );
+}
+
+#if 0
+#pragma mark -
+#pragma mark == IPersistStream implementation ==
+#endif
+
+//
+// IPersistStream implementation
+//
+// This is only supported to allow the desk band to be dropped on the desktop and to prevent multiple instances of
+// the desk band from showing up in the context menu. This desk band doesn't actually persist any data.
+//
+
+//===========================================================================================================================
+// GetClassID
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::GetClassID( LPCLSID outClassID )
+{
+ *outClassID = CLSID_ExplorerBar;
+ return( S_OK );
+}
+
+//===========================================================================================================================
+// IsDirty
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::IsDirty( void )
+{
+ return( S_FALSE );
+}
+
+//===========================================================================================================================
+// Load
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::Load( LPSTREAM inStream )
+{
+ DEBUG_UNUSED( inStream );
+
+ return( S_OK );
+}
+
+//===========================================================================================================================
+// Save
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::Save( LPSTREAM inStream, BOOL inClearDirty )
+{
+ DEBUG_UNUSED( inStream );
+ DEBUG_UNUSED( inClearDirty );
+
+ return( S_OK );
+}
+
+//===========================================================================================================================
+// GetSizeMax
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::GetSizeMax( ULARGE_INTEGER *outSizeMax )
+{
+ DEBUG_UNUSED( outSizeMax );
+
+ return( E_NOTIMPL );
+}
+
+
+//===========================================================================================================================
+// QueryContextMenu
+//===========================================================================================================================
+
+STDMETHODIMP ExplorerBar::QueryContextMenu(HMENU hShellContextMenu, UINT iContextMenuFirstItem, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
+{
+ DEBUG_UNUSED( idCmdLast );
+ DEBUG_UNUSED( uFlags );
+
+ CMenu menubar;
+
+ menubar.LoadMenu(IDR_CONTEXT_MENU);
+ CMenu * menu = menubar.GetSubMenu(0);
+
+ CMenu shellmenu;
+
+ shellmenu.Attach(hShellContextMenu);
+
+ UINT iShellItem = iContextMenuFirstItem; //! remove plus one
+ UINT idShellCmd = idCmdFirst;
+
+ int n = menu->GetMenuItemCount();
+
+ for (int i=0; i<n; ++i)
+ {
+ MENUITEMINFO mii;
+ TCHAR sz[128] = {0};
+
+ ZeroMemory(&mii, sizeof(mii));
+ mii.fMask = MIIM_TYPE | MIIM_ID;
+ mii.fType = MFT_STRING;
+ mii.cbSize = sizeof(mii);
+ mii.cch = LENGTHOF(sz);
+ mii.dwTypeData = sz;
+
+ menu->GetMenuItemInfo(i, &mii, TRUE);
+
+ mii.wID = idShellCmd++;
+
+ shellmenu.InsertMenuItem(iShellItem++, &mii, TRUE);
+ }
+
+ shellmenu.Detach();
+
+ return n;
+}
+
+
+//===========================================================================================================================
+// GetCommandString
+//===========================================================================================================================
+
+// Not called for explorer bars
+STDMETHODIMP ExplorerBar::GetCommandString(UINT_PTR idCmd, UINT uType, UINT* pwReserved, LPSTR pszName, UINT cchMax)
+{
+ DEBUG_UNUSED( idCmd );
+ DEBUG_UNUSED( uType );
+ DEBUG_UNUSED( pwReserved );
+ DEBUG_UNUSED( pszName );
+ DEBUG_UNUSED( cchMax );
+
+ return E_NOTIMPL;
+}
+
+//===========================================================================================================================
+// InvokeCommand
+//===========================================================================================================================
+
+// The shell sends either strings or indexes
+// IE never sends strings
+// The indexes are into an array of my commands
+// So the verb for the first command I added to the menu is always 0x0000
+// Here - because I don't have any submenus -
+// I can treat the 'verb' as an menu item position
+STDMETHODIMP ExplorerBar::InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
+{
+ // IE doesn't send string commands
+ if (HIWORD(lpici->lpVerb) != 0) return 0;
+
+ CAbout dlg;
+
+ dlg.DoModal();
+
+ return S_OK;
+}
+
+#if 0
+#pragma mark -
+#pragma mark == Other ==
+#endif
+
+//===========================================================================================================================
+// SetupWindow
+//===========================================================================================================================
+
+OSStatus ExplorerBar::SetupWindow( void )
+{
+ OSStatus err;
+ CWnd * window;
+ CRect rect;
+ CString s;
+ BOOL ok;
+
+ window = CWnd::FromHandle( mParentWindow );
+ check( window );
+ window->GetClientRect( rect );
+
+ ok = s.LoadString( IDS_NAME );
+ require_action( ok, exit, err = kNoResourcesErr );
+
+ ok = mWindow.Create( NULL, s, WS_CHILD | WS_VISIBLE, rect, window, 100 ) != 0;
+ require_action( ok, exit, err = kNoResourcesErr );
+
+ mWindow.SetOwner( this );
+ err = kNoErr;
+
+exit:
+ return( err );
+}
+
+//===========================================================================================================================
+// GoToURL
+//===========================================================================================================================
+
+OSStatus ExplorerBar::GoToURL( const CString &inURL )
+{
+ OSStatus err;
+ BSTR s;
+ VARIANT empty;
+
+ s = inURL.AllocSysString();
+ require_action( s, exit, err = kNoMemoryErr );
+
+ VariantInit( &empty );
+ err = mWebBrowser->Navigate( s, &empty, &empty, &empty, &empty );
+ SysFreeString( s );
+ require_noerr( err, exit );
+
+exit:
+ return( err );
+}
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.h b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.h
new file mode 100644
index 00000000..01d1beee
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBar.h
@@ -0,0 +1,104 @@
+/* -*- 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.
+ */
+
+#ifndef __EXPLORER_BAR__
+#define __EXPLORER_BAR__
+
+#include "StdAfx.h"
+
+#include "ExplorerBarWindow.h"
+#include "ExplorerPlugin.h"
+
+//===========================================================================================================================
+// ExplorerBar
+//===========================================================================================================================
+
+class ExplorerBar : public IDeskBand,
+ public IInputObject,
+ public IObjectWithSite,
+ public IPersistStream,
+ public IContextMenu
+{
+protected:
+
+DWORD mRefCount;
+IInputObjectSite * mSite;
+IWebBrowser2 * mWebBrowser;
+HWND mParentWindow;
+BOOL mFocus;
+DWORD mViewMode;
+DWORD mBandID;
+ExplorerBarWindow mWindow;
+
+public:
+
+ExplorerBar( void );
+~ExplorerBar( void );
+
+// IUnknown methods
+
+STDMETHODIMP QueryInterface( REFIID inID, LPVOID *outResult );
+STDMETHODIMP_( DWORD ) AddRef( void );
+STDMETHODIMP_( DWORD ) Release( void );
+
+// IOleWindow methods
+
+STDMETHOD( GetWindow ) ( HWND *outWindow );
+STDMETHOD( ContextSensitiveHelp ) ( BOOL inEnterMode );
+
+// IDockingWindow methods
+
+STDMETHOD( ShowDW ) ( BOOL inShow );
+STDMETHOD( CloseDW ) ( DWORD inReserved );
+STDMETHOD( ResizeBorderDW ) ( LPCRECT inBorder, IUnknown *inPunkSite, BOOL inReserved );
+
+// IDeskBand methods
+
+STDMETHOD( GetBandInfo ) ( DWORD inBandID, DWORD inViewMode, DESKBANDINFO *outInfo );
+
+// IInputObject methods
+
+STDMETHOD( UIActivateIO ) ( BOOL inActivate, LPMSG inMsg );
+STDMETHOD( HasFocusIO ) ( void );
+STDMETHOD( TranslateAcceleratorIO ) ( LPMSG inMsg );
+
+// IObjectWithSite methods
+
+STDMETHOD( SetSite ) ( IUnknown *inPunkSite );
+STDMETHOD( GetSite ) ( REFIID inID, LPVOID *outResult );
+
+// IPersistStream methods
+
+STDMETHOD( GetClassID ) ( LPCLSID outClassID );
+STDMETHOD( IsDirty ) ( void );
+STDMETHOD( Load ) ( LPSTREAM inStream );
+STDMETHOD( Save ) ( LPSTREAM inStream, BOOL inClearDirty );
+STDMETHOD( GetSizeMax ) ( ULARGE_INTEGER *outSizeMax );
+
+// IContextMenu methods
+
+STDMETHOD( QueryContextMenu ) ( HMENU hContextMenu, UINT iContextMenuFirstItem, UINT idCmdFirst, UINT idCmdLast, UINT uFlags );
+STDMETHOD( GetCommandString ) ( UINT_PTR idCmd, UINT uType, UINT* pwReserved, LPSTR pszName, UINT cchMax );
+STDMETHOD( InvokeCommand ) ( LPCMINVOKECOMMANDINFO lpici );
+
+// Other
+
+OSStatus SetupWindow( void );
+OSStatus GoToURL( const CString &inURL );
+};
+
+#endif // __EXPLORER_BAR__
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.cpp b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.cpp
new file mode 100644
index 00000000..5e0692aa
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.cpp
@@ -0,0 +1,794 @@
+/* -*- 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 "CommonServices.h"
+#include "DebugServices.h"
+#include "WinServices.h"
+#include "dns_sd.h"
+
+#include "ExplorerBar.h"
+#include "LoginDialog.h"
+#include "Resource.h"
+
+#include "ExplorerBarWindow.h"
+#include "ExplorerPlugin.h"
+
+// MFC Debugging
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+#if 0
+#pragma mark == Constants ==
+#endif
+
+//===========================================================================================================================
+// Constants
+//===========================================================================================================================
+
+// Control IDs
+
+#define IDC_EXPLORER_TREE 1234
+
+// Private Messages
+
+#define WM_PRIVATE_SERVICE_EVENT ( WM_USER + 0x100 )
+
+// TXT records
+
+#define kTXTRecordKeyPath "path"
+
+// IE Icon resource
+
+#define kIEIconResource 32529
+
+
+#if 0
+#pragma mark == Prototypes ==
+#endif
+
+//===========================================================================================================================
+// Prototypes
+//===========================================================================================================================
+
+DEBUG_LOCAL int FindServiceArrayIndex( const ServiceInfoArray &inArray, const ServiceInfo &inService, int &outIndex );
+
+#if 0
+#pragma mark == Message Map ==
+#endif
+
+//===========================================================================================================================
+// Message Map
+//===========================================================================================================================
+
+BEGIN_MESSAGE_MAP( ExplorerBarWindow, CWnd )
+ ON_WM_CREATE()
+ ON_WM_DESTROY()
+ ON_WM_SIZE()
+ ON_NOTIFY( NM_DBLCLK, IDC_EXPLORER_TREE, OnDoubleClick )
+ ON_MESSAGE( WM_PRIVATE_SERVICE_EVENT, OnServiceEvent )
+END_MESSAGE_MAP()
+
+#if 0
+#pragma mark -
+#endif
+
+//===========================================================================================================================
+// ExplorerBarWindow
+//===========================================================================================================================
+
+ExplorerBarWindow::ExplorerBarWindow( void )
+{
+ mOwner = NULL;
+ mResolveServiceRef = NULL;
+}
+
+//===========================================================================================================================
+// ~ExplorerBarWindow
+//===========================================================================================================================
+
+ExplorerBarWindow::~ExplorerBarWindow( void )
+{
+ //
+}
+
+#if 0
+#pragma mark -
+#endif
+
+//===========================================================================================================================
+// OnCreate
+//===========================================================================================================================
+
+int ExplorerBarWindow::OnCreate( LPCREATESTRUCT inCreateStruct )
+{
+ AFX_MANAGE_STATE( AfxGetStaticModuleState() );
+
+ HINSTANCE module = NULL;
+ OSStatus err;
+ CRect rect;
+ CBitmap bitmap;
+ CString s;
+
+ err = CWnd::OnCreate( inCreateStruct );
+ require_noerr( err, exit );
+
+ GetClientRect( rect );
+ mTree.Create( WS_TABSTOP | WS_VISIBLE | WS_CHILD | TVS_HASBUTTONS | TVS_LINESATROOT | TVS_NOHSCROLL , rect, this,
+ IDC_EXPLORER_TREE );
+
+ ServiceHandlerEntry * e;
+
+ s.LoadString( IDS_ABOUT );
+ m_about = mTree.InsertItem( s, 0, 0 );
+
+ // Web Site Handler
+
+ e = new ServiceHandlerEntry;
+ check( e );
+ e->type = "_http._tcp";
+ e->urlScheme = "http://";
+ e->ref = NULL;
+ e->obj = this;
+ e->needsLogin = false;
+ mServiceHandlers.Add( e );
+
+ err = DNSServiceBrowse( &e->ref, 0, 0, e->type, NULL, BrowseCallBack, e );
+ require_noerr( err, exit );
+
+ err = WSAAsyncSelect((SOCKET) DNSServiceRefSockFD(e->ref), m_hWnd, WM_PRIVATE_SERVICE_EVENT, FD_READ|FD_CLOSE);
+ require_noerr( err, exit );
+
+ m_serviceRefs.push_back(e->ref);
+
+#if defined( _BROWSE_FOR_HTTPS_ )
+ e = new ServiceHandlerEntry;
+ check( e );
+ e->type = "_https._tcp";
+ e->urlScheme = "https://";
+ e->ref = NULL;
+ e->obj = this;
+ e->needsLogin = false;
+ mServiceHandlers.Add( e );
+
+ err = DNSServiceBrowse( &e->ref, 0, 0, e->type, NULL, BrowseCallBack, e );
+ require_noerr( err, exit );
+
+ err = WSAAsyncSelect((SOCKET) DNSServiceRefSockFD(e->ref), m_hWnd, WM_PRIVATE_SERVICE_EVENT, FD_READ|FD_CLOSE);
+ require_noerr( err, exit );
+
+ m_serviceRefs.push_back(e->ref);
+#endif
+
+ m_imageList.Create( 16, 16, ILC_MASK | ILC_COLOR16, 2, 0);
+
+ bitmap.Attach( ::LoadBitmap( GetNonLocalizedResources(), MAKEINTRESOURCE( IDB_LOGO ) ) );
+ m_imageList.Add( &bitmap, (CBitmap*) NULL );
+ bitmap.Detach();
+
+ mTree.SetImageList(&m_imageList, TVSIL_NORMAL);
+
+exit:
+
+ if ( module )
+ {
+ FreeLibrary( module );
+ module = NULL;
+ }
+
+ // Cannot talk to the mDNSResponder service. Show the error message and exit (with kNoErr so they can see it).
+ if ( err )
+ {
+ if ( err == kDNSServiceErr_Firewall )
+ {
+ s.LoadString( IDS_FIREWALL );
+ }
+ else
+ {
+ s.LoadString( IDS_MDNSRESPONDER_NOT_AVAILABLE );
+ }
+
+ mTree.DeleteAllItems();
+ mTree.InsertItem( s, 0, 0, TVI_ROOT, TVI_LAST );
+
+ err = kNoErr;
+ }
+
+ return( err );
+}
+
+//===========================================================================================================================
+// OnDestroy
+//===========================================================================================================================
+
+void ExplorerBarWindow::OnDestroy( void )
+{
+ // Stop any resolves that may still be pending (shouldn't be any).
+
+ StopResolve();
+
+ // Clean up the extant browses
+ while (m_serviceRefs.size() > 0)
+ {
+ //
+ // take the head of the list
+ //
+ DNSServiceRef ref = m_serviceRefs.front();
+
+ //
+ // Stop will remove it from the list
+ //
+ Stop( ref );
+ }
+
+ // Clean up the service handlers.
+
+ int i;
+ int n;
+
+ n = (int) mServiceHandlers.GetSize();
+ for( i = 0; i < n; ++i )
+ {
+ delete mServiceHandlers[ i ];
+ }
+
+ CWnd::OnDestroy();
+}
+
+//===========================================================================================================================
+// OnSize
+//===========================================================================================================================
+
+void ExplorerBarWindow::OnSize( UINT inType, int inX, int inY )
+{
+ CWnd::OnSize( inType, inX, inY );
+ mTree.MoveWindow( 0, 0, inX, inY );
+}
+
+//===========================================================================================================================
+// OnDoubleClick
+//===========================================================================================================================
+
+void ExplorerBarWindow::OnDoubleClick( NMHDR *inNMHDR, LRESULT *outResult )
+{
+ HTREEITEM item;
+ ServiceInfo * service;
+ OSStatus err;
+
+ DEBUG_UNUSED( inNMHDR );
+
+ item = mTree.GetSelectedItem();
+ require( item, exit );
+
+ // Tell Internet Explorer to go to the URL if it's about item
+
+ if ( item == m_about )
+ {
+ CString url;
+
+ check( mOwner );
+
+ url.LoadString( IDS_ABOUT_URL );
+ mOwner->GoToURL( url );
+ }
+ else
+ {
+ service = reinterpret_cast < ServiceInfo * > ( mTree.GetItemData( item ) );
+ require_quiet( service, exit );
+
+ err = StartResolve( service );
+ require_noerr( err, exit );
+ }
+
+exit:
+ *outResult = 0;
+}
+
+
+//===========================================================================================================================
+// OnServiceEvent
+//===========================================================================================================================
+
+LRESULT
+ExplorerBarWindow::OnServiceEvent(WPARAM inWParam, LPARAM inLParam)
+{
+ if (WSAGETSELECTERROR(inLParam) && !(HIWORD(inLParam)))
+ {
+ dlog( kDebugLevelError, "OnServiceEvent: window error\n" );
+ }
+ else
+ {
+ SOCKET sock = (SOCKET) inWParam;
+
+ // iterate thru list
+ ServiceRefList::iterator it;
+
+ for (it = m_serviceRefs.begin(); it != m_serviceRefs.end(); it++)
+ {
+ DNSServiceRef ref = *it;
+
+ check(ref != NULL);
+
+ if ((SOCKET) DNSServiceRefSockFD(ref) == sock)
+ {
+ DNSServiceErrorType err;
+
+ err = DNSServiceProcessResult(ref);
+
+ if (err != 0)
+ {
+ CString s;
+
+ s.LoadString( IDS_MDNSRESPONDER_NOT_AVAILABLE );
+ mTree.DeleteAllItems();
+ mTree.InsertItem( s, 0, 0, TVI_ROOT, TVI_LAST );
+
+ Stop(ref);
+ }
+
+ break;
+ }
+ }
+ }
+
+ return ( 0 );
+}
+
+#if 0
+#pragma mark -
+#endif
+
+//===========================================================================================================================
+// BrowseCallBack
+//===========================================================================================================================
+
+void DNSSD_API
+ ExplorerBarWindow::BrowseCallBack(
+ DNSServiceRef inRef,
+ DNSServiceFlags inFlags,
+ uint32_t inInterfaceIndex,
+ DNSServiceErrorType inErrorCode,
+ const char * inName,
+ const char * inType,
+ const char * inDomain,
+ void * inContext )
+{
+ ServiceHandlerEntry * obj;
+ ServiceInfo * service;
+ OSStatus err;
+
+ DEBUG_UNUSED( inRef );
+
+ obj = NULL;
+ service = NULL;
+
+ require_noerr( inErrorCode, exit );
+ obj = reinterpret_cast < ServiceHandlerEntry * > ( inContext );
+ check( obj );
+ check( obj->obj );
+
+ //
+ // set the UI to hold off on updates
+ //
+ obj->obj->mTree.SetRedraw(FALSE);
+
+ try
+ {
+ service = new ServiceInfo;
+ require_action( service, exit, err = kNoMemoryErr );
+
+ err = UTF8StringToStringObject( inName, service->displayName );
+ check_noerr( err );
+
+ service->name = _strdup( inName );
+ require_action( service->name, exit, err = kNoMemoryErr );
+
+ service->type = _strdup( inType );
+ require_action( service->type, exit, err = kNoMemoryErr );
+
+ service->domain = _strdup( inDomain );
+ require_action( service->domain, exit, err = kNoMemoryErr );
+
+ service->ifi = inInterfaceIndex;
+ service->handler = obj;
+
+ service->refs = 1;
+
+ if (inFlags & kDNSServiceFlagsAdd) obj->obj->OnServiceAdd (service);
+ else obj->obj->OnServiceRemove(service);
+
+ service = NULL;
+ }
+ catch( ... )
+ {
+ dlog( kDebugLevelError, "BrowseCallBack: exception thrown\n" );
+ }
+
+exit:
+ //
+ // If no more coming, then update UI
+ //
+ if (obj && obj->obj && ((inFlags & kDNSServiceFlagsMoreComing) == 0))
+ {
+ obj->obj->mTree.SetRedraw(TRUE);
+ obj->obj->mTree.Invalidate();
+ }
+
+ if( service )
+ {
+ delete service;
+ }
+}
+
+//===========================================================================================================================
+// OnServiceAdd
+//===========================================================================================================================
+
+LONG ExplorerBarWindow::OnServiceAdd( ServiceInfo * service )
+{
+ ServiceHandlerEntry * handler;
+ int cmp;
+ int index;
+
+
+ check( service );
+ handler = service->handler;
+ check( handler );
+
+ cmp = FindServiceArrayIndex( handler->array, *service, index );
+ if( cmp == 0 )
+ {
+ // Found a match so update the item. The index is index + 1 so subtract 1.
+
+ index -= 1;
+ check( index < handler->array.GetSize() );
+
+ handler->array[ index ]->refs++;
+
+ delete service;
+ }
+ else
+ {
+ HTREEITEM afterItem;
+
+ // Insert the new item in sorted order.
+
+ afterItem = ( index > 0 ) ? handler->array[ index - 1 ]->item : m_about;
+ handler->array.InsertAt( index, service );
+ service->item = mTree.InsertItem( service->displayName, 0, 0, NULL, afterItem );
+ mTree.SetItemData( service->item, (DWORD_PTR) service );
+ }
+ return( 0 );
+}
+
+//===========================================================================================================================
+// OnServiceRemove
+//===========================================================================================================================
+
+LONG ExplorerBarWindow::OnServiceRemove( ServiceInfo * service )
+{
+ ServiceHandlerEntry * handler;
+ int cmp;
+ int index;
+
+
+ check( service );
+ handler = service->handler;
+ check( handler );
+
+ // Search to see if we know about this service instance. If so, remove it from the list.
+
+ cmp = FindServiceArrayIndex( handler->array, *service, index );
+ check( cmp == 0 );
+
+ if( cmp == 0 )
+ {
+ // Possibly found a match remove the item. The index
+ // is index + 1 so subtract 1.
+ index -= 1;
+ check( index < handler->array.GetSize() );
+
+ if ( --handler->array[ index ]->refs == 0 )
+ {
+ mTree.DeleteItem( handler->array[ index ]->item );
+ delete handler->array[ index ];
+ handler->array.RemoveAt( index );
+ }
+ }
+
+ delete service;
+ return( 0 );
+}
+
+#if 0
+#pragma mark -
+#endif
+
+//===========================================================================================================================
+// StartResolve
+//===========================================================================================================================
+
+OSStatus ExplorerBarWindow::StartResolve( ServiceInfo *inService )
+{
+ OSStatus err;
+
+ check( inService );
+
+ // Stop any current resolve that may be in progress.
+
+ StopResolve();
+
+ // Resolve the service.
+ err = DNSServiceResolve( &mResolveServiceRef, 0, 0,
+ inService->name, inService->type, inService->domain, (DNSServiceResolveReply) ResolveCallBack, inService->handler );
+ require_noerr( err, exit );
+
+ err = WSAAsyncSelect((SOCKET) DNSServiceRefSockFD(mResolveServiceRef), m_hWnd, WM_PRIVATE_SERVICE_EVENT, FD_READ|FD_CLOSE);
+ require_noerr( err, exit );
+
+ m_serviceRefs.push_back(mResolveServiceRef);
+
+exit:
+ return( err );
+}
+
+//===========================================================================================================================
+// StopResolve
+//===========================================================================================================================
+
+void ExplorerBarWindow::StopResolve( void )
+{
+ if( mResolveServiceRef )
+ {
+ Stop( mResolveServiceRef );
+ mResolveServiceRef = NULL;
+ }
+}
+
+//===========================================================================================================================
+// ResolveCallBack
+//===========================================================================================================================
+
+void DNSSD_API
+ ExplorerBarWindow::ResolveCallBack(
+ DNSServiceRef inRef,
+ DNSServiceFlags inFlags,
+ uint32_t inInterfaceIndex,
+ DNSServiceErrorType inErrorCode,
+ const char * inFullName,
+ const char * inHostName,
+ uint16_t inPort,
+ uint16_t inTXTSize,
+ const char * inTXT,
+ void * inContext )
+{
+ ExplorerBarWindow * obj;
+ ServiceHandlerEntry * handler;
+ OSStatus err;
+
+ DEBUG_UNUSED( inRef );
+ DEBUG_UNUSED( inFlags );
+ DEBUG_UNUSED( inErrorCode );
+ DEBUG_UNUSED( inFullName );
+
+ require_noerr( inErrorCode, exit );
+ handler = (ServiceHandlerEntry *) inContext;
+ check( handler );
+ obj = handler->obj;
+ check( obj );
+
+ try
+ {
+ ResolveInfo * resolve;
+ int idx;
+
+ dlog( kDebugLevelNotice, "resolved %s on ifi %d to %s\n", inFullName, inInterfaceIndex, inHostName );
+
+ // Stop resolving after the first good result.
+
+ obj->StopResolve();
+
+ // Post a message to the main thread so it can handle it since MFC is not thread safe.
+
+ resolve = new ResolveInfo;
+ require_action( resolve, exit, err = kNoMemoryErr );
+
+ UTF8StringToStringObject( inHostName, resolve->host );
+
+ // rdar://problem/3841564
+ //
+ // strip trailing dot from hostname because some flavors of Windows
+ // have trouble parsing it.
+
+ idx = resolve->host.ReverseFind('.');
+
+ if ((idx > 1) && ((resolve->host.GetLength() - 1) == idx))
+ {
+ resolve->host.Delete(idx, 1);
+ }
+
+ resolve->port = ntohs( inPort );
+ resolve->ifi = inInterfaceIndex;
+ resolve->handler = handler;
+
+ err = resolve->txt.SetData( inTXT, inTXTSize );
+ check_noerr( err );
+
+ obj->OnResolve(resolve);
+ }
+ catch( ... )
+ {
+ dlog( kDebugLevelError, "ResolveCallBack: exception thrown\n" );
+ }
+
+exit:
+ return;
+}
+
+//===========================================================================================================================
+// OnResolve
+//===========================================================================================================================
+
+LONG ExplorerBarWindow::OnResolve( ResolveInfo * resolve )
+{
+ CString url;
+ uint8_t * path;
+ uint8_t pathSize;
+ char * pathPrefix;
+ CString username;
+ CString password;
+
+
+ check( resolve );
+
+ // Get login info if needed.
+
+ if( resolve->handler->needsLogin )
+ {
+ LoginDialog dialog;
+
+ if( !dialog.GetLogin( username, password ) )
+ {
+ goto exit;
+ }
+ }
+
+ // If the HTTP TXT record is a "path=" entry, use it as the resource path. Otherwise, use "/".
+
+ pathPrefix = "";
+ if( strcmp( resolve->handler->type, "_http._tcp" ) == 0 )
+ {
+ uint8_t * txtData;
+ uint16_t txtLen;
+
+ resolve->txt.GetData( &txtData, &txtLen );
+
+ path = (uint8_t*) TXTRecordGetValuePtr(txtLen, txtData, kTXTRecordKeyPath, &pathSize);
+
+ if (path == NULL)
+ {
+ path = (uint8_t*) "";
+ pathSize = 1;
+ }
+ }
+ else
+ {
+ path = (uint8_t *) "";
+ pathSize = 1;
+ }
+
+ // Build the URL in the following format:
+ //
+ // <urlScheme>[<username>[:<password>]@]<name/ip>[<path>]
+
+ url.AppendFormat( TEXT( "%S" ), resolve->handler->urlScheme ); // URL Scheme
+ if( username.GetLength() > 0 )
+ {
+ url.AppendFormat( TEXT( "%s" ), username ); // Username
+ if( password.GetLength() > 0 )
+ {
+ url.AppendFormat( TEXT( ":%s" ), password ); // Password
+ }
+ url.AppendFormat( TEXT( "@" ) );
+ }
+
+ url += resolve->host; // Host
+ url.AppendFormat( TEXT( ":%d" ), resolve->port ); // :Port
+ url.AppendFormat( TEXT( "%S" ), pathPrefix ); // Path Prefix ("/" or empty).
+ url.AppendFormat( TEXT( "%.*S" ), (int) pathSize, (char *) path ); // Path (possibly empty).
+
+ // Tell Internet Explorer to go to the URL.
+
+ check( mOwner );
+ mOwner->GoToURL( url );
+
+exit:
+ delete resolve;
+ return( 0 );
+}
+
+//===========================================================================================================================
+// Stop
+//===========================================================================================================================
+void ExplorerBarWindow::Stop( DNSServiceRef ref )
+{
+ m_serviceRefs.remove( ref );
+
+ WSAAsyncSelect(DNSServiceRefSockFD( ref ), m_hWnd, WM_PRIVATE_SERVICE_EVENT, 0);
+
+ DNSServiceRefDeallocate( ref );
+}
+
+
+#if 0
+#pragma mark -
+#endif
+
+//===========================================================================================================================
+// FindServiceArrayIndex
+//===========================================================================================================================
+
+DEBUG_LOCAL int FindServiceArrayIndex( const ServiceInfoArray &inArray, const ServiceInfo &inService, int &outIndex )
+{
+ int result;
+ int lo;
+ int hi;
+ int mid;
+
+ result = -1;
+ mid = 0;
+ lo = 0;
+ hi = (int)( inArray.GetSize() - 1 );
+ while( lo <= hi )
+ {
+ mid = ( lo + hi ) / 2;
+ result = inService.displayName.CompareNoCase( inArray[ mid ]->displayName );
+#if 0
+ if( result == 0 )
+ {
+ result = ( (int) inService.ifi ) - ( (int) inArray[ mid ]->ifi );
+ }
+#endif
+ if( result == 0 )
+ {
+ break;
+ }
+ else if( result < 0 )
+ {
+ hi = mid - 1;
+ }
+ else
+ {
+ lo = mid + 1;
+ }
+ }
+ if( result == 0 )
+ {
+ mid += 1; // Bump index so new item is inserted after matching item.
+ }
+ else if( result > 0 )
+ {
+ mid += 1;
+ }
+ outIndex = mid;
+ return( result );
+}
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.h b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.h
new file mode 100644
index 00000000..e8163181
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerBarWindow.h
@@ -0,0 +1,264 @@
+/* -*- 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.
+ */
+
+#ifndef __EXPLORER_BAR_WINDOW__
+#define __EXPLORER_BAR_WINDOW__
+
+#pragma once
+
+#include "afxtempl.h"
+
+#include "dns_sd.h"
+#include <list>
+
+//===========================================================================================================================
+// Structures
+//===========================================================================================================================
+
+// Forward Declarations
+
+struct ServiceHandlerEntry;
+class ExplorerBarWindow;
+
+// ServiceInfo
+
+struct ServiceInfo
+{
+ CString displayName;
+ char * name;
+ char * type;
+ char * domain;
+ uint32_t ifi;
+ HTREEITEM item;
+ ServiceHandlerEntry * handler;
+ DWORD refs;
+
+ ServiceInfo( void )
+ {
+ item = NULL;
+ type = NULL;
+ domain = NULL;
+ handler = NULL;
+ }
+
+ ~ServiceInfo( void )
+ {
+ if( name )
+ {
+ free( name );
+ }
+ if( type )
+ {
+ free( type );
+ }
+ if( domain )
+ {
+ free( domain );
+ }
+ }
+};
+
+typedef CArray < ServiceInfo *, ServiceInfo * > ServiceInfoArray;
+
+// TextRecord
+
+struct TextRecord
+{
+ uint8_t * mData;
+ uint16_t mSize;
+
+ TextRecord( void )
+ {
+ mData = NULL;
+ mSize = 0;
+ }
+
+ ~TextRecord( void )
+ {
+ if( mData )
+ {
+ free( mData );
+ }
+ }
+
+ void GetData( void *outData, uint16_t *outSize )
+ {
+ if( outData )
+ {
+ *( (void **) outData ) = mData;
+ }
+ if( outSize )
+ {
+ *outSize = mSize;
+ }
+ }
+
+ OSStatus SetData( const void *inData, uint16_t inSize )
+ {
+ OSStatus err;
+ uint8_t * newData;
+
+ newData = (uint8_t *) malloc( inSize );
+ require_action( newData, exit, err = kNoMemoryErr );
+ memcpy( newData, inData, inSize );
+
+ if( mData )
+ {
+ free( mData );
+ }
+ mData = newData;
+ mSize = inSize;
+ err = kNoErr;
+
+exit:
+ return( err );
+ }
+};
+
+// ResolveInfo
+
+struct ResolveInfo
+{
+ CString host;
+ uint16_t port;
+ uint32_t ifi;
+ TextRecord txt;
+ ServiceHandlerEntry * handler;
+};
+
+// ServiceHandlerEntry
+
+struct ServiceHandlerEntry
+{
+ const char * type;
+ const char * urlScheme;
+ DNSServiceRef ref;
+ ServiceInfoArray array;
+ ExplorerBarWindow * obj;
+ bool needsLogin;
+
+ ServiceHandlerEntry( void )
+ {
+ type = NULL;
+ urlScheme = NULL;
+ ref = NULL;
+ obj = NULL;
+ needsLogin = false;
+ }
+
+ ~ServiceHandlerEntry( void )
+ {
+ int i;
+ int n;
+
+ n = (int) array.GetSize();
+ for( i = 0; i < n; ++i )
+ {
+ delete array[ i ];
+ }
+ }
+};
+
+typedef CArray < ServiceHandlerEntry *, ServiceHandlerEntry * > ServiceHandlerArray;
+
+//===========================================================================================================================
+// ExplorerBarWindow
+//===========================================================================================================================
+
+class ExplorerBar; // Forward Declaration
+
+class ExplorerBarWindow : public CWnd
+{
+protected:
+
+ExplorerBar * mOwner;
+CTreeCtrl mTree;
+
+ServiceHandlerArray mServiceHandlers;
+DNSServiceRef mResolveServiceRef;
+
+public:
+
+ExplorerBarWindow( void );
+virtual ~ExplorerBarWindow( void );
+
+protected:
+
+// General
+
+afx_msg int OnCreate( LPCREATESTRUCT inCreateStruct );
+afx_msg void OnDestroy( void );
+afx_msg void OnSize( UINT inType, int inX, int inY );
+afx_msg void OnDoubleClick( NMHDR *inNMHDR, LRESULT *outResult );
+afx_msg LRESULT OnServiceEvent( WPARAM inWParam, LPARAM inLParam );
+
+// Browsing
+
+static void DNSSD_API
+BrowseCallBack(
+ DNSServiceRef inRef,
+ DNSServiceFlags inFlags,
+ uint32_t inInterfaceIndex,
+ DNSServiceErrorType inErrorCode,
+ const char * inName,
+ const char * inType,
+ const char * inDomain,
+ void * inContext );
+LONG OnServiceAdd( ServiceInfo * service );
+LONG OnServiceRemove( ServiceInfo * service );
+
+// Resolving
+
+OSStatus StartResolve( ServiceInfo *inService );
+void StopResolve( void );
+
+
+void Stop( DNSServiceRef ref );
+
+
+static void DNSSD_API
+ResolveCallBack(
+ DNSServiceRef inRef,
+ DNSServiceFlags inFlags,
+ uint32_t inInterfaceIndex,
+ DNSServiceErrorType inErrorCode,
+ const char * inFullName,
+ const char * inHostName,
+ uint16_t inPort,
+ uint16_t inTXTSize,
+ const char * inTXT,
+ void * inContext );
+LONG OnResolve( ResolveInfo * resolve );
+
+// Accessors
+
+public:
+
+ExplorerBar * GetOwner( void ) const { return( mOwner ); }
+void SetOwner( ExplorerBar *inOwner ) { mOwner = inOwner; }
+
+DECLARE_MESSAGE_MAP()
+private:
+
+typedef std::list< DNSServiceRef > ServiceRefList;
+
+HTREEITEM m_about;
+ServiceRefList m_serviceRefs;
+CImageList m_imageList;
+};
+
+#endif // __EXPLORER_BAR_WINDOW__
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.cpp b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.cpp
new file mode 100644
index 00000000..fb1b7c24
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.cpp
@@ -0,0 +1,600 @@
+/* -*- 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"
+
+// The following 2 includes have to be in this order and INITGUID must be defined here, before including the file
+// that specifies the GUID(s), and nowhere else. The reason for this is that initguid.h doesn't provide separate
+// define and declare macros for GUIDs so you have to #define INITGUID in the single file where you want to define
+// your GUID then in all the other files that just need the GUID declared, INITGUID must not be defined.
+
+#define INITGUID
+#include <initguid.h>
+#include "ExplorerPlugin.h"
+
+#include <comcat.h>
+#include <Shlwapi.h>
+
+#include "CommonServices.h"
+#include "DebugServices.h"
+
+#include "ClassFactory.h"
+#include "Resource.h"
+
+#include "loclibrary.h"
+
+// MFC Debugging
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+#if 0
+#pragma mark == Prototypes ==
+#endif
+
+//===========================================================================================================================
+// Prototypes
+//===========================================================================================================================
+
+// Utilities
+
+DEBUG_LOCAL OSStatus RegisterServer( HINSTANCE inInstance, CLSID inCLSID, LPCTSTR inName );
+DEBUG_LOCAL OSStatus RegisterCOMCategory( CLSID inCLSID, CATID inCategoryID, BOOL inRegister );
+DEBUG_LOCAL OSStatus UnregisterServer( CLSID inCLSID );
+DEBUG_LOCAL OSStatus MyRegDeleteKey( HKEY hKeyRoot, LPTSTR lpSubKey );
+
+// Stash away pointers to our resource DLLs
+
+static HINSTANCE g_nonLocalizedResources = NULL;
+static CString g_nonLocalizedResourcesName;
+static HINSTANCE g_localizedResources = NULL;
+
+HINSTANCE
+GetNonLocalizedResources()
+{
+ return g_nonLocalizedResources;
+}
+
+HINSTANCE
+GetLocalizedResources()
+{
+ return g_localizedResources;
+}
+
+// This is the class GUID for an undocumented hook into IE that will allow us to register
+// and have IE notice our new ExplorerBar without rebooting.
+// {8C7461EF-2B13-11d2-BE35-3078302C2030}
+
+DEFINE_GUID(CLSID_CompCatCacheDaemon,
+0x8C7461EF, 0x2b13, 0x11d2, 0xbe, 0x35, 0x30, 0x78, 0x30, 0x2c, 0x20, 0x30);
+
+
+#if 0
+#pragma mark == Globals ==
+#endif
+
+//===========================================================================================================================
+// Globals
+//===========================================================================================================================
+
+HINSTANCE gInstance = NULL;
+int gDLLRefCount = 0;
+CExplorerPluginApp gApp;
+
+#if 0
+#pragma mark -
+#pragma mark == DLL Exports ==
+#endif
+
+//===========================================================================================================================
+// CExplorerPluginApp::CExplorerPluginApp
+//===========================================================================================================================
+
+IMPLEMENT_DYNAMIC(CExplorerPluginApp, CWinApp);
+
+CExplorerPluginApp::CExplorerPluginApp()
+{
+}
+
+
+//===========================================================================================================================
+// CExplorerPluginApp::~CExplorerPluginApp
+//===========================================================================================================================
+
+CExplorerPluginApp::~CExplorerPluginApp()
+{
+}
+
+
+//===========================================================================================================================
+// CExplorerPluginApp::InitInstance
+//===========================================================================================================================
+
+BOOL
+CExplorerPluginApp::InitInstance()
+{
+ wchar_t resource[MAX_PATH];
+ OSStatus err;
+ int res;
+ HINSTANCE inInstance;
+
+ inInstance = AfxGetInstanceHandle();
+ gInstance = inInstance;
+
+ debug_initialize( kDebugOutputTypeWindowsEventLog, "DNSServices Bar", inInstance );
+ debug_set_property( kDebugPropertyTagPrintLevel, kDebugLevelTrace );
+ dlog( kDebugLevelTrace, "\nCCPApp::InitInstance\n" );
+
+ res = PathForResource( inInstance, L"ExplorerPluginResources.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 );
+
+ g_nonLocalizedResourcesName = resource;
+
+ res = PathForResource( inInstance, L"ExplorerPluginLocalized.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 );
+
+exit:
+
+ return TRUE;
+}
+
+
+//===========================================================================================================================
+// CExplorerPluginApp::ExitInstance
+//===========================================================================================================================
+
+int
+CExplorerPluginApp::ExitInstance()
+{
+ return 0;
+}
+
+
+
+//===========================================================================================================================
+// DllCanUnloadNow
+//===========================================================================================================================
+
+STDAPI DllCanUnloadNow( void )
+{
+ dlog( kDebugLevelTrace, "DllCanUnloadNow (refCount=%d)\n", gDLLRefCount );
+
+ return( gDLLRefCount == 0 );
+}
+
+//===========================================================================================================================
+// DllGetClassObject
+//===========================================================================================================================
+
+STDAPI DllGetClassObject( REFCLSID inCLSID, REFIID inIID, LPVOID *outResult )
+{
+ HRESULT err;
+ BOOL ok;
+ ClassFactory * factory;
+
+ dlog( kDebugLevelTrace, "DllGetClassObject\n" );
+
+ *outResult = NULL;
+
+ // Check if the class ID is supported.
+
+ ok = IsEqualCLSID( inCLSID, CLSID_ExplorerBar );
+ require_action_quiet( ok, exit, err = CLASS_E_CLASSNOTAVAILABLE );
+
+ // Create the ClassFactory object.
+
+ factory = NULL;
+ try
+ {
+ factory = new ClassFactory( inCLSID );
+ }
+ catch( ... )
+ {
+ // Do not let exception escape.
+ }
+ require_action( factory, exit, err = E_OUTOFMEMORY );
+
+ // Query for the specified interface. Release the factory since QueryInterface retains it.
+
+ err = factory->QueryInterface( inIID, outResult );
+ factory->Release();
+
+exit:
+ return( err );
+}
+
+//===========================================================================================================================
+// DllRegisterServer
+//===========================================================================================================================
+
+STDAPI DllRegisterServer( void )
+{
+ IRunnableTask * pTask = NULL;
+ HRESULT err;
+ BOOL ok;
+ CString s;
+
+ dlog( kDebugLevelTrace, "DllRegisterServer\n" );
+
+ ok = s.LoadString( IDS_NAME );
+ require_action( ok, exit, err = E_UNEXPECTED );
+
+ err = RegisterServer( gInstance, CLSID_ExplorerBar, s );
+ require_noerr( err, exit );
+
+ err = RegisterCOMCategory( CLSID_ExplorerBar, CATID_InfoBand, TRUE );
+ require_noerr( err, exit );
+
+ // <rdar://problem/4130635> Clear IE cache so it will rebuild the cache when it runs next. This
+ // will allow us to install and not reboot
+
+ err = CoCreateInstance(CLSID_CompCatCacheDaemon, NULL, CLSCTX_INPROC, IID_IRunnableTask, (void**) &pTask);
+ require_noerr( err, exit );
+
+ pTask->Run();
+ pTask->Release();
+
+exit:
+ return( err );
+}
+
+//===========================================================================================================================
+// DllUnregisterServer
+//===========================================================================================================================
+
+STDAPI DllUnregisterServer( void )
+{
+ HRESULT err;
+
+ dlog( kDebugLevelTrace, "DllUnregisterServer\n" );
+
+ err = RegisterCOMCategory( CLSID_ExplorerBar, CATID_InfoBand, FALSE );
+ require_noerr( err, exit );
+
+ err = UnregisterServer( CLSID_ExplorerBar );
+ require_noerr( err, exit );
+
+exit:
+ return( err );
+}
+
+
+#if 0
+#pragma mark -
+#pragma mark == Utilities ==
+#endif
+
+//===========================================================================================================================
+// RegisterServer
+//===========================================================================================================================
+
+DEBUG_LOCAL OSStatus RegisterServer( HINSTANCE inInstance, CLSID inCLSID, LPCTSTR inName )
+{
+ typedef struct RegistryBuilder RegistryBuilder;
+ struct RegistryBuilder
+ {
+ HKEY rootKey;
+ LPCTSTR subKey;
+ LPCTSTR valueName;
+ LPCTSTR data;
+ };
+
+ OSStatus err;
+ LPWSTR clsidWideString;
+ TCHAR clsidString[ 64 ];
+ DWORD nChars;
+ size_t n;
+ size_t i;
+ HKEY key;
+ TCHAR keyName[ MAX_PATH ];
+ TCHAR moduleName[ MAX_PATH ] = TEXT( "" );
+ TCHAR data[ MAX_PATH ];
+ RegistryBuilder entries[] =
+ {
+ { HKEY_CLASSES_ROOT, TEXT( "CLSID\\%s" ), NULL, inName },
+ { HKEY_CLASSES_ROOT, TEXT( "CLSID\\%s\\InprocServer32" ), NULL, moduleName },
+ { HKEY_CLASSES_ROOT, TEXT( "CLSID\\%s\\InprocServer32" ), TEXT( "ThreadingModel" ), TEXT( "Apartment" ) }
+ };
+ DWORD size;
+ OSVERSIONINFO versionInfo;
+
+ // Convert the CLSID to a string based on the encoding of this code (ANSI or Unicode).
+
+ err = StringFromIID( inCLSID, &clsidWideString );
+ require_noerr( err, exit );
+ require_action( clsidWideString, exit, err = kNoMemoryErr );
+
+ #ifdef UNICODE
+ lstrcpyn( clsidString, clsidWideString, sizeof_array( clsidString ) );
+ CoTaskMemFree( clsidWideString );
+ #else
+ nChars = WideCharToMultiByte( CP_ACP, 0, clsidWideString, -1, clsidString, sizeof_array( clsidString ), NULL, NULL );
+ err = translate_errno( nChars > 0, (OSStatus) GetLastError(), kUnknownErr );
+ CoTaskMemFree( clsidWideString );
+ require_noerr( err, exit );
+ #endif
+
+ // Register the CLSID entries.
+
+ nChars = GetModuleFileName( inInstance, moduleName, sizeof_array( moduleName ) );
+ err = translate_errno( nChars > 0, (OSStatus) GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+
+ n = sizeof_array( entries );
+ for( i = 0; i < n; ++i )
+ {
+ wsprintf( keyName, entries[ i ].subKey, clsidString );
+ err = RegCreateKeyEx( entries[ i ].rootKey, keyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &key, NULL );
+ require_noerr( err, exit );
+
+ size = (DWORD)( ( lstrlen( entries[ i ].data ) + 1 ) * sizeof( TCHAR ) );
+ err = RegSetValueEx( key, entries[ i ].valueName, 0, REG_SZ, (LPBYTE) entries[ i ].data, size );
+ RegCloseKey( key );
+ require_noerr( err, exit );
+ }
+
+ // If running on NT, register the extension as approved.
+
+ versionInfo.dwOSVersionInfoSize = sizeof( versionInfo );
+ GetVersionEx( &versionInfo );
+ if( versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
+ {
+ lstrcpyn( keyName, TEXT( "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved" ), sizeof_array( keyName ) );
+ err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, keyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &key, NULL );
+ require_noerr( err, exit );
+
+ lstrcpyn( data, inName, sizeof_array( data ) );
+ size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) );
+ err = RegSetValueEx( key, clsidString, 0, REG_SZ, (LPBYTE) data, size );
+ RegCloseKey( key );
+ }
+
+ // register toolbar button
+ lstrcpyn( keyName, TEXT( "SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\{7F9DB11C-E358-4ca6-A83D-ACC663939424}"), sizeof_array( keyName ) );
+ err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, keyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &key, NULL );
+ require_noerr( err, exit );
+
+ lstrcpyn( data, L"Yes", sizeof_array( data ) );
+ size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) );
+ RegSetValueEx( key, L"Default Visible", 0, REG_SZ, (LPBYTE) data, size );
+
+ lstrcpyn( data, inName, sizeof_array( data ) );
+ size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) );
+ RegSetValueEx( key, L"ButtonText", 0, REG_SZ, (LPBYTE) data, size );
+
+ lstrcpyn( data, L"{E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16}", sizeof_array( data ) );
+ size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) );
+ RegSetValueEx( key, L"CLSID", 0, REG_SZ, (LPBYTE) data, size );
+
+ lstrcpyn( data, clsidString, sizeof_array( data ) );
+ size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) );
+ RegSetValueEx( key, L"BandCLSID", 0, REG_SZ, (LPBYTE) data, size );
+
+ // check if we're running XP or later
+ if ( ( versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT ) &&
+ ( versionInfo.dwMajorVersion == 5 ) &&
+ ( versionInfo.dwMinorVersion >= 1 ) )
+ {
+ wsprintf( data, L"%s,%d", (LPCTSTR) g_nonLocalizedResourcesName, IDI_BUTTON_XP );
+ size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) );
+ RegSetValueEx( key, L"Icon", 0, REG_SZ, (LPBYTE) data, size);
+
+ wsprintf( data, L"%s,%d", (LPCTSTR) g_nonLocalizedResourcesName, IDI_BUTTON_XP );
+ size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) );
+ RegSetValueEx( key, L"HotIcon", 0, REG_SZ, (LPBYTE) data, size);
+ }
+ else
+ {
+ wsprintf( data, L"%s,%d", (LPCTSTR) g_nonLocalizedResourcesName, IDI_BUTTON_2K );
+ size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) );
+ RegSetValueEx( key, L"Icon", 0, REG_SZ, (LPBYTE) data, size);
+
+ wsprintf( data, L"%s,%d", (LPCTSTR) g_nonLocalizedResourcesName, IDI_BUTTON_2K );
+ size = (DWORD)( ( lstrlen( data ) + 1 ) * sizeof( TCHAR ) );
+ RegSetValueEx( key, L"HotIcon", 0, REG_SZ, (LPBYTE) data, size);
+ }
+
+ RegCloseKey( key );
+
+exit:
+ return( err );
+}
+
+//===========================================================================================================================
+// RegisterCOMCategory
+//===========================================================================================================================
+
+DEBUG_LOCAL OSStatus RegisterCOMCategory( CLSID inCLSID, CATID inCategoryID, BOOL inRegister )
+{
+ HRESULT err;
+ ICatRegister * cat;
+
+ err = CoInitialize( NULL );
+ require( SUCCEEDED( err ), exit );
+
+ err = CoCreateInstance( CLSID_StdComponentCategoriesMgr, NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (LPVOID *) &cat );
+ check( SUCCEEDED( err ) );
+ if( SUCCEEDED( err ) )
+ {
+ if( inRegister )
+ {
+ err = cat->RegisterClassImplCategories( inCLSID, 1, &inCategoryID );
+ check_noerr( err );
+ }
+ else
+ {
+ err = cat->UnRegisterClassImplCategories( inCLSID, 1, &inCategoryID );
+ check_noerr( err );
+ }
+ cat->Release();
+ }
+ CoUninitialize();
+
+exit:
+ return( err );
+}
+
+
+//===========================================================================================================================
+// UnregisterServer
+//===========================================================================================================================
+
+DEBUG_LOCAL OSStatus UnregisterServer( CLSID inCLSID )
+{
+ OSStatus err = 0;
+ LPWSTR clsidWideString;
+ TCHAR clsidString[ 64 ];
+ HKEY key;
+ TCHAR keyName[ MAX_PATH * 2 ];
+ OSVERSIONINFO versionInfo;
+
+ // Convert the CLSID to a string based on the encoding of this code (ANSI or Unicode).
+
+ err = StringFromIID( inCLSID, &clsidWideString );
+ require_noerr( err, exit );
+ require_action( clsidWideString, exit, err = kNoMemoryErr );
+
+ #ifdef UNICODE
+ lstrcpyn( clsidString, clsidWideString, sizeof_array( clsidString ) );
+ CoTaskMemFree( clsidWideString );
+ #else
+ nChars = WideCharToMultiByte( CP_ACP, 0, clsidWideString, -1, clsidString, sizeof_array( clsidString ), NULL, NULL );
+ err = translate_errno( nChars > 0, (OSStatus) GetLastError(), kUnknownErr );
+ CoTaskMemFree( clsidWideString );
+ require_noerr( err, exit );
+ #endif
+
+ wsprintf( keyName, L"CLSID\\%s", clsidString );
+ MyRegDeleteKey( HKEY_CLASSES_ROOT, keyName );
+
+ // If running on NT, de-register the extension as approved.
+
+ versionInfo.dwOSVersionInfoSize = sizeof( versionInfo );
+ GetVersionEx( &versionInfo );
+ if( versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT )
+ {
+ lstrcpyn( keyName, TEXT( "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved" ), sizeof_array( keyName ) );
+ err = RegCreateKeyEx( HKEY_LOCAL_MACHINE, keyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &key, NULL );
+ require_noerr( err, exit );
+
+ RegDeleteValue( key, clsidString );
+
+ err = RegCloseKey( key );
+ require_noerr( err, exit );
+ }
+
+ // de-register toolbar button
+
+ lstrcpyn( keyName, TEXT( "SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\{7F9DB11C-E358-4ca6-A83D-ACC663939424}"), sizeof_array( keyName ) );
+ MyRegDeleteKey( HKEY_LOCAL_MACHINE, keyName );
+
+exit:
+ return( err );
+}
+
+
+
+//===========================================================================================================================
+// 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;
+}
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.def b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.def
new file mode 100644
index 00000000..8b931d10
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.def
@@ -0,0 +1,24 @@
+;
+;
+; 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 ExplorerPlugin
+
+EXPORTS
+ DllCanUnloadNow PRIVATE
+ DllGetClassObject PRIVATE
+ DllRegisterServer PRIVATE
+ DllUnregisterServer PRIVATE
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.h b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.h
new file mode 100644
index 00000000..9fa56aea
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.h
@@ -0,0 +1,47 @@
+/* -*- 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
+
+//===========================================================================================================================
+// Globals
+//===========================================================================================================================
+
+// {9999A076-A9E2-4c99-8A2B-632FC9429223}
+DEFINE_GUID(CLSID_ExplorerBar,
+ 0x9999a076, 0xa9e2, 0x4c99, 0x8a, 0x2b, 0x63, 0x2f, 0xc9, 0x42, 0x92, 0x23);
+
+extern HINSTANCE gInstance;
+extern int gDLLRefCount;
+extern HINSTANCE GetNonLocalizedResources();
+extern HINSTANCE GetLocalizedResources();
+
+
+class CExplorerPluginApp : public CWinApp
+{
+public:
+
+CExplorerPluginApp();
+virtual ~CExplorerPluginApp();
+
+protected:
+
+virtual BOOL InitInstance();
+virtual int ExitInstance();
+
+DECLARE_DYNAMIC(CExplorerPluginApp);
+};
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.rc b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.rc
new file mode 100644
index 00000000..03320d5c
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.rc
@@ -0,0 +1,122 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource_dll.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_dll.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 Explorer Bar"
+ VALUE "FileVersion", MASTER_PROD_VERS_STR
+ VALUE "InternalName", "ExplorerPlugin.dll"
+ VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT
+ VALUE "OriginalFilename", "ExplorerPlugin.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.
+//
+#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/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcproj b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcproj
new file mode 100644
index 00000000..c157cfb2
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcproj
@@ -0,0 +1,595 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ExplorerPlugin"
+ ProjectGUID="{BB8AC1B5-6587-4163-BDC6-788B157705CA}"
+ >
+ <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"
+ Description=""
+ CommandLine=""
+ Outputs=""
+ />
+ <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="..\..\mDNSShared;..\..\mDNSWindows"
+ PreprocessorDefinitions="_USRDLL;WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ StringPooling="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ ForceConformanceInForLoopScope="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=""
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(IntDir)\vc80.pdb"
+ 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="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386 /IGNORE:4089 /NXCOMPAT /DYNAMICBASE /SAFESEH"
+ AdditionalDependencies="../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib uafxcwd.lib ws2_32.lib"
+ OutputFile="$(OutDir)/ExplorerPlugin.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="uafxcwd.lib"
+ ModuleDefinitionFile="./$(ProjectName).def"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/$(ProjectName).lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="res\ExplorerPlugin.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="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="1"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ Description=""
+ CommandLine=""
+ Outputs=""
+ />
+ <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="..\..\mDNSShared;..\..\mDNSWindows"
+ PreprocessorDefinitions="_USRDLL;WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ StringPooling="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ ForceConformanceInForLoopScope="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=""
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(IntDir)\vc80.pdb"
+ 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="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/IGNORE:4089 /NXCOMPAT /DYNAMICBASE"
+ AdditionalDependencies="../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib uafxcwd.lib ws2_32.lib"
+ OutputFile="$(OutDir)/ExplorerPlugin.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="uafxcwd.lib"
+ ModuleDefinitionFile="./$(ProjectName).def"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/$(ProjectName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="res\ExplorerPlugin64.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="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="1"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ Description=""
+ />
+ <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;..\..\mDNSWindows"
+ PreprocessorDefinitions="_USRDLL;WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="true"
+ EnableFunctionLevelLinking="false"
+ ForceConformanceInForLoopScope="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=""
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(IntDir)\vc80.pdb"
+ BrowseInformation="1"
+ WarningLevel="4"
+ WarnAsError="false"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386 /IGNORE:4089 /NXCOMPAT /DYNAMICBASE /SAFESEH"
+ AdditionalDependencies="../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib ws2_32.lib uafxcw.lib"
+ OutputFile="$(OutDir)/$(ProjectName).dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="uafxcw.lib"
+ ModuleDefinitionFile="./$(ProjectName).def"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(IntDir)/$(ProjectName).pdb"
+ SubSystem="2"
+ OptimizeReferences="0"
+ EnableCOMDATFolding="0"
+ ImportLibrary="$(IntDir)/$(ProjectName).lib"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="res\ExplorerPlugin.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="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ UseOfMFC="1"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ Description=""
+ />
+ <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;..\..\mDNSWindows"
+ PreprocessorDefinitions="_USRDLL;WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="true"
+ EnableFunctionLevelLinking="false"
+ ForceConformanceInForLoopScope="true"
+ UsePrecompiledHeader="0"
+ PrecompiledHeaderFile=""
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(IntDir)\vc80.pdb"
+ BrowseInformation="1"
+ WarningLevel="4"
+ WarnAsError="false"
+ SuppressStartupBanner="true"
+ Detect64BitPortabilityProblems="true"
+ CompileAs="0"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/IGNORE:4089 /NXCOMPAT /DYNAMICBASE"
+ AdditionalDependencies="../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib ws2_32.lib uafxcw.lib"
+ OutputFile="$(OutDir)/$(ProjectName).dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ IgnoreDefaultLibraryNames="uafxcw.lib"
+ ModuleDefinitionFile="./$(ProjectName).def"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(IntDir)/$(ProjectName).pdb"
+ SubSystem="2"
+ OptimizeReferences="0"
+ EnableCOMDATFolding="0"
+ ImportLibrary="$(IntDir)/$(ProjectName).lib"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="res\ExplorerPlugin64.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="Support"
+ >
+ <File
+ RelativePath="..\..\mDNSShared\CommonServices.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSShared\DebugServices.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSShared\DebugServices.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\isocode.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\loclibrary.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\loclibrary.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\WinServices.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\WinServices.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+ >
+ <File
+ RelativePath="About.cpp"
+ >
+ </File>
+ <File
+ RelativePath="ClassFactory.cpp"
+ >
+ </File>
+ <File
+ RelativePath="ExplorerBar.cpp"
+ >
+ </File>
+ <File
+ RelativePath="ExplorerBarWindow.cpp"
+ >
+ </File>
+ <File
+ RelativePath="ExplorerPlugin.cpp"
+ >
+ </File>
+ <File
+ RelativePath="ExplorerPlugin.def"
+ >
+ </File>
+ <File
+ RelativePath="LoginDialog.cpp"
+ >
+ </File>
+ <File
+ RelativePath="StdAfx.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc"
+ >
+ <File
+ RelativePath=".\About.h"
+ >
+ </File>
+ <File
+ RelativePath="ClassFactory.h"
+ >
+ </File>
+ <File
+ RelativePath="ExplorerBar.h"
+ >
+ </File>
+ <File
+ RelativePath="ExplorerBarWindow.h"
+ >
+ </File>
+ <File
+ RelativePath="ExplorerPlugin.h"
+ >
+ </File>
+ <File
+ RelativePath="LoginDialog.h"
+ >
+ </File>
+ <File
+ RelativePath="Resource.h"
+ >
+ </File>
+ <File
+ RelativePath="resource_dll.h"
+ >
+ </File>
+ <File
+ RelativePath="StdAfx.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest"
+ >
+ <File
+ RelativePath="ExplorerPlugin.rc"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ <Global
+ Name="RESOURCE_FILE"
+ Value="ExplorerPlugin.rc"
+ />
+ </Globals>
+</VisualStudioProject>
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj
new file mode 100755
index 00000000..810c90e1
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj
@@ -0,0 +1,402 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Template|Win32">
+ <Configuration>Template</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Template|x64">
+ <Configuration>Template</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{BB8AC1B5-6587-4163-BDC6-788B157705CA}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <CustomBuildStep>
+ <Message>
+ </Message>
+ <Command>
+ </Command>
+ <Outputs>%(Outputs)</Outputs>
+ </CustomBuildStep>
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_USRDLL;WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>StdCall</CallingConvention>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 /NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;uafxcwd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)ExplorerPlugin.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>uafxcwd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>./$(ProjectName).def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>res\ExplorerPlugin.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <CustomBuildStep>
+ <Message>
+ </Message>
+ <Command>
+ </Command>
+ <Outputs>%(Outputs)</Outputs>
+ </CustomBuildStep>
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_USRDLL;WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>StdCall</CallingConvention>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/IGNORE:4089 /NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;uafxcwd.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)ExplorerPlugin.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>uafxcwd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>./$(ProjectName).def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>res\ExplorerPlugin64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <CustomBuildStep>
+ <Message>
+ </Message>
+ </CustomBuildStep>
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_USRDLL;WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 /NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;uafxcw.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>uafxcw.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>./$(ProjectName).def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>
+ </OptimizeReferences>
+ <EnableCOMDATFolding>
+ </EnableCOMDATFolding>
+ <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>res\ExplorerPlugin.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <CustomBuildStep>
+ <Message>
+ </Message>
+ </CustomBuildStep>
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_USRDLL;WIN32;NDEBUG;_WINDOWS;WINVER=0x0501;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/IGNORE:4089 /NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;uafxcw.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)$(ProjectName).dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>uafxcw.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>./$(ProjectName).def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>
+ </OptimizeReferences>
+ <EnableCOMDATFolding>
+ </EnableCOMDATFolding>
+ <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>res\ExplorerPlugin64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\mDNSShared\CommonServices.h" />
+ <ClInclude Include="..\..\mDNSShared\DebugServices.h" />
+ <ClInclude Include="..\..\mDNSWindows\isocode.h" />
+ <ClInclude Include="..\..\mDNSWindows\loclibrary.h" />
+ <ClInclude Include="..\..\mDNSWindows\WinServices.h" />
+ <ClInclude Include="About.h" />
+ <ClInclude Include="ClassFactory.h" />
+ <ClInclude Include="ExplorerBar.h" />
+ <ClInclude Include="ExplorerBarWindow.h" />
+ <ClInclude Include="ExplorerPlugin.h" />
+ <ClInclude Include="LoginDialog.h" />
+ <ClInclude Include="Resource.h" />
+ <ClInclude Include="resource_dll.h" />
+ <ClInclude Include="StdAfx.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\mDNSShared\DebugServices.c" />
+ <ClCompile Include="..\..\mDNSWindows\loclibrary.c" />
+ <ClCompile Include="..\..\mDNSWindows\WinServices.cpp" />
+ <ClCompile Include="About.cpp" />
+ <ClCompile Include="ClassFactory.cpp" />
+ <ClCompile Include="ExplorerBar.cpp" />
+ <ClCompile Include="ExplorerBarWindow.cpp" />
+ <ClCompile Include="ExplorerPlugin.cpp" />
+ <ClCompile Include="LoginDialog.cpp" />
+ <ClCompile Include="StdAfx.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="ExplorerPlugin.def" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="ExplorerPlugin.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\mDNSWindows\DLLStub\DLLStub.vcxproj">
+ <Project>{3a2b6325-3053-4236-84bd-aa9be2e323e5}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+ <ProjectExtensions>
+ <VisualStudio>
+ <UserProperties RESOURCE_FILE="ExplorerPlugin.rc" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj.filters b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj.filters
new file mode 100755
index 00000000..f86a9f56
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPlugin.vcxproj.filters
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Support">
+ <UniqueIdentifier>{b3978812-899a-4e8b-9f75-9458141da3b4}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{62896a08-c5fd-4a48-8f8b-33f3fc2f8b1f}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{8aded36a-5c99-4074-8892-31cb394d0eed}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{31823db1-cc70-4c1b-990d-ad0e8f840b66}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\mDNSShared\CommonServices.h">
+ <Filter>Support</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSShared\DebugServices.h">
+ <Filter>Support</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSWindows\isocode.h">
+ <Filter>Support</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSWindows\loclibrary.h">
+ <Filter>Support</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSWindows\WinServices.h">
+ <Filter>Support</Filter>
+ </ClInclude>
+ <ClInclude Include="About.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ClassFactory.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ExplorerBar.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ExplorerBarWindow.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ExplorerPlugin.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="LoginDialog.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="Resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource_dll.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="StdAfx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\mDNSShared\DebugServices.c">
+ <Filter>Support</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSWindows\loclibrary.c">
+ <Filter>Support</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSWindows\WinServices.cpp">
+ <Filter>Support</Filter>
+ </ClCompile>
+ <ClCompile Include="About.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ClassFactory.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ExplorerBar.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ExplorerBarWindow.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ExplorerPlugin.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="LoginDialog.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="StdAfx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="ExplorerPlugin.def">
+ <Filter>Source Files</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="ExplorerPlugin.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.rc b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.rc
new file mode 100755
index 00000000..9f4c4f5b
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.rc
@@ -0,0 +1,213 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource_loc_res.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_loc_res.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", "ExplorerPluginLocalized.dll"
+ VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT
+ VALUE "OriginalFilename", "ExplorerPluginLocalized.dll"
+ VALUE "ProductName", MASTER_PROD_NAME
+ VALUE "ProductVersion", MASTER_PROD_VERS_STR
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_LOGIN DIALOGEX 0, 0, 180, 89
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
+CAPTION "Login"
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+ LTEXT "Enter a username and password. Leave blank to use the default username and/or password.",
+ IDC_STATIC,8,8,156,16,NOT WS_GROUP
+ RTEXT "Username:",IDC_STATIC,10,34,36,8,NOT WS_GROUP
+ EDITTEXT IDC_LOGIN_USERNAME_TEXT,50,32,118,12,ES_AUTOHSCROLL
+ RTEXT "Password:",IDC_STATIC,10,50,36,8,NOT WS_GROUP
+ EDITTEXT IDC_LOGIN_PASSWORD_TEXT,50,48,118,12,ES_PASSWORD |
+ ES_AUTOHSCROLL
+ DEFPUSHBUTTON "OK",IDOK,129,70,44,14
+ PUSHBUTTON "Cancel",IDCANCEL,77,70,44,14
+END
+
+IDD_ABOUT DIALOGEX 0, 0, 219, 87
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_RTLREADING | WS_EX_LEFTSCROLLBAR
+CAPTION "About Bonjour"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ CONTROL "",IDC_ABOUT_BACKGROUND,"Static",SS_BITMAP | SS_REALSIZEIMAGE,0,0,
+ 220,86
+ CONTROL "Explorer Plugin",IDC_COMPONENT,"Static",
+ SS_SIMPLE | WS_GROUP,92,10,122,8
+ CONTROL "",IDC_COMPONENT_VERSION,"Static",
+ SS_SIMPLE | WS_GROUP,142,10,122,8
+ LTEXT "Copyright (c) 2004-2007 Apple Inc. All rights reserved. Apple and the Apple logo are trademarks of Apple Inc., registered in the U.S. and other countries.",
+ IDC_LEGAL,92,31,123,50,0
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_LOGIN, DIALOG
+ BEGIN
+ BOTTOMMARGIN, 62
+ END
+
+ IDD_ABOUT, DIALOG
+ BEGIN
+ BOTTOMMARGIN, 132
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_CONTEXT_MENU MENU
+BEGIN
+ POPUP "ContextMenu"
+ BEGIN
+ MENUITEM "About Bonjour...", ID_Menu
+ MENUITEM SEPARATOR
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE
+BEGIN
+ IDS_ABOUT "About Bonjour"
+ IDS_ABOUT_URL "http://www.apple.com/macosx/features/bonjour"
+ IDS_NAME "Bonjour"
+ IDS_WEB_SITES "Web Sites"
+ IDS_PRINTERS "Printers"
+ IDS_MDNSRESPONDER_NOT_AVAILABLE "Bonjour Service is not available."
+ IDS_FIREWALL "Check firewall settings"
+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/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcproj b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcproj
new file mode 100755
index 00000000..f354cf2a
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcproj
@@ -0,0 +1,487 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ExplorerPluginLocRes"
+ ProjectGUID="{1643427B-F226-4AD6-B413-97DA64D5C6B4}"
+ RootNamespace="ExplorerPluginLocRes"
+ >
+ <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="..\..\mDNSWindows"
+ 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="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist $(OutDir)\ExplorerPlugin.Resources mkdir $(OutDir)\ExplorerPlugin.Resources&#x0D;&#x0A;if not exist $(OutDir)\ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)\ExplorerPlugin.Resources\en.lproj&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "
+ AdditionalDependencies=""
+ OutputFile="$(OutDir)\ExplorerPlugin.Resources\en.lproj\ExplorerPluginLocalized.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="..\..\mDNSWindows"
+ 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="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist $(OutDir)\ExplorerPlugin.Resources mkdir $(OutDir)\ExplorerPlugin.Resources&#x0D;&#x0A;if not exist $(OutDir)\ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)\ExplorerPlugin.Resources\en.lproj&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "
+ AdditionalDependencies=""
+ OutputFile="$(OutDir)\ExplorerPlugin.Resources\en.lproj\ExplorerPluginLocalized.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="..\..\mDNSWindows"
+ 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="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist $(OutDir)\ExplorerPlugin.Resources mkdir $(OutDir)\ExplorerPlugin.Resources&#x0D;&#x0A;if not exist $(OutDir)\ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)\ExplorerPlugin.Resources\en.lproj&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "
+ AdditionalDependencies=""
+ OutputFile="$(OutDir)\ExplorerPlugin.Resources\en.lproj\ExplorerPluginLocalized.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)\ExplorerPlugin.Resources\en.lproj&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ExplorerPlugin.Resources\en.lproj&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ExplorerPlugin.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="..\..\mDNSWindows"
+ 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="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist $(OutDir)\ExplorerPlugin.Resources mkdir $(OutDir)\ExplorerPlugin.Resources&#x0D;&#x0A;if not exist $(OutDir)\ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)\ExplorerPlugin.Resources\en.lproj&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "
+ AdditionalDependencies=""
+ OutputFile="$(OutDir)\ExplorerPlugin.Resources\en.lproj\ExplorerPluginLocalized.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)\ExplorerPlugin.Resources\en.lproj&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ExplorerPlugin.Resources\en.lproj&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ExplorerPlugin.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="ExplorerPluginLocRes.rc"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ <Global
+ Name="RESOURCE_FILE"
+ Value="ExplorerPluginLocRes.rc"
+ />
+ </Globals>
+</VisualStudioProject>
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj
new file mode 100755
index 00000000..fb96fd3b
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj
@@ -0,0 +1,397 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Template|Win32">
+ <Configuration>Template</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Template|x64">
+ <Configuration>Template</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{1643427B-F226-4AD6-B413-97DA64D5C6B4}</ProjectGuid>
+ <RootNamespace>ExplorerPluginLocRes</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ExplorerPluginLocalized</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ExplorerPluginLocalized</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">ExplorerPluginLocalized</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ExplorerPluginLocalized</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ExplorerPluginLocalized</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|x64'">ExplorerPluginLocalized</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|x64'">.dll</TargetExt>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\en.lproj\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
+ <ObjectFileName>.\Debug/</ObjectFileName>
+ <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>StdCall</CallingConvention>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist $(OutDir)ExplorerPlugin.Resources mkdir $(OutDir)ExplorerPlugin.Resources
+if not exist $(OutDir)ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)ExplorerPlugin.Resources\en.lproj
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)ExplorerPluginLocalized.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>
+ </ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
+ <ObjectFileName>.\Debug/</ObjectFileName>
+ <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>StdCall</CallingConvention>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist $(OutDir)ExplorerPlugin.Resources mkdir $(OutDir)ExplorerPlugin.Resources
+if not exist $(OutDir)ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)ExplorerPlugin.Resources\en.lproj
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)ExplorerPluginLocalized.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>
+ </ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>.\Release/</AssemblerListingLocation>
+ <ObjectFileName>.\Release/</ObjectFileName>
+ <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist $(OutDir)ExplorerPlugin.Resources mkdir $(OutDir)ExplorerPlugin.Resources
+if not exist $(OutDir)ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)ExplorerPlugin.Resources\en.lproj
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)ExplorerPluginLocalized.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>
+ </ModuleDefinitionFile>
+ <ProgramDatabaseFile>
+ </ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>
+ </OptimizeReferences>
+ <EnableCOMDATFolding>
+ </EnableCOMDATFolding>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>
+ </Link>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>.\Release/</AssemblerListingLocation>
+ <ObjectFileName>.\Release/</ObjectFileName>
+ <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist $(OutDir)ExplorerPlugin.Resources mkdir $(OutDir)ExplorerPlugin.Resources
+if not exist $(OutDir)ExplorerPlugin.Resources\en.lproj mkdir $(OutDir)ExplorerPlugin.Resources\en.lproj
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)ExplorerPluginLocalized.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>
+ </ModuleDefinitionFile>
+ <ProgramDatabaseFile>
+ </ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>
+ </OptimizeReferences>
+ <EnableCOMDATFolding>
+ </EnableCOMDATFolding>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources\en.lproj"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
+ <Link>
+ <OutputFile>$(OutDir)ExplorerPluginLocalized.dll</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'">
+ <Link>
+ <OutputFile>$(OutDir)ExplorerPluginLocalized.dll</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="resource_loc_res.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="ExplorerPluginLocRes.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\mDNSWindows\DLL\dnssd.vcxproj">
+ <Project>{ab581101-18f0-46f6-b56a-83a6b1ea657e}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+ <ProjectExtensions>
+ <VisualStudio>
+ <UserProperties RESOURCE_FILE="ExplorerPluginLocRes.rc" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj.filters b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj.filters
new file mode 100755
index 00000000..c2dd2ad9
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginLocRes.vcxproj.filters
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{fdb2f45e-acf9-4bf2-87a1-fb0df2aca928}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{ee265e77-1d8e-4a0c-8c10-27b123ab1232}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="resource_loc_res.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="ExplorerPluginLocRes.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.rc b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.rc
new file mode 100755
index 00000000..bf0d64ca
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.rc
@@ -0,0 +1,140 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource_res.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_res.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", "ExplorerPluginResources.dll"
+ VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT
+ VALUE "OriginalFilename", "ExplorerPluginResources.dll"
+ VALUE "ProductName", MASTER_PROD_NAME
+ VALUE "ProductVersion", MASTER_PROD_VERS_STR
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_LOGO BITMAP "res\\logo.bmp"
+IDB_ABOUT BITMAP "res\\about.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_BUTTON_2K ICON "res\\button-2k.ico"
+IDI_BUTTON_XP ICON "res\\button-xp.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/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcproj b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcproj
new file mode 100755
index 00000000..6b940ac8
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcproj
@@ -0,0 +1,518 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="ExplorerPluginRes"
+ ProjectGUID="{871B1492-B4A4-4B57-9237-FA798484D7D7}"
+ >
+ <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="..\..\mDNSWindows"
+ 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="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist Debug\ExplorerPlugin.Resources mkdir Debug\ExplorerPlugin.Resources"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "
+ OutputFile="$(OutDir)\ExplorerPlugin.Resources\ExplorerPluginResources.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="..\..\mDNSWindows"
+ 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="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist Debug\ExplorerPlugin.Resources mkdir Debug\ExplorerPlugin.Resources"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "
+ OutputFile="$(OutDir)\ExplorerPlugin.Resources\ExplorerPluginResources.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;..\..\mDNSWindows"
+ 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="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist Release mkdir Release&#x0D;&#x0A;if not exist &quot;Release\ExplorerPlugin.Resources&quot; mkdir &quot;Release\ExplorerPlugin.Resources&quot;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "
+ OutputFile="$(OutDir)\ExplorerPlugin.Resources\ExplorerPluginResources.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)\ExplorerPlugin.Resources&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ExplorerPlugin.Resources&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ExplorerPlugin.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;..\..\mDNSWindows"
+ 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="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist Release mkdir Release&#x0D;&#x0A;if not exist &quot;Release\ExplorerPlugin.Resources&quot; mkdir &quot;Release\ExplorerPlugin.Resources&quot;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386 /IGNORE:4089 "
+ OutputFile="$(OutDir)\ExplorerPlugin.Resources\ExplorerPluginResources.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)\ExplorerPlugin.Resources&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ExplorerPlugin.Resources&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\ExplorerPlugin.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=".\about.bmp"
+ >
+ </File>
+ <File
+ RelativePath="res\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="ExplorerPluginRes.rc"
+ >
+ </File>
+ <File
+ RelativePath=".\hot.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\logo.bmp"
+ >
+ </File>
+ <File
+ RelativePath="res\logo.bmp"
+ >
+ </File>
+ <File
+ RelativePath="Web.ico"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ <Global
+ Name="RESOURCE_FILE"
+ Value="ExplorerPluginRes.rc"
+ />
+ </Globals>
+</VisualStudioProject>
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj
new file mode 100755
index 00000000..4fb64902
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj
@@ -0,0 +1,399 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Template|Win32">
+ <Configuration>Template</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Template|x64">
+ <Configuration>Template</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{871B1492-B4A4-4B57-9237-FA798484D7D7}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ExplorerPluginResources</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ExplorerPluginResources</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.dll</TargetExt>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">ExplorerPluginResources</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ExplorerPluginResources</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ExplorerPluginResources</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.dll</TargetExt>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\ExplorerPlugin.Resources\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|x64'">ExplorerPluginResources</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|x64'">.dll</TargetExt>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
+ <ObjectFileName>.\Debug/</ObjectFileName>
+ <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>StdCall</CallingConvention>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist Debug\ExplorerPlugin.Resources mkdir Debug\ExplorerPlugin.Resources</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)ExplorerPluginResources.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>
+ </ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;DEBUG=1;ENABLE_DOT_LOCAL_NAMES;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>.\Debug/</AssemblerListingLocation>
+ <ObjectFileName>.\Debug/</ObjectFileName>
+ <ProgramDataBaseFileName>.\Debug/</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>StdCall</CallingConvention>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist Debug\ExplorerPlugin.Resources mkdir Debug\ExplorerPlugin.Resources</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)ExplorerPluginResources.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>
+ </ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(OutDir)$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>.\Release/</AssemblerListingLocation>
+ <ObjectFileName>.\Release/</ObjectFileName>
+ <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist Release mkdir Release
+if not exist "Release\ExplorerPlugin.Resources" mkdir "Release\ExplorerPlugin.Resources"
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)ExplorerPluginResources.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>
+ </ModuleDefinitionFile>
+ <ProgramDatabaseFile>
+ </ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>
+ </OptimizeReferences>
+ <EnableCOMDATFolding>
+ </EnableCOMDATFolding>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>
+ </Link>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>X64</TargetEnvironment>
+ <TypeLibraryName>$(OutDir)$(ProjectName).tlb</TypeLibraryName>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\mDNSShared;..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;WINVER=0x0400;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>.\Release/</AssemblerListingLocation>
+ <ObjectFileName>.\Release/</ObjectFileName>
+ <ProgramDataBaseFileName>.\Release/</ProgramDataBaseFileName>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>false</TreatWarningAsError>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <CompileAs>Default</CompileAs>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist Release mkdir Release
+if not exist "Release\ExplorerPlugin.Resources" mkdir "Release\ExplorerPlugin.Resources"
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalOptions>/MACHINE:I386 /IGNORE:4089 %(AdditionalOptions)</AdditionalOptions>
+ <OutputFile>$(OutDir)ExplorerPluginResources.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
+ <ModuleDefinitionFile>
+ </ModuleDefinitionFile>
+ <ProgramDatabaseFile>
+ </ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>
+ </OptimizeReferences>
+ <EnableCOMDATFolding>
+ </EnableCOMDATFolding>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(IntDir)$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\ExplorerPlugin.Resources"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
+ <Link>
+ <OutputFile>$(OutDir)ExplorerPluginResources.dll</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'">
+ <Link>
+ <OutputFile>$(OutDir)ExplorerPluginResources.dll</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="resource_res.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="about.bmp" />
+ <None Include="res\about.bmp" />
+ <None Include="res\button-2k.ico" />
+ <None Include="res\button-xp.ico" />
+ <None Include="res\cold.ico" />
+ <None Include="hot.ico" />
+ <None Include="logo.bmp" />
+ <None Include="res\logo.bmp" />
+ <None Include="Web.ico" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="ExplorerPluginRes.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\mDNSWindows\DLL\dnssd.vcxproj">
+ <Project>{ab581101-18f0-46f6-b56a-83a6b1ea657e}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+ <ProjectExtensions>
+ <VisualStudio>
+ <UserProperties RESOURCE_FILE="ExplorerPluginRes.rc" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj.filters b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj.filters
new file mode 100755
index 00000000..72a0998f
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ExplorerPluginRes.vcxproj.filters
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{89aee21a-a42b-4f10-87db-f6d3b27eb612}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{27ad7c9e-deb4-4963-8cf0-adf004ed2437}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="resource_res.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="about.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\about.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\button-2k.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\button-xp.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\cold.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="hot.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="logo.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\logo.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="Web.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="ExplorerPluginRes.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/ExplorerPlugin/LoginDialog.cpp b/mDNSResponder/Clients/ExplorerPlugin/LoginDialog.cpp
new file mode 100644
index 00000000..a2cc89ef
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/LoginDialog.cpp
@@ -0,0 +1,111 @@
+/* -*- 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 <assert.h>
+#include <stdlib.h>
+
+#include "stdafx.h"
+
+#include "LoginDialog.h"
+
+// MFC Debugging
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+//===========================================================================================================================
+// Message Map
+//===========================================================================================================================
+
+BEGIN_MESSAGE_MAP( LoginDialog, CDialog )
+END_MESSAGE_MAP()
+
+//===========================================================================================================================
+// LoginDialog
+//===========================================================================================================================
+
+LoginDialog::LoginDialog( CWnd *inParent )
+ : CDialog( LoginDialog::IDD, inParent )
+{
+ //
+}
+
+//===========================================================================================================================
+// OnInitDialog
+//===========================================================================================================================
+
+BOOL LoginDialog::OnInitDialog( void )
+{
+ CDialog::OnInitDialog();
+ return( TRUE );
+}
+
+//===========================================================================================================================
+// DoDataExchange
+//===========================================================================================================================
+
+void LoginDialog::DoDataExchange( CDataExchange *inDX )
+{
+ CDialog::DoDataExchange( inDX );
+}
+
+//===========================================================================================================================
+// OnOK
+//===========================================================================================================================
+
+void LoginDialog::OnOK( void )
+{
+ const CWnd * control;
+
+ // Username
+
+ control = GetDlgItem( IDC_LOGIN_USERNAME_TEXT );
+ assert( control );
+ if( control )
+ {
+ control->GetWindowText( mUsername );
+ }
+
+ // Password
+
+ control = GetDlgItem( IDC_LOGIN_PASSWORD_TEXT );
+ assert( control );
+ if( control )
+ {
+ control->GetWindowText( mPassword );
+ }
+
+ CDialog::OnOK();
+}
+
+//===========================================================================================================================
+// GetLogin
+//===========================================================================================================================
+
+BOOL LoginDialog::GetLogin( CString &outUsername, CString &outPassword )
+{
+ if( DoModal() == IDOK )
+ {
+ outUsername = mUsername;
+ outPassword = mPassword;
+ return( TRUE );
+ }
+ return( FALSE );
+}
diff --git a/mDNSResponder/Clients/ExplorerPlugin/LoginDialog.h b/mDNSResponder/Clients/ExplorerPlugin/LoginDialog.h
new file mode 100644
index 00000000..3aeb6966
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/LoginDialog.h
@@ -0,0 +1,53 @@
+/* -*- 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.
+ */
+
+#ifndef __LOGIN_DIALOG__
+#define __LOGIN_DIALOG__
+
+#pragma once
+
+#include "Resource.h"
+
+//===========================================================================================================================
+// LoginDialog
+//===========================================================================================================================
+
+class LoginDialog : public CDialog
+{
+protected:
+
+CString mUsername;
+CString mPassword;
+
+public:
+
+enum { IDD = IDD_LOGIN };
+
+LoginDialog( CWnd *inParent = NULL );
+
+virtual BOOL GetLogin( CString &outUsername, CString &outPassword );
+
+protected:
+
+virtual BOOL OnInitDialog( void );
+virtual void DoDataExchange( CDataExchange *inDX );
+virtual void OnOK( void );
+
+DECLARE_MESSAGE_MAP()
+};
+
+#endif // __LOGIN_DIALOG__
diff --git a/mDNSResponder/Clients/ExplorerPlugin/ReadMe.txt b/mDNSResponder/Clients/ExplorerPlugin/ReadMe.txt
new file mode 100644
index 00000000..2fbe6660
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/ReadMe.txt
@@ -0,0 +1,9 @@
+The DNSServices Explorer Plugin is a vertical Explorer bar. It lets you browse for DNS-SD advertised services directly within Internet Explorer.
+
+This DLL needs to be registered to work. The Visual Studio project automatically registers the DLL after each successful build. If you need to manually register the DLL for some reason, you can execute the following line from the DOS command line prompt ("<path>" is the actual parent path of the DLL):
+
+regsvr32.exe /s /c <path>\ExplorerPlugin.dll
+
+For more information, see the Band Objects topic in the Microsoft Platform SDK documentation and check the following URL:
+
+<http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_adv/bands.asp>
diff --git a/mDNSResponder/Clients/ExplorerPlugin/Resource.h b/mDNSResponder/Clients/ExplorerPlugin/Resource.h
new file mode 100644
index 00000000..aff47a42
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/Resource.h
@@ -0,0 +1,28 @@
+/* -*- 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 the core resources
+
+#include "resource_dll.h"
+
+// Include the non-localizable resources
+
+#include "resource_res.h"
+
+// Include the localizable resources
+
+#include "resource_loc_res.h"
diff --git a/mDNSResponder/Clients/ExplorerPlugin/StdAfx.cpp b/mDNSResponder/Clients/ExplorerPlugin/StdAfx.cpp
new file mode 100644
index 00000000..768fa3f9
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/StdAfx.cpp
@@ -0,0 +1,18 @@
+/* -*- 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"
diff --git a/mDNSResponder/Clients/ExplorerPlugin/StdAfx.h b/mDNSResponder/Clients/ExplorerPlugin/StdAfx.h
new file mode 100644
index 00000000..29608927
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/StdAfx.h
@@ -0,0 +1,41 @@
+/* -*- 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.
+ */
+
+#ifndef __STDAFX__
+#define __STDAFX__
+
+#pragma once
+
+#ifndef VC_EXTRALEAN
+#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
+#endif
+
+#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 <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
+
+#include <winsock2.h>
+#include <afxsock.h> // MFC socket extensions
+
+#endif // __STDAFX__
diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin.manifest b/mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin.manifest
new file mode 100644
index 00000000..90a067ee
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin.manifest
@@ -0,0 +1,22 @@
+<?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="Microsoft.Windows.Wiz97_3"
+ type="win32"
+/>
+<description>Your app description here</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/mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin64.manifest b/mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin64.manifest
new file mode 100644
index 00000000..ddc54b59
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/res/ExplorerPlugin64.manifest
@@ -0,0 +1,22 @@
+<?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="amd64"
+ name="Microsoft.Windows.Wiz97_3"
+ type="win32"
+/>
+<description>Your app description here</description>
+<dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="amd64"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+</dependency>
+</assembly>
diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/about.bmp b/mDNSResponder/Clients/ExplorerPlugin/res/about.bmp
new file mode 100644
index 00000000..ab5e430b
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/res/about.bmp
Binary files differ
diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/button-2k.ico b/mDNSResponder/Clients/ExplorerPlugin/res/button-2k.ico
new file mode 100755
index 00000000..3699b441
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/res/button-2k.ico
Binary files differ
diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/button-xp.ico b/mDNSResponder/Clients/ExplorerPlugin/res/button-xp.ico
new file mode 100755
index 00000000..5d6360ee
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/res/button-xp.ico
Binary files differ
diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/cold.ico b/mDNSResponder/Clients/ExplorerPlugin/res/cold.ico
new file mode 100644
index 00000000..3699b441
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/res/cold.ico
Binary files differ
diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/hot.ico b/mDNSResponder/Clients/ExplorerPlugin/res/hot.ico
new file mode 100644
index 00000000..95b03d05
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/res/hot.ico
Binary files differ
diff --git a/mDNSResponder/Clients/ExplorerPlugin/res/logo.bmp b/mDNSResponder/Clients/ExplorerPlugin/res/logo.bmp
new file mode 100644
index 00000000..f866bd79
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/res/logo.bmp
Binary files differ
diff --git a/mDNSResponder/Clients/ExplorerPlugin/resource_dll.h b/mDNSResponder/Clients/ExplorerPlugin/resource_dll.h
new file mode 100755
index 00000000..fc3c0a99
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/resource_dll.h
@@ -0,0 +1,26 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by ExplorerPlugin.rc
+//
+#define IDS_NAME 106
+#define IDS_WEB_SITES 107
+#define IDS_PRINTERS 109
+#define IDS_MDNSRESPONDER_NOT_AVAILABLE 110
+#define IDS_FIREWALL 111
+#define IDC_COMPONENT 1001
+#define IDC_LEGAL 1002
+#define IDC_COMPONENT_VERSION 1003
+#define IDC_LOGIN_USERNAME_TEXT 1182
+#define IDC_LOGIN_PASSWORD_TEXT 1183
+#define ID_Menu 40001
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 119
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/mDNSResponder/Clients/ExplorerPlugin/resource_loc_res.h b/mDNSResponder/Clients/ExplorerPlugin/resource_loc_res.h
new file mode 100755
index 00000000..6fc2d09b
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/resource_loc_res.h
@@ -0,0 +1,32 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by ExplorerPluginLocRes.rc
+//
+#define IDS_NAME 106
+#define IDS_WEB_SITES 107
+#define IDS_PRINTERS 109
+#define IDS_MDNSRESPONDER_NOT_AVAILABLE 110
+#define IDS_FIREWALL 111
+#define IDD_ABOUT 118
+#define IDR_CONTEXT_MENU 120
+#define IDD_LOGIN 145
+#define IDC_ABOUT_BACKGROUND 146
+#define IDS_ABOUT 147
+#define IDS_ABOUT_URL 148
+#define IDC_COMPONENT 1001
+#define IDC_LEGAL 1002
+#define IDC_COMPONENT_VERSION 1003
+#define IDC_LOGIN_USERNAME_TEXT 1182
+#define IDC_LOGIN_PASSWORD_TEXT 1183
+#define ID_Menu 40001
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 119
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/mDNSResponder/Clients/ExplorerPlugin/resource_res.h b/mDNSResponder/Clients/ExplorerPlugin/resource_res.h
new file mode 100755
index 00000000..f2d4abd4
--- /dev/null
+++ b/mDNSResponder/Clients/ExplorerPlugin/resource_res.h
@@ -0,0 +1,30 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by ExplorerPluginRes.rc
+//
+#define IDS_NAME 106
+#define IDS_WEB_SITES 107
+#define IDS_PRINTERS 109
+#define IDS_MDNSRESPONDER_NOT_AVAILABLE 110
+#define IDS_FIREWALL 111
+#define IDB_LOGO 115
+#define IDI_BUTTON_2K 115
+#define IDI_BUTTON_XP 118
+#define IDB_ABOUT 119
+#define IDC_COMPONENT 1001
+#define IDC_LEGAL 1002
+#define IDC_COMPONENT_VERSION 1003
+#define IDC_LOGIN_USERNAME_TEXT 1182
+#define IDC_LOGIN_PASSWORD_TEXT 1183
+#define ID_Menu 40001
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 119
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/mDNSResponder/Clients/FirefoxExtension/CDNSSDService.cpp b/mDNSResponder/Clients/FirefoxExtension/CDNSSDService.cpp
new file mode 100755
index 00000000..ae57da94
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/CDNSSDService.cpp
@@ -0,0 +1,394 @@
+/* -*- 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 "CDNSSDService.h"
+#include "nsThreadUtils.h"
+#include "nsIEventTarget.h"
+#include "private/pprio.h"
+#include <string>
+#include <stdio.h>
+
+
+NS_IMPL_ISUPPORTS2(CDNSSDService, IDNSSDService, nsIRunnable)
+
+CDNSSDService::CDNSSDService()
+:
+ m_master( 1 ),
+ m_threadPool( NULL ),
+ m_mainRef( NULL ),
+ m_subRef( NULL ),
+ m_listener( NULL ),
+ m_fileDesc( NULL ),
+ m_job( NULL )
+{
+ nsresult err;
+
+ if ( DNSServiceCreateConnection( &m_mainRef ) != kDNSServiceErr_NoError )
+ {
+ err = NS_ERROR_FAILURE;
+ goto exit;
+ }
+
+ if ( ( m_fileDesc = PR_ImportTCPSocket( DNSServiceRefSockFD( m_mainRef ) ) ) == NULL )
+ {
+ err = NS_ERROR_FAILURE;
+ goto exit;
+ }
+
+ if ( ( m_threadPool = PR_CreateThreadPool( 1, 1, 8192 ) ) == NULL )
+ {
+ err = NS_ERROR_FAILURE;
+ goto exit;
+ }
+
+ err = SetupNotifications();
+
+exit:
+
+ if ( err != NS_OK )
+ {
+ Cleanup();
+ }
+}
+
+
+CDNSSDService::CDNSSDService( DNSServiceRef ref, nsISupports * listener )
+:
+ m_master( 0 ),
+ m_threadPool( NULL ),
+ m_mainRef( ref ),
+ m_subRef( ref ),
+ m_listener( listener ),
+ m_fileDesc( NULL ),
+ m_job( NULL )
+{
+}
+
+
+CDNSSDService::~CDNSSDService()
+{
+ Cleanup();
+}
+
+
+void
+CDNSSDService::Cleanup()
+{
+ if ( m_master )
+ {
+ if ( m_job )
+ {
+ PR_CancelJob( m_job );
+ m_job = NULL;
+ }
+
+ if ( m_threadPool != NULL )
+ {
+ PR_ShutdownThreadPool( m_threadPool );
+ m_threadPool = NULL;
+ }
+
+ if ( m_fileDesc != NULL )
+ {
+ PR_Close( m_fileDesc );
+ m_fileDesc = NULL;
+ }
+
+ if ( m_mainRef )
+ {
+ DNSServiceRefDeallocate( m_mainRef );
+ m_mainRef = NULL;
+ }
+ }
+ else
+ {
+ if ( m_subRef )
+ {
+ DNSServiceRefDeallocate( m_subRef );
+ m_subRef = NULL;
+ }
+ }
+}
+
+
+nsresult
+CDNSSDService::SetupNotifications()
+{
+ NS_PRECONDITION( m_threadPool != NULL, "m_threadPool is NULL" );
+ NS_PRECONDITION( m_fileDesc != NULL, "m_fileDesc is NULL" );
+ NS_PRECONDITION( m_job == NULL, "m_job is not NULL" );
+
+ m_iod.socket = m_fileDesc;
+ m_iod.timeout = PR_INTERVAL_MAX;
+ m_job = PR_QueueJob_Read( m_threadPool, &m_iod, Read, this, PR_FALSE );
+ return ( m_job ) ? NS_OK : NS_ERROR_FAILURE;
+}
+
+
+/* IDNSSDService browse (in long interfaceIndex, in AString regtype, in AString domain, in IDNSSDBrowseListener listener); */
+NS_IMETHODIMP
+CDNSSDService::Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM)
+{
+ CDNSSDService * service = NULL;
+ DNSServiceErrorType dnsErr = 0;
+ nsresult err = 0;
+
+ *_retval = NULL;
+
+ if ( !m_mainRef )
+ {
+ err = NS_ERROR_NOT_AVAILABLE;
+ goto exit;
+ }
+
+ try
+ {
+ service = new CDNSSDService( m_mainRef, listener );
+ }
+ catch ( ... )
+ {
+ service = NULL;
+ }
+
+ if ( service == NULL )
+ {
+ err = NS_ERROR_FAILURE;
+ goto exit;
+ }
+
+ dnsErr = DNSServiceBrowse( &service->m_subRef, kDNSServiceFlagsShareConnection, interfaceIndex, NS_ConvertUTF16toUTF8( regtype ).get(), NS_ConvertUTF16toUTF8( domain ).get(), ( DNSServiceBrowseReply ) BrowseReply, service );
+
+ if ( dnsErr != kDNSServiceErr_NoError )
+ {
+ err = NS_ERROR_FAILURE;
+ goto exit;
+ }
+
+ listener->AddRef();
+ service->AddRef();
+ *_retval = service;
+ err = NS_OK;
+
+exit:
+
+ if ( err && service )
+ {
+ delete service;
+ service = NULL;
+ }
+
+ return err;
+}
+
+
+/* IDNSSDService resolve (in long interfaceIndex, in AString name, in AString regtype, in AString domain, in IDNSSDResolveListener listener); */
+NS_IMETHODIMP
+CDNSSDService::Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM)
+{
+ CDNSSDService * service;
+ DNSServiceErrorType dnsErr;
+ nsresult err;
+
+ *_retval = NULL;
+
+ if ( !m_mainRef )
+ {
+ err = NS_ERROR_NOT_AVAILABLE;
+ goto exit;
+ }
+
+ try
+ {
+ service = new CDNSSDService( m_mainRef, listener );
+ }
+ catch ( ... )
+ {
+ service = NULL;
+ }
+
+ if ( service == NULL )
+ {
+ err = NS_ERROR_FAILURE;
+ goto exit;
+ }
+
+ dnsErr = DNSServiceResolve( &service->m_subRef, kDNSServiceFlagsShareConnection, interfaceIndex, NS_ConvertUTF16toUTF8( name ).get(), NS_ConvertUTF16toUTF8( regtype ).get(), NS_ConvertUTF16toUTF8( domain ).get(), ( DNSServiceResolveReply ) ResolveReply, service );
+
+ if ( dnsErr != kDNSServiceErr_NoError )
+ {
+ err = NS_ERROR_FAILURE;
+ goto exit;
+ }
+
+ listener->AddRef();
+ service->AddRef();
+ *_retval = service;
+ err = NS_OK;
+
+exit:
+
+ if ( err && service )
+ {
+ delete service;
+ service = NULL;
+ }
+
+ return err;
+}
+
+
+/* void stop (); */
+NS_IMETHODIMP
+CDNSSDService::Stop()
+{
+ if ( m_subRef )
+ {
+ DNSServiceRefDeallocate( m_subRef );
+ m_subRef = NULL;
+ }
+
+ return NS_OK;
+}
+
+
+void
+CDNSSDService::Read( void * arg )
+{
+ NS_PRECONDITION( arg != NULL, "arg is NULL" );
+
+ NS_DispatchToMainThread( ( CDNSSDService* ) arg );
+}
+
+
+NS_IMETHODIMP
+CDNSSDService::Run()
+{
+ nsresult err = NS_OK;
+
+ NS_PRECONDITION( m_mainRef != NULL, "m_mainRef is NULL" );
+
+ m_job = NULL;
+
+ if ( PR_Available( m_fileDesc ) > 0 )
+ {
+ if ( DNSServiceProcessResult( m_mainRef ) != kDNSServiceErr_NoError )
+ {
+ err = NS_ERROR_FAILURE;
+ }
+ }
+
+ if ( !err )
+ {
+ err = SetupNotifications();
+ }
+
+ return err;
+}
+
+
+void DNSSD_API
+CDNSSDService::BrowseReply
+ (
+ DNSServiceRef sdRef,
+ DNSServiceFlags flags,
+ uint32_t interfaceIndex,
+ DNSServiceErrorType errorCode,
+ const char * serviceName,
+ const char * regtype,
+ const char * replyDomain,
+ void * context
+ )
+{
+ CDNSSDService * self = ( CDNSSDService* ) context;
+
+ // This should never be NULL, but let's be defensive.
+
+ if ( self != NULL )
+ {
+ IDNSSDBrowseListener * listener = ( IDNSSDBrowseListener* ) self->m_listener;
+
+ // Same for this
+
+ if ( listener != NULL )
+ {
+ listener->OnBrowse( self, ( flags & kDNSServiceFlagsAdd ) ? PR_TRUE : PR_FALSE, interfaceIndex, errorCode, NS_ConvertUTF8toUTF16( serviceName ), NS_ConvertUTF8toUTF16( regtype ), NS_ConvertUTF8toUTF16( replyDomain ) );
+ }
+ }
+}
+
+
+void DNSSD_API
+CDNSSDService::ResolveReply
+ (
+ DNSServiceRef sdRef,
+ DNSServiceFlags flags,
+ uint32_t interfaceIndex,
+ DNSServiceErrorType errorCode,
+ const char * fullname,
+ const char * hosttarget,
+ uint16_t port,
+ uint16_t txtLen,
+ const unsigned char * txtRecord,
+ void * context
+ )
+{
+ CDNSSDService * self = ( CDNSSDService* ) context;
+
+ // This should never be NULL, but let's be defensive.
+
+ if ( self != NULL )
+ {
+ IDNSSDResolveListener * listener = ( IDNSSDResolveListener* ) self->m_listener;
+
+ // Same for this
+
+ if ( listener != NULL )
+ {
+ std::string path = "";
+ const void * value = NULL;
+ uint8_t valueLen = 0;
+
+ value = TXTRecordGetValuePtr( txtLen, txtRecord, "path", &valueLen );
+
+ if ( value && valueLen )
+ {
+ char * temp;
+
+ temp = new char[ valueLen + 2 ];
+
+ if ( temp )
+ {
+ char * dst = temp;
+
+ memset( temp, 0, valueLen + 2 );
+
+ if ( ( ( char* ) value )[ 0 ] != '/' )
+ {
+ *dst++ = '/';
+ }
+
+ memcpy( dst, value, valueLen );
+ path = temp;
+ delete [] temp;
+ }
+ }
+
+ listener->OnResolve( self, interfaceIndex, errorCode, NS_ConvertUTF8toUTF16( fullname ), NS_ConvertUTF8toUTF16( hosttarget ) , ntohs( port ), NS_ConvertUTF8toUTF16( path.c_str() ) );
+ }
+ }
+}
+
diff --git a/mDNSResponder/Clients/FirefoxExtension/CDNSSDService.h b/mDNSResponder/Clients/FirefoxExtension/CDNSSDService.h
new file mode 100755
index 00000000..33eaa712
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/CDNSSDService.h
@@ -0,0 +1,104 @@
+/* -*- 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.
+ */
+
+
+#ifndef _CDNSSDSERVICE_H
+#define _CDNSSDSERVICE_H
+
+#include "IDNSSDService.h"
+#include "nsCOMPtr.h"
+#include "nsComponentManagerUtils.h"
+#include "nsIThread.h"
+#include "nsIRunnable.h"
+#include "prtpool.h"
+#include <dns_sd.h>
+#include <stdio.h>
+#include <string>
+
+
+#define CDNSSDSERVICE_CONTRACTID "@apple.com/DNSSDService;1"
+#define CDNSSDSERVICE_CLASSNAME "CDNSSDService"
+#define CDNSSDSERVICE_CID { 0x944ED267, 0x465A, 0x4989, { 0x82, 0x72, 0x7E, 0xE9, 0x28, 0x6C, 0x99, 0xA5 } }
+
+
+/* Header file */
+class CDNSSDService : public IDNSSDService, nsIRunnable
+{
+public:
+NS_DECL_ISUPPORTS
+NS_DECL_IDNSSDSERVICE
+NS_DECL_NSIRUNNABLE
+
+CDNSSDService();
+CDNSSDService( DNSServiceRef mainRef, nsISupports * listener );
+
+virtual ~CDNSSDService();
+
+private:
+
+static void DNSSD_API
+BrowseReply
+(
+ DNSServiceRef sdRef,
+ DNSServiceFlags flags,
+ uint32_t interfaceIndex,
+ DNSServiceErrorType errorCode,
+ const char * serviceName,
+ const char * regtype,
+ const char * replyDomain,
+ void * context
+);
+
+static void DNSSD_API
+ResolveReply
+(
+ DNSServiceRef sdRef,
+ DNSServiceFlags flags,
+ uint32_t interfaceIndex,
+ DNSServiceErrorType errorCode,
+ const char * fullname,
+ const char * hosttarget,
+ uint16_t port,
+ uint16_t txtLen,
+ const unsigned char * txtRecord,
+ void * context
+);
+
+static void
+Read
+(
+ void * arg
+);
+
+nsresult
+SetupNotifications();
+
+void
+Cleanup();
+
+char m_master;
+PRThreadPool * m_threadPool;
+DNSServiceRef m_mainRef;
+DNSServiceRef m_subRef;
+nsISupports * m_listener;
+PRFileDesc * m_fileDesc;
+PRJobIoDesc m_iod;
+PRJob * m_job;
+};
+
+
+#endif
diff --git a/mDNSResponder/Clients/FirefoxExtension/CDNSSDServiceModule.cpp b/mDNSResponder/Clients/FirefoxExtension/CDNSSDServiceModule.cpp
new file mode 100755
index 00000000..3833c5aa
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/CDNSSDServiceModule.cpp
@@ -0,0 +1,37 @@
+/* -*- 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 "nsIGenericFactory.h"
+#include "CDNSSDService.h"
+
+NS_COM_GLUE nsresult
+NS_NewGenericModule2(nsModuleInfo const *info, nsIModule* *result);
+
+NS_GENERIC_FACTORY_CONSTRUCTOR(CDNSSDService)
+
+static nsModuleComponentInfo components[] =
+{
+ {
+ CDNSSDSERVICE_CLASSNAME,
+ CDNSSDSERVICE_CID,
+ CDNSSDSERVICE_CONTRACTID,
+ CDNSSDServiceConstructor,
+ }
+};
+
+NS_IMPL_NSGETMODULE("CDNSSDServiceModule", components)
+
diff --git a/mDNSResponder/Clients/FirefoxExtension/DNSSDService.sln b/mDNSResponder/Clients/FirefoxExtension/DNSSDService.sln
new file mode 100755
index 00000000..68534f46
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/DNSSDService.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DNSSDService", "DNSSDService.vcproj", "{7826EA27-D4CC-4FAA-AD23-DF813823227B}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Debug|Win32.ActiveCfg = Debug|Win32
+ {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Debug|Win32.Build.0 = Debug|Win32
+ {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Release|Win32.ActiveCfg = Release|Win32
+ {7826EA27-D4CC-4FAA-AD23-DF813823227B}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.rc b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.rc
new file mode 100644
index 00000000..998e5e98
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.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", "Firefox Extension Library"
+ VALUE "FileVersion", MASTER_PROD_VERS_STR
+ VALUE "InternalName", "DNSSDService.dll"
+ VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT
+ VALUE "OriginalFilename", "DNSSDService.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/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcproj b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcproj
new file mode 100755
index 00000000..352fdd61
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcproj
@@ -0,0 +1,282 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="FirefoxExtension"
+ ProjectGUID="{7826EA27-D4CC-4FAA-AD23-DF813823227B}"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <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)\DNSSDService.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="..\..\mDNSShared;&quot;$(SRCROOT)\AppleInternal\XULRunner\include\xpcom&quot;;&quot;$(SRCROOT)\AppleInternal\XULRunner\include\nspr&quot;;&quot;$(SRCROOT)\AppleInternal\XULRunner\include\string&quot;;&quot;$(SRCROOT)\AppleInternal\XULRunner\include\pref&quot;;&quot;$(SRCROOT)\AppleInternal\XULRunner\sdk\include&quot;"
+ PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;DNSSDSERVICE_EXPORTS;XP_WIN;XP_WIN32"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile=""
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(IntDir)\vc80.pdb"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ ForcedIncludeFiles=""
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"
+ AdditionalDependencies="$(SRCROOT)\AppleInternal\XULRunner\lib\nspr4.lib $(SRCROOT)\AppleInternal\XULRunner\lib\xpcom.lib $(SRCROOT)\AppleInternal\XULRunner\lib\xpcomglue_s.lib ws2_32.lib ../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib"
+ OutputFile="$(OutDir)\DNSSDService.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""
+ ProgramDatabaseFile=".\$(OutDir)/DNSSDService.pdb"
+ ImportLibrary=".\$(OutDir)/DNSSDService.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\$(OutDir)\DNSSDService.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="xcopy /I/Y $(PlatformName)\$(ConfigurationName)\DNSSDService.dll extension\platform\WINNT\components&#x0D;&#x0A;if not &quot;%RC_XBS%&quot; == &quot;YES&quot; goto END&#x0D;&#x0A;if not exist &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\FirefoxExtension&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\FirefoxExtension&quot;&#x0D;&#x0A;xcopy /E/I/Y &quot;extension&quot; &quot;$(DSTROOT)\Program Files\Bonjour SDK\bin\$(PlatformName)\FirefoxExtension&quot;&#x0D;&#x0A;:END&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <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)\DNSSDService.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="..\..\mDNSShared;&quot;$(SRCROOT)\AppleInternal\XULRunner\include\xpcom&quot;;&quot;$(SRCROOT)\AppleInternal\XULRunner\include\nspr&quot;;&quot;$(SRCROOT)\AppleInternal\XULRunner\include\string&quot;;&quot;$(SRCROOT)\AppleInternal\XULRunner\include\pref&quot;;&quot;$(SRCROOT)\AppleInternal\XULRunner\sdk\include&quot;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;DNSSDSERVICE_EXPORTS;XP_WIN;XP_WIN32"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile=""
+ AssemblerListingLocation="$(IntDir)\"
+ ObjectFile="$(IntDir)\"
+ ProgramDataBaseFileName="$(IntDir)\vc80.pdb"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="3"
+ ForcedIncludeFiles=""
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"
+ AdditionalDependencies="$(SRCROOT)\AppleInternal\XULRunner\lib\nspr4.lib $(SRCROOT)\AppleInternal\XULRunner\lib\xpcom.lib $(SRCROOT)\AppleInternal\XULRunner\lib\xpcomglue_s.lib ws2_32.lib ../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib"
+ OutputFile="$(OutDir)\DNSSDService.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ AdditionalLibraryDirectories=""
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\$(OutDir)\DNSSDService.pdb"
+ ImportLibrary=".\$(OutDir)/DNSSDService.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\$(OutDir)\DNSSDService.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="xcopy /I/Y $(PlatformName)\$(ConfigurationName)\DNSSDService.dll extension\platform\WINNT\components"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath=".\CDNSSDService.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\CDNSSDServiceModule.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath=".\CDNSSDService.h"
+ >
+ </File>
+ <File
+ RelativePath=".\IDNSSDService.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="IDL"
+ Filter="idl"
+ >
+ <File
+ RelativePath=".\IDNSSDService.idl"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath=".\FirefoxExtension.rc"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj
new file mode 100755
index 00000000..1d02a4ec
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{7826EA27-D4CC-4FAA-AD23-DF813823227B}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">DNSSDService</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">DNSSDService</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>.\$(OutDir)DNSSDService.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <AdditionalIncludeDirectories>..\..\mDNSShared;$(SRCROOT)\AppleInternal\XULRunner\include\xpcom;$(SRCROOT)\AppleInternal\XULRunner\include\nspr;$(SRCROOT)\AppleInternal\XULRunner\include\string;$(SRCROOT)\AppleInternal\XULRunner\include\pref;$(SRCROOT)\AppleInternal\XULRunner\sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>NDEBUG;WIN32;_WINDOWS;_USRDLL;DNSSDSERVICE_EXPORTS;XP_WIN;XP_WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>$(SRCROOT)\AppleInternal\XULRunner\lib\nspr4.lib;$(SRCROOT)\AppleInternal\XULRunner\lib\xpcom.lib;$(SRCROOT)\AppleInternal\XULRunner\lib\xpcomglue_s.lib;ws2_32.lib;../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)DNSSDService.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <ProgramDatabaseFile>.\$(OutDir)DNSSDService.pdb</ProgramDatabaseFile>
+ <ImportLibrary>.\$(OutDir)DNSSDService.lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>.\$(OutDir)DNSSDService.bsc</OutputFile>
+ </Bscmake>
+ <PostBuildEvent>
+ <Command>xcopy /I/Y $(Platform)\$(Configuration)\DNSSDService.dll extension\platform\WINNT\components
+if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\FirefoxExtension" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\FirefoxExtension"
+xcopy /E/I/Y "extension" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)\FirefoxExtension"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>.\$(OutDir)DNSSDService.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\mDNSShared;$(SRCROOT)\AppleInternal\XULRunner\include\xpcom;$(SRCROOT)\AppleInternal\XULRunner\include\nspr;$(SRCROOT)\AppleInternal\XULRunner\include\string;$(SRCROOT)\AppleInternal\XULRunner\include\pref;$(SRCROOT)\AppleInternal\XULRunner\sdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;DNSSDSERVICE_EXPORTS;XP_WIN;XP_WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeaderOutputFile>
+ </PrecompiledHeaderOutputFile>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)vc80.pdb</ProgramDataBaseFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>$(SRCROOT)\AppleInternal\XULRunner\lib\nspr4.lib;$(SRCROOT)\AppleInternal\XULRunner\lib\xpcom.lib;$(SRCROOT)\AppleInternal\XULRunner\lib\xpcomglue_s.lib;ws2_32.lib;../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)DNSSDService.dll</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>.\$(OutDir)DNSSDService.pdb</ProgramDatabaseFile>
+ <ImportLibrary>.\$(OutDir)DNSSDService.lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>.\$(OutDir)DNSSDService.bsc</OutputFile>
+ </Bscmake>
+ <PostBuildEvent>
+ <Command>xcopy /I/Y $(Platform)\$(Configuration)\DNSSDService.dll extension\platform\WINNT\components</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="CDNSSDService.cpp" />
+ <ClCompile Include="CDNSSDServiceModule.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="CDNSSDService.h" />
+ <ClInclude Include="IDNSSDService.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuildStep Include="IDNSSDService.idl" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="FirefoxExtension.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\mDNSWindows\DLLStub\DLLStub.vcxproj">
+ <Project>{3a2b6325-3053-4236-84bd-aa9be2e323e5}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj.filters b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj.filters
new file mode 100755
index 00000000..02c1c55a
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/FirefoxExtension.vcxproj.filters
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{89e57cc2-d6b1-4e68-ad57-71223df12d28}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{4d103fe8-9737-47c7-9190-6f7b5666ecf5}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="IDL">
+ <UniqueIdentifier>{4dae44a8-3da8-43c0-a749-2d1e0610c66f}</UniqueIdentifier>
+ <Extensions>idl</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{ac7dbdd1-2fe3-416d-9cab-2d663c05f252}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="CDNSSDService.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="CDNSSDServiceModule.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="CDNSSDService.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="IDNSSDService.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="FirefoxExtension.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuildStep Include="IDNSSDService.idl">
+ <Filter>IDL</Filter>
+ </CustomBuildStep>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/FirefoxExtension/IDNSSDService.h b/mDNSResponder/Clients/FirefoxExtension/IDNSSDService.h
new file mode 100755
index 00000000..e4784d4d
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/IDNSSDService.h
@@ -0,0 +1,263 @@
+/*
+ * DO NOT EDIT. THIS FILE IS GENERATED FROM IDNSSDService.idl
+ */
+
+#ifndef __gen_IDNSSDService_h__
+#define __gen_IDNSSDService_h__
+
+
+#ifndef __gen_nsISupports_h__
+#include "nsISupports.h"
+#endif
+
+/* For IDL files that don't want to include root IDL files. */
+#ifndef NS_NO_VTABLE
+#define NS_NO_VTABLE
+#endif
+class IDNSSDService; /* forward declaration */
+
+
+/* starting interface: IDNSSDBrowseListener */
+#define IDNSSDBROWSELISTENER_IID_STR "27346495-a1ed-458a-a5bc-587df9a26b4f"
+
+#define IDNSSDBROWSELISTENER_IID \
+ {0x27346495, 0xa1ed, 0x458a, \
+ { 0xa5, 0xbc, 0x58, 0x7d, 0xf9, 0xa2, 0x6b, 0x4f }}
+
+class NS_NO_VTABLE NS_SCRIPTABLE IDNSSDBrowseListener : public nsISupports {
+public:
+
+NS_DECLARE_STATIC_IID_ACCESSOR(IDNSSDBROWSELISTENER_IID)
+
+/* void onBrowse (in IDNSSDService service, in boolean add, in long interfaceIndex, in long error, in AString serviceName, in AString regtype, in AString domain); */
+NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain) = 0;
+
+};
+
+NS_DEFINE_STATIC_IID_ACCESSOR(IDNSSDBrowseListener, IDNSSDBROWSELISTENER_IID)
+
+/* Use this macro when declaring classes that implement this interface. */
+#define NS_DECL_IDNSSDBROWSELISTENER \
+ NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString &serviceName, const nsAString &regtype, const nsAString &domain);
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object. */
+#define NS_FORWARD_IDNSSDBROWSELISTENER(_to) \
+ NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString &serviceName, const nsAString &regtype, const nsAString &domain) { return _to OnBrowse(service, add, interfaceIndex, error, serviceName, regtype, domain); }
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
+#define NS_FORWARD_SAFE_IDNSSDBROWSELISTENER(_to) \
+ NS_SCRIPTABLE NS_IMETHOD OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString &serviceName, const nsAString &regtype, const nsAString &domain) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnBrowse(service, add, interfaceIndex, error, serviceName, regtype, domain); }
+
+#if 0
+/* Use the code below as a template for the implementation class for this interface. */
+
+/* Header file */
+class _MYCLASS_ : public IDNSSDBrowseListener
+{
+public:
+NS_DECL_ISUPPORTS
+NS_DECL_IDNSSDBROWSELISTENER
+
+_MYCLASS_();
+
+private:
+~_MYCLASS_();
+
+protected:
+/* additional members */
+};
+
+/* Implementation file */
+NS_IMPL_ISUPPORTS1(_MYCLASS_, IDNSSDBrowseListener)
+
+_MYCLASS_::_MYCLASS_()
+{
+ /* member initializers and constructor code */
+}
+
+_MYCLASS_::~_MYCLASS_()
+{
+ /* destructor code */
+}
+
+/* void onBrowse (in IDNSSDService service, in boolean add, in long interfaceIndex, in long error, in AString serviceName, in AString regtype, in AString domain); */
+NS_IMETHODIMP _MYCLASS_::OnBrowse(IDNSSDService *service, PRBool add, PRInt32 interfaceIndex, PRInt32 error, const nsAString & serviceName, const nsAString & regtype, const nsAString & domain)
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* End of implementation class template. */
+#endif
+
+
+/* starting interface: IDNSSDResolveListener */
+#define IDNSSDRESOLVELISTENER_IID_STR "6620e18f-47f3-47c6-941f-126a5fd4fcf7"
+
+#define IDNSSDRESOLVELISTENER_IID \
+ {0x6620e18f, 0x47f3, 0x47c6, \
+ { 0x94, 0x1f, 0x12, 0x6a, 0x5f, 0xd4, 0xfc, 0xf7 }}
+
+class NS_NO_VTABLE NS_SCRIPTABLE IDNSSDResolveListener : public nsISupports {
+public:
+
+NS_DECLARE_STATIC_IID_ACCESSOR(IDNSSDRESOLVELISTENER_IID)
+
+/* void onResolve (in IDNSSDService service, in long interfaceIndex, in long error, in AString fullname, in AString host, in short port, in AString path); */
+NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path) = 0;
+
+};
+
+NS_DEFINE_STATIC_IID_ACCESSOR(IDNSSDResolveListener, IDNSSDRESOLVELISTENER_IID)
+
+/* Use this macro when declaring classes that implement this interface. */
+#define NS_DECL_IDNSSDRESOLVELISTENER \
+ NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString &fullname, const nsAString &host, PRInt16 port, const nsAString &path);
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object. */
+#define NS_FORWARD_IDNSSDRESOLVELISTENER(_to) \
+ NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString &fullname, const nsAString &host, PRInt16 port, const nsAString &path) { return _to OnResolve(service, interfaceIndex, error, fullname, host, port, path); }
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
+#define NS_FORWARD_SAFE_IDNSSDRESOLVELISTENER(_to) \
+ NS_SCRIPTABLE NS_IMETHOD OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString &fullname, const nsAString &host, PRInt16 port, const nsAString &path) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnResolve(service, interfaceIndex, error, fullname, host, port, path); }
+
+#if 0
+/* Use the code below as a template for the implementation class for this interface. */
+
+/* Header file */
+class _MYCLASS_ : public IDNSSDResolveListener
+{
+public:
+NS_DECL_ISUPPORTS
+NS_DECL_IDNSSDRESOLVELISTENER
+
+_MYCLASS_();
+
+private:
+~_MYCLASS_();
+
+protected:
+/* additional members */
+};
+
+/* Implementation file */
+NS_IMPL_ISUPPORTS1(_MYCLASS_, IDNSSDResolveListener)
+
+_MYCLASS_::_MYCLASS_()
+{
+ /* member initializers and constructor code */
+}
+
+_MYCLASS_::~_MYCLASS_()
+{
+ /* destructor code */
+}
+
+/* void onResolve (in IDNSSDService service, in long interfaceIndex, in long error, in AString fullname, in AString host, in short port, in AString path); */
+NS_IMETHODIMP _MYCLASS_::OnResolve(IDNSSDService *service, PRInt32 interfaceIndex, PRInt32 error, const nsAString & fullname, const nsAString & host, PRInt16 port, const nsAString & path)
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* End of implementation class template. */
+#endif
+
+
+/* starting interface: IDNSSDService */
+#define IDNSSDSERVICE_IID_STR "3a3539ff-f8d8-40b4-8d02-5ea73c51fa12"
+
+#define IDNSSDSERVICE_IID \
+ {0x3a3539ff, 0xf8d8, 0x40b4, \
+ { 0x8d, 0x02, 0x5e, 0xa7, 0x3c, 0x51, 0xfa, 0x12 }}
+
+class NS_NO_VTABLE NS_SCRIPTABLE IDNSSDService : public nsISupports {
+public:
+
+NS_DECLARE_STATIC_IID_ACCESSOR(IDNSSDSERVICE_IID)
+
+/* IDNSSDService browse (in long interfaceIndex, in AString regtype, in AString domain, in IDNSSDBrowseListener listener); */
+NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) = 0;
+
+/* IDNSSDService resolve (in long interfaceIndex, in AString name, in AString regtype, in AString domain, in IDNSSDResolveListener listener); */
+NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) = 0;
+
+/* void stop (); */
+NS_SCRIPTABLE NS_IMETHOD Stop(void) = 0;
+
+};
+
+NS_DEFINE_STATIC_IID_ACCESSOR(IDNSSDService, IDNSSDSERVICE_IID)
+
+/* Use this macro when declaring classes that implement this interface. */
+#define NS_DECL_IDNSSDSERVICE \
+ NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString &regtype, const nsAString &domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM); \
+ NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString &name, const nsAString &regtype, const nsAString &domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM); \
+ NS_SCRIPTABLE NS_IMETHOD Stop(void);
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object. */
+#define NS_FORWARD_IDNSSDSERVICE(_to) \
+ NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString &regtype, const nsAString &domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return _to Browse(interfaceIndex, regtype, domain, listener, _retval); } \
+ NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString &name, const nsAString &regtype, const nsAString &domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return _to Resolve(interfaceIndex, name, regtype, domain, listener, _retval); } \
+ NS_SCRIPTABLE NS_IMETHOD Stop(void) { return _to Stop(); }
+
+/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
+#define NS_FORWARD_SAFE_IDNSSDSERVICE(_to) \
+ NS_SCRIPTABLE NS_IMETHOD Browse(PRInt32 interfaceIndex, const nsAString &regtype, const nsAString &domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Browse(interfaceIndex, regtype, domain, listener, _retval); } \
+ NS_SCRIPTABLE NS_IMETHOD Resolve(PRInt32 interfaceIndex, const nsAString &name, const nsAString &regtype, const nsAString &domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Resolve(interfaceIndex, name, regtype, domain, listener, _retval); } \
+ NS_SCRIPTABLE NS_IMETHOD Stop(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Stop(); }
+
+#if 0
+/* Use the code below as a template for the implementation class for this interface. */
+
+/* Header file */
+class _MYCLASS_ : public IDNSSDService
+{
+public:
+NS_DECL_ISUPPORTS
+NS_DECL_IDNSSDSERVICE
+
+_MYCLASS_();
+
+private:
+~_MYCLASS_();
+
+protected:
+/* additional members */
+};
+
+/* Implementation file */
+NS_IMPL_ISUPPORTS1(_MYCLASS_, IDNSSDService)
+
+_MYCLASS_::_MYCLASS_()
+{
+ /* member initializers and constructor code */
+}
+
+_MYCLASS_::~_MYCLASS_()
+{
+ /* destructor code */
+}
+
+/* IDNSSDService browse (in long interfaceIndex, in AString regtype, in AString domain, in IDNSSDBrowseListener listener); */
+NS_IMETHODIMP _MYCLASS_::Browse(PRInt32 interfaceIndex, const nsAString & regtype, const nsAString & domain, IDNSSDBrowseListener *listener, IDNSSDService **_retval NS_OUTPARAM)
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* IDNSSDService resolve (in long interfaceIndex, in AString name, in AString regtype, in AString domain, in IDNSSDResolveListener listener); */
+NS_IMETHODIMP _MYCLASS_::Resolve(PRInt32 interfaceIndex, const nsAString & name, const nsAString & regtype, const nsAString & domain, IDNSSDResolveListener *listener, IDNSSDService **_retval NS_OUTPARAM)
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* void stop (); */
+NS_IMETHODIMP _MYCLASS_::Stop()
+{
+ return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+/* End of implementation class template. */
+#endif
+
+
+#endif /* __gen_IDNSSDService_h__ */
diff --git a/mDNSResponder/Clients/FirefoxExtension/IDNSSDService.idl b/mDNSResponder/Clients/FirefoxExtension/IDNSSDService.idl
new file mode 100755
index 00000000..d0f62c82
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/IDNSSDService.idl
@@ -0,0 +1,50 @@
+/* -*- 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 "nsISupports.idl"
+
+interface IDNSSDService;
+
+
+[scriptable, function, uuid(27346495-A1ED-458A-A5BC-587DF9A26B4F)]
+interface IDNSSDBrowseListener : nsISupports
+{
+ void
+ onBrowse( in IDNSSDService service, in boolean add, in long interfaceIndex, in long error, in AString serviceName, in AString regtype, in AString domain );
+};
+
+
+[scriptable, function, uuid(6620E18F-47F3-47C6-941F-126A5FD4FCF7)]
+interface IDNSSDResolveListener : nsISupports
+{
+ void
+ onResolve( in IDNSSDService service, in long interfaceIndex, in long error, in AString fullname, in AString host, in short port, in AString path );
+};
+
+
+[scriptable, uuid(3A3539FF-F8D8-40B4-8D02-5EA73C51FA12)]
+interface IDNSSDService : nsISupports
+{
+ IDNSSDService
+ browse( in long interfaceIndex, in AString regtype, in AString domain, in IDNSSDBrowseListener listener );
+
+ IDNSSDService
+ resolve( in long interfaceIndex, in AString name, in AString regtype, in AString domain, in IDNSSDResolveListener listener );
+
+ void
+ stop();
+};
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/chrome.manifest b/mDNSResponder/Clients/FirefoxExtension/extension/chrome.manifest
new file mode 100755
index 00000000..f1daf86c
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/chrome.manifest
@@ -0,0 +1,6 @@
+content bonjour4firefox content/
+locale bonjour4firefox en-US locale/en-US/
+skin bonjour4firefox classic/1.0 skin/
+skin bonjour4firefox classic/1.0 skin-darwin/ os=darwin
+overlay chrome://browser/content/browser.xul chrome://bonjour4firefox/content/browserOverlay.xul
+style chrome://global/content/customizeToolbar.xul chrome://bonjour4firefox/skin/overlay.css
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/components/IDNSSDService.xpt b/mDNSResponder/Clients/FirefoxExtension/extension/components/IDNSSDService.xpt
new file mode 100755
index 00000000..bfda3e58
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/components/IDNSSDService.xpt
Binary files differ
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_bonjour4firefox.png b/mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_bonjour4firefox.png
new file mode 100755
index 00000000..baf8b215
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_bonjour4firefox.png
Binary files differ
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_listImage.png b/mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_listImage.png
new file mode 100755
index 00000000..278efe37
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/content/_internal_listImage.png
Binary files differ
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.css b/mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.css
new file mode 100755
index 00000000..2e7eb2c4
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.css
@@ -0,0 +1,16 @@
+tree.sidebar-placesTree treechildren::-moz-tree-row(selected)
+{
+ background-color: #6f81a9;
+ background-image: url("chrome://browser/skin/places/selected-gradient.png");
+ background-repeat: repeat-x;
+ background-position: bottom left;
+ border-top: 1px solid #979797;
+}
+
+
+tree.sidebar-placesTree treechildren::-moz-tree-separator
+{
+ border-top: 1px solid #505d6d;
+ margin: 0 10px;
+}
+
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.xul b/mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.xul
new file mode 100755
index 00000000..2be0c691
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/content/bonjour4firefox.xul
@@ -0,0 +1,222 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
+<?xml-stylesheet href="browseList.css"?>
+<!DOCTYPE page SYSTEM "chrome://bonjour4firefox/locale/bonjour4firefox.dtd">
+ <page
+ orient="vertical"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ style="background-color: transparent !important; -moz-appearance: none !important;"
+ onload="BonjourBrowser.init()"
+ onunload="BonjourBrowser.cleanup()">
+
+
+ <menupopup id="targetmenu">
+ <menuitem label="&bonjour4firefoxSidebarOpenDefault.label;" value="current"/>
+ <menuitem label="&bonjour4firefoxSidebarOpenTab.label;" value="tab"/>
+ <menuitem label="&bonjour4firefoxSidebarOpenWindow.label;" value="window"/>
+ </menupopup>
+
+ <tree id="treeBrowseList" flex="1" class="sidebar-placesTree" hidecolumnpicker="true">
+ <treecols hide="true">
+ <treecol id="title" flex="1" primary="true" hideheader="true"/>
+ </treecols>
+
+ <treechildren class="sidebar-placesTreechildren" context="targetmenu" flex="1" id="treeChildrenBrowseList">
+ <treeitem>
+ <treerow>
+ <treecell src="chrome://bonjour4firefox/content/_internal_bonjour4firefox.png" label="About Bonjour"/>
+ </treerow>
+ </treeitem>
+ </treechildren>
+ </tree>
+
+ <script><![CDATA[
+
+ var BonjourBrowser =
+ {
+ Service: null,
+ Browse: null,
+ BrowseListener: null,
+ Resolve: null,
+ ResolveListener: null,
+
+ init: function()
+ {
+ document.getElementById("treeChildrenBrowseList").addEventListener( "click", this.listListener, false );
+
+ try
+ {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ const cid = "@apple.com/DNSSDService;1";
+ Service = Components.classes[cid].createInstance();
+ Service = Service.QueryInterface(Components.interfaces.IDNSSDService);
+ }
+ catch (err)
+ {
+ alert(err);
+ return;
+ }
+
+ BrowseListener = this.browseListener;
+ ResolveListener = this.resolveListener;
+
+ try
+ {
+ Browse = Service.browse(0, "_http._tcp", "", BrowseListener );
+ }
+ catch ( err )
+ {
+ alert( err );
+ return;
+ }
+ },
+
+ cleanup: function()
+ {
+ if ( Browse != null )
+ {
+ Browse.stop();
+ Browse = null;
+ }
+ },
+
+
+ browseListener: function( service, add, interfaceIndex, error, serviceName, regtype, domain )
+ {
+ if ( error == 0 )
+ {
+ // First see if we can look this guy up
+
+ var treeView = document.getElementById( 'treeChildrenBrowseList' );
+ var treeItem = null;
+
+ for ( i = 1; i < treeView.childNodes.length; i++ )
+ {
+ var ti = treeView.childNodes[ i ];
+ var tr = ti.childNodes[ 0 ];
+ var tc = tr.childNodes[ 0 ];
+
+ if ( tc.getAttribute( 'label' ) == serviceName )
+ {
+ treeItem = ti;
+ break;
+ }
+ }
+
+ if ( add )
+ {
+ // If we've already seen this guy, then bump up his reference count
+
+ if ( treeItem )
+ {
+ var refcnt = treeItem.getUserData( 'refcnt' );
+ refcnt++;
+ }
+ else
+ {
+ var newTreeItem = document.createElement('treeitem');
+ var newTreeRow = document.createElement('treerow');
+ newTreeRow.setAttribute( 'properties', 'bonjourRow' );
+ var newTreeCell = document.createElement('treecell');
+ newTreeCell.setAttribute( 'label', serviceName );
+ newTreeCell.setAttribute( 'src', 'chrome://bonjour4firefox/content/_internal_bonjour4firefox.png' );
+
+ newTreeItem.appendChild( newTreeRow );
+ newTreeRow.appendChild( newTreeCell );
+ newTreeItem.setUserData( 'interfaceIndex', interfaceIndex, null );
+ newTreeItem.setUserData( 'serviceName', serviceName, null );
+ newTreeItem.setUserData( 'regtype', regtype, null );
+ newTreeItem.setUserData( 'domain', domain, null );
+ newTreeItem.setUserData( 'refcnt', 1, null );
+
+ // Insert in alphabetical order
+
+ var insertBefore = null;
+
+ for ( i = 1; i < treeView.childNodes.length; i++ )
+ {
+ var ti = treeView.childNodes[ i ];
+ var tr = ti.childNodes[ 0 ];
+ var tc = tr.childNodes[ 0 ];
+
+ if ( serviceName.toLowerCase() < tc.getAttribute( 'label' ).toLowerCase() )
+ {
+ insertBefore = ti;
+ break;
+ }
+ }
+
+ if ( insertBefore != null )
+ {
+ treeView.insertBefore( newTreeItem, insertBefore );
+ }
+ else
+ {
+ treeView.appendChild( newTreeItem );
+ }
+ }
+ }
+ else if ( treeItem )
+ {
+ var refcnt = treeItem.getUserData( 'refcnt' );
+
+ if ( --refcnt == 0 )
+ {
+ treeView.removeChild( treeItem );
+ }
+ }
+ }
+ else
+ {
+ alert( 'There was an error browsing for websites: ' + error );
+ }
+ },
+
+ listListener: function( event )
+ {
+ var treeBrowseList = document.getElementById( 'treeBrowseList' );
+
+ if ( treeBrowseList.currentIndex == 0 )
+ {
+ window._content.location="http://www.apple.com/macosx/features/bonjour";
+ }
+ else
+ {
+ var item = treeBrowseList.view.getItemAtIndex(treeBrowseList.currentIndex);
+
+ var interfaceIndex = item.getUserData("interfaceIndex");
+ var serviceName = item.getUserData("serviceName");
+ var regtype = item.getUserData("regtype");
+ var domain = item.getUserData("domain");
+
+ try
+ {
+ Resolve = Service.resolve( interfaceIndex, serviceName, regtype, domain, ResolveListener );
+ }
+ catch ( err )
+ {
+ alert( err );
+ return;
+ }
+ }
+ },
+
+ resolveListener: function( service, interfaceIndex, error, fullname, host, port, path )
+ {
+ if ( error == 0 )
+ {
+ window._content.location='http://' + host + ':' + port + path;
+ }
+ else
+ {
+ alert( 'There was an error resolving ' + fullname );
+ }
+
+ Resolve.stop();
+ },
+ };
+
+ ]]></script>
+</page>
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/content/browserOverlay.xul b/mDNSResponder/Clients/FirefoxExtension/extension/content/browserOverlay.xul
new file mode 100755
index 00000000..3b4d6683
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/content/browserOverlay.xul
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="chrome://bonjour4firefox/skin/overlay.css" type="text/css"?>
+<!DOCTYPE overlay SYSTEM "chrome://bonjour4firefox/locale/bonjour4firefox.dtd">
+<overlay id="bonjour4firefox-overlay"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <script src="overlay.js"/>
+ <stringbundleset id="stringbundleset">
+ <stringbundle id="bonjour4firefox-strings" src="chrome://bonjour4firefox/locale/bonjour4firefox.properties"/>
+ </stringbundleset>
+
+ <menupopup id="viewSidebarMenu">
+ <menuitem observes="viewBonjour4FirefoxSidebar"/>
+ </menupopup>
+
+ <toolbarpalette id="BrowserToolbarPalette">
+ <toolbarbutton id="bonjour4firefox-toolbar-button"
+ label="&bonjour4firefoxToolbar.label;"
+ tooltiptext="&bonjour4firefoxToolbar.tooltip;"
+ oncommand="toggleSidebar('viewBonjour4FirefoxSidebar');"
+ class="toolbarbutton-1 chromeclass-toolbar-additional"/>
+ </toolbarpalette>
+
+ <broadcasterset id="mainBroadcasterSet">
+ <broadcaster id="viewBonjour4FirefoxSidebar"
+ autoCheck="false"
+ label="Bonjour"
+ type="checkbox" group="sidebar"
+ sidebarurl="chrome://bonjour4firefox/content/bonjour4firefox.xul"
+ sidebartitle="&bonjour4firefox.label;"
+ oncommand="toggleSidebar('viewBonjour4FirefoxSidebar');"/>
+ </broadcasterset>
+</overlay>
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/content/overlay.js b/mDNSResponder/Clients/FirefoxExtension/extension/content/overlay.js
new file mode 100755
index 00000000..f989caaf
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/content/overlay.js
@@ -0,0 +1,21 @@
+var bonjour4firefox =
+{
+ onLoad: function()
+ {
+ // initialization code
+ this.initialized = true;
+ this.strings = document.getElementById("bonjour4firefox-strings");
+ },
+ onMenuItemCommand: function(e)
+ {
+ var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService(Components.interfaces.nsIPromptService);
+ promptService.alert(window, this.strings.getString("helloMessageTitle"), this.strings.getString("helloMessage"));
+ },
+ onToolbarButtonCommand: function(e)
+ {
+ // just reuse the function above. you can change this, obviously!
+ bonjour4firefox.onMenuItemCommand(e);
+ }
+};
+
+window.addEventListener("load", function(e) { bonjour4firefox.onLoad(e); }, false);
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/defaults/preferences/bonjour4firefox.js b/mDNSResponder/Clients/FirefoxExtension/extension/defaults/preferences/bonjour4firefox.js
new file mode 100755
index 00000000..2965608a
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/defaults/preferences/bonjour4firefox.js
@@ -0,0 +1,2 @@
+// See http://kb.mozillazine.org/Localize_extension_descriptions
+pref("extensions.bonjour4firefox@apple.com.description", "chrome://bonjour4firefox/locale/bonjour4firefox.properties");
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/install.rdf b/mDNSResponder/Clients/FirefoxExtension/extension/install.rdf
new file mode 100755
index 00000000..37c0955e
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/install.rdf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:em="http://www.mozilla.org/2004/em-rdf#">
+ <Description about="urn:mozilla:install-manifest">
+ <em:id>bonjour4firefox@apple.com</em:id>
+ <em:name>Bonjour Extension for Firefox</em:name>
+ <em:version>1.0</em:version>
+ <em:creator>Apple Inc.</em:creator>
+ <em:description>Bonjour Browsing Extension for Firefox</em:description>
+ <em:iconURL>chrome://bonjour4firefox/content/_internal_bonjour4firefox.png</em:iconURL>
+ <em:targetApplication>
+ <Description>
+ <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- firefox -->
+ <em:minVersion>3.5</em:minVersion>
+ <em:maxVersion>3.6.*</em:maxVersion>
+ </Description>
+ </em:targetApplication>
+ </Description>
+</RDF>
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/locale/en-US/bonjour4firefox.dtd b/mDNSResponder/Clients/FirefoxExtension/extension/locale/en-US/bonjour4firefox.dtd
new file mode 100755
index 00000000..2e133f99
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/locale/en-US/bonjour4firefox.dtd
@@ -0,0 +1,6 @@
+<!ENTITY bonjour4firefox.label "Bonjour">
+<!ENTITY bonjour4firefoxToolbar.label "Bonjour">
+<!ENTITY bonjour4firefoxToolbar.tooltip "Display Bonjour enabled websites">
+<!ENTITY bonjour4firefoxSidebarOpenDefault.label "Open in current window">
+<!ENTITY bonjour4firefoxSidebarOpenTab.label "Open in new tab">
+<!ENTITY bonjour4firefoxSidebarOpenWindow.label "Open in new window">
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/locale/en-US/bonjour4firefox.properties b/mDNSResponder/Clients/FirefoxExtension/extension/locale/en-US/bonjour4firefox.properties
new file mode 100755
index 00000000..afed1abd
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/locale/en-US/bonjour4firefox.properties
@@ -0,0 +1,4 @@
+helloMessage=Hello World!
+helloMessageTitle=Hello
+prefMessage=Int Pref Value: %d
+extensions.bonjour4firefox.description=Bonjour Browsing Extension for Firefox
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/readme.txt b/mDNSResponder/Clients/FirefoxExtension/extension/readme.txt
new file mode 100755
index 00000000..71f1edc7
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/readme.txt
@@ -0,0 +1,21 @@
+This extension was generated by the Extension Wizard at
+http://ted.mielczarek.org/code/mozilla/extensionwiz/ .
+This extension is compatible only with Firefox 1.5 and
+above. Most of the files in this package are based on
+the 'helloworld' extension from the Mozillazine Knowledge Base.
+
+You can build an XPI for installation by running the
+build.sh script located in this folder. For development
+you should do the following:
+ 1. Unzip the entire contents of this package to somewhere,
+ e.g, c:\dev or /home/user/dev
+ 2. Put the full path to the folder (e.g. c:\dev\bonjour4firefox on
+ Windows, /home/user/dev/bonjour4firefox on Linux) in a file named
+ bonjour4firefox@apple.com and copy that file to
+ [your profile folder]\extensions\
+ 3. Restart Firefox.
+
+For more information, see the Mozillazine Knowledge Base:
+http://kb.mozillazine.org/Getting_started_with_extension_development
+
+-Ted Mielczarek <ted.mielczarek@gmail.com>
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/skin-darwin/_internal_toobar-button.png b/mDNSResponder/Clients/FirefoxExtension/extension/skin-darwin/_internal_toobar-button.png
new file mode 100644
index 00000000..2bd6c9dc
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/skin-darwin/_internal_toobar-button.png
Binary files differ
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/skin-darwin/overlay.css b/mDNSResponder/Clients/FirefoxExtension/extension/skin-darwin/overlay.css
new file mode 100644
index 00000000..f5f4a281
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/skin-darwin/overlay.css
@@ -0,0 +1,17 @@
+#bonjour4firefox-hello
+{
+ color: red ! important;
+}
+#bonjour4firefox-toolbar-button
+{
+ list-style-image: url("chrome://bonjour4firefox/skin/_internal_toolbar-button.png");
+ -moz-image-region: rect(0px 36px 23px 0px);
+}
+#bonjour4firefox-toolbar-button[disabled="true"]
+{
+ -moz-image-region: rect(23px 36px 46px 0px);
+}
+#bonjour4firefox-toolbar-button:hover:active
+{
+ -moz-image-region: rect(46px 36px 69px 0px);
+}
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/skin/_internal_toobar-button.png b/mDNSResponder/Clients/FirefoxExtension/extension/skin/_internal_toobar-button.png
new file mode 100755
index 00000000..d99a0c98
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/skin/_internal_toobar-button.png
Binary files differ
diff --git a/mDNSResponder/Clients/FirefoxExtension/extension/skin/overlay.css b/mDNSResponder/Clients/FirefoxExtension/extension/skin/overlay.css
new file mode 100755
index 00000000..b2865603
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/extension/skin/overlay.css
@@ -0,0 +1,21 @@
+#bonjour4firefox-hello
+{
+ color: black ! important;
+}
+#bonjour4firefox-toolbar-button
+{
+ list-style-image: url("chrome://bonjour4firefox/skin/_internal_toolbar-button.png");
+ -moz-image-region: rect(0px 24px 24px 0px);
+}
+#bonjour4firefox-toolbar-button:hover
+{
+ -moz-image-region: rect(24px 24px 48px 0px);
+}
+[iconsize="small"] #bonjour4firefox-toolbar-button
+{
+ -moz-image-region: rect( 0px 40px 16px 24px);
+}
+[iconsize="small"] #bonjour4firefox-toolbar-button:hover
+{
+ -moz-image-region: rect(24px 40px 40px 24px);
+}
diff --git a/mDNSResponder/Clients/FirefoxExtension/readme.txt b/mDNSResponder/Clients/FirefoxExtension/readme.txt
new file mode 100644
index 00000000..f898f330
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/readme.txt
@@ -0,0 +1,16 @@
+Building the Bonjour Firefox Extension on Windows
+
+There is a Visual Studio 2005 project file that will build the extension correctly as long as the Visual Studio environment is setup correctly. This code was built against the 1.9 version of the XULRunner SDK. The Visual Studio environment should be modified to add the include and lib paths of the XULRunner SDK. Specifically, the following include paths should be added to VC++ include directories:
+
+…\xulrunner-sdk\include\xpcom
+…\xulrunner-sdk\include\nspr
+…\xulrunner-sdk\include\string
+…\xulrunner-sdk\include\pref
+…\xulrunner-sdk\sdk\include
+
+The following path should be added to VC++ lib directories:
+
+…\xulrunner-sdk\lib
+
+After the code has been built, it can be installed like any other Firefox extension. Please consult Firefox extension documentation for more information on how to package and install Firefox extensions.
+
diff --git a/mDNSResponder/Clients/FirefoxExtension/resource.h b/mDNSResponder/Clients/FirefoxExtension/resource.h
new file mode 100644
index 00000000..42710b88
--- /dev/null
+++ b/mDNSResponder/Clients/FirefoxExtension/resource.h
@@ -0,0 +1,27 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by FirefoxExtension.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/mDNSResponder/Clients/Java/BrowserApp.java b/mDNSResponder/Clients/Java/BrowserApp.java
new file mode 100644
index 00000000..8f512151
--- /dev/null
+++ b/mDNSResponder/Clients/Java/BrowserApp.java
@@ -0,0 +1,420 @@
+/* -*- Mode: Java; tab-width: 4 -*-
+ *
+ * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
+ * ("Apple") in consideration of your agreement to the following terms, and your
+ * use, installation, modification or redistribution of this Apple software
+ * constitutes acceptance of these terms. If you do not agree with these terms,
+ * please do not use, install, modify or redistribute this Apple software.
+ *
+ * In consideration of your agreement to abide by the following terms, and subject
+ * to these terms, Apple grants you a personal, non-exclusive license, under Apple's
+ * copyrights in this original Apple software (the "Apple Software"), to use,
+ * reproduce, modify and redistribute the Apple Software, with or without
+ * modifications, in source and/or binary forms; provided that if you redistribute
+ * the Apple Software in its entirety and without modifications, you must retain
+ * this notice and the following text and disclaimers in all such redistributions of
+ * the Apple Software. Neither the name, trademarks, service marks or logos of
+ * Apple Computer, Inc. may be used to endorse or promote products derived from the
+ * Apple Software without specific prior written permission from Apple. Except as
+ * expressly stated in this notice, no other rights or licenses, express or implied,
+ * are granted by Apple herein, including but not limited to any patent rights that
+ * may be infringed by your derivative works or by other works in which the Apple
+ * Software may be incorporated.
+ *
+ * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
+ * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ * COMBINATION WITH YOUR PRODUCTS.
+ *
+ * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
+ * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
+ * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ BrowserApp demonstrates how to use DNS-SD to browse for and resolve services.
+
+ To do:
+ - display resolved TXTRecord
+ */
+
+
+import java.awt.*;
+import java.awt.event.*;
+import java.util.*;
+import java.text.*;
+import javax.swing.*;
+import javax.swing.event.*;
+
+import com.apple.dnssd.*;
+
+
+class BrowserApp implements ListSelectionListener, ResolveListener, Runnable
+{
+ static BrowserApp app;
+ JFrame frame;
+ DomainListModel domainList;
+ BrowserListModel servicesList, serviceList;
+ JList domainPane, servicesPane, servicePane;
+ DNSSDService servicesBrowser, serviceBrowser, domainBrowser;
+ JLabel hostLabel, portLabel;
+ String hostNameForUpdate;
+ int portForUpdate;
+
+ public BrowserApp()
+ {
+ frame = new JFrame("DNS-SD Service Browser");
+ frame.addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {System.exit(0);}
+ });
+
+ domainList = new DomainListModel();
+ servicesList = new ServicesBrowserListModel();
+ serviceList = new BrowserListModel();
+
+ try {
+ domainBrowser = DNSSD.enumerateDomains( DNSSD.BROWSE_DOMAINS, 0, domainList);
+
+ servicesBrowser = DNSSD.browse( 0, 0, "_services._dns-sd._udp.", "", servicesList);
+ serviceBrowser = null;
+ }
+ catch ( Exception ex) { terminateWithException( ex); }
+
+ this.setupSubPanes( frame.getContentPane());
+ frame.pack();
+ frame.setVisible(true);
+ }
+
+ protected void setupSubPanes( Container parent)
+ {
+ parent.setLayout( new BoxLayout( parent, BoxLayout.Y_AXIS));
+
+ JPanel browserRow = new JPanel();
+ browserRow.setLayout( new BoxLayout( browserRow, BoxLayout.X_AXIS));
+ domainPane = new JList( domainList);
+ domainPane.addListSelectionListener( this);
+ JScrollPane domainScroller = new JScrollPane( domainPane, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+ browserRow.add( domainScroller);
+ servicesPane = new JList( servicesList);
+ servicesPane.addListSelectionListener( this);
+ JScrollPane servicesScroller = new JScrollPane( servicesPane, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+ browserRow.add( servicesScroller);
+ servicePane = new JList( serviceList);
+ servicePane.addListSelectionListener( this);
+ JScrollPane serviceScroller = new JScrollPane( servicePane, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
+ browserRow.add( serviceScroller);
+
+/*
+ JPanel buttonRow = new JPanel();
+ buttonRow.setLayout( new BoxLayout( buttonRow, BoxLayout.X_AXIS));
+ buttonRow.add( Box.createHorizontalGlue());
+ JButton connectButton = new JButton( "Don't Connect");
+ buttonRow.add( connectButton);
+ buttonRow.add( Box.createRigidArea( new Dimension( 16, 0)));
+*/
+
+ JPanel labelRow = new JPanel();
+ labelRow.setLayout( new BoxLayout( labelRow, BoxLayout.X_AXIS));
+ labelRow.add( new JLabel( " Host: "));
+ hostLabel = new JLabel();
+ labelRow.add( hostLabel);
+ labelRow.add( Box.createRigidArea( new Dimension( 32, 0)));
+ labelRow.add( new JLabel( "Port: "));
+ portLabel = new JLabel();
+ labelRow.add( portLabel);
+ labelRow.add( Box.createHorizontalGlue());
+
+ parent.add( browserRow);
+ parent.add( Box.createRigidArea( new Dimension( 0, 8)));
+ parent.add( labelRow);
+// parent.add( buttonRow);
+ parent.add( Box.createRigidArea( new Dimension( 0, 16)));
+ }
+
+ public void valueChanged( ListSelectionEvent e)
+ {
+ try {
+ if ( e.getSource() == domainPane && !e.getValueIsAdjusting())
+ {
+ int newSel = domainPane.getSelectedIndex();
+ if ( -1 != newSel)
+ {
+ if ( serviceBrowser != null)
+ serviceBrowser.stop();
+ serviceList.removeAllElements();
+ servicesBrowser = DNSSD.browse( 0, 0, "_services._dns-sd._udp.", "", servicesList);
+ }
+ }
+ else if ( e.getSource() == servicesPane && !e.getValueIsAdjusting())
+ {
+ int newSel = servicesPane.getSelectedIndex();
+ if ( serviceBrowser != null)
+ serviceBrowser.stop();
+ serviceList.removeAllElements();
+ if ( -1 != newSel)
+ serviceBrowser = DNSSD.browse( 0, 0, servicesList.getNthRegType( newSel), "", serviceList);
+ }
+ else if ( e.getSource() == servicePane && !e.getValueIsAdjusting())
+ {
+ int newSel = servicePane.getSelectedIndex();
+
+ hostLabel.setText( "");
+ portLabel.setText( "");
+
+ if ( -1 != newSel)
+ {
+ DNSSD.resolve( 0, serviceList.getNthInterface( newSel),
+ serviceList.getNthServiceName( newSel),
+ serviceList.getNthRegType( newSel),
+ serviceList.getNthDomain( newSel),
+ this);
+ }
+ }
+ }
+ catch ( Exception ex) { terminateWithException( ex); }
+ }
+
+ public void run()
+ {
+ hostLabel.setText( hostNameForUpdate);
+ portLabel.setText( String.valueOf( portForUpdate));
+ }
+
+ public void serviceResolved( DNSSDService resolver, int flags, int ifIndex, String fullName,
+ String hostName, int port, TXTRecord txtRecord)
+ {
+ // We want to update GUI on the AWT event dispatching thread, but we can't stop
+ // the resolve from that thread, since stop() is synchronized with this callback.
+ // So, we stop the resolve on this thread, then invokeAndWait on the AWT event thread.
+
+ resolver.stop();
+
+ hostNameForUpdate = hostName;
+ portForUpdate = port;
+
+ try {
+ SwingUtilities.invokeAndWait(this);
+ }
+ catch ( Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void operationFailed( DNSSDService service, int errorCode)
+ {
+ service.stop();
+ // handle failure here
+ }
+
+ protected static void terminateWithException( Exception e)
+ {
+ e.printStackTrace();
+ System.exit( -1);
+ }
+
+ public static void main(String s[])
+ {
+ app = new BrowserApp();
+ }
+}
+
+
+class BrowserListModel extends DefaultListModel implements BrowseListener, Runnable
+{
+ public BrowserListModel()
+ {
+ addCache = new Vector();
+ removeCache = new Vector();
+ }
+
+ /* The Browser invokes this callback when a service is discovered. */
+ public void serviceFound( DNSSDService browser, int flags, int ifIndex,
+ String serviceName, String regType, String domain)
+ {
+ addCache.add( new BrowserListElem( serviceName, domain, regType, ifIndex));
+ if ( ( flags & DNSSD.MORE_COMING) == 0)
+ this.scheduleOnEventThread();
+ }
+
+ public void serviceLost( DNSSDService browser, int flags, int ifIndex,
+ String serviceName, String regType, String domain)
+ {
+ removeCache.add( serviceName);
+ if ( ( flags & DNSSD.MORE_COMING) == 0)
+ this.scheduleOnEventThread();
+ }
+
+ public void run()
+ {
+ while ( removeCache.size() > 0)
+ {
+ String serviceName = (String) removeCache.remove( removeCache.size() - 1);
+ int matchInd = this.findMatching( serviceName); // probably doesn't handle near-duplicates well.
+ if ( matchInd != -1)
+ this.removeElementAt( matchInd);
+ }
+ while ( addCache.size() > 0)
+ {
+ BrowserListElem elem = (BrowserListElem) addCache.remove( addCache.size() - 1);
+ if ( -1 == this.findMatching( elem.fServiceName)) // probably doesn't handle near-duplicates well.
+ this.addInSortOrder( elem);
+ }
+ }
+
+ public void operationFailed( DNSSDService service, int errorCode)
+ {
+ // handle failure here
+ }
+
+ /* The list contains BrowserListElem's */
+ class BrowserListElem
+ {
+ public BrowserListElem( String serviceName, String domain, String type, int ifIndex)
+ { fServiceName = serviceName; fDomain = domain; fType = type; fInt = ifIndex; }
+
+ public String toString() { return fServiceName; }
+
+ public String fServiceName, fDomain, fType;
+ public int fInt;
+ }
+
+ public String getNthServiceName( int n)
+ {
+ BrowserListElem sel = (BrowserListElem) this.get( n);
+ return sel.fServiceName;
+ }
+
+ public String getNthRegType( int n)
+ {
+ BrowserListElem sel = (BrowserListElem) this.get( n);
+ return sel.fType;
+ }
+
+ public String getNthDomain( int n)
+ {
+ BrowserListElem sel = (BrowserListElem) this.get( n);
+ return sel.fDomain;
+ }
+
+ public int getNthInterface( int n)
+ {
+ BrowserListElem sel = (BrowserListElem) this.get( n);
+ return sel.fInt;
+ }
+
+ protected void addInSortOrder( Object obj)
+ {
+ int i;
+ for ( i = 0; i < this.size(); i++)
+ if ( sCollator.compare( obj.toString(), this.getElementAt( i).toString()) < 0)
+ break;
+ this.add( i, obj);
+ }
+
+ protected int findMatching( String match)
+ {
+ for ( int i = 0; i < this.size(); i++)
+ if ( match.equals( this.getElementAt( i).toString()))
+ return i;
+ return -1;
+ }
+
+ protected void scheduleOnEventThread()
+ {
+ try {
+ SwingUtilities.invokeAndWait( this);
+ }
+ catch ( Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ protected Vector removeCache; // list of serviceNames to remove
+ protected Vector addCache; // list of BrowserListElem's to add
+
+ protected static Collator sCollator;
+
+ static // Initialize our static variables
+ {
+ sCollator = Collator.getInstance();
+ sCollator.setStrength( Collator.PRIMARY);
+ }
+}
+
+
+class ServicesBrowserListModel extends BrowserListModel
+{
+ /* The Browser invokes this callback when a service is discovered. */
+ public void serviceFound( DNSSDService browser, int flags, int ifIndex,
+ String serviceName, String regType, String domain)
+ // Overridden to stuff serviceName into regType and make serviceName human-readable.
+ {
+ regType = serviceName + ( regType.startsWith( "_udp.") ? "._udp." : "._tcp.");
+ super.serviceFound( browser, flags, ifIndex, this.mapTypeToName( serviceName), regType, domain);
+ }
+
+ public void serviceLost( DNSSDService browser, int flags, int ifIndex,
+ String serviceName, String regType, String domain)
+ // Overridden to make serviceName human-readable.
+ {
+ super.serviceLost( browser, flags, ifIndex, this.mapTypeToName( serviceName), regType, domain);
+ }
+
+ protected String mapTypeToName( String type)
+ // Convert a registration type into a human-readable string. Returns original string on no-match.
+ {
+ final String[] namedServices = {
+ "_afpovertcp", "Apple File Sharing",
+ "_http", "World Wide Web servers",
+ "_daap", "Digital Audio Access",
+ "_apple-sasl", "Apple Password Servers",
+ "_distcc", "Distributed Compiler nodes",
+ "_finger", "Finger servers",
+ "_ichat", "iChat clients",
+ "_presence", "iChat AV clients",
+ "_ssh", "SSH servers",
+ "_telnet", "Telnet servers",
+ "_workstation", "Macintosh Manager clients",
+ "_bootps", "BootP servers",
+ "_xserveraid", "XServe RAID devices",
+ "_eppc", "Remote AppleEvents",
+ "_ftp", "FTP services",
+ "_tftp", "TFTP services"
+ };
+
+ for ( int i = 0; i < namedServices.length; i+=2)
+ if ( namedServices[i].equals( type))
+ return namedServices[i + 1];
+ return type;
+ }
+}
+
+
+class DomainListModel extends DefaultListModel implements DomainListener
+{
+ /* Called when a domain is discovered. */
+ public void domainFound( DNSSDService domainEnum, int flags, int ifIndex, String domain)
+ {
+ if ( !this.contains( domain))
+ this.addElement( domain);
+ }
+
+ public void domainLost( DNSSDService domainEnum, int flags, int ifIndex, String domain)
+ {
+ if ( this.contains( domain))
+ this.removeElement( domain);
+ }
+
+ public void operationFailed( DNSSDService service, int errorCode)
+ {
+ // handle failure here
+ }
+}
+
diff --git a/mDNSResponder/Clients/Java/BrowserApp.manifest b/mDNSResponder/Clients/Java/BrowserApp.manifest
new file mode 100644
index 00000000..7c392a19
--- /dev/null
+++ b/mDNSResponder/Clients/Java/BrowserApp.manifest
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Main-Class: BrowserApp
diff --git a/mDNSResponder/Clients/Java/DNSSDUnitTest.java b/mDNSResponder/Clients/Java/DNSSDUnitTest.java
new file mode 100644
index 00000000..2b1839a0
--- /dev/null
+++ b/mDNSResponder/Clients/Java/DNSSDUnitTest.java
@@ -0,0 +1,334 @@
+/* -*- Mode: Java; 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.
+ *
+ * DNSSDUnitTest is a simple program that exercises parts of the DNSSD API.
+ */
+
+import com.apple.dnssd.*;
+
+import java.net.*;
+import java.util.*;
+
+
+class DNSSDUnitTest
+{
+ public static final String TEST_TYPE = "_unittest._udp";
+ public static final String WIRE_CHAR_SET = "ISO-8859-1";
+
+ public DNSSDUnitTest fInstance = null;
+
+ public DNSSDUnitTest() throws Exception
+ {
+ fStage = 0;
+ fInstance = this;
+
+ Enumeration en = NetworkInterface.getNetworkInterfaces();
+ while ( en.hasMoreElements())
+ System.out.println( ((NetworkInterface) en.nextElement()).getName());
+ }
+
+ public void testTxtRecord()
+ {
+ byte[] src = { 6, 'a', 't', '=', 'X', 'Y', 'Z' };
+ TXTRecord txtRecord = new TXTRecord( src);
+ String a;
+
+ txtRecord.set( "path", "~/names");
+ txtRecord.set( "rw", (String) null);
+ txtRecord.set( "empty", "");
+ txtRecord.set( "ttl", "4");
+
+ byte[] rawBytes = txtRecord.getRawBytes();
+ System.out.println( ( new String( rawBytes, 0, rawBytes.length)) + " has count " +
+ String.valueOf( txtRecord.size()));
+
+ System.out.println( txtRecord);
+ boolean ttlPresent = txtRecord.contains( "ttl");
+ System.out.println( "ttl is present: " + ( ttlPresent ? "true" : "false"));
+ boolean timeoutPresent = txtRecord.contains( "timeout");
+ System.out.println( "timeout is present: " + ( timeoutPresent ? "true" : "false"));
+
+ txtRecord.set( "path", "~/numbers");
+ System.out.println( txtRecord);
+
+ txtRecord.remove( "ttl");
+ System.out.println( txtRecord);
+
+ txtRecord.remove( "path");
+ System.out.println( txtRecord);
+
+ txtRecord.remove( "at");
+ System.out.println( txtRecord);
+
+ txtRecord.set( "rw", "1");
+ System.out.println( txtRecord);
+ }
+
+ public void run() throws DNSSDException
+ {
+ System.out.println( "Running DNSSD unit test for " + System.getProperty( "user.name"));
+
+ this.testTxtRecord();
+
+ fRegTest = new RegTest();
+ new BrowseTest();
+ new DomainTest();
+ new RegistrarTest();
+
+ this.waitForEnd();
+ }
+
+ protected int fStage;
+ protected RegTest fRegTest;
+
+ public synchronized void bumpStage()
+ {
+ fStage++;
+ this.notifyAll();
+ }
+
+ protected synchronized void waitForEnd()
+ {
+ int stage = fStage;
+ while ( stage == fStage)
+ {
+ try {
+ wait();
+ } catch (InterruptedException e) {}
+ }
+ }
+
+ public static void main(String s[])
+ {
+ try {
+ new DNSSDUnitTest().run();
+ }
+ catch ( Exception e) { terminateWithException( e); }
+ }
+
+ protected static void terminateWithException( Exception e)
+ {
+ e.printStackTrace();
+ System.exit( -1);
+ }
+}
+
+class TermReporter implements BaseListener
+{
+ public void operationFailed( DNSSDService service, int errorCode)
+ {
+ System.out.println( this.getClass().getName() + " encountered error " + String.valueOf( errorCode));
+ }
+
+ protected void finalize() throws Throwable
+ {
+ System.out.println( "Instance of " + this.getClass().getName() + " has been destroyed");
+ }
+}
+
+class RegTest extends TermReporter implements RegisterListener
+{
+ public static final int TEST_PORT = 5678;
+
+ public RegTest() throws DNSSDException
+ {
+ fReg = DNSSD.register( 0, 0, "Test service", DNSSDUnitTest.TEST_TYPE, "", "", TEST_PORT, null, this);
+ }
+
+ public void serviceRegistered( DNSSDRegistration registration, int flags, String serviceName,
+ String regType, String domain)
+ {
+ String s = "RegTest result flags:" + String.valueOf( flags) +
+ " serviceName:" + serviceName + " regType:" + regType + " domain:" + domain;
+ System.out.println( s);
+
+ try {
+ new DupRegTest();
+
+ byte[] kResponsiblePerson = { 'c','o','o','k','i','e',' ','m','o','n','s','t','e','r' };
+ fReg.addRecord( 0, 17 /*ns_t_rp*/, kResponsiblePerson, 3600);
+ new QueryTest( 0, 0, "Test service", 17 /*ns_t_rp*/, 1);
+ } catch( Exception e) { e.printStackTrace(); }
+ }
+
+ protected DNSSDRegistration fReg;
+}
+
+class DupRegTest extends TermReporter implements RegisterListener
+{
+ public static final int TEST_PORT = 5678;
+
+ public DupRegTest() throws DNSSDException
+ {
+ DNSSD.register( DNSSD.NO_AUTO_RENAME | DNSSD.UNIQUE, 0, "Test service", DNSSDUnitTest.TEST_TYPE, "", "", TEST_PORT + 1, null, this);
+ }
+
+ public void serviceRegistered( DNSSDRegistration registration, int flags, String serviceName,
+ String regType, String domain)
+ {
+ System.out.println( "Oik - registered a duplicate!");
+ String s = "DupRegTest result flags:" + String.valueOf( flags) +
+ " serviceName:" + serviceName + " regType:" + regType + " domain:" + domain;
+ System.out.println( s);
+ }
+}
+
+class BrowseTest extends TermReporter implements BrowseListener
+{
+ public BrowseTest()
+ {
+ try {
+ DNSSD.browse( 0, 0, DNSSDUnitTest.TEST_TYPE, "", this);
+ } catch( Exception e) { e.printStackTrace(); }
+ }
+
+ public void serviceFound( DNSSDService browser, int flags, int ifIndex,
+ String serviceName, String regType, String domain)
+ {
+ String s = "BrowseTest found flags:" + String.valueOf( flags) +
+ " ifIndex:" + String.valueOf( ifIndex) +
+ " serviceName:" + serviceName + " regType:" + regType + " domain:" + domain;
+ System.out.println( s);
+
+ System.out.println( "Resolving " + serviceName);
+ new ResolveTest( 0, ifIndex, serviceName, regType, domain);
+ }
+
+ public void serviceLost( DNSSDService browser, int flags, int ifIndex,
+ String serviceName, String regType, String domain)
+ {
+ String s = "BrowseTest lost flags:" + String.valueOf( flags) +
+ " ifIndex:" + String.valueOf( ifIndex) +
+ " serviceName:" + serviceName + " regType:" + regType + " domain:" + domain;
+ System.out.println( s);
+ }
+
+ public void operationFailed( DNSSDService service, int errorCode)
+ {
+ System.out.println( "Browse failed " + String.valueOf( errorCode));
+ }
+}
+
+class DomainTest extends TermReporter implements DomainListener
+{
+ public DomainTest()
+ {
+ try {
+ DNSSD.enumerateDomains( DNSSD.BROWSE_DOMAINS, 0, this);
+ } catch( Exception e) { e.printStackTrace(); }
+ }
+
+ public void domainFound( DNSSDService enumerator, int flags, int ifIndex, String domain)
+ {
+ String s = "Domain found flags:" + String.valueOf( flags) +
+ " ifIndex:" + String.valueOf( ifIndex) +
+ " domain:" + domain;
+ System.out.println( s);
+ }
+
+ public void domainLost( DNSSDService enumerator, int flags, int ifIndex, String domain)
+ {
+ String s = "Domain lost flags:" + String.valueOf( flags) +
+ " ifIndex:" + String.valueOf( ifIndex) +
+ " domain:" + domain;
+ System.out.println( s);
+ }
+
+ public void operationFailed( DNSSDService service, int errorCode)
+ {
+ System.out.println( "Domain enum op failed " + String.valueOf( errorCode));
+ }
+}
+
+class ResolveTest extends TermReporter implements ResolveListener
+{
+ public ResolveTest( int flags, int ifIndex, String serviceName, String regType,
+ String domain)
+ {
+ try {
+ DNSSD.resolve( flags, ifIndex, serviceName, regType, domain, this);
+ } catch( Exception e) { e.printStackTrace(); }
+ }
+
+ public void serviceResolved( DNSSDService resolver, int flags, int ifIndex, String fullName,
+ String hostName, int port, TXTRecord txtRecord)
+ {
+ String a;
+ String s = "ResolveTest result flags:" + String.valueOf( flags) +
+ " ifIndex:" + String.valueOf( ifIndex) +
+ " fullName:" + fullName + " hostName:" + hostName + " port:" + String.valueOf( port);
+ for ( int i=0; null != ( a = txtRecord.getKey( i)); i++)
+ s += " attr/val " + String.valueOf( i) + ": " + a + "," + txtRecord.getValueAsString( i);
+
+ System.out.println( s);
+
+ System.out.println( "Querying " + hostName);
+ new QueryTest( 0, ifIndex, hostName, 1 /* ns_t_a */, 1 /* ns_c_in */);
+ }
+}
+
+class QueryTest extends TermReporter implements QueryListener
+{
+ public QueryTest( int flags, int ifIndex, String serviceName, int rrtype, int rrclass)
+ {
+ try {
+ DNSSD.queryRecord( flags, ifIndex, serviceName, rrtype, rrclass, this);
+ } catch( Exception e) { e.printStackTrace(); }
+ }
+
+ public void queryAnswered( DNSSDService query, int flags, int ifIndex, String fullName,
+ int rrtype, int rrclass, byte[] rdata, int ttl)
+ {
+ String s = "QueryTest result flags:" + String.valueOf( flags) +
+ " ifIndex:" + String.valueOf( ifIndex) +
+ " fullName:" + fullName + " rrtype:" + String.valueOf( rrtype) +
+ " rrclass:" + String.valueOf( rrclass) + " ttl:" + String.valueOf( ttl);
+ System.out.println( s);
+
+ try {
+ String dataTxt = new String( rdata, 0, rdata.length, DNSSDUnitTest.WIRE_CHAR_SET);
+ System.out.println( "Query data is:" + dataTxt);
+ } catch( Exception e) { e.printStackTrace(); }
+ }
+}
+
+class RegistrarTest extends TermReporter implements RegisterRecordListener
+{
+ public RegistrarTest()
+ {
+ try {
+ byte[] kResponsiblePerson = { 'g','r','o','v','e','r' };
+ fRegistrar = DNSSD.createRecordRegistrar( this);
+ fRegistrar.registerRecord( DNSSD.UNIQUE, 0,
+ "test.registrartest.local", 17 /*ns_t_rp*/, 1, kResponsiblePerson, 3600);
+ } catch( Exception e) { e.printStackTrace(); }
+ }
+
+ public void recordRegistered( DNSRecord record, int flags)
+ {
+ String s = "RegistrarTest result flags:" + String.valueOf( flags);
+ System.out.println( s);
+
+ try {
+ byte[] kResponsiblePerson = { 'e','l','m','o' };
+ record.update( 0, kResponsiblePerson, 3600);
+ record.remove();
+ } catch( Exception e) { e.printStackTrace(); }
+ }
+
+ protected DNSSDRecordRegistrar fRegistrar;
+}
+
diff --git a/mDNSResponder/Clients/Java/JavaSamples.vcproj b/mDNSResponder/Clients/Java/JavaSamples.vcproj
new file mode 100755
index 00000000..fbb68257
--- /dev/null
+++ b/mDNSResponder/Clients/Java/JavaSamples.vcproj
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="JavaSamples"
+ ProjectGUID="{A987A0C1-344F-475C-869C-F082EB11EEBA}"
+ Keyword="MakeFileProj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ <Platform
+ Name="x64"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="0"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="nmake /f nmakefile DEBUG=1 DNS_SD=..\..\mDNSWindows\Java\build\debug\dns_sd.jar"
+ ReBuildCommandLine="nmake /f nmakefile DEBUG=1 DNS_SD=..\..\mDNSWindows\Java\build\debug\dns_sd.jar"
+ CleanCommandLine="nmake /f nmakefile DEBUG=1 CLEAN"
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="0"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="nmake /f nmakefile DNS_SD=..\..\mDNSWindows\Java\build\prod\dns_sd.jar"
+ ReBuildCommandLine="nmake /f nmakefile DNS_SD=..\..\mDNSWindows\Java\build\prod\dns_sd.jar"
+ CleanCommandLine="nmake /f nmakefile CLEAN"
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="0"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="nmake /f nmakefile DEBUG=1 DNS_SD=..\..\mDNSWindows\Java\build\debug\dns_sd.jar"
+ ReBuildCommandLine="nmake /f nmakefile DEBUG=1 DNS_SD=..\..\mDNSWindows\Java\build\debug\dns_sd.jar"
+ CleanCommandLine="nmake /f nmakefile DEBUG=1 CLEAN"
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="0"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
+ >
+ <Tool
+ Name="VCNMakeTool"
+ BuildCommandLine="nmake /f nmakefile DNS_SD=..\..\mDNSWindows\Java\build\prod\dns_sd.jar"
+ ReBuildCommandLine="nmake /f nmakefile DNS_SD=..\..\mDNSWindows\Java\build\prod\dns_sd.jar"
+ CleanCommandLine="nmake /f nmakefile CLEAN"
+ Output=""
+ PreprocessorDefinitions=""
+ IncludeSearchPath=""
+ ForcedIncludes=""
+ AssemblySearchPath=""
+ ForcedUsingAssemblies=""
+ CompileAsManaged=""
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/mDNSResponder/Clients/Java/JavaSamples.vcxproj b/mDNSResponder/Clients/Java/JavaSamples.vcxproj
new file mode 100755
index 00000000..046cbd5d
--- /dev/null
+++ b/mDNSResponder/Clients/Java/JavaSamples.vcxproj
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{A987A0C1-344F-475C-869C-F082EB11EEBA}</ProjectGuid>
+ <Keyword>MakeFileProj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>
+ <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nmake /f nmakefile DEBUG=1 DNS_SD=..\..\mDNSWindows\Java\build\debug\dns_sd.jar</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nmake /f nmakefile DEBUG=1 DNS_SD=..\..\mDNSWindows\Java\build\debug\dns_sd.jar</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">nmake /f nmakefile DEBUG=1 CLEAN</NMakeCleanCommandLine>
+ <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
+ <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+ <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+ <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Release\</IntDir>
+ <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nmake /f nmakefile DNS_SD=..\..\mDNSWindows\Java\build\prod\dns_sd.jar</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nmake /f nmakefile DNS_SD=..\..\mDNSWindows\Java\build\prod\dns_sd.jar</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">nmake /f nmakefile CLEAN</NMakeCleanCommandLine>
+ <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
+ <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+ <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+ <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">nmake /f nmakefile DEBUG=1 DNS_SD=..\..\mDNSWindows\Java\build\debug\dns_sd.jar</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">nmake /f nmakefile DEBUG=1 DNS_SD=..\..\mDNSWindows\Java\build\debug\dns_sd.jar</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">nmake /f nmakefile DEBUG=1 CLEAN</NMakeCleanCommandLine>
+ <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
+ <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+ <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+ <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">nmake /f nmakefile DNS_SD=..\..\mDNSWindows\Java\build\prod\dns_sd.jar</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">nmake /f nmakefile DNS_SD=..\..\mDNSWindows\Java\build\prod\dns_sd.jar</NMakeReBuildCommandLine>
+ <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">nmake /f nmakefile CLEAN</NMakeCleanCommandLine>
+ <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
+ <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
+ <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath>
+ <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeForcedIncludes)</NMakeForcedIncludes>
+ <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath>
+ <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies>
+ </PropertyGroup>
+ <ItemDefinitionGroup>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\mDNSWindows\Java\Java.vcxproj">
+ <Project>{9ce2568a-3170-41c6-9f20-a0188a9ec114}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/Java/SimpleChat.java b/mDNSResponder/Clients/Java/SimpleChat.java
new file mode 100644
index 00000000..a1fee5c0
--- /dev/null
+++ b/mDNSResponder/Clients/Java/SimpleChat.java
@@ -0,0 +1,333 @@
+/* -*- Mode: Java; tab-width: 4 -*-
+ *
+ * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
+ * ("Apple") in consideration of your agreement to the following terms, and your
+ * use, installation, modification or redistribution of this Apple software
+ * constitutes acceptance of these terms. If you do not agree with these terms,
+ * please do not use, install, modify or redistribute this Apple software.
+ *
+ * In consideration of your agreement to abide by the following terms, and subject
+ * to these terms, Apple grants you a personal, non-exclusive license, under Apple's
+ * copyrights in this original Apple software (the "Apple Software"), to use,
+ * reproduce, modify and redistribute the Apple Software, with or without
+ * modifications, in source and/or binary forms; provided that if you redistribute
+ * the Apple Software in its entirety and without modifications, you must retain
+ * this notice and the following text and disclaimers in all such redistributions of
+ * the Apple Software. Neither the name, trademarks, service marks or logos of
+ * Apple Computer, Inc. may be used to endorse or promote products derived from the
+ * Apple Software without specific prior written permission from Apple. Except as
+ * expressly stated in this notice, no other rights or licenses, express or implied,
+ * are granted by Apple herein, including but not limited to any patent rights that
+ * may be infringed by your derivative works or by other works in which the Apple
+ * Software may be incorporated.
+ *
+ * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
+ * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ * COMBINATION WITH YOUR PRODUCTS.
+ *
+ * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
+ * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
+ * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ SimpleChat is a simple peer-to-peer chat program that demonstrates
+ DNS-SD registration, browsing, resolving and record-querying.
+
+ To do:
+ - implement better coloring algorithm
+ */
+
+
+import java.awt.*;
+import java.awt.event.*;
+import java.text.*;
+import java.net.*;
+import javax.swing.*;
+import javax.swing.event.*;
+import javax.swing.text.*;
+
+import com.apple.dnssd.*;
+
+
+class SimpleChat implements ResolveListener, RegisterListener, QueryListener,
+ ActionListener, ItemListener, Runnable
+{
+ Document textDoc; // Holds all the chat text
+ JTextField inputField; // Holds a pending chat response
+ String ourName; // name used to identify this user in chat
+ DNSSDService browser; // object that actively browses for other chat clients
+ DNSSDService resolver; // object that resolves other chat clients
+ DNSSDRegistration registration; // object that maintains our connection advertisement
+ JComboBox targetPicker; // Indicates who we're talking to
+ TargetListModel targetList; // and its list model
+ JButton sendButton; // Will send text in inputField to target
+ InetAddress buddyAddr; // and address
+ int buddyPort; // and port
+ DatagramPacket dataPacket; // Inbound data packet
+ DatagramSocket outSocket; // Outbound data socket
+ SimpleAttributeSet textAttribs;
+
+ static final String kChatExampleRegType = "_p2pchat._udp";
+ static final String kWireCharSet = "ISO-8859-1";
+
+ public SimpleChat() throws Exception
+ {
+ JFrame frame = new JFrame("SimpleChat");
+ frame.addWindowListener(new WindowAdapter() {
+ public void windowClosing(WindowEvent e) {System.exit(0);}
+ });
+
+ ourName = System.getProperty( "user.name");
+ targetList = new TargetListModel();
+ textAttribs = new SimpleAttributeSet();
+ DatagramSocket inSocket = new DatagramSocket();
+ dataPacket = new DatagramPacket( new byte[ 4096], 4096);
+ outSocket = new DatagramSocket();
+
+ this.setupSubPanes( frame.getContentPane(), frame.getRootPane());
+ frame.pack();
+ frame.setVisible(true);
+ inputField.requestFocusInWindow();
+
+ browser = DNSSD.browse( 0, 0, kChatExampleRegType, "", new SwingBrowseListener( targetList));
+
+ registration = DNSSD.register( 0, 0, ourName, kChatExampleRegType, "", "", inSocket.getLocalPort(), null, this);
+
+ new ListenerThread( this, inSocket, dataPacket).start();
+ }
+
+ protected void setupSubPanes( Container parent, JRootPane rootPane)
+ {
+ parent.setLayout( new BoxLayout( parent, BoxLayout.Y_AXIS));
+
+ JPanel textRow = new JPanel();
+ textRow.setLayout( new BoxLayout( textRow, BoxLayout.X_AXIS));
+ textRow.add( Box.createRigidArea( new Dimension( 16, 0)));
+ JEditorPane textPane = new JEditorPane( "text/html", "<BR>");
+ textPane.setPreferredSize( new Dimension( 400, 300));
+ textPane.setEditable( false);
+ JScrollPane textScroller = new JScrollPane( textPane);
+ textRow.add( textScroller);
+ textRow.add( Box.createRigidArea( new Dimension( 16, 0)));
+ textDoc = textPane.getDocument();
+
+ JPanel addressRow = new JPanel();
+ addressRow.setLayout( new BoxLayout( addressRow, BoxLayout.X_AXIS));
+ targetPicker = new JComboBox( targetList);
+ targetPicker.addItemListener( this);
+ addressRow.add( Box.createRigidArea( new Dimension( 16, 0)));
+ addressRow.add( new JLabel( "Talk to: "));
+ addressRow.add( targetPicker);
+ addressRow.add( Box.createHorizontalGlue());
+
+ JPanel buttonRow = new JPanel();
+ buttonRow.setLayout( new BoxLayout( buttonRow, BoxLayout.X_AXIS));
+ buttonRow.add( Box.createRigidArea( new Dimension( 16, 0)));
+ inputField = new JTextField();
+ // prevent inputField from hijacking <Enter> key
+ inputField.getKeymap().removeKeyStrokeBinding( KeyStroke.getKeyStroke( KeyEvent.VK_ENTER, 0));
+ buttonRow.add( inputField);
+ sendButton = new JButton( "Send");
+ buttonRow.add( Box.createRigidArea( new Dimension( 8, 0)));
+ buttonRow.add( sendButton);
+ buttonRow.add( Box.createRigidArea( new Dimension( 16, 0)));
+ rootPane.setDefaultButton( sendButton);
+ sendButton.addActionListener( this);
+ sendButton.setEnabled( false);
+
+ parent.add( Box.createRigidArea( new Dimension( 0, 16)));
+ parent.add( textRow);
+ parent.add( Box.createRigidArea( new Dimension( 0, 8)));
+ parent.add( addressRow);
+ parent.add( Box.createRigidArea( new Dimension( 0, 8)));
+ parent.add( buttonRow);
+ parent.add( Box.createRigidArea( new Dimension( 0, 16)));
+ }
+
+ public void serviceRegistered( DNSSDRegistration registration, int flags,
+ String serviceName, String regType, String domain)
+ {
+ ourName = serviceName; // might have been renamed on collision
+ }
+
+ public void operationFailed( DNSSDService service, int errorCode)
+ {
+ System.out.println( "Service reported error " + String.valueOf( errorCode));
+ }
+
+ public void serviceResolved( DNSSDService resolver, int flags, int ifIndex, String fullName,
+ String hostName, int port, TXTRecord txtRecord)
+ {
+ buddyPort = port;
+ try {
+ // Start a record query to obtain IP address from hostname
+ DNSSD.queryRecord( 0, ifIndex, hostName, 1 /* ns_t_a */, 1 /* ns_c_in */,
+ new SwingQueryListener( this));
+ }
+ catch ( Exception e) { terminateWithException( e); }
+ resolver.stop();
+ }
+
+ public void queryAnswered( DNSSDService query, int flags, int ifIndex, String fullName,
+ int rrtype, int rrclass, byte[] rdata, int ttl)
+ {
+ try {
+ buddyAddr = InetAddress.getByAddress( rdata);
+ }
+ catch ( Exception e) { terminateWithException( e); }
+ sendButton.setEnabled( true);
+ }
+
+ public void actionPerformed( ActionEvent e) // invoked when Send button is hit
+ {
+ try
+ {
+ String sendString = ourName + ": " + inputField.getText();
+ byte[] sendData = sendString.getBytes( kWireCharSet);
+ outSocket.send( new DatagramPacket( sendData, sendData.length, buddyAddr, buddyPort));
+ StyleConstants.setForeground( textAttribs, Color.black);
+ textDoc.insertString( textDoc.getLength(), inputField.getText() + "\n", textAttribs);
+ inputField.setText( "");
+ }
+ catch ( Exception exception) { terminateWithException( exception); }
+ }
+
+ public void itemStateChanged( ItemEvent e) // invoked when Target selection changes
+ {
+ sendButton.setEnabled( false);
+ if ( e.getStateChange() == ItemEvent.SELECTED)
+ {
+ try {
+ TargetListElem sel = (TargetListElem) targetList.getSelectedItem();
+ resolver = DNSSD.resolve( 0, sel.fInt, sel.fServiceName, sel.fType, sel.fDomain, this);
+ }
+ catch ( Exception exception) { terminateWithException( exception); }
+ }
+ }
+
+ public void run() // invoked on event thread when inbound packet arrives
+ {
+ try
+ {
+ String inMessage = new String( dataPacket.getData(), 0, dataPacket.getLength(), kWireCharSet);
+ StyleConstants.setForeground( textAttribs, this.getColorFor( dataPacket.getData(), dataPacket.getLength()));
+ textDoc.insertString( textDoc.getLength(), inMessage + "\n", textAttribs);
+ }
+ catch ( Exception e) { terminateWithException( e); }
+ }
+
+ protected Color getColorFor( byte[] chars, int length)
+ // Produce a mapping from a string to a color, suitable for text display
+ {
+ int rgb = 0;
+ for ( int i=0; i < length && chars[i] != ':'; i++)
+ rgb = rgb ^ ( (int) chars[i] << (i%3+2) * 8);
+ return new Color( rgb & 0x007F7FFF); // mask off high bits so it is a dark color
+
+// for ( int i=0; i < length && chars[i] != ':'; i++)
+
+ }
+
+ protected static void terminateWithException( Exception e)
+ {
+ e.printStackTrace();
+ System.exit( -1);
+ }
+
+ public static void main(String s[])
+ {
+ try {
+ new SimpleChat();
+ }
+ catch ( Exception e) { terminateWithException( e); }
+ }
+}
+
+
+
+class TargetListElem
+{
+ public TargetListElem( String serviceName, String domain, String type, int ifIndex)
+ { fServiceName = serviceName; fDomain = domain; fType = type; fInt = ifIndex; }
+
+ public String toString() { return fServiceName; }
+
+ public String fServiceName, fDomain, fType;
+ public int fInt;
+}
+
+class TargetListModel extends DefaultComboBoxModel implements BrowseListener
+{
+ /* The Browser invokes this callback when a service is discovered. */
+ public void serviceFound( DNSSDService browser, int flags, int ifIndex,
+ String serviceName, String regType, String domain)
+ {
+ TargetListElem match = this.findMatching( serviceName); // probably doesn't handle near-duplicates well.
+
+ if ( match == null)
+ this.addElement( new TargetListElem( serviceName, domain, regType, ifIndex));
+ }
+
+ /* The Browser invokes this callback when a service disappears. */
+ public void serviceLost( DNSSDService browser, int flags, int ifIndex,
+ String serviceName, String regType, String domain)
+ {
+ TargetListElem match = this.findMatching( serviceName); // probably doesn't handle near-duplicates well.
+
+ if ( match != null)
+ this.removeElement( match);
+ }
+
+ /* The Browser invokes this callback when a service disappears. */
+ public void operationFailed( DNSSDService service, int errorCode)
+ {
+ System.out.println( "Service reported error " + String.valueOf( errorCode));
+ }
+
+ protected TargetListElem findMatching( String match)
+ {
+ for ( int i = 0; i < this.getSize(); i++)
+ if ( match.equals( this.getElementAt( i).toString()))
+ return (TargetListElem) this.getElementAt( i);
+ return null;
+ }
+
+}
+
+
+// A ListenerThread runs its owner when datagram packet p appears on socket s.
+class ListenerThread extends Thread
+{
+ public ListenerThread( Runnable owner, DatagramSocket s, DatagramPacket p)
+ { fOwner = owner; fSocket = s; fPacket = p; }
+
+ public void run()
+ {
+ while ( true )
+ {
+ try
+ {
+ fSocket.receive( fPacket);
+ SwingUtilities.invokeAndWait( fOwner); // process data on main thread
+ }
+ catch( Exception e)
+ {
+ break; // terminate thread
+ }
+ }
+ }
+
+ protected Runnable fOwner;
+ protected DatagramSocket fSocket;
+ protected DatagramPacket fPacket;
+}
+
+
+
diff --git a/mDNSResponder/Clients/Java/SimpleChat.manifest b/mDNSResponder/Clients/Java/SimpleChat.manifest
new file mode 100644
index 00000000..45c02025
--- /dev/null
+++ b/mDNSResponder/Clients/Java/SimpleChat.manifest
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+Main-Class: SimpleChat
diff --git a/mDNSResponder/Clients/Java/SwingBrowseListener.java b/mDNSResponder/Clients/Java/SwingBrowseListener.java
new file mode 100644
index 00000000..db971b2b
--- /dev/null
+++ b/mDNSResponder/Clients/Java/SwingBrowseListener.java
@@ -0,0 +1,124 @@
+/* -*- Mode: Java; tab-width: 4 -*-
+ *
+ * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
+ * ("Apple") in consideration of your agreement to the following terms, and your
+ * use, installation, modification or redistribution of this Apple software
+ * constitutes acceptance of these terms. If you do not agree with these terms,
+ * please do not use, install, modify or redistribute this Apple software.
+ *
+ * In consideration of your agreement to abide by the following terms, and subject
+ * to these terms, Apple grants you a personal, non-exclusive license, under Apple's
+ * copyrights in this original Apple software (the "Apple Software"), to use,
+ * reproduce, modify and redistribute the Apple Software, with or without
+ * modifications, in source and/or binary forms; provided that if you redistribute
+ * the Apple Software in its entirety and without modifications, you must retain
+ * this notice and the following text and disclaimers in all such redistributions of
+ * the Apple Software. Neither the name, trademarks, service marks or logos of
+ * Apple Computer, Inc. may be used to endorse or promote products derived from the
+ * Apple Software without specific prior written permission from Apple. Except as
+ * expressly stated in this notice, no other rights or licenses, express or implied,
+ * are granted by Apple herein, including but not limited to any patent rights that
+ * may be infringed by your derivative works or by other works in which the Apple
+ * Software may be incorporated.
+ *
+ * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
+ * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ * COMBINATION WITH YOUR PRODUCTS.
+ *
+ * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
+ * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
+ * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+import javax.swing.*;
+import com.apple.dnssd.*;
+
+
+/** Use this to schedule BrowseListener callbacks via SwingUtilities.invokeAndWait(). */
+
+public class SwingBrowseListener implements Runnable, BrowseListener
+{
+ /** Create a listener for DNSSD that will call your listener on the Swing/AWT event thread. */
+ public SwingBrowseListener( BrowseListener listener)
+ { fListener = listener; fErrorCode = 0; }
+
+ /** (Clients should not call this method directly.) */
+ public void operationFailed( DNSSDService service, int errorCode)
+ {
+ fBrowser = service;
+ fErrorCode = errorCode;
+ this.schedule();
+ }
+
+ /** (Clients should not call this method directly.) */
+ public void serviceFound( DNSSDService browser, int flags, int ifIndex,
+ String serviceName, String regType, String domain)
+
+ {
+ fBrowser = browser;
+ fIsAdd = true;
+ fFlags = flags;
+ fIndex = ifIndex;
+ fService = serviceName;
+ fRegType = regType;
+ fDomain = domain;
+ this.schedule();
+ }
+
+ /** (Clients should not call this method directly.) */
+ public void serviceLost( DNSSDService browser, int flags, int ifIndex,
+ String serviceName, String regType, String domain)
+ {
+ fBrowser = browser;
+ fIsAdd = false;
+ fFlags = flags;
+ fIndex = ifIndex;
+ fService = serviceName;
+ fRegType = regType;
+ fDomain = domain;
+ this.schedule();
+ }
+
+ /** (Clients should not call this method directly.) */
+ public void run()
+ {
+ if ( fErrorCode != 0)
+ fListener.operationFailed( fBrowser, fErrorCode);
+ else if ( fIsAdd)
+ fListener.serviceFound( fBrowser, fFlags, fIndex, fService, fRegType, fDomain);
+ else
+ fListener.serviceLost( fBrowser, fFlags, fIndex, fService, fRegType, fDomain);
+ }
+
+ protected void schedule()
+ {
+ try {
+ SwingUtilities.invokeAndWait( this);
+ }
+ catch ( Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ protected BrowseListener fListener;
+
+ protected boolean fIsAdd;
+ protected DNSSDService fBrowser;
+ protected int fFlags;
+ protected int fIndex;
+ protected int fErrorCode;
+ protected String fService;
+ protected String fRegType;
+ protected String fDomain;
+}
+
diff --git a/mDNSResponder/Clients/Java/SwingDomainListener.java b/mDNSResponder/Clients/Java/SwingDomainListener.java
new file mode 100644
index 00000000..b67313b7
--- /dev/null
+++ b/mDNSResponder/Clients/Java/SwingDomainListener.java
@@ -0,0 +1,116 @@
+/* -*- Mode: Java; tab-width: 4 -*-
+ *
+ * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
+ * ("Apple") in consideration of your agreement to the following terms, and your
+ * use, installation, modification or redistribution of this Apple software
+ * constitutes acceptance of these terms. If you do not agree with these terms,
+ * please do not use, install, modify or redistribute this Apple software.
+ *
+ * In consideration of your agreement to abide by the following terms, and subject
+ * to these terms, Apple grants you a personal, non-exclusive license, under Apple's
+ * copyrights in this original Apple software (the "Apple Software"), to use,
+ * reproduce, modify and redistribute the Apple Software, with or without
+ * modifications, in source and/or binary forms; provided that if you redistribute
+ * the Apple Software in its entirety and without modifications, you must retain
+ * this notice and the following text and disclaimers in all such redistributions of
+ * the Apple Software. Neither the name, trademarks, service marks or logos of
+ * Apple Computer, Inc. may be used to endorse or promote products derived from the
+ * Apple Software without specific prior written permission from Apple. Except as
+ * expressly stated in this notice, no other rights or licenses, express or implied,
+ * are granted by Apple herein, including but not limited to any patent rights that
+ * may be infringed by your derivative works or by other works in which the Apple
+ * Software may be incorporated.
+ *
+ * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
+ * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ * COMBINATION WITH YOUR PRODUCTS.
+ *
+ * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
+ * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
+ * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+import javax.swing.*;
+import com.apple.dnssd.*;
+
+
+/** Use this to schedule DomainListener callbacks via SwingUtilities.invokeAndWait(). */
+
+public class SwingDomainListener implements Runnable, DomainListener
+{
+ /** Create a listener for DNSSD that will call your listener on the Swing/AWT event thread. */
+ public SwingDomainListener( DomainListener listener)
+ { fListener = listener; fErrorCode = 0; }
+
+ /** (Clients should not call this method directly.) */
+ public void operationFailed( DNSSDService service, int errorCode)
+ {
+ fEnumerator = service;
+ fErrorCode = errorCode;
+ this.schedule();
+ }
+
+ /** (Clients should not call this method directly.) */
+ public void domainFound( DNSSDService domainEnum, int flags, int ifIndex, String domain)
+
+ {
+ fEnumerator = domainEnum;
+ fIsAdd = true;
+ fFlags = flags;
+ fIndex = ifIndex;
+ fDomain = domain;
+ this.schedule();
+ }
+
+ /** (Clients should not call this method directly.) */
+ public void domainLost( DNSSDService domainEnum, int flags, int ifIndex, String domain)
+ {
+ fEnumerator = domainEnum;
+ fIsAdd = false;
+ fFlags = flags;
+ fIndex = ifIndex;
+ fDomain = domain;
+ this.schedule();
+ }
+
+ /** (Clients should not call this method directly.) */
+ public void run()
+ {
+ if ( fErrorCode != 0)
+ fListener.operationFailed( fEnumerator, fErrorCode);
+ else if ( fIsAdd)
+ fListener.domainFound( fEnumerator, fFlags, fIndex, fDomain);
+ else
+ fListener.domainLost( fEnumerator, fFlags, fIndex, fDomain);
+ }
+
+ protected void schedule()
+ {
+ try {
+ SwingUtilities.invokeAndWait( this);
+ }
+ catch ( Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ protected DomainListener fListener;
+
+ protected boolean fIsAdd;
+ protected DNSSDService fEnumerator;
+ protected int fFlags;
+ protected int fIndex;
+ protected int fErrorCode;
+ protected String fDomain;
+}
+
diff --git a/mDNSResponder/Clients/Java/SwingQueryListener.java b/mDNSResponder/Clients/Java/SwingQueryListener.java
new file mode 100644
index 00000000..fcac75b8
--- /dev/null
+++ b/mDNSResponder/Clients/Java/SwingQueryListener.java
@@ -0,0 +1,108 @@
+/* -*- Mode: Java; tab-width: 4 -*-
+ *
+ * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
+ * ("Apple") in consideration of your agreement to the following terms, and your
+ * use, installation, modification or redistribution of this Apple software
+ * constitutes acceptance of these terms. If you do not agree with these terms,
+ * please do not use, install, modify or redistribute this Apple software.
+ *
+ * In consideration of your agreement to abide by the following terms, and subject
+ * to these terms, Apple grants you a personal, non-exclusive license, under Apple's
+ * copyrights in this original Apple software (the "Apple Software"), to use,
+ * reproduce, modify and redistribute the Apple Software, with or without
+ * modifications, in source and/or binary forms; provided that if you redistribute
+ * the Apple Software in its entirety and without modifications, you must retain
+ * this notice and the following text and disclaimers in all such redistributions of
+ * the Apple Software. Neither the name, trademarks, service marks or logos of
+ * Apple Computer, Inc. may be used to endorse or promote products derived from the
+ * Apple Software without specific prior written permission from Apple. Except as
+ * expressly stated in this notice, no other rights or licenses, express or implied,
+ * are granted by Apple herein, including but not limited to any patent rights that
+ * may be infringed by your derivative works or by other works in which the Apple
+ * Software may be incorporated.
+ *
+ * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
+ * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ * COMBINATION WITH YOUR PRODUCTS.
+ *
+ * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
+ * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
+ * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+import javax.swing.*;
+import com.apple.dnssd.*;
+
+
+/** Use this to schedule QueryListener callbacks via SwingUtilities.invokeAndWait(). */
+
+public class SwingQueryListener implements Runnable, QueryListener
+{
+ /** Create a listener for DNSSD that will call your listener on the Swing/AWT event thread. */
+ public SwingQueryListener( QueryListener listener)
+ { fListener = listener; }
+
+ public void operationFailed( DNSSDService service, int errorCode)
+ {
+ fQuery = service;
+ fErrorCode = errorCode;
+ this.schedule();
+ }
+
+ /** (Clients should not call this method directly.) */
+ public void queryAnswered( DNSSDService query, int flags, int ifIndex, String fullName,
+ int rrtype, int rrclass, byte[] rdata, int ttl)
+ {
+ fQuery = query;
+ fFlags = flags;
+ fIndex = ifIndex;
+ fFullName = fullName;
+ fType = rrtype;
+ fClass = rrclass;
+ fData = rdata;
+ fTTL = ttl;
+ this.schedule();
+ }
+
+ /** (Clients should not call this method directly.) */
+ public void run()
+ {
+ if ( fErrorCode != 0)
+ fListener.operationFailed( fQuery, fErrorCode);
+ else
+ fListener.queryAnswered( fQuery, fFlags, fIndex, fFullName, fType, fClass, fData, fTTL);
+ }
+
+ protected void schedule()
+ {
+ try {
+ SwingUtilities.invokeAndWait( this);
+ }
+ catch ( Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ protected QueryListener fListener;
+
+ protected DNSSDService fQuery;
+ protected int fFlags;
+ protected int fIndex;
+ protected int fErrorCode;
+ protected String fFullName;
+ protected int fType;
+ protected int fClass;
+ protected byte[] fData;
+ protected int fTTL;
+}
+
diff --git a/mDNSResponder/Clients/Java/nmakefile b/mDNSResponder/Clients/Java/nmakefile
new file mode 100644
index 00000000..89168e0b
--- /dev/null
+++ b/mDNSResponder/Clients/Java/nmakefile
@@ -0,0 +1,109 @@
+# -*- 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.
+#
+# This Makefile builds .jar files for the DNS-SD Java sample apps.
+# You must have the Java support installed.
+#
+# nmake with no arguments builds all production targets.
+# 'nmake DEBUG=1' to build debugging targets.
+# 'nmake clean' or 'nmake clean DEBUG=1' to delete prod/debug objects & targets
+#
+# To run nmake, you may need to set up your PATH correctly, using a script
+# such as: "\Program Files\Microsoft Visual Studio .NET\Common7\tools\vsvars32.bat"
+#
+# The default location of the JDK is \javasdk. You can override this on the
+# command line (e.g. 'nmake JDK=\j2dk1.4.2_03').
+
+############################################################################
+
+JDK = $(JAVA_HOME)
+
+CP = copy
+RM = del /Q
+RMDIR = rmdir /S /Q
+JAVAC = $(JDK)\bin\javac
+JAVAH = $(JDK)\bin\javah
+JAR = $(JDK)\bin\jar
+
+# Set up diverging paths for debug vs. prod builds
+DEBUG=0
+!if $(DEBUG) == 1
+JFLAGS = -g
+OBJDIR = objects\debug
+BUILDDIR = build\debug
+!else
+JFLAGS =
+OBJDIR = objects\prod
+BUILDDIR = build\prod
+!endif
+
+SCOBJ = $(OBJDIR)\SimpleChat
+BAOBJ = $(OBJDIR)\BrowserApp
+
+#############################################################################
+
+all: setup Java postbuild
+
+# 'setup' sets up the build directory structure the way we want
+setup:
+ @if not exist objects mkdir objects
+ @if not exist build mkdir build
+ @if not exist $(OBJDIR) mkdir $(OBJDIR)
+ @if not exist $(SCOBJ) mkdir $(SCOBJ)
+ @if not exist $(BAOBJ) mkdir $(BAOBJ)
+ @if not exist $(BUILDDIR) mkdir $(BUILDDIR)
+
+postbuild:
+ @if not "%RC_XBS%"=="YES" GOTO END
+ @if not exist "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java"
+ @copy "nmakefile" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java"
+ @copy "BrowserApp.java" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java"
+ @copy "SimpleChat.java" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java"
+ @copy "Swing*.java" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java"
+ @copy "$(BUILDDIR)\*.jar" "$(DSTROOT)\Program Files\Bonjour SDK\Samples\Java"
+ @:END
+
+# clean removes targets and objects
+clean:
+ @if exist $(OBJDIR) $(RMDIR) $(OBJDIR)
+ @if exist $(BUILDDIR) $(RMDIR) $(BUILDDIR)
+
+#############################################################################
+
+Java: setup $(BUILDDIR)\SimpleChat.jar $(BUILDDIR)\BrowserApp.jar
+ @echo "Build complete"
+
+SIMPLECHATOBJ = $(SCOBJ)\SwingBrowseListener.class \
+ $(SCOBJ)\SwingQueryListener.class \
+ $(SCOBJ)\SimpleChat.class
+SIMPLECHATMAN = SimpleChat.manifest
+
+$(BUILDDIR)\SimpleChat.jar: $(SIMPLECHATOBJ) $(SIMPLECHATMAN)
+ $(JAR) -cfm $@ $(SIMPLECHATMAN) -C $(SCOBJ) .
+
+BROWSERAPPOBJ = $(BAOBJ)\BrowserApp.class
+BROWSERAPPMAN = BrowserApp.manifest
+
+$(BUILDDIR)\BrowserApp.jar: $(BROWSERAPPOBJ) $(BROWSERAPPMAN)
+ $(JAR) -cfm $@ $(BROWSERAPPMAN) -C $(BAOBJ) .
+
+JAVASRC = .
+.SUFFIXES : .java
+{$(JAVASRC)}.java{$(BAOBJ)}.class:
+ $(JAVAC) -d $(BAOBJ) -classpath $(BAOBJ);$(DNS_SD) $<
+{$(JAVASRC)}.java{$(SCOBJ)}.class:
+ $(JAVAC) -d $(SCOBJ) -classpath $(SCOBJ);$(DNS_SD) $<
+
diff --git a/mDNSResponder/Clients/Makefile b/mDNSResponder/Clients/Makefile
new file mode 100755
index 00000000..ce0b5f0c
--- /dev/null
+++ b/mDNSResponder/Clients/Makefile
@@ -0,0 +1,54 @@
+# -*- 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.
+#
+# Notes:
+# $@ means "The file name of the target of the rule"
+# $< means "The name of the first prerequisite"
+# $+ means "The names of all the prerequisites, with spaces between them, exactly as given"
+# For more magic automatic variables, see
+# <http://www.gnu.org/software/make/manual/html_chapter/make_10.html#SEC111>
+
+#############################################################################
+
+# On OS X the dns_sd library functions are included in libSystem, which is implicitly linked with every executable
+# If /usr/lib/libSystem.dylib exists, then we're on OS X, so we don't need also to link the "dns_sd" shared library
+ifneq "$(wildcard /usr/lib/libSystem.dylib)" ""
+TARGETS = build/dns-sd build/dns-sd64
+LIBS =
+else
+TARGETS = build/dns-sd
+LIBS = -L../mDNSPosix/build/prod/ -ldns_sd
+endif
+
+all: $(TARGETS)
+
+clean:
+ rm -rf build
+
+build:
+ mkdir build
+
+build/dns-sd: build dns-sd.c ClientCommon.c
+ cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@
+
+build/dns-sd64: build dns-sd.c ClientCommon.c
+ cc $(filter %.c %.o, $+) $(LIBS) -I../mDNSShared -Wall -o $@ -m64
+
+# Note, we can make a 'fat' version of dns-sd using 'lipo', as shown below, but we
+# don't, because we don't want or need a 'fat' version of dns-sd, because it will
+# never need to access more than 4GB of data. We build the 64-bit version purely so
+# we have a test tool for making sure that the APIs work properly from 64-bit clients.
+# lipo -create dns-sd dns-sd64 -output dns-sd-fat
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/About.cpp b/mDNSResponder/Clients/PrinterSetupWizard/About.cpp
new file mode 100644
index 00000000..6fda7101
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/About.cpp
@@ -0,0 +1,31 @@
+// About.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "PrinterSetupWizardApp.h"
+#include "About.h"
+
+
+// CAbout dialog
+
+IMPLEMENT_DYNAMIC(CAbout, CDialog)
+CAbout::CAbout(CWnd* pParent /*=NULL*/)
+ : CDialog(CAbout::IDD, pParent)
+{
+}
+
+CAbout::~CAbout()
+{
+}
+
+void CAbout::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+}
+
+
+BEGIN_MESSAGE_MAP(CAbout, CDialog)
+END_MESSAGE_MAP()
+
+
+// CAbout message handlers
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/About.h b/mDNSResponder/Clients/PrinterSetupWizard/About.h
new file mode 100644
index 00000000..72e893da
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/About.h
@@ -0,0 +1,21 @@
+#pragma once
+
+
+// CAbout dialog
+
+class CAbout : public CDialog
+{
+DECLARE_DYNAMIC(CAbout)
+
+public:
+CAbout(CWnd* pParent = NULL); // standard constructor
+virtual ~CAbout();
+
+// Dialog Data
+enum { IDD = IDD_DIALOG1 };
+
+protected:
+virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+
+DECLARE_MESSAGE_MAP()
+};
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/FirstPage.cpp b/mDNSResponder/Clients/PrinterSetupWizard/FirstPage.cpp
new file mode 100644
index 00000000..a4e6e43d
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/FirstPage.cpp
@@ -0,0 +1,98 @@
+/* -*- 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"
+#include "PrinterSetupWizardApp.h"
+#include "PrinterSetupWizardSheet.h"
+#include "FirstPage.h"
+
+#include <DebugServices.h>
+
+
+// CFirstPage dialog
+
+IMPLEMENT_DYNAMIC(CFirstPage, CPropertyPage)
+CFirstPage::CFirstPage()
+ : CPropertyPage(CFirstPage::IDD)
+{
+ CString fontName;
+
+ m_psp.dwFlags &= ~(PSP_HASHELP);
+ m_psp.dwFlags |= PSP_DEFAULT|PSP_HIDEHEADER;
+
+ fontName.LoadString(IDS_LARGE_FONT);
+
+ // create the large font
+ m_largeFont.CreateFont(-16, 0, 0, 0,
+ FW_BOLD, FALSE, FALSE, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
+ CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, fontName);
+}
+
+CFirstPage::~CFirstPage()
+{
+}
+
+void CFirstPage::DoDataExchange(CDataExchange* pDX)
+{
+ CPropertyPage::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_GREETING, m_greeting);
+}
+
+
+BOOL
+CFirstPage::OnSetActive()
+{
+ CPrinterSetupWizardSheet * psheet;
+ CString greetingText;
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ psheet->SetWizardButtons(PSWIZB_NEXT);
+
+ m_greeting.SetFont(&m_largeFont);
+
+ greetingText.LoadString(IDS_GREETING);
+ m_greeting.SetWindowText(greetingText);
+
+exit:
+
+ return CPropertyPage::OnSetActive();
+}
+
+
+BOOL
+CFirstPage::OnKillActive()
+{
+ CPrinterSetupWizardSheet * psheet;
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ psheet->SetLastPage(this);
+
+exit:
+
+ return CPropertyPage::OnKillActive();
+}
+
+
+BEGIN_MESSAGE_MAP(CFirstPage, CPropertyPage)
+END_MESSAGE_MAP()
+
+
+// CFirstPage message handlers
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/FirstPage.h b/mDNSResponder/Clients/PrinterSetupWizard/FirstPage.h
new file mode 100644
index 00000000..0186c026
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/FirstPage.h
@@ -0,0 +1,50 @@
+/* -*- 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
+#include "afxwin.h"
+
+
+// CFirstPage dialog
+
+class CFirstPage : public CPropertyPage
+{
+DECLARE_DYNAMIC(CFirstPage)
+
+public:
+CFirstPage();
+virtual ~CFirstPage();
+
+// Dialog Data
+enum { IDD = IDD_FIRST_PAGE };
+
+protected:
+virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+virtual BOOL OnSetActive();
+virtual BOOL OnKillActive();
+
+
+DECLARE_MESSAGE_MAP()
+
+private:
+
+CFont m_largeFont;
+
+public:
+
+CStatic m_greeting;
+};
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/FourthPage.cpp b/mDNSResponder/Clients/PrinterSetupWizard/FourthPage.cpp
new file mode 100644
index 00000000..3817246e
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/FourthPage.cpp
@@ -0,0 +1,212 @@
+/* -*- 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"
+#include "PrinterSetupWizardApp.h"
+#include "PrinterSetupWizardSheet.h"
+#include "FourthPage.h"
+
+#if !defined( PBS_MARQUEE )
+# define PBS_MARQUEE 0x08
+#endif
+
+#if !defined( PBM_SETMARQUEE )
+# define PBM_SETMARQUEE WM_USER + 10
+#endif
+
+
+
+// CFourthPage dialog
+
+IMPLEMENT_DYNAMIC(CFourthPage, CPropertyPage)
+CFourthPage::CFourthPage()
+ : CPropertyPage(CFourthPage::IDD),
+ m_initialized(false)
+{
+ CString fontName;
+
+ m_psp.dwFlags &= ~(PSP_HASHELP);
+ m_psp.dwFlags |= PSP_DEFAULT|PSP_HIDEHEADER;
+
+ fontName.LoadString(IDS_LARGE_FONT);
+
+ // create the large font
+ m_largeFont.CreateFont(-16, 0, 0, 0,
+ FW_BOLD, FALSE, FALSE, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS,
+ CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH, fontName);
+}
+
+CFourthPage::~CFourthPage()
+{
+}
+
+void CFourthPage::DoDataExchange(CDataExchange* pDX)
+{
+ CPropertyPage::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_GOODBYE, m_goodbye);
+ DDX_Control(pDX, IDC_PRINTER_NAME, m_printerNameCtrl);
+ DDX_Control(pDX, IDC_PRINTER_MANUFACTURER, m_printerManufacturerCtrl);
+ DDX_Control(pDX, IDC_PRINTER_MODEL, m_printerModelCtrl);
+ DDX_Control(pDX, IDC_PRINTER_PROTOCOL, m_printerProtocolCtrl);
+ DDX_Control(pDX, IDC_PRINTER_DEFAULT, m_printerDefault);
+}
+
+
+BEGIN_MESSAGE_MAP(CFourthPage, CPropertyPage)
+END_MESSAGE_MAP()
+
+
+// CFourthPage message handlers
+OSStatus
+CFourthPage::OnInitPage()
+{
+ CWnd * window;
+ OSStatus err = kNoErr;
+
+ window = GetDlgItem( IDC_INSTALLING );
+ require_action( window, exit, err = kUnknownErr );
+ window->ShowWindow( SW_HIDE );
+
+ window = GetDlgItem( IDC_PROGRESS );
+ require_action( window, exit, err = kUnknownErr );
+ SetWindowLong( *window, GWL_STYLE, GetWindowLong( *window, GWL_STYLE ) | PBS_MARQUEE );
+ SetWindowLongPtr( *window, GWL_STYLE, GetWindowLongPtr( *window, GWL_STYLE ) | PBS_MARQUEE );
+ window->SendMessage( ( UINT ) PBM_SETMARQUEE, ( WPARAM ) FALSE,( LPARAM ) 35 );
+ window->ShowWindow( SW_HIDE );
+
+exit:
+
+ return err;
+}
+
+
+BOOL
+CFourthPage::OnSetActive()
+{
+ CPrinterSetupWizardSheet * psheet;
+ CString goodbyeText;
+ Printer * printer;
+ CString defaultText;
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ printer = psheet->GetSelectedPrinter();
+ require_quiet( psheet, exit );
+
+ psheet->SetWizardButtons(PSWIZB_BACK|PSWIZB_FINISH);
+
+ if (m_initialized == false)
+ {
+ m_initialized = true;
+ OnInitPage();
+ }
+
+ m_goodbye.SetFont(&m_largeFont);
+
+ goodbyeText.LoadString(IDS_GOODBYE);
+ m_goodbye.SetWindowText(goodbyeText);
+
+ m_printerNameCtrl.SetWindowText( printer->actualName );
+ m_printerManufacturerCtrl.SetWindowText ( printer->manufacturer );
+ m_printerModelCtrl.SetWindowText ( printer->displayModelName );
+
+ Service * service = printer->services.front();
+ require_quiet( service, exit );
+ m_printerProtocolCtrl.SetWindowText ( service->protocol );
+
+ if (printer->deflt)
+ {
+ defaultText.LoadString(IDS_YES);
+ }
+ else
+ {
+ defaultText.LoadString(IDS_NO);
+ }
+
+ m_printerDefault.SetWindowText ( defaultText );
+
+exit:
+
+ return CPropertyPage::OnSetActive();
+}
+
+
+BOOL
+CFourthPage::OnKillActive()
+{
+ CPrinterSetupWizardSheet * psheet;
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ psheet->SetLastPage(this);
+
+exit:
+
+ return CPropertyPage::OnKillActive();
+}
+
+
+BOOL
+CFourthPage::StartActivityIndicator()
+{
+ CWnd * window;
+ BOOL ok = TRUE;
+
+ window = GetDlgItem( IDC_COMPLETE1 );
+ require_action( window, exit, ok = FALSE );
+ window->ShowWindow( SW_HIDE );
+
+ window = GetDlgItem( IDC_COMPLETE2 );
+ require_action( window, exit, ok = FALSE );
+ window->ShowWindow( SW_HIDE );
+
+ window = GetDlgItem( IDC_INSTALLING );
+ require_action( window, exit, ok = FALSE );
+ window->ShowWindow( SW_SHOW );
+
+ window = GetDlgItem( IDC_PROGRESS );
+ require_action( window, exit, ok = FALSE );
+ window->SendMessage( ( UINT ) PBM_SETMARQUEE, ( WPARAM ) TRUE,( LPARAM ) 50 );
+ window->ShowWindow( SW_SHOW );
+
+exit:
+
+ return ok;
+}
+
+
+BOOL
+CFourthPage::StopActivityIndicator()
+{
+ CWnd * window;
+ BOOL ok = TRUE;
+
+ window = GetDlgItem( IDC_INSTALLING );
+ require_action( window, exit, ok = FALSE );
+ window->ShowWindow( SW_HIDE );
+
+ window = GetDlgItem( IDC_PROGRESS );
+ require_action( window, exit, ok = FALSE );
+ window->SendMessage( ( UINT ) PBM_SETMARQUEE, ( WPARAM ) FALSE,( LPARAM ) 35 );
+ window->ShowWindow( SW_HIDE );
+
+exit:
+
+ return ok;
+}
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/FourthPage.h b/mDNSResponder/Clients/PrinterSetupWizard/FourthPage.h
new file mode 100644
index 00000000..5b4ea99b
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/FourthPage.h
@@ -0,0 +1,61 @@
+/* -*- 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
+#include "afxwin.h"
+
+
+// CFourthPage dialog
+
+class CFourthPage : public CPropertyPage
+{
+DECLARE_DYNAMIC(CFourthPage)
+
+public:
+CFourthPage();
+virtual ~CFourthPage();
+
+// Dialog Data
+enum { IDD = IDD_FOURTH_PAGE };
+
+virtual BOOL OnSetActive();
+virtual BOOL OnKillActive();
+
+BOOL StartActivityIndicator();
+BOOL StopActivityIndicator();
+
+protected:
+virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+
+DECLARE_MESSAGE_MAP()
+
+private:
+
+OSStatus OnInitPage();
+CFont m_largeFont;
+bool m_initialized;
+
+
+public:
+CStatic m_goodbye;
+private:
+CStatic m_printerNameCtrl;
+CStatic m_printerManufacturerCtrl;
+CStatic m_printerModelCtrl;
+CStatic m_printerProtocolCtrl;
+CStatic m_printerDefault;
+};
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/Logger.cpp b/mDNSResponder/Clients/PrinterSetupWizard/Logger.cpp
new file mode 100644
index 00000000..3385d31c
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/Logger.cpp
@@ -0,0 +1,85 @@
+/* -*- 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"
+#include "Logger.h"
+#include "DebugServices.h"
+#include <string>
+
+
+Logger::Logger()
+{
+ std::string tmp;
+ char path[ MAX_PATH ];
+ HRESULT err;
+ BOOL ok;
+
+ err = SHGetFolderPathA( NULL, CSIDL_LOCAL_APPDATA, NULL, 0, path );
+ require_noerr( err, exit );
+
+ tmp = path;
+
+ // Create Logs subdir
+ tmp += "\\Apple";
+ ok = CreateDirectoryA( tmp.c_str(), NULL );
+ require_action( ( ok || ( GetLastError() == ERROR_ALREADY_EXISTS ) ), exit, err = -1 );
+
+ // Create Logs subdir
+ tmp += "\\Bonjour";
+ ok = CreateDirectoryA( tmp.c_str(), NULL );
+ require_action( ( ok || ( GetLastError() == ERROR_ALREADY_EXISTS ) ), exit, err = -1 );
+
+ // Create log file
+ tmp += "\\PrinterSetupLog.txt";
+ open( tmp.c_str());
+
+ *this << currentTime() << " Log started" << std::endl;
+
+exit:
+
+ return;
+}
+
+
+Logger::~Logger()
+{
+ *this << currentTime() << " Log finished" << std::endl;
+ flush();
+}
+
+
+std::string
+Logger::currentTime()
+{
+ time_t ltime;
+ struct tm now;
+ int err;
+ std::string ret;
+
+ time( &ltime );
+ err = localtime_s( &now, &ltime );
+
+ if ( !err )
+ {
+ char temp[ 64 ];
+
+ strftime( temp, sizeof( temp ), "%m/%d/%y %I:%M:%S %p", &now );
+ ret = temp;
+ }
+
+ return ret;
+}
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/Logger.h b/mDNSResponder/Clients/PrinterSetupWizard/Logger.h
new file mode 100644
index 00000000..2f338c1f
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/Logger.h
@@ -0,0 +1,63 @@
+/* -*- 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.
+ */
+
+#ifndef _Logger_h
+#define _Logger_h
+
+#include <fstream>
+#include <string>
+
+
+class Logger : public std::ofstream
+{
+public:
+
+Logger();
+~Logger();
+
+std::string
+currentTime();
+};
+
+
+#define require_noerr_with_log( LOG, MESSAGE, ERR, LABEL ) \
+ do \
+ { \
+ int_least32_t localErr; \
+ localErr = (int_least32_t)( ERR ); \
+ if( localErr != 0 ) \
+ { \
+ log << log.currentTime() << " [ERROR] " << MESSAGE << " returned " << ERR << std::endl; \
+ log << log.currentTime() << " [WHERE] " << "\"" << __FILE__ << "\", \"" << __FUNCTION__ << "\", line " << __LINE__ << std::endl << std::endl; \
+ goto LABEL; \
+ } \
+ } while( 0 )
+
+
+#define require_action_with_log( LOG, X, LABEL, ACTION ) \
+ do \
+ { \
+ if( !( X ) ) \
+ { \
+ log << log.currentTime() << " [ERROR] " << # X << std::endl; \
+ log << log.currentTime() << " [WHERE] " << "\"" << __FILE__ << "\", \"" << __FUNCTION__ << "\", line " << __LINE__ << std::endl << std::endl; \
+ { ACTION; } \
+ goto LABEL; \
+ } \
+ } while( 0 )
+
+#endif
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.ncb b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.ncb
new file mode 100644
index 00000000..9057ebac
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.ncb
@@ -0,0 +1 @@
+Microsoft C/C++ MSF 7.00
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.rc b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.rc
new file mode 100644
index 00000000..88b13795
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.rc
@@ -0,0 +1,157 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource_exe.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+#include "WinVersRes.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Russian resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
+#ifdef _WIN32
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+#pragma code_page(1251)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource_exe.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 ""res\\PrinterSetupWizard.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
+ "#include ""afxres.rc"" // Standard components\r\n"
+ "#endif\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // Russian resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// 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.
+IDR_MAINFRAME ICON "res\\NetworkPrinter.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 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904e4"
+ BEGIN
+ VALUE "CompanyName", MASTER_COMPANY_NAME
+ VALUE "FileDescription", "Bonjour Printer Wizard"
+ VALUE "FileVersion", MASTER_PROD_VERS_STR
+ VALUE "InternalName", "PrinterWizard.exe"
+ VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT
+ VALUE "OriginalFilename", "PrinterWizard.exe"
+ VALUE "ProductName", MASTER_PROD_NAME
+ VALUE "ProductVersion", MASTER_PROD_VERS_STR
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1252
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE
+BEGIN
+ IDS_REINSTALL "Bonjour Printer Wizard cannot run because some of its required files are missing. Please reinstall Bonjour Printer Wizard."
+ IDS_REINSTALL_CAPTION "Bonjour Printer Wizard"
+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 "res\PrinterSetupWizard.rc2" // non-Microsoft Visual C++ edited resources
+#include "afxres.rc" // Standard components
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcproj b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcproj
new file mode 100644
index 00000000..f570ab67
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcproj
@@ -0,0 +1,638 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="PrinterSetupWizard"
+ ProjectGUID="{B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}"
+ 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"
+ CharacterSet="2"
+ >
+ <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=".;../../mDNSWindows;../../mDNSShared"
+ PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ StringPooling="true"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ DisableSpecificWarnings="4702"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir);../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"
+ AdditionalDependencies="../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib ws2_32.lib iphlpapi.lib winspool.lib setupapi.lib"
+ OutputFile="$(OutDir)/PrinterWizard.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(IntDir)/$(ProjectName).pdb"
+ SubSystem="2"
+ EntryPointSymbol="wWinMainCRTStartup"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="res\PrinterSetupWizard.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"
+ CharacterSet="2"
+ >
+ <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=".;../../mDNSWindows;../../mDNSShared"
+ PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1"
+ StringPooling="true"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ AssemblerListingLocation="$(IntDir)\"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ DisableSpecificWarnings="4702"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir);../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE"
+ AdditionalDependencies="../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib ws2_32.lib iphlpapi.lib winspool.lib setupapi.lib"
+ OutputFile="$(OutDir)/PrinterWizard.exe"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(IntDir)/$(ProjectName).pdb"
+ SubSystem="2"
+ EntryPointSymbol="wWinMainCRTStartup"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="res\PrinterSetupWizard64.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"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories=".;../../mDNSWindows;../../mDNSShared"
+ PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;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)\"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4702"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir);../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"
+ AdditionalDependencies="../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib ws2_32.lib iphlpapi.lib winspool.lib setupapi.lib"
+ OutputFile="$(OutDir)/PrinterWizard.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(IntDir)/$(ProjectName).pdb"
+ SubSystem="2"
+ OptimizeReferences="0"
+ EnableCOMDATFolding="0"
+ EntryPointSymbol="wWinMainCRTStartup"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="res\PrinterSetupWizard.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 Print Services\$(PlatformName)&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour Print Services\$(PlatformName)&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot; &quot;$(DSTROOT)\Program Files\Bonjour Print Services\$(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"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories=".;../../mDNSWindows;../../mDNSShared"
+ PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;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)\"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4702"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir);../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE"
+ AdditionalDependencies="../../mDNSWindows/DLLStub/$(PlatformName)/$(ConfigurationName)/dnssdStatic.lib ws2_32.lib iphlpapi.lib winspool.lib setupapi.lib"
+ OutputFile="$(OutDir)/PrinterWizard.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile="$(IntDir)/$(ProjectName).pdb"
+ SubSystem="2"
+ OptimizeReferences="0"
+ EnableCOMDATFolding="0"
+ EntryPointSymbol="wWinMainCRTStartup"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="res\PrinterSetupWizard64.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 Print Services\$(PlatformName)&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour Print Services\$(PlatformName)&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot; &quot;$(DSTROOT)\Program Files\Bonjour Print Services\$(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"
+ >
+ <File
+ RelativePath=".\About.cpp"
+ >
+ </File>
+ <File
+ RelativePath="FirstPage.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\FourthPage.cpp"
+ >
+ </File>
+ <File
+ RelativePath="PrinterSetupWizardApp.cpp"
+ >
+ </File>
+ <File
+ RelativePath="PrinterSetupWizardSheet.cpp"
+ >
+ </File>
+ <File
+ RelativePath="SecondPage.cpp"
+ >
+ </File>
+ <File
+ RelativePath="stdafx.cpp"
+ >
+ </File>
+ <File
+ RelativePath="ThirdPage.cpp"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc"
+ >
+ <File
+ RelativePath=".\About.h"
+ >
+ </File>
+ <File
+ RelativePath="FirstPage.h"
+ >
+ </File>
+ <File
+ RelativePath=".\FourthPage.h"
+ >
+ </File>
+ <File
+ RelativePath="PrinterSetupWizardApp.h"
+ >
+ </File>
+ <File
+ RelativePath="PrinterSetupWizardSheet.h"
+ >
+ </File>
+ <File
+ RelativePath="resource.h"
+ >
+ </File>
+ <File
+ RelativePath="resource_exe.h"
+ >
+ </File>
+ <File
+ RelativePath="SecondPage.h"
+ >
+ </File>
+ <File
+ RelativePath="stdafx.h"
+ >
+ </File>
+ <File
+ RelativePath="ThirdPage.h"
+ >
+ </File>
+ <File
+ RelativePath=".\UtilTypes.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="res\banner_icon.bmp"
+ >
+ </File>
+ <File
+ RelativePath="res\Info.ico"
+ >
+ </File>
+ <File
+ RelativePath="res\NetworkPrinter.ico"
+ >
+ </File>
+ <File
+ RelativePath="res\PrinterSetupWizard.manifest"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|x64"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="PrinterSetupWizard.rc"
+ >
+ </File>
+ <File
+ RelativePath="res\watermark.bmp"
+ >
+ </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="..\..\mDNSWindows\isocode.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\loclibrary.c"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableSpecificWarnings="4201"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|x64"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ DisableSpecificWarnings="4201"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\loclibrary.h"
+ >
+ </File>
+ <File
+ RelativePath=".\Logger.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\Logger.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\WinServices.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\WinServices.h"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ <Global
+ Name="RESOURCE_FILE"
+ Value="PrinterSetupWizard.rc"
+ />
+ </Globals>
+</VisualStudioProject>
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj
new file mode 100755
index 00000000..563597e3
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj
@@ -0,0 +1,365 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Template|Win32">
+ <Configuration>Template</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Template|x64">
+ <Configuration>Template</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{B1D2CDA2-CC8F-45D5-A694-2EE45B0308CF}</ProjectGuid>
+ <Keyword>MFCProj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IncludePath)</IncludePath>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">PrinterWizard</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PrinterWizard</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">PrinterWizard</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">PrinterWizard</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">PrinterWizard</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|x64'">PrinterWizard</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>false</MkTypLibCompatible>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>.;../../mDNSWindows;../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0501;_WIN32_WINNT=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>Cdecl</CallingConvention>
+ <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;iphlpapi.lib;winspool.lib;setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)PrinterWizard.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>res\PrinterSetupWizard.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>false</MkTypLibCompatible>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>.;../../mDNSWindows;../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0501;_WIN32_WINNT=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>Cdecl</CallingConvention>
+ <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;iphlpapi.lib;winspool.lib;setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)PrinterWizard.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>res\PrinterSetupWizard64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>false</MkTypLibCompatible>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>.;../../mDNSWindows;../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WINVER=0x0501;_WIN32_WINNT=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;iphlpapi.lib;winspool.lib;setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)PrinterWizard.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>
+ </OptimizeReferences>
+ <EnableCOMDATFolding>
+ </EnableCOMDATFolding>
+ <EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>res\PrinterSetupWizard.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)" mkdir "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>false</MkTypLibCompatible>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>.;../../mDNSWindows;../../mDNSShared;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WINVER=0x0501;_WIN32_WINNT=0x0501;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>../../mDNSWindows/DLLStub/$(Platform)/$(Configuration)/dnssdStatic.lib;ws2_32.lib;iphlpapi.lib;winspool.lib;setupapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(OutDir)PrinterWizard.exe</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)$(ProjectName).pdb</ProgramDatabaseFile>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>
+ </OptimizeReferences>
+ <EnableCOMDATFolding>
+ </EnableCOMDATFolding>
+ <EntryPointSymbol>wWinMainCRTStartup</EntryPointSymbol>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>res\PrinterSetupWizard64.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)" mkdir "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="About.cpp" />
+ <ClCompile Include="FirstPage.cpp" />
+ <ClCompile Include="FourthPage.cpp" />
+ <ClCompile Include="PrinterSetupWizardApp.cpp" />
+ <ClCompile Include="PrinterSetupWizardSheet.cpp" />
+ <ClCompile Include="SecondPage.cpp" />
+ <ClCompile Include="stdafx.cpp" />
+ <ClCompile Include="ThirdPage.cpp" />
+ <ClCompile Include="..\..\mDNSShared\DebugServices.c" />
+ <ClCompile Include="..\..\mDNSWindows\loclibrary.c">
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4201;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">4201;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ClCompile Include="Logger.cpp" />
+ <ClCompile Include="..\..\mDNSWindows\WinServices.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="About.h" />
+ <ClInclude Include="FirstPage.h" />
+ <ClInclude Include="FourthPage.h" />
+ <ClInclude Include="PrinterSetupWizardApp.h" />
+ <ClInclude Include="PrinterSetupWizardSheet.h" />
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="resource_exe.h" />
+ <ClInclude Include="SecondPage.h" />
+ <ClInclude Include="stdafx.h" />
+ <ClInclude Include="tcpxcv.h" />
+ <ClInclude Include="ThirdPage.h" />
+ <ClInclude Include="UtilTypes.h" />
+ <ClInclude Include="..\..\mDNSShared\CommonServices.h" />
+ <ClInclude Include="..\..\mDNSShared\DebugServices.h" />
+ <ClInclude Include="..\..\mDNSShared\dns_sd.h" />
+ <ClInclude Include="..\..\mDNSWindows\isocode.h" />
+ <ClInclude Include="..\..\mDNSWindows\loclibrary.h" />
+ <ClInclude Include="Logger.h" />
+ <ClInclude Include="..\..\mDNSWindows\WinServices.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\about.bmp" />
+ <None Include="res\banner_icon.bmp" />
+ <None Include="res\Info.ico" />
+ <None Include="res\NetworkPrinter.ico" />
+ <None Include="res\watermark.bmp" />
+ <None Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuildStep Include="res\PrinterSetupWizard.manifest">
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
+ <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
+ </CustomBuildStep>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="PrinterSetupWizard.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\mDNSWindows\DLLStub\DLLStub.vcxproj">
+ <Project>{3a2b6325-3053-4236-84bd-aa9be2e323e5}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+ <ProjectExtensions>
+ <VisualStudio>
+ <UserProperties RESOURCE_FILE="PrinterSetupWizard.rc" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj.filters b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj.filters
new file mode 100755
index 00000000..d2102791
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizard.vcxproj.filters
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{2a6fb856-bfd6-4cf1-bd97-b1c798cadff4}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{cc2ba15e-c8ac-4990-9bf2-a27b18361b12}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{18aa6a23-2325-46e6-a1e2-45d743d9ff32}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>
+ </Filter>
+ <Filter Include="Support">
+ <UniqueIdentifier>{5c8be428-d955-40e2-bbb6-349f5867d422}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="About.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="FirstPage.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="FourthPage.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PrinterSetupWizardApp.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="PrinterSetupWizardSheet.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="SecondPage.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="stdafx.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="ThirdPage.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSShared\DebugServices.c">
+ <Filter>Support</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSWindows\loclibrary.c">
+ <Filter>Support</Filter>
+ </ClCompile>
+ <ClCompile Include="Logger.cpp">
+ <Filter>Support</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSWindows\WinServices.cpp">
+ <Filter>Support</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="About.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="FirstPage.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="FourthPage.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="PrinterSetupWizardApp.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="PrinterSetupWizardSheet.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource_exe.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="SecondPage.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="stdafx.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="ThirdPage.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="UtilTypes.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSShared\CommonServices.h">
+ <Filter>Support</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSShared\DebugServices.h">
+ <Filter>Support</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSShared\dns_sd.h">
+ <Filter>Support</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSWindows\isocode.h">
+ <Filter>Support</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSWindows\loclibrary.h">
+ <Filter>Support</Filter>
+ </ClInclude>
+ <ClInclude Include="Logger.h">
+ <Filter>Support</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSWindows\WinServices.h">
+ <Filter>Support</Filter>
+ </ClInclude>
+ <ClInclude Include="tcpxcv.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\about.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\banner_icon.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\Info.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\NetworkPrinter.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\watermark.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="PrinterSetupWizard.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuildStep Include="res\PrinterSetupWizard.manifest">
+ <Filter>Resource Files</Filter>
+ </CustomBuildStep>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardApp.cpp b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardApp.cpp
new file mode 100644
index 00000000..d2a896d0
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardApp.cpp
@@ -0,0 +1,172 @@
+/* -*- 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"
+#include "PrinterSetupWizardApp.h"
+#include "PrinterSetupWizardSheet.h"
+#include "DebugServices.h"
+#include "loclibrary.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#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;
+}
+
+
+// CPrinterSetupWizardApp
+
+BEGIN_MESSAGE_MAP(CPrinterSetupWizardApp, CWinApp)
+ ON_COMMAND(ID_HELP, CWinApp::OnHelp)
+END_MESSAGE_MAP()
+
+
+// CPrinterSetupWizardApp construction
+
+CPrinterSetupWizardApp::CPrinterSetupWizardApp()
+{
+ // TODO: add construction code here,
+ // Place all significant initialization in InitInstance
+}
+
+
+// The one and only CPrinterSetupWizardApp object
+
+CPrinterSetupWizardApp theApp;
+
+
+// CPrinterSetupWizardApp initialization
+
+BOOL CPrinterSetupWizardApp::InitInstance()
+{
+ CString errorMessage;
+ CString errorCaption;
+ wchar_t resource[MAX_PATH];
+ int res;
+ OSStatus err = kNoErr;
+
+ HeapSetInformation( NULL, HeapEnableTerminationOnCorruption, NULL, 0 );
+
+ //
+ // initialize the debugging framework
+ //
+ debug_initialize( kDebugOutputTypeWindowsDebugger, "PrinterSetupWizard", 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 );
+
+ // Load Resources
+
+ res = PathForResource( NULL, L"PrinterWizardResources.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"PrinterWizardLocalized.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();
+
+ {
+ CPrinterSetupWizardSheet dlg(IDS_CAPTION);
+
+ 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 (CPrinterSetupWizardSheet::WizardException & exc)
+ {
+ MessageBox(NULL, exc.text, exc.caption, MB_OK|MB_ICONEXCLAMATION);
+ }
+ }
+
+exit:
+
+ if ( err )
+ {
+ MessageBox( NULL, errorMessage, errorCaption, MB_ICONERROR | MB_OK );
+ }
+
+ if ( g_nonLocalizedResources )
+ {
+ FreeLibrary( g_nonLocalizedResources );
+ }
+
+ if ( g_localizedResources )
+ {
+ FreeLibrary( g_localizedResources );
+ }
+
+ // 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/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardApp.h b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardApp.h
new file mode 100644
index 00000000..379c9e4b
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardApp.h
@@ -0,0 +1,48 @@
+/* -*- 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 __AFXWIN_H__
+ #error include 'stdafx.h' before including this file for PCH
+#endif
+
+#include "resource.h" // main symbols
+
+
+// CWiz97_3App:
+// See Wiz97_3.cpp for the implementation of this class
+//
+
+class CPrinterSetupWizardApp : public CWinApp
+{
+public:
+CPrinterSetupWizardApp();
+
+// Overrides
+public:
+virtual BOOL InitInstance();
+
+// Implementation
+
+DECLARE_MESSAGE_MAP()
+};
+
+
+extern CPrinterSetupWizardApp theApp;
+extern HINSTANCE GetNonLocalizedResources();
+extern HINSTANCE GetLocalizedResources();
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.rc b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.rc
new file mode 100755
index 00000000..198890fd
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.rc
@@ -0,0 +1,310 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource_loc_res.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+#include "WinVersRes.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Russian resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
+#ifdef _WIN32
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+#pragma code_page(1251)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource_loc_res.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 ""res\\PrinterSetupWizardLocRes.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
+ "#include ""afxres.rc"" // Standard components\r\n"
+ "#endif\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // Russian resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// 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
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ABOUTBOX DIALOGEX 0, 0, 235, 55
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
+ WS_SYSMENU
+CAPTION "About Printer Wizard"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ ICON 128,IDC_STATIC,11,17,20,20
+ LTEXT "Printer Wizard Version 1.0",IDC_STATIC,40,10,119,
+ 8,SS_NOPREFIX
+ LTEXT "Copyright (C) 2002",IDC_STATIC,40,25,119,8
+ DEFPUSHBUTTON "OK",IDOK,178,7,50,16,WS_GROUP
+END
+
+IDD_PRINTERSETUPWIZARD_DIALOG DIALOGEX 0, 0, 320, 200
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE |
+ WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_APPWINDOW
+CAPTION "Bonjour Printer Wizard"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,263,7,50,16
+ PUSHBUTTON "Cancel",IDCANCEL,263,25,50,16
+ PUSHBUTTON "Start Wizard",IDC_BUTTON1,100,86,109,35
+END
+
+IDD_SECOND_PAGE DIALOGEX 0, 0, 290, 154
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "Bonjour Printer Wizard"
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+ LTEXT "Shared printers:",IDC_STATIC,3,0,171,8
+ CONTROL "",IDC_BROWSE_LIST,"SysTreeView32",TVS_DISABLEDRAGDROP |
+ TVS_SHOWSELALWAYS | TVS_FULLROWSELECT | WS_BORDER |
+ WS_TABSTOP,2,11,286,101
+ LTEXT "Description:",IDC_DESCRIPTION_LABEL,13,128,39,8
+ LTEXT "Location:",IDC_LOCATION_LABEL,13,139,30,8
+ GROUPBOX "Printer information",IDC_PRINTER_INFORMATION,2,116,286,
+ 37
+ LTEXT "",IDC_DESCRIPTION_FIELD,57,128,226,8
+ LTEXT "",IDC_LOCATION_FIELD,57,139,226,8
+END
+
+IDD_FIRST_PAGE DIALOGEX 0, 0, 290, 199
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "Bonjour Printer Wizard"
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+ LTEXT "Welcome to the Bonjour Printer Wizard",
+ IDC_GREETING,114,7,171,46
+ LTEXT "To continue, click Next.",IDC_STATIC,115,188,143,8
+ LTEXT "This wizard helps you connect to a shared printer using Bonjour. Make sure your printer is turned on and connected to your network.",
+ IDC_STATIC,114,60,171,62
+END
+
+IDD_THIRD_PAGE DIALOGEX 0, 0, 290, 154
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
+ WS_SYSMENU
+CAPTION "Bonjour Printer Wizard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ CONTROL "",IDC_PRINTER_MODEL,"SysListView32",LVS_REPORT |
+ LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING |
+ LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,110,58,178,76
+ CONTROL "",IDC_PRINTER_MANUFACTURER,"SysListView32",LVS_REPORT |
+ LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SORTASCENDING |
+ LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,2,58,105,76
+ ICON 1017,1,3,5,20,27
+ LTEXT "",IDC_PRINTER_NAME,40,5,173,8
+ LTEXT "The Bonjour Printer Wizard has auto-selected the following printer settings. To continue installing this printer, click Next.",
+ IDC_PRINTER_SELECTION_TEXT,40,18,243,33
+ CONTROL "Use this printer as the default printer",
+ IDC_DEFAULT_PRINTER,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,3,142,140,10
+ PUSHBUTTON "Have Disk...",IDC_HAVE_DISK,238,140,50,14
+END
+
+IDD_FOURTH_PAGE DIALOGEX 0, 0, 290, 199
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "Bonjour Printer Wizard"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ LTEXT "Completing the Bonjour Printer Wizard",IDC_GOODBYE,
+ 116,7,171,27
+ LTEXT "You are ready to complete the Bonjour Printer Wizard. The printer has the following settings:",
+ IDC_STATIC,116,42,171,31
+ LTEXT "Name:",IDC_STATIC,116,78,22,8
+ LTEXT "Manufacturer:",IDC_STATIC,116,91,47,8
+ LTEXT "Model:",IDC_STATIC,116,104,22,8
+ LTEXT "Protocol:",IDC_STATIC,116,117,38,8
+ LTEXT "Default:",IDC_STATIC,116,130,27,8
+ LTEXT "",IDC_PRINTER_NAME,172,78,113,8,SS_ENDELLIPSIS
+ LTEXT "",IDC_PRINTER_MANUFACTURER,172,91,113,8
+ LTEXT "",IDC_PRINTER_MODEL,172,104,113,8
+ LTEXT "",IDC_PRINTER_PROTOCOL,172,117,113,8
+ LTEXT "",IDC_PRINTER_DEFAULT,172,130,113,8
+ LTEXT "To complete the installation, click Finish.",IDC_COMPLETE1,116,180,171,8
+ LTEXT "To change these settings, click Back.",IDC_COMPLETE2,116,190,171,8
+ LTEXT "Please wait a few moments while the Bonjour Printer Wizard installs the printer.",IDC_INSTALLING,116,170,171,31
+ CONTROL "",IDC_PROGRESS,"msctls_progress32",WS_BORDER,116,190,165,8
+END
+
+IDD_DIALOG1 DIALOGEX 0, 0, 265, 130
+STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
+ WS_SYSMENU
+CAPTION "Dialog"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ CONTROL 138,IDC_STATIC,"Static",SS_BITMAP | SS_REALSIZEIMAGE,0,0,
+ 265,131
+ LTEXT "Static",IDC_STATIC,77,12,19,8
+ LTEXT "Static",IDC_STATIC,71,46,19,8
+ LTEXT "Static",IDC_STATIC,71,89,19,8
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// 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 Resource Module"
+ VALUE "FileVersion", MASTER_PROD_VERS_STR
+ VALUE "InternalName", "PrinterWizardLocalized.dll"
+ VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT
+ VALUE "OriginalFilename", "PrinterWizardLocalized.dll"
+ VALUE "ProductName", MASTER_PROD_NAME
+ VALUE "ProductVersion", MASTER_PROD_VERS_STR
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1252
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE
+BEGIN
+ IDS_ABOUTBOX "&About Bonjour Printer Wizard..."
+ IDS_GOODBYE "Completing the Bonjour Printer Wizard."
+ IDS_GREETING "Welcome to the Bonjour Printer Wizard"
+ IDS_BROWSE_TITLE "Browse for Bonjour Printers"
+ IDS_BROWSE_SUBTITLE "Select the printer you want to use from the list below."
+ IDS_CAPTION "Bonjour Printer Wizard"
+ IDS_GOODBYE_GOOD1 "You are ready to complete the Bonjour Printer Wizard. The printer has the following settings:"
+ IDS_SEARCHING "Searching for printers..."
+ IDS_GOODBYTE_GOOD2 "To complete the installation, click Finish."
+ IDS_INSTALL_TITLE "Install Bonjour Printer"
+ IDS_INSTALL_SUBTITLE "The manufacturer and model determine which printer software to use."
+END
+
+STRINGTABLE
+BEGIN
+ IDS_ERROR_SELECTING_PRINTER_TEXT
+ "There was an error selecting this printer."
+ IDS_ERROR_SELECTING_PRINTER_CAPTION "Error"
+ IDS_INSTALL_ERROR_CAPTION "Error"
+ IDS_INSTALL_ERROR_MESSAGE
+ "You do not have sufficient access to your computer to connect to the selected printer."
+ IDS_NO_MATCH_INF_FILE "The software that you chose does not match the selected printer."
+ IDS_NO_MATCH_INF_FILE_CAPTION "Select Device"
+ IDS_BAD_INF_FILE "The specified location does not contain information about your printer"
+ IDS_BAD_INF_FILE_CAPTION "Select Device"
+ IDS_MANUFACTURER_HEADING "Manufacturer"
+ IDS_MODEL_HEADING "Model"
+ IDS_NO_PRINTERS "No Bonjour Printers are available"
+ IDS_NO_MDNSRESPONDER_SERVICE_TEXT "Bonjour Service is not available."
+ IDS_NO_MDNSRESPONDER_SERVICE_CAPTION "Error"
+ IDS_PRINTER_MATCH_GOOD "The Bonjour Printer Wizard has auto-selected the following printer settings. Click 'Next' to continue installing this printer."
+ IDS_PRINTER_MATCH_BAD "The Bonjour Printer Wizard cannot find a driver for this printer. Manually select from the list, or click 'Have Disk' if your printer came with an installation disk. "
+ IDS_PRINTER_MATCH_MAYBE "The Bonjour Printer Wizard has selected a generic printer driver for this printer. If your printer came with an installation disk, click 'Have Disk' now to load the manufacturer's drivers."
+ IDS_YES "Yes"
+ IDS_NO "No"
+ IDS_LARGE_FONT "MS Sans Serif"
+ IDS_FIREWALL "Please check firewall setting to ensure the Bonjour Printer Wizard operates correctly."
+ IDS_ERROR_CAPTION "Error"
+ IDS_PRINTER_UNAVAILABLE "The Bonjour printer you have selected is no longer available. Please make sure the printer is powered-on and plugged-in."
+END
+
+STRINGTABLE
+BEGIN
+ IDS_FIREWALL_CAPTION "Firewall Detected"
+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 "res\PrinterSetupWizardLocRes.rc2" // non-Microsoft Visual C++ edited resources
+#include "afxres.rc" // Standard components
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcproj b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcproj
new file mode 100755
index 00000000..3b3c68f9
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcproj
@@ -0,0 +1,441 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="PrinterSetupWizardLocRes"
+ ProjectGUID="{967F5375-0176-43D3-ADA3-22EE25551C37}"
+ Keyword="MFCProj"
+ >
+ <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"
+ CharacterSet="2"
+ >
+ <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="..\..\mDNSWindows"
+ PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0400;UNICODE;_UNICODE"
+ StringPooling="true"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ CallingConvention="0"
+ DisableSpecificWarnings="4702"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir);../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist $(OutDir)\PrinterWizard.Resources mkdir $(OutDir)\PrinterWizard.Resources&#x0D;&#x0A;if not exist $(OutDir)\PrinterWizard.Resources\en.lproj mkdir $(OutDir)\PrinterWizard.Resources\en.lproj&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\PrinterWizard.Resources\en.lproj\PrinterWizardLocalized.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="true"
+ ImportLibrary="$(OutDir)/Localized.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"
+ UseOfMFC="1"
+ CharacterSet="2"
+ >
+ <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="..\..\mDNSWindows"
+ PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0400;UNICODE;_UNICODE"
+ StringPooling="true"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ DisableSpecificWarnings="4702"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir);../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist $(OutDir)\PrinterWizard.Resources mkdir $(OutDir)\PrinterWizard.Resources&#x0D;&#x0A;if not exist $(OutDir)\PrinterWizard.Resources\en.lproj mkdir $(OutDir)\PrinterWizard.Resources\en.lproj&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\PrinterWizard.Resources\en.lproj\PrinterWizardLocalized.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="true"
+ ImportLibrary="$(OutDir)/Localized.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"
+ 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"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\mDNSWindows"
+ PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;WINVER=0x0400;UNICODE;_UNICODE"
+ StringPooling="true"
+ MinimalRebuild="false"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4702"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir);../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist $(OutDir)\PrinterWizard.Resources mkdir $(OutDir)\PrinterWizard.Resources&#x0D;&#x0A;if not exist $(OutDir)\PrinterWizard.Resources\en.lproj mkdir $(OutDir)\PrinterWizard.Resources\en.lproj&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\PrinterWizard.Resources\en.lproj\PrinterWizardLocalized.dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="false"
+ SubSystem="2"
+ OptimizeReferences="0"
+ EnableCOMDATFolding="0"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="true"
+ ImportLibrary="$(IntDir)/$(TargetName).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)\Program Files\Bonjour Print Services\$(PlatformName)\PrinterWizard.Resources\en.lproj&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour Print Services\$(PlatformName)\PrinterWizard.Resources\en.lproj&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot; &quot;$(DSTROOT)\Program Files\Bonjour Print Services\$(PlatformName)\PrinterWizard.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"
+ 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"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\mDNSWindows"
+ PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;WINVER=0x0400;UNICODE;_UNICODE"
+ StringPooling="true"
+ MinimalRebuild="false"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4702"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir);../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist $(OutDir)\PrinterWizard.Resources mkdir $(OutDir)\PrinterWizard.Resources&#x0D;&#x0A;if not exist $(OutDir)\PrinterWizard.Resources\en.lproj mkdir $(OutDir)\PrinterWizard.Resources\en.lproj&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\PrinterWizard.Resources\en.lproj\PrinterWizardLocalized.dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="false"
+ SubSystem="2"
+ OptimizeReferences="0"
+ EnableCOMDATFolding="0"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="true"
+ ImportLibrary="$(IntDir)/$(TargetName).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 Print Services\$(PlatformName)\PrinterWizard.Resources\en.lproj&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour Print Services\$(PlatformName)\PrinterWizard.Resources\en.lproj&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot; &quot;$(DSTROOT)\Program Files\Bonjour Print Services\$(PlatformName)\PrinterWizard.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_dll.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest"
+ >
+ <File
+ RelativePath="PrinterSetupWizardLocRes.rc"
+ >
+ </File>
+ <File
+ RelativePath="res\PrinterSetupWizardLocRes.rc2"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ <Global
+ Name="RESOURCE_FILE"
+ Value="PrinterSetupWizardLocRes.rc"
+ />
+ </Globals>
+</VisualStudioProject>
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj
new file mode 100755
index 00000000..86affb8c
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj
@@ -0,0 +1,345 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Template|Win32">
+ <Configuration>Template</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Template|x64">
+ <Configuration>Template</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{967F5375-0176-43D3-ADA3-22EE25551C37}</ProjectGuid>
+ <Keyword>MFCProj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\PrinterWizard.Resources\en.lproj\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\PrinterWizard.Resources\en.lproj\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\PrinterWizard.Resources\en.lproj\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\PrinterWizard.Resources\en.lproj\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\PrinterWizard.Resources\en.lproj\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\PrinterWizard.Resources\en.lproj\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">PrinterWizardLocalized</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PrinterWizardLocalized</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">PrinterWizardLocalized</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">PrinterWizardLocalized</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">PrinterWizardLocalized</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|x64'">PrinterWizardLocalized</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|x64'">.dll</TargetExt>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>false</MkTypLibCompatible>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <CallingConvention>Cdecl</CallingConvention>
+ <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist $(OutDir)PrinterWizard.Resources mkdir $(OutDir)PrinterWizard.Resources
+if not exist $(OutDir)PrinterWizard.Resources\en.lproj mkdir $(OutDir)PrinterWizard.Resources\en.lproj
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <OutputFile>$(OutDir)PrinterWizardLocalized.dll</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <EntryPointSymbol>
+ </EntryPointSymbol>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(OutDir)Localized.lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>false</MkTypLibCompatible>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>Cdecl</CallingConvention>
+ <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist $(OutDir)PrinterWizard.Resources mkdir $(OutDir)PrinterWizard.Resources
+if not exist $(OutDir)PrinterWizard.Resources\en.lproj mkdir $(OutDir)PrinterWizard.Resources\en.lproj
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <OutputFile>$(OutDir)PrinterWizardLocalized.dll</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <EntryPointSymbol>
+ </EntryPointSymbol>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(OutDir)Localized.lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>false</MkTypLibCompatible>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist $(OutDir)PrinterWizard.Resources mkdir $(OutDir)PrinterWizard.Resources
+if not exist $(OutDir)PrinterWizard.Resources\en.lproj mkdir $(OutDir)PrinterWizard.Resources\en.lproj
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <OutputFile>$(OutDir)PrinterWizardLocalized.dll</OutputFile>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>
+ </OptimizeReferences>
+ <EnableCOMDATFolding>
+ </EnableCOMDATFolding>
+ <EntryPointSymbol>
+ </EntryPointSymbol>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources\en.lproj" mkdir "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources\en.lproj"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources\en.lproj"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>false</MkTypLibCompatible>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist $(OutDir)PrinterWizard.Resources mkdir $(OutDir)PrinterWizard.Resources
+if not exist $(OutDir)PrinterWizard.Resources\en.lproj mkdir $(OutDir)PrinterWizard.Resources\en.lproj
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <OutputFile>$(OutDir)PrinterWizardLocalized.dll</OutputFile>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>
+ </OptimizeReferences>
+ <EnableCOMDATFolding>
+ </EnableCOMDATFolding>
+ <EntryPointSymbol>
+ </EntryPointSymbol>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources\en.lproj" mkdir "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources\en.lproj"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources\en.lproj"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
+ <Link>
+ <OutputFile>$(OutDir)PrinterWizardLocalized.dll</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'">
+ <Link>
+ <OutputFile>$(OutDir)PrinterWizardLocalized.dll</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="resource_loc_dll.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="PrinterSetupWizardLocRes.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\PrinterSetupWizardLocRes.rc2" />
+ <None Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\mDNSWindows\DLL\dnssd.vcxproj">
+ <Project>{ab581101-18f0-46f6-b56a-83a6b1ea657e}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+ <ProjectExtensions>
+ <VisualStudio>
+ <UserProperties RESOURCE_FILE="PrinterSetupWizardLocRes.rc" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj.filters b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj.filters
new file mode 100755
index 00000000..b0c2900e
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardLocRes.vcxproj.filters
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{7a783aeb-7735-4f37-9b8d-ae201c3bf118}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{e9d0d017-9740-4270-9ab9-b3b50c3bff30}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="resource_loc_dll.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="PrinterSetupWizardLocRes.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\PrinterSetupWizardLocRes.rc2">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="ReadMe.txt" />
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.rc b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.rc
new file mode 100755
index 00000000..067aabfe
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.rc
@@ -0,0 +1,173 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource_res.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+#include "WinVersRes.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Russian resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
+#ifdef _WIN32
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+#pragma code_page(1251)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource_res.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 ""res\\PrinterSetupWizardRes.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
+ "#include ""afxres.rc"" // Standard components\r\n"
+ "#endif\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // Russian resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// 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.
+IDR_MAINFRAME ICON "res\\NetworkPrinter.ico"
+IDI_INFO ICON "res\\Info.ico"
+IDI_PRINTER ICON "res\\NetworkPrinter.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_WATERMARK BITMAP "res\\watermark.bmp"
+IDB_BANNER_ICON BITMAP "res\\banner_icon.bmp"
+IDB_ABOUT BITMAP "res\\about.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// 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 Resource Module"
+ VALUE "FileVersion", MASTER_PROD_VERS_STR
+ VALUE "InternalName", "PrinterWizardLocalized.dll"
+ VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT
+ VALUE "OriginalFilename", "PrinterWizardLocalized.dll"
+ VALUE "ProductName", MASTER_PROD_NAME
+ VALUE "ProductVersion", MASTER_PROD_VERS_STR
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1252
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+#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 "res\PrinterSetupWizardRes.rc2" // non-Microsoft Visual C++ edited resources
+#include "afxres.rc" // Standard components
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcproj b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcproj
new file mode 100755
index 00000000..07d05f07
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcproj
@@ -0,0 +1,465 @@
+<?xml version="1.0" encoding="windows-1251"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="PrinterSetupWizardRes"
+ ProjectGUID="{CFCCB176-6CAA-472B-B0A2-90511C8E2E52}"
+ Keyword="MFCProj"
+ >
+ <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"
+ CharacterSet="2"
+ >
+ <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="..\..\mDNSWindows"
+ PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0400;UNICODE;_UNICODE"
+ StringPooling="true"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ CallingConvention="0"
+ DisableSpecificWarnings="4702"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir);../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist Debug\PrinterWizard.Resources mkdir Debug\PrinterWizard.Resources"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\PrinterWizard.Resources\PrinterWizardResources.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="true"
+ ImportLibrary="$(OutDir)/Localized.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"
+ UseOfMFC="1"
+ CharacterSet="2"
+ >
+ <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="..\..\mDNSWindows"
+ PreprocessorDefinitions="WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0400;UNICODE;_UNICODE"
+ StringPooling="true"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ BufferSecurityCheck="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ CallingConvention="0"
+ DisableSpecificWarnings="4702"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir);../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist Debug\PrinterWizard.Resources mkdir Debug\PrinterWizard.Resources"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\PrinterWizard.Resources\PrinterWizardResources.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="true"
+ ImportLibrary="$(OutDir)/Localized.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"
+ 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"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\mDNSWindows"
+ PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;WINVER=0x0400;UNICODE;_UNICODE"
+ StringPooling="true"
+ MinimalRebuild="false"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4702"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir);../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist Release mkdir Release&#x0D;&#x0A;if not exist &quot;Release\PrinterWizard.Resources&quot; mkdir &quot;Release\PrinterWizard.Resources&quot;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\PrinterWizard.Resources\PrinterWizardResources.dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="false"
+ SubSystem="2"
+ OptimizeReferences="0"
+ EnableCOMDATFolding="0"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="true"
+ ImportLibrary="$(IntDir)/$(TargetName).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)\Program Files\Bonjour Print Services\$(PlatformName)\PrinterWizard.Resources&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour Print Services\$(PlatformName)\PrinterWizard.Resources&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot; &quot;$(DSTROOT)\Program Files\Bonjour Print Services\$(PlatformName)\PrinterWizard.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"
+ 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"
+ OmitFramePointers="true"
+ AdditionalIncludeDirectories="..\..\mDNSWindows"
+ PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;WINVER=0x0400;UNICODE;_UNICODE"
+ StringPooling="true"
+ MinimalRebuild="false"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ TreatWChar_tAsBuiltInType="true"
+ UsePrecompiledHeader="0"
+ WarningLevel="4"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ DisableSpecificWarnings="4702"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="1033"
+ AdditionalIncludeDirectories="$(IntDir);../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ Description="Building Output Directories"
+ CommandLine="if not exist Release mkdir Release&#x0D;&#x0A;if not exist &quot;Release\PrinterWizard.Resources&quot; mkdir &quot;Release\PrinterWizard.Resources&quot;&#x0D;&#x0A;"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)\PrinterWizard.Resources\PrinterWizardResources.dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="false"
+ SubSystem="2"
+ OptimizeReferences="0"
+ EnableCOMDATFolding="0"
+ EntryPointSymbol=""
+ ResourceOnlyDLL="true"
+ ImportLibrary="$(IntDir)/$(TargetName).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 Print Services\$(PlatformName)\PrinterWizard.Resources&quot; mkdir &quot;$(DSTROOT)\Program Files\Bonjour Print Services\$(PlatformName)\PrinterWizard.Resources&quot;&#x0D;&#x0A;xcopy /I/Y &quot;$(TargetPath)&quot; &quot;$(DSTROOT)\Program Files\Bonjour Print Services\$(PlatformName)\PrinterWizard.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_dll.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="res\banner_icon.bmp"
+ >
+ </File>
+ <File
+ RelativePath=".\res\Info.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\NetworkPrinter.ico"
+ >
+ </File>
+ <File
+ RelativePath=".\res\Printer.bmp"
+ >
+ </File>
+ <File
+ RelativePath="PrinterSetupWizardRes.rc"
+ >
+ </File>
+ <File
+ RelativePath="res\PrinterSetupWizardRes.rc2"
+ >
+ </File>
+ <File
+ RelativePath="res\watermark.bmp"
+ >
+ </File>
+ </Filter>
+ <File
+ RelativePath="ReadMe.txt"
+ >
+ </File>
+ </Files>
+ <Globals>
+ <Global
+ Name="RESOURCE_FILE"
+ Value="PrinterSetupWizardRes.rc"
+ />
+ </Globals>
+</VisualStudioProject>
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj
new file mode 100755
index 00000000..16befa70
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj
@@ -0,0 +1,347 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Template|Win32">
+ <Configuration>Template</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Template|x64">
+ <Configuration>Template</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{CFCCB176-6CAA-472B-B0A2-90511C8E2E52}</ProjectGuid>
+ <Keyword>MFCProj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>Static</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\PrinterWizard.Resources\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\PrinterWizard.Resources\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\PrinterWizard.Resources\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\PrinterWizard.Resources\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">PrinterWizardResources</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">PrinterWizardResources</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.dll</TargetExt>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\PrinterWizard.Resources\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">PrinterWizardResources</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">PrinterWizardResources</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.dll</TargetExt>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">PrinterWizardResources</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.dll</TargetExt>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\PrinterWizard.Resources\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Template|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Template|x64'">PrinterWizardResources</TargetName>
+ <TargetExt Condition="'$(Configuration)|$(Platform)'=='Template|x64'">.dll</TargetExt>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>false</MkTypLibCompatible>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <CallingConvention>Cdecl</CallingConvention>
+ <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist Debug\PrinterWizard.Resources mkdir Debug\PrinterWizard.Resources</Command>
+ </PreLinkEvent>
+ <Link>
+ <OutputFile>$(OutDir)PrinterWizardResources.dll</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <EntryPointSymbol>
+ </EntryPointSymbol>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(OutDir)Localized.lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>false</MkTypLibCompatible>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUGS;DEBUG=1;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CallingConvention>Cdecl</CallingConvention>
+ <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist Debug\PrinterWizard.Resources mkdir Debug\PrinterWizard.Resources</Command>
+ </PreLinkEvent>
+ <Link>
+ <OutputFile>$(OutDir)PrinterWizardResources.dll</OutputFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <EntryPointSymbol>
+ </EntryPointSymbol>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(OutDir)Localized.lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>false</MkTypLibCompatible>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist Release mkdir Release
+if not exist "Release\PrinterWizard.Resources" mkdir "Release\PrinterWizard.Resources"
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <OutputFile>$(OutDir)PrinterWizardResources.dll</OutputFile>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>
+ </OptimizeReferences>
+ <EnableCOMDATFolding>
+ </EnableCOMDATFolding>
+ <EntryPointSymbol>
+ </EntryPointSymbol>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources" mkdir "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>false</MkTypLibCompatible>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <OmitFramePointers>true</OmitFramePointers>
+ <AdditionalIncludeDirectories>..\..\mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;WINVER=0x0400;UNICODE;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <MinimalRebuild>false</MinimalRebuild>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level4</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <DisableSpecificWarnings>4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0409</Culture>
+ <AdditionalIncludeDirectories>$(IntDir);../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Message>Building Output Directories</Message>
+ <Command>if not exist Release mkdir Release
+if not exist "Release\PrinterWizard.Resources" mkdir "Release\PrinterWizard.Resources"
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <OutputFile>$(OutDir)PrinterWizardResources.dll</OutputFile>
+ <GenerateDebugInformation>false</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <OptimizeReferences>
+ </OptimizeReferences>
+ <EnableCOMDATFolding>
+ </EnableCOMDATFolding>
+ <EntryPointSymbol>
+ </EntryPointSymbol>
+ <NoEntryPoint>true</NoEntryPoint>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ </Link>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources" mkdir "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour Print Services\$(Platform)\PrinterWizard.Resources"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|Win32'">
+ <Link>
+ <OutputFile>$(OutDir)PrinterWizardResources.dll</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Template|x64'">
+ <Link>
+ <OutputFile>$(OutDir)PrinterWizardResources.dll</OutputFile>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="resource_dll.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\about.bmp" />
+ <None Include="res\banner_icon.bmp" />
+ <None Include="res\Info.ico" />
+ <None Include="res\NetworkPrinter.ico" />
+ <None Include="res\Printer.bmp" />
+ <None Include="res\PrinterSetupWizardRes.rc2" />
+ <None Include="res\watermark.bmp" />
+ <None Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="PrinterSetupWizardRes.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\mDNSWindows\DLL\dnssd.vcxproj">
+ <Project>{ab581101-18f0-46f6-b56a-83a6b1ea657e}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+ <ProjectExtensions>
+ <VisualStudio>
+ <UserProperties RESOURCE_FILE="PrinterSetupWizardRes.rc" />
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj.filters b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj.filters
new file mode 100755
index 00000000..e5b0f595
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardRes.vcxproj.filters
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{f366b81b-a033-4fe2-83f9-f249205c8f41}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{dd34ed24-7798-4514-b9b3-ecc1172409a0}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="resource_dll.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\about.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\banner_icon.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\Info.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\NetworkPrinter.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\Printer.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\PrinterSetupWizardRes.rc2">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="res\watermark.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="PrinterSetupWizardRes.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardSheet.cpp b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardSheet.cpp
new file mode 100644
index 00000000..47e5f911
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardSheet.cpp
@@ -0,0 +1,1949 @@
+/* -*- 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"
+#include "PrinterSetupWizardApp.h"
+#include "PrinterSetupWizardSheet.h"
+#include "CommonServices.h"
+#include "DebugServices.h"
+#include "WinServices.h"
+#include "About.h"
+#include "tcpxcv.h"
+#include <winspool.h>
+#include <string>
+#include <shlwapi.h>
+
+// unreachable code
+#pragma warning(disable:4702)
+
+
+#if( !TARGET_OS_WINDOWS_CE )
+# include <mswsock.h>
+# include <process.h>
+#endif
+
+
+#if defined( UNICODE ) || defined( _UNICODE )
+# define GetEnv _wgetenv
+#else
+# define GetEnv getenv
+#endif
+
+static TCHAR*
+g_printerDriverFiles[] = // Printer driver files
+{
+ TEXT( "ps5ui.dll" ),
+ TEXT( "pscript.hlp" ),
+ TEXT( "pscript.ntf" ),
+ TEXT( "pscript5.dll" ),
+ TEXT( "cups6.ini" ),
+ TEXT( "cupsui6.dll" ),
+ TEXT( "cupsps6.dll" )
+};
+
+
+// Private Messages
+
+#define WM_SOCKET_EVENT ( WM_USER + 0x100 )
+#define WM_PROCESS_EVENT ( WM_USER + 0x101 )
+
+
+static BOOL
+Is64BitWindows()
+{
+#if defined(_WIN64)
+ return TRUE; // 64-bit programs run only on Win64
+#else
+ typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS)( HANDLE, PBOOL );
+ LPFN_ISWOW64PROCESS fnIsWow64Process;
+ BOOL bIsWow64 = FALSE;
+
+ fnIsWow64Process = ( LPFN_ISWOW64PROCESS ) GetProcAddress( GetModuleHandle( TEXT( "kernel32" ) ), "IsWow64Process" );
+
+ if ( fnIsWow64Process != NULL )
+ {
+ BOOL ok;
+
+ ok = fnIsWow64Process( GetCurrentProcess(), &bIsWow64 );
+
+ if ( !ok )
+ {
+ bIsWow64 = FALSE;
+ }
+ }
+
+ return bIsWow64;
+#endif
+}
+
+
+// CPrinterSetupWizardSheet
+CPrinterSetupWizardSheet * CPrinterSetupWizardSheet::m_self;
+
+IMPLEMENT_DYNAMIC(CPrinterSetupWizardSheet, CPropertySheet)
+CPrinterSetupWizardSheet::CPrinterSetupWizardSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
+ :CPropertySheet(nIDCaption, pParentWnd, iSelectPage),
+ m_selectedPrinter(NULL),
+ m_driverThreadExitCode( 0 ),
+ m_driverThreadFinished( false ),
+ m_pdlBrowser( NULL ),
+ m_ippBrowser( NULL ),
+ m_lprBrowser( NULL ),
+ m_lastPage( NULL )
+{
+ m_arrow = LoadCursor(0, IDC_ARROW);
+ m_wait = LoadCursor(0, IDC_APPSTARTING);
+ m_active = m_arrow;
+ m_self = this;
+
+ Init();
+
+ LoadPrinterNames();
+}
+
+
+CPrinterSetupWizardSheet::~CPrinterSetupWizardSheet()
+{
+ Printer * printer;
+
+ while ( m_printers.size() > 0 )
+ {
+ printer = m_printers.front();
+ m_printers.pop_front();
+
+ delete printer;
+ }
+
+ m_self = NULL;
+}
+
+
+// ------------------------------------------------------
+// SetSelectedPrinter
+//
+// Manages setting a printer as the printer to install. Stops
+// any pending resolves.
+//
+void
+CPrinterSetupWizardSheet::SetSelectedPrinter(Printer * printer)
+{
+ check( !printer || ( printer != m_selectedPrinter ) );
+
+ m_selectedPrinter = printer;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::LoadPrinterNames()
+{
+ PBYTE buffer = NULL;
+ OSStatus err = 0;
+
+ //
+ // rdar://problem/3701926 - Printer can't be installed twice
+ //
+ // First thing we want to do is make sure the printer isn't already installed.
+ // If the printer name is found, we'll try and rename it until we
+ // find a unique name
+ //
+ DWORD dwNeeded = 0, dwNumPrinters = 0;
+
+ BOOL ok = EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 4, NULL, 0, &dwNeeded, &dwNumPrinters);
+ err = translate_errno( ok, errno_compat(), kUnknownErr );
+
+ if ((err == ERROR_INSUFFICIENT_BUFFER) && (dwNeeded > 0))
+ {
+ try
+ {
+ buffer = new unsigned char[dwNeeded];
+ }
+ catch (...)
+ {
+ buffer = NULL;
+ }
+
+ require_action( buffer, exit, kNoMemoryErr );
+ ok = EnumPrinters(PRINTER_ENUM_LOCAL, NULL, 4, buffer, dwNeeded, &dwNeeded, &dwNumPrinters);
+ err = translate_errno( ok, errno_compat(), kUnknownErr );
+ require_noerr( err, exit );
+
+ for (DWORD index = 0; index < dwNumPrinters; index++)
+ {
+ PRINTER_INFO_4 * lppi4 = (PRINTER_INFO_4*) (buffer + index * sizeof(PRINTER_INFO_4));
+
+ m_printerNames.push_back( lppi4->pPrinterName );
+ }
+ }
+
+exit:
+
+ if (buffer != NULL)
+ {
+ delete [] buffer;
+ }
+
+ return err;
+}
+
+
+
+// ------------------------------------------------------
+// InstallPrinter
+//
+// Installs a printer with Windows.
+//
+// Note: this works one of two ways, depending on whether
+// there are drivers already installed for this printer.
+// If there are, then we can just create a port with XcvData,
+// and then call AddPrinter. If not, we use the printui.dll
+// to install the printer. Actually installing drivers that
+// are not currently installed is painful, and it's much
+// easier and less error prone to just let printui.dll do
+// the hard work for us.
+//
+
+OSStatus
+CPrinterSetupWizardSheet::InstallPrinter(Printer * printer)
+{
+ Logger log;
+ CUPSLibrary cupsLib;
+ Service * service = NULL;
+ BOOL ok;
+ OSStatus err = 0;
+
+ service = printer->services.front();
+ check( service );
+
+ if ( printer->isCUPSPrinter && cupsLib.IsInstalled() )
+ {
+ err = InstallPrinterCUPS( printer, service, cupsLib );
+ require_noerr( err, exit );
+ }
+ else
+ {
+ //
+ // if the driver isn't installed, then install it
+ //
+
+ if ( !printer->driverInstalled )
+ {
+ DWORD dwResult;
+ HANDLE hThread;
+ unsigned threadID;
+
+ m_driverThreadFinished = false;
+
+ //
+ // create the thread
+ //
+ hThread = (HANDLE) _beginthreadex_compat( NULL, 0, InstallDriverThread, printer, 0, &threadID );
+ err = translate_errno( hThread, (OSStatus) GetLastError(), kUnknownErr );
+ require_noerr_with_log( log, "_beginthreadex_compat()", err, exit );
+
+ //
+ // go modal
+ //
+ while (!m_driverThreadFinished)
+ {
+ MSG msg;
+
+ GetMessage( &msg, m_hWnd, 0, 0 );
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+
+ //
+ // Wait until child process exits.
+ //
+ dwResult = WaitForSingleObject( hThread, INFINITE );
+ err = translate_errno( dwResult == WAIT_OBJECT_0, errno_compat(), err = kUnknownErr );
+ require_noerr_with_log( log, "WaitForSingleObject()", err, exit );
+
+ //
+ // check the return value of thread
+ //
+ require_noerr_with_log( log, "thread exit code", m_driverThreadExitCode, exit );
+
+ //
+ // now we know that the driver was successfully installed
+ //
+ printer->driverInstalled = true;
+ }
+
+ if ( service->type == kPDLServiceType )
+ {
+ err = InstallPrinterPort( printer, service, PROTOCOL_RAWTCP_TYPE, log );
+ require_noerr_with_log( log, "InstallPrinterPort()", err, exit );
+ err = InstallPrinterPDLAndLPR( printer, service, log );
+ require_noerr_with_log( log, "InstallPrinterPDLAndLPR()", err, exit );
+ }
+ else if ( service->type == kLPRServiceType )
+ {
+ err = InstallPrinterPort( printer, service, PROTOCOL_LPR_TYPE, log );
+ require_noerr_with_log( log, "InstallPrinterPort()", err, exit );
+ err = InstallPrinterPDLAndLPR( printer, service, log );
+ require_noerr_with_log( log, "InstallPrinterPDLAndLPR()", err, exit );
+ }
+ else if ( service->type == kIPPServiceType )
+ {
+ // There's no need to install a printer port for IPP printers, because
+ // the call to AddPrinter() will do that for us.
+
+ err = InstallPrinterIPP( printer, service, log );
+ require_noerr_with_log( log, "InstallPrinterIPP()", err, exit );
+ }
+ else
+ {
+ require_action_with_log( log, ( service->type == kPDLServiceType ) || ( service->type == kLPRServiceType ) || ( service->type == kIPPServiceType ), exit, err = kUnknownErr );
+ }
+ }
+
+ printer->installed = true;
+
+ //
+ // if the user specified a default printer, set it
+ //
+ if (printer->deflt)
+ {
+ ok = SetDefaultPrinter( printer->actualName );
+ err = translate_errno( ok, errno_compat(), err = kUnknownErr );
+ require_noerr_with_log( log, "SetDefaultPrinter()", err, exit );
+ }
+
+exit:
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::InstallPrinterPort( Printer * printer, Service * service, DWORD protocol, Logger & log )
+{
+ PRINTER_DEFAULTS printerDefaults = { NULL, NULL, SERVER_ACCESS_ADMINISTER };
+ PORT_DATA_1 portData;
+ DWORD dwStatus;
+ DWORD cbInputData = 100;
+ PBYTE pOutputData = NULL;
+ DWORD cbOutputNeeded = 0;
+ HANDLE hXcv = NULL;
+ Queue * q;
+ BOOL ok;
+ OSStatus err;
+
+ ZeroMemory(&portData, sizeof(PORT_DATA_1));
+
+ require_action_with_log( log, wcslen(printer->portName) < sizeof_array(portData.sztPortName), exit, err = kSizeErr );
+ wcscpy_s(portData.sztPortName, printer->portName);
+
+ q = service->queues.front();
+ check( q );
+
+ ok = OpenPrinter(L",XcvMonitor Standard TCP/IP Port", &hXcv, &printerDefaults);
+ err = translate_errno( ok, errno_compat(), kUnknownErr );
+ require_noerr_with_log( log, "OpenPrinter()", err, exit );
+
+ //
+ // BUGBUG: MSDN said this is not required, but my experience shows it is required
+ //
+ try
+ {
+ pOutputData = new BYTE[cbInputData];
+ }
+ catch (...)
+ {
+ pOutputData = NULL;
+ }
+
+ require_action_with_log( log, pOutputData, exit, err = kNoMemoryErr );
+
+ portData.dwPortNumber = service->portNumber;
+ portData.dwVersion = 1;
+ portData.dwDoubleSpool = 1;
+
+ portData.dwProtocol = protocol;
+ portData.cbSize = sizeof PORT_DATA_1;
+ portData.dwReserved = 0L;
+
+ require_action_with_log( log, wcslen(q->name) < sizeof_array(portData.sztQueue), exit, err = kSizeErr );
+ wcscpy_s(portData.sztQueue, q->name);
+
+ require_action_with_log( log, wcslen( service->hostname ) < sizeof_array(portData.sztHostAddress), exit, err = kSizeErr );
+ wcscpy_s( portData.sztHostAddress, service->hostname );
+
+ ok = XcvData(hXcv, L"AddPort", (PBYTE) &portData, sizeof(PORT_DATA_1), pOutputData, cbInputData, &cbOutputNeeded, &dwStatus);
+ err = translate_errno( ok, errno_compat(), kUnknownErr );
+ require_noerr_with_log( log, "XcvData()", err, exit );
+
+exit:
+
+ if (hXcv != NULL)
+ {
+ ClosePrinter(hXcv);
+ }
+
+ if (pOutputData != NULL)
+ {
+ delete [] pOutputData;
+ }
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::InstallPrinterPDLAndLPR(Printer * printer, Service * service, Logger & log )
+{
+ PRINTER_INFO_2 pInfo;
+ HANDLE hPrinter = NULL;
+ Queue * q;
+ OSStatus err;
+
+ check(printer != NULL);
+ check(printer->installed == false);
+
+ q = service->queues.front();
+ check( q );
+
+ //
+ // add the printer
+ //
+ ZeroMemory(&pInfo, sizeof(pInfo));
+
+ pInfo.pPrinterName = printer->actualName.GetBuffer();
+ pInfo.pServerName = NULL;
+ pInfo.pShareName = NULL;
+ pInfo.pPortName = printer->portName.GetBuffer();
+ pInfo.pDriverName = printer->modelName.GetBuffer();
+ pInfo.pComment = printer->displayModelName.GetBuffer();
+ pInfo.pLocation = q->location.GetBuffer();
+ pInfo.pDevMode = NULL;
+ pInfo.pDevMode = NULL;
+ pInfo.pSepFile = L"";
+ pInfo.pPrintProcessor = L"winprint";
+ pInfo.pDatatype = L"RAW";
+ pInfo.pParameters = L"";
+ pInfo.pSecurityDescriptor = NULL;
+ pInfo.Attributes = PRINTER_ATTRIBUTE_QUEUED;
+ pInfo.Priority = 0;
+ pInfo.DefaultPriority = 0;
+ pInfo.StartTime = 0;
+ pInfo.UntilTime = 0;
+
+ hPrinter = AddPrinter(NULL, 2, (LPBYTE) &pInfo);
+ err = translate_errno( hPrinter, errno_compat(), kUnknownErr );
+ require_noerr_with_log( log, "AddPrinter()", err, exit );
+
+exit:
+
+ if (hPrinter != NULL)
+ {
+ ClosePrinter(hPrinter);
+ }
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::InstallPrinterIPP(Printer * printer, Service * service, Logger & log)
+{
+ DEBUG_UNUSED( service );
+
+ Queue * q = service->SelectedQueue();
+ HANDLE hPrinter = NULL;
+ PRINTER_INFO_2 pInfo;
+ OSStatus err;
+
+ check( q );
+
+ //
+ // add the printer
+ //
+ ZeroMemory(&pInfo, sizeof(PRINTER_INFO_2));
+
+ pInfo.pPrinterName = printer->actualName.GetBuffer();
+ pInfo.pPortName = printer->portName.GetBuffer();
+ pInfo.pDriverName = printer->modelName.GetBuffer();
+ pInfo.pPrintProcessor = L"winprint";
+ pInfo.pLocation = q->location.GetBuffer();
+ pInfo.pComment = printer->displayModelName.GetBuffer();
+ pInfo.Attributes = PRINTER_ATTRIBUTE_NETWORK | PRINTER_ATTRIBUTE_LOCAL;
+
+ hPrinter = AddPrinter(NULL, 2, (LPBYTE)&pInfo);
+ err = translate_errno( hPrinter, errno_compat(), kUnknownErr );
+ require_noerr_with_log( log, "AddPrinter()", err, exit );
+
+exit:
+
+ if ( hPrinter != NULL )
+ {
+ ClosePrinter(hPrinter);
+ }
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::InstallPrinterCUPS(Printer * printer, Service * service, CUPSLibrary & cupsLib )
+{
+ OSStatus err = kNoErr;
+
+ check( printer );
+ check( service );
+ check( cupsLib.IsInstalled() );
+
+ err = InstallPrinterCUPS( printer, service, cupsLib, TEXT( "Windows NT x86" ) );
+ require_noerr( err, exit );
+
+ if ( Is64BitWindows() )
+ {
+ err = InstallPrinterCUPS( printer, service, cupsLib, TEXT( "Windows x64" ) );
+ require_noerr( err, exit );
+ }
+
+exit:
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::InstallPrinterCUPS(Printer * printer, Service * service, CUPSLibrary & cupsLib, TCHAR * env )
+{
+
+ Queue * q;
+ CString ppdfile; // PPD file for printer drivers
+ TCHAR driverdir[1024]; // Directory for driver files
+ DWORD needed; // Bytes needed
+ DRIVER_INFO_3 driverinfo; // Driver information
+ PRINTER_INFO_2 printerinfo; // Printer information
+ HANDLE printerHandle = NULL; // Handle to printer
+ CString filename; // Driver filename
+ CString dependentFiles; // List of dependent files
+ CString portName; // Port Name
+ int bytes; // Bytes copied
+ TCHAR datadir[ MAX_PATH ]; // Driver files location
+ CFile in; // Input file
+ CFile out; // Output file
+ void * http; // Connection to server
+ char buffer[4096]; // Copy/error buffer
+ CString platform;
+ char hostname[ 1024 ];
+ CString dest;
+ char destANSI[ 1024 ];
+ int i;
+ DWORD num;
+ OSStatus err = 0;
+ BOOL ok;
+
+ check( printer );
+ check( service );
+ check( cupsLib.IsInstalled() );
+ check( env );
+
+ // What do we do here for multiple queues?
+ q = service->queues.front();
+ require_action( q != NULL, exit, err = kUnknownErr );
+
+ num = GetModuleFileName( NULL, datadir, MAX_PATH );
+ err = translate_errno( num > 0, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+ ok = PathRemoveFileSpec( datadir );
+ require_action( ok, exit, err = kUnknownErr );
+
+ ok = GetPrinterDriverDirectory(NULL, env, 1, ( LPBYTE ) driverdir, sizeof( driverdir ), &needed );
+ err = translate_errno( ok, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+
+ platform = env;
+ platform = platform.Right( 3 );
+
+ // Append the supported banner pages to the PPD file...
+ err = StringObjectToUTF8String( service->hostname, hostname, sizeof( hostname ) );
+ require_noerr( err, exit );
+ http = cupsLib.httpConnectEncrypt( hostname, service->portNumber, cupsLib.cupsEncryption() );
+ err = translate_errno( http != NULL, errno, kUnknownErr );
+ require_noerr( err, exit );
+
+ if ( ( service->portNumber == 443 ) || ( cupsLib.cupsEncryption() >= HTTP_ENCRYPT_REQUIRED ) )
+ {
+ // This forces the use the https: URLs below...
+ cupsLib.cupsSetEncryption( HTTP_ENCRYPT_ALWAYS );
+ }
+
+ // Strip the leading "printers/" or "classes/" from the beginning
+ // of the name
+
+ dest = q->name;
+ dest.Replace( TEXT( "printers/" ), TEXT( "" ) );
+ dest.Replace( TEXT( "classes/" ), TEXT( "" ) );
+
+ err = StringObjectToUTF8String( dest, destANSI, sizeof( destANSI ) );
+ require_noerr( err, exit );
+
+ // Get the PPD file...
+ for ( i = 0; i < 10; i++ )
+ {
+ char ppdfileANSI[ 1024 ];
+
+ if ( cupsLib.cupsAdminCreateWindowsPPD( http, destANSI, ppdfileANSI, sizeof( ppdfileANSI ) ) )
+ {
+ err = UTF8StringToStringObject( ppdfileANSI, ppdfile );
+ require_noerr( err, exit );
+ break;
+ }
+ }
+
+ err = translate_errno( i < 10, errno, kUnknownErr );
+ require_noerr( err, exit );
+
+ // Copy the PPD file to the Windows driver directory...
+ filename.Format( TEXT( "%s/%s.ppd" ), driverdir, dest );
+
+ ok = in.Open( ppdfile, CFile::modeRead | CFile::typeBinary );
+ translate_errno( ok, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+
+ ok = out.Open( filename, CFile::modeCreate | CFile::modeWrite | CFile::typeBinary );
+ translate_errno( ok, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+
+ while ( ( bytes = in.Read( buffer, sizeof(buffer) ) ) > 0 )
+ {
+ out.Write(buffer, bytes );
+ }
+
+ in.Close();
+ out.Close();
+
+ // Cleanup temp file...
+ CFile::Remove( ppdfile );
+
+ // Copy the driver files to the driver directory...
+ for ( i = 0; i < ( sizeof( g_printerDriverFiles ) / sizeof( g_printerDriverFiles[0] ) ); i++ )
+ {
+ filename.Format( TEXT( "%s/drivers/%s/%s" ), datadir, platform, g_printerDriverFiles[i]);
+
+ ok = in.Open(filename, CFile::modeRead | CFile::typeBinary );
+ err = translate_errno( ok, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+
+ filename.Format( TEXT( "%s/%s" ), driverdir, g_printerDriverFiles[i] );
+ ok = out.Open(filename, CFile::modeCreate | CFile::modeWrite | CFile::typeBinary );
+ err = translate_errno( ok, errno, kUnknownErr );
+
+ while ( ( bytes = in.Read(buffer, sizeof( buffer ) ) ) > 0 )
+ {
+ out.Write( buffer, bytes );
+ }
+
+ in.Close();
+ out.Close();
+ }
+
+ // Do the Windows system calls needed to add the printer driver...
+ filename.Format( TEXT( "%s.ppd" ), dest);
+ dependentFiles.Format( TEXT( "pscript5.dll%c" ) TEXT( "%s.ppd%c" ) TEXT( "ps5ui.dll%c" ) TEXT( "pscript.hlp%c" ) TEXT( "pscript.ntf%c" ) TEXT( "cups6.ini%c" ) TEXT( "cupsps6.dll%c" ) TEXT( "cupsui6.dll%c" ), 0, dest, 0, 0, 0, 0, 0, 0, 0);
+
+ driverinfo.cVersion = 3;
+ driverinfo.pName = printer->actualName.GetBuffer();
+ driverinfo.pEnvironment = env;
+ driverinfo.pDriverPath = TEXT( "pscript5.dll" );
+ driverinfo.pDataFile = filename.GetBuffer();
+ driverinfo.pConfigFile = TEXT( "ps5ui.dll" );
+ driverinfo.pHelpFile = TEXT( "pscript.hlp" );
+ driverinfo.pDependentFiles = dependentFiles.GetBuffer();
+ driverinfo.pMonitorName = NULL;
+ driverinfo.pDefaultDataType = TEXT( "raw" );
+
+ ok = AddPrinterDriverEx(NULL, 3, (LPBYTE) &driverinfo, APD_COPY_ALL_FILES );
+ err = translate_errno( ok, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+
+ // See if the printer has already been added?
+ if ( OpenPrinter( printer->actualName.GetBuffer(), &printerHandle, NULL ) )
+ {
+ // Printer already exists, so we are done now...
+ goto exit;
+ }
+
+ // Add the printer using the HTTP/IPP port...
+ portName.Format( TEXT( "%s://%s:%d/printers/%s" ), cupsLib.cupsEncryption() == HTTP_ENCRYPT_ALWAYS ? TEXT( "https" ) : TEXT( "http" ), service->hostname.GetBuffer(), service->portNumber, dest );
+
+ memset(&printerinfo, 0, sizeof(printerinfo));
+ printerinfo.pPrinterName = printer->actualName.GetBuffer();
+ printerinfo.pPortName = portName.GetBuffer();
+ printerinfo.pDriverName = printer->actualName.GetBuffer();
+ printerinfo.Attributes = PRINTER_ATTRIBUTE_NETWORK | PRINTER_ATTRIBUTE_LOCAL;
+ printerinfo.pComment = q->description.GetBuffer();
+ printerinfo.pLocation = q->location.GetBuffer();
+ printerinfo.pPrintProcessor = TEXT( "winprint" );
+
+ printerHandle = AddPrinter( NULL, 2, (LPBYTE) &printerinfo );
+ err = translate_errno( printerHandle, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+
+exit:
+
+ if ( printerHandle != NULL )
+ {
+ ClosePrinter( printerHandle );
+ printerHandle = NULL;
+ }
+
+ return err;
+}
+
+BEGIN_MESSAGE_MAP(CPrinterSetupWizardSheet, CPropertySheet)
+ON_MESSAGE( WM_SOCKET_EVENT, OnSocketEvent )
+ON_MESSAGE( WM_PROCESS_EVENT, OnProcessEvent )
+ON_WM_SETCURSOR()
+ON_WM_TIMER()
+END_MESSAGE_MAP()
+
+
+// ------------------------------------------------------
+// OnCommand
+//
+// Traps when the user hits Finish
+//
+BOOL CPrinterSetupWizardSheet::OnCommand(WPARAM wParam, LPARAM lParam)
+{
+ //
+ // Check if this is OK
+ //
+ if (wParam == ID_WIZFINISH) // If OK is hit...
+ {
+ OnOK();
+ }
+
+ return CPropertySheet::OnCommand(wParam, lParam);
+}
+
+
+// ------------------------------------------------------
+// OnInitDialog
+//
+// Initializes this Dialog object.
+//
+BOOL CPrinterSetupWizardSheet::OnInitDialog()
+{
+ OSStatus err;
+
+ CPropertySheet::OnInitDialog();
+
+ err = StartBrowse();
+ require_noerr( err, exit );
+
+exit:
+
+ if ( err )
+ {
+ StopBrowse();
+
+ if ( err == kDNSServiceErr_Firewall )
+ {
+ CString text, caption;
+
+ text.LoadString( IDS_FIREWALL );
+ caption.LoadString( IDS_FIREWALL_CAPTION );
+
+ MessageBox(text, caption, MB_OK|MB_ICONEXCLAMATION);
+ }
+ else
+ {
+ CString text, caption;
+
+ text.LoadString( IDS_NO_MDNSRESPONDER_SERVICE_TEXT );
+ caption.LoadString( IDS_ERROR_CAPTION );
+
+ MessageBox(text, caption, MB_OK|MB_ICONEXCLAMATION);
+
+ _exit( 0 );
+ }
+ }
+
+ return TRUE;
+}
+
+
+// ------------------------------------------------------
+// OnSetCursor
+//
+// This is called when Windows wants to know what cursor
+// to display. So we tell it.
+//
+BOOL
+CPrinterSetupWizardSheet::OnSetCursor(CWnd * pWnd, UINT nHitTest, UINT message)
+{
+ DEBUG_UNUSED(pWnd);
+ DEBUG_UNUSED(nHitTest);
+ DEBUG_UNUSED(message);
+
+ SetCursor(m_active);
+ return TRUE;
+}
+
+
+// ------------------------------------------------------
+// OnContextMenu
+//
+// This is not fully implemented yet.
+//
+
+void
+CPrinterSetupWizardSheet::OnContextMenu(CWnd * pWnd, CPoint pos)
+{
+ DEBUG_UNUSED(pWnd);
+ DEBUG_UNUSED(pos);
+
+ CAbout dlg;
+
+ dlg.DoModal();
+}
+
+
+// ------------------------------------------------------
+// OnOK
+//
+// This is called when the user hits the "Finish" button
+//
+void
+CPrinterSetupWizardSheet::OnOK()
+{
+ CWnd * window;
+ OSStatus err;
+
+ check ( m_selectedPrinter != NULL );
+
+ SetWizardButtons( PSWIZB_DISABLEDFINISH );
+
+ window = GetDlgItem( IDCANCEL );
+
+ if ( window )
+ {
+ window->EnableWindow( FALSE );
+ }
+
+ m_pgFourth.StartActivityIndicator();
+
+ err = InstallPrinter( m_selectedPrinter );
+
+ m_pgFourth.StopActivityIndicator();
+
+ if ( err != kNoErr )
+ {
+ CString caption;
+ CString message;
+
+ caption.LoadString(IDS_INSTALL_ERROR_CAPTION);
+ caption.AppendFormat( TEXT( " (%d)" ), err );
+ message.LoadString(IDS_INSTALL_ERROR_MESSAGE);
+ MessageBox(message, caption, MB_OK|MB_ICONEXCLAMATION);
+ }
+
+ StopBrowse();
+}
+
+
+// CPrinterSetupWizardSheet message handlers
+
+void CPrinterSetupWizardSheet::Init(void)
+{
+ AddPage(&m_pgSecond);
+ AddPage(&m_pgThird);
+ AddPage(&m_pgFourth);
+
+ m_psh.dwFlags &= (~PSH_HASHELP);
+
+ m_psh.dwFlags |= PSH_WIZARD97|PSH_WATERMARK|PSH_HEADER;
+ m_psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
+ m_psh.pszbmHeader = MAKEINTRESOURCE(IDB_BANNER_ICON);
+
+ m_psh.hInstance = GetNonLocalizedResources();
+
+ SetWizardMode();
+}
+
+
+LRESULT
+CPrinterSetupWizardSheet::OnSocketEvent(WPARAM inWParam, LPARAM inLParam)
+{
+ if (WSAGETSELECTERROR(inLParam) && !(HIWORD(inLParam)))
+ {
+ dlog( kDebugLevelError, "OnServiceEvent: window error\n" );
+ }
+ else
+ {
+ SOCKET sock = (SOCKET) inWParam;
+
+ // iterate thru list
+ ServiceRefList::iterator begin = m_serviceRefList.begin();
+ ServiceRefList::iterator end = m_serviceRefList.end();
+
+ while (begin != end)
+ {
+ DNSServiceRef ref = *begin++;
+
+ check(ref != NULL);
+
+ if ((SOCKET) DNSServiceRefSockFD(ref) == sock)
+ {
+ DNSServiceProcessResult(ref);
+ break;
+ }
+ }
+ }
+
+ return ( 0 );
+}
+
+
+LRESULT
+CPrinterSetupWizardSheet::OnProcessEvent(WPARAM inWParam, LPARAM inLParam)
+{
+ DEBUG_UNUSED(inLParam);
+
+ m_driverThreadExitCode = (DWORD) inWParam;
+ m_driverThreadFinished = true;
+
+ return 0;
+}
+
+
+unsigned WINAPI
+CPrinterSetupWizardSheet::InstallDriverThread( LPVOID inParam )
+{
+ Printer * printer = (Printer*) inParam;
+ DWORD exitCode = 0;
+ DWORD dwResult;
+ OSStatus err;
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ BOOL ok;
+
+ check( printer );
+ check( m_self );
+
+ //
+ // because we're calling endthreadex(), C++ objects won't be cleaned up
+ // correctly. we'll nest the CString 'command' inside a block so
+ // that it's destructor will be invoked.
+ //
+ {
+ CString command;
+
+ ZeroMemory( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ ZeroMemory( &pi, sizeof(pi) );
+
+ command.Format(L"rundll32.exe printui.dll,PrintUIEntry /ia /m \"%s\" /f \"%s\"", (LPCTSTR) printer->modelName, (LPCTSTR) printer->infFileName );
+
+ ok = CreateProcess(NULL, command.GetBuffer(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
+ err = translate_errno( ok, errno_compat(), kUnknownErr );
+ require_noerr( err, exit );
+
+ dwResult = WaitForSingleObject( pi.hProcess, INFINITE );
+ translate_errno( dwResult == WAIT_OBJECT_0, errno_compat(), err = kUnknownErr );
+ require_noerr( err, exit );
+
+ ok = GetExitCodeProcess( pi.hProcess, &exitCode );
+ err = translate_errno( ok, errno_compat(), kUnknownErr );
+ require_noerr( err, exit );
+ }
+
+exit:
+
+ //
+ // Close process and thread handles.
+ //
+ if ( pi.hProcess )
+ {
+ CloseHandle( pi.hProcess );
+ }
+
+ if ( pi.hThread )
+ {
+ CloseHandle( pi.hThread );
+ }
+
+ //
+ // alert the main thread
+ //
+ m_self->PostMessage( WM_PROCESS_EVENT, err, exitCode );
+
+ _endthreadex_compat( 0 );
+
+ return 0;
+}
+
+
+void DNSSD_API
+CPrinterSetupWizardSheet::OnBrowse(
+ DNSServiceRef inRef,
+ DNSServiceFlags inFlags,
+ uint32_t inInterfaceIndex,
+ DNSServiceErrorType inErrorCode,
+ const char * inName,
+ const char * inType,
+ const char * inDomain,
+ void * inContext )
+{
+ DEBUG_UNUSED(inRef);
+
+ CPrinterSetupWizardSheet * self;
+ bool moreComing = (bool) (inFlags & kDNSServiceFlagsMoreComing);
+ CPropertyPage * active;
+ Printer * printer = NULL;
+ Service * service = NULL;
+ OSStatus err = kNoErr;
+
+ require_noerr( inErrorCode, exit );
+
+ self = reinterpret_cast <CPrinterSetupWizardSheet*>( inContext );
+ require_quiet( self, exit );
+
+ active = self->GetActivePage();
+ require_quiet( active, exit );
+
+ // Have we seen this printer before?
+
+ printer = self->Lookup( inName );
+
+ if ( printer )
+ {
+ service = printer->LookupService( inType );
+ }
+
+ if ( inFlags & kDNSServiceFlagsAdd )
+ {
+ BOOL newPrinter = FALSE;
+
+ if ( !printer )
+ {
+ printer = self->OnAddPrinter( inInterfaceIndex, inName, inType, inDomain, moreComing );
+ require_action( printer, exit, err = kUnknownErr );
+ newPrinter = TRUE;
+ }
+
+ // If we're looking at the browse list on page 2, then we need to call
+ // CPage2::OnAddPrinter() regardless of whether we've seen the printer
+ // or not because the moreComing flag might have changed from a previous
+ // call. If we only call CPage2::OnAddPrinter() when there's a new printer,
+ // we might not correctly update our UI, so if we've seen the printer before,
+ // call OnAddPrinter with a NULL parameter.
+
+ if ( self->GetActivePage() == &self->m_pgSecond )
+ {
+ self->m_pgSecond.OnAddPrinter( newPrinter ? printer : NULL, moreComing );
+ }
+
+ if ( !service )
+ {
+ err = self->OnAddService( printer, inInterfaceIndex, inName, inType, inDomain );
+ require_noerr( err, exit );
+ }
+ else
+ {
+ service->refs++;
+ }
+ }
+ else if ( printer )
+ {
+ check( service );
+
+ err = self->OnRemoveService( service );
+ require_noerr( err, exit );
+
+ if ( printer->services.size() == 0 )
+ {
+ err = self->OnRemovePrinter( printer, moreComing );
+ require_noerr( err, exit );
+ }
+ }
+
+exit:
+
+ return;
+}
+
+
+void DNSSD_API
+CPrinterSetupWizardSheet::OnResolve(
+ DNSServiceRef inRef,
+ DNSServiceFlags inFlags,
+ uint32_t inInterfaceIndex,
+ DNSServiceErrorType inErrorCode,
+ const char * inFullName,
+ const char * inHostName,
+ uint16_t inPort,
+ uint16_t inTXTSize,
+ const char * inTXT,
+ void * inContext )
+{
+ DEBUG_UNUSED(inFullName);
+ DEBUG_UNUSED(inInterfaceIndex);
+ DEBUG_UNUSED(inFlags);
+ DEBUG_UNUSED(inRef);
+
+ CPrinterSetupWizardSheet * self;
+ Service * service;
+ Queue * q;
+ int idx;
+ OSStatus err;
+
+ require_noerr( inErrorCode, exit );
+
+ service = reinterpret_cast<Service*>( inContext );
+ require_quiet( service, exit);
+
+ check( service->refs != 0 );
+
+ self = service->printer->window;
+ require_quiet( self, exit );
+
+ err = self->StopOperation( service->serviceRef );
+ require_noerr( err, exit );
+
+ //
+ // hold on to the hostname...
+ //
+ err = UTF8StringToStringObject( inHostName, service->hostname );
+ require_noerr( err, exit );
+
+ //
+ // <rdar://problem/3739200> remove the trailing dot on hostname
+ //
+ idx = service->hostname.ReverseFind('.');
+
+ if ((idx > 1) && ((service->hostname.GetLength() - 1) == idx))
+ {
+ service->hostname.Delete(idx, 1);
+ }
+
+ //
+ // hold on to the port
+ //
+ service->portNumber = ntohs(inPort);
+
+ if ( service->qtotal == 1 )
+ {
+ //
+ // create a new queue
+ //
+ try
+ {
+ q = new Queue;
+ }
+ catch (...)
+ {
+ q = NULL;
+ }
+
+ require_action( q, exit, err = E_OUTOFMEMORY );
+
+ //
+ // parse the text record.
+ //
+
+ err = self->ParseTextRecord( service, q, inTXTSize, inTXT );
+ require_noerr( err, exit );
+
+ service->queues.push_back( q );
+
+ //
+ // we've completely resolved this service
+ //
+
+ self->OnResolveService( service );
+ }
+ else
+ {
+ //
+ // if qtotal is more than 1, then we need to get additional
+ // text records. if not, then this service is considered
+ // resolved
+ //
+
+ err = DNSServiceQueryRecord(&service->serviceRef, 0, inInterfaceIndex, inFullName, kDNSServiceType_TXT, kDNSServiceClass_IN, OnQuery, (void*) service );
+ require_noerr( err, exit );
+
+ err = self->StartOperation( service->serviceRef );
+ require_noerr( err, exit );
+ }
+
+exit:
+
+ return;
+}
+
+
+void DNSSD_API
+CPrinterSetupWizardSheet::OnQuery(
+ DNSServiceRef inRef,
+ DNSServiceFlags inFlags,
+ uint32_t inInterfaceIndex,
+ DNSServiceErrorType inErrorCode,
+ const char * inFullName,
+ uint16_t inRRType,
+ uint16_t inRRClass,
+ uint16_t inRDLen,
+ const void * inRData,
+ uint32_t inTTL,
+ void * inContext)
+{
+ DEBUG_UNUSED( inTTL );
+ DEBUG_UNUSED( inRRClass );
+ DEBUG_UNUSED( inRRType );
+ DEBUG_UNUSED( inFullName );
+ DEBUG_UNUSED( inInterfaceIndex );
+ DEBUG_UNUSED( inRef );
+
+ Service * service = NULL;
+ Queue * q;
+ CPrinterSetupWizardSheet * self;
+ OSStatus err = kNoErr;
+
+ require_noerr( inErrorCode, exit );
+
+ service = reinterpret_cast<Service*>( inContext );
+ require_quiet( service, exit);
+
+ self = service->printer->window;
+ require_quiet( self, exit );
+
+ if ( ( inFlags & kDNSServiceFlagsAdd ) && ( inRDLen > 0 ) && ( inRData != NULL ) )
+ {
+ const char * inTXT = ( const char * ) inRData;
+
+ //
+ // create a new queue
+ //
+ try
+ {
+ q = new Queue;
+ }
+ catch (...)
+ {
+ q = NULL;
+ }
+
+ require_action( q, exit, err = E_OUTOFMEMORY );
+
+ err = service->printer->window->ParseTextRecord( service, q, inRDLen, inTXT );
+ require_noerr( err, exit );
+
+ //
+ // add this queue
+ //
+
+ service->queues.push_back( q );
+
+ if ( service->queues.size() == service->qtotal )
+ {
+ //
+ // else if moreComing is not set, then we're going
+ // to assume that we're done
+ //
+
+ self->StopOperation( service->serviceRef );
+
+ //
+ // sort the queues
+ //
+
+ service->queues.sort( OrderQueueFunc );
+
+ //
+ // we've completely resolved this service
+ //
+
+ self->OnResolveService( service );
+ }
+ }
+
+exit:
+
+ if ( err && service && ( service->serviceRef != NULL ) )
+ {
+ service->printer->window->StopOperation( service->serviceRef );
+ }
+
+ return;
+}
+
+
+Printer*
+CPrinterSetupWizardSheet::OnAddPrinter(
+ uint32_t inInterfaceIndex,
+ const char * inName,
+ const char * inType,
+ const char * inDomain,
+ bool moreComing)
+{
+ Printer * printer = NULL;
+ DWORD printerNameCount;
+ OSStatus err;
+
+ DEBUG_UNUSED( inInterfaceIndex );
+ DEBUG_UNUSED( inType );
+ DEBUG_UNUSED( inDomain );
+ DEBUG_UNUSED( moreComing );
+
+ try
+ {
+ printer = new Printer;
+ }
+ catch (...)
+ {
+ printer = NULL;
+ }
+
+ require_action( printer, exit, err = E_OUTOFMEMORY );
+
+ printer->window = this;
+ printer->name = inName;
+
+ err = UTF8StringToStringObject(inName, printer->displayName);
+ check_noerr( err );
+ printer->actualName = printer->displayName;
+ printer->installed = false;
+ printer->deflt = false;
+ printer->resolving = 0;
+
+ // Compare this name against printers that are already installed
+ // to avoid name clashes. Rename as necessary
+ // to come up with a unique name.
+
+ printerNameCount = 2;
+
+ for (;;)
+ {
+ CPrinterSetupWizardSheet::PrinterNames::iterator it;
+
+ // <rdar://problem/4141221> Don't use find to do comparisons because we need to
+ // do a case insensitive string comparison
+
+ for ( it = m_printerNames.begin(); it != m_printerNames.end(); it++ )
+ {
+ if ( (*it).CompareNoCase( printer->actualName ) == 0 )
+ {
+ break;
+ }
+ }
+
+ if (it != m_printerNames.end())
+ {
+ printer->actualName.Format(L"%s (%d)", printer->displayName, printerNameCount);
+ }
+ else
+ {
+ break;
+ }
+
+ printerNameCount++;
+ }
+
+ m_printers.push_back( printer );
+
+exit:
+
+ return printer;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::OnAddService(
+ Printer * printer,
+ uint32_t inInterfaceIndex,
+ const char * inName,
+ const char * inType,
+ const char * inDomain)
+{
+ Service * service = NULL;
+ OSStatus err = kNoErr;
+
+ DEBUG_UNUSED( inName );
+ DEBUG_UNUSED( inDomain );
+
+ try
+ {
+ service = new Service;
+ }
+ catch (...)
+ {
+ service = NULL;
+ }
+
+ require_action( service, exit, err = E_OUTOFMEMORY );
+
+ service->printer = printer;
+ service->ifi = inInterfaceIndex;
+ service->type = inType;
+ service->domain = inDomain;
+ service->qtotal = 1;
+ service->refs = 1;
+ service->serviceRef = NULL;
+
+ printer->services.push_back( service );
+
+ //
+ // if the printer is selected, then we'll want to start a
+ // resolve on this guy
+ //
+
+ if ( printer == m_selectedPrinter )
+ {
+ StartResolve( service );
+ }
+
+exit:
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::OnRemovePrinter( Printer * printer, bool moreComing )
+{
+ CPropertyPage * active = GetActivePage();
+ OSStatus err = kNoErr;
+
+ if ( active == &m_pgSecond )
+ {
+ m_pgSecond.OnRemovePrinter( printer, moreComing );
+ }
+
+ m_printers.remove( printer );
+
+ if ( m_selectedPrinter == printer )
+ {
+ m_selectedPrinter = NULL;
+
+ if ( ( active == &m_pgThird ) || ( active == &m_pgFourth ) )
+ {
+ CString caption;
+ CString message;
+
+ caption.LoadString( IDS_ERROR_CAPTION );
+ message.LoadString( IDS_PRINTER_UNAVAILABLE );
+
+ MessageBox(message, caption, MB_OK|MB_ICONEXCLAMATION);
+
+ SetActivePage( &m_pgSecond );
+ }
+ }
+
+ delete printer;
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::OnRemoveService( Service * service )
+{
+ OSStatus err = kNoErr;
+
+ if ( service && ( --service->refs == 0 ) )
+ {
+ if ( service->serviceRef != NULL )
+ {
+ err = StopResolve( service );
+ require_noerr( err, exit );
+ }
+
+ service->printer->services.remove( service );
+
+ delete service;
+ }
+
+exit:
+
+ return err;
+}
+
+
+void
+CPrinterSetupWizardSheet::OnResolveService( Service * service )
+{
+ // Make sure that the active page is page 2
+
+ require_quiet( GetActivePage() == &m_pgSecond, exit );
+
+ if ( !--service->printer->resolving )
+ {
+ // sort the services now. we want the service that
+ // has the highest priority queue to be first in
+ // the list.
+
+ service->printer->services.sort( OrderServiceFunc );
+
+ // Now we can hit next
+
+ SetWizardButtons( PSWIZB_BACK|PSWIZB_NEXT );
+
+ // Reset the cursor
+
+ m_active = m_arrow;
+
+ // And tell page 2 about it
+
+ m_pgSecond.OnResolveService( service );
+ }
+
+exit:
+
+ return;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::StartBrowse()
+{
+ OSStatus err;
+
+ //
+ // setup the DNS-SD browsing
+ //
+ err = DNSServiceBrowse( &m_pdlBrowser, 0, 0, kPDLServiceType, NULL, OnBrowse, this );
+ require_noerr( err, exit );
+
+ err = StartOperation( m_pdlBrowser );
+ require_noerr( err, exit );
+
+ err = DNSServiceBrowse( &m_lprBrowser, 0, 0, kLPRServiceType, NULL, OnBrowse, this );
+ require_noerr( err, exit );
+
+ err = StartOperation( m_lprBrowser );
+ require_noerr( err, exit );
+
+ err = DNSServiceBrowse( &m_ippBrowser, 0, 0, kIPPServiceType, NULL, OnBrowse, this );
+ require_noerr( err, exit );
+
+ err = StartOperation( m_ippBrowser );
+ require_noerr( err, exit );
+
+exit:
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::StopBrowse()
+{
+ OSStatus err;
+
+ err = StopOperation( m_pdlBrowser );
+ require_noerr( err, exit );
+
+ err = StopOperation( m_lprBrowser );
+ require_noerr( err, exit );
+
+ err = StopOperation( m_ippBrowser );
+ require_noerr( err, exit );
+
+ while ( m_printers.size() > 0 )
+ {
+ Printer * printer = m_printers.front();
+
+ m_printers.pop_front();
+
+ if ( printer->resolving )
+ {
+ StopResolve( printer );
+ }
+
+ delete printer;
+ }
+
+exit:
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::StartResolve( Printer * printer )
+{
+ OSStatus err = kNoErr;
+ Services::iterator it;
+
+ check( printer );
+
+ for ( it = printer->services.begin(); it != printer->services.end(); it++ )
+ {
+ if ( (*it)->serviceRef == NULL )
+ {
+ err = StartResolve( *it );
+ require_noerr( err, exit );
+ }
+ }
+
+ m_selectedPrinter = printer;
+
+exit:
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::StartResolve( Service * service )
+{
+ OSStatus err = kNoErr;
+
+ check( service->serviceRef == NULL );
+
+ //
+ // clean out any queues that were collected during a previous
+ // resolve
+ //
+
+ service->EmptyQueues();
+
+ //
+ // now start the new resolve
+ //
+
+ err = DNSServiceResolve( &service->serviceRef, 0, 0, service->printer->name.c_str(), service->type.c_str(), service->domain.c_str(), (DNSServiceResolveReply) OnResolve, service );
+ require_noerr( err, exit );
+
+ err = StartOperation( service->serviceRef );
+ require_noerr( err, exit );
+
+ //
+ // If we're not currently resolving, then disable the next button
+ // and set the cursor to hourglass
+ //
+
+ if ( !service->printer->resolving )
+ {
+ SetWizardButtons( PSWIZB_BACK );
+
+ m_active = m_wait;
+ SetCursor(m_active);
+ }
+
+ service->printer->resolving++;
+
+exit:
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::StopResolve(Printer * printer)
+{
+ OSStatus err = kNoErr;
+
+ check( printer );
+
+ Services::iterator it;
+
+ for ( it = printer->services.begin(); it != printer->services.end(); it++ )
+ {
+ if ( (*it)->serviceRef )
+ {
+ err = StopResolve( *it );
+ require_noerr( err, exit );
+ }
+ }
+
+exit:
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::StopResolve( Service * service )
+{
+ OSStatus err;
+
+ check( service->serviceRef );
+
+ err = StopOperation( service->serviceRef );
+ require_noerr( err, exit );
+
+ service->printer->resolving--;
+
+exit:
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::StartOperation( DNSServiceRef ref )
+{
+ OSStatus err;
+
+ err = WSAAsyncSelect((SOCKET) DNSServiceRefSockFD(ref), m_hWnd, WM_SOCKET_EVENT, FD_READ|FD_CLOSE);
+ require_noerr( err, exit );
+
+ m_serviceRefList.push_back( ref );
+
+exit:
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::StopOperation( DNSServiceRef & ref )
+{
+ OSStatus err = kNoErr;
+
+ if ( ref )
+ {
+ m_serviceRefList.remove( ref );
+
+ if ( IsWindow( m_hWnd ) )
+ {
+ err = WSAAsyncSelect((SOCKET) DNSServiceRefSockFD( ref ), m_hWnd, 0, 0 );
+ require_noerr( err, exit );
+ }
+
+ DNSServiceRefDeallocate( ref );
+ ref = NULL;
+ }
+
+exit:
+
+ return err;
+}
+
+
+OSStatus
+CPrinterSetupWizardSheet::ParseTextRecord( Service * service, Queue * q, uint16_t inTXTSize, const char * inTXT )
+{
+ check( service );
+ check( q );
+
+ // <rdar://problem/3946587> Use TXTRecord APIs declared in dns_sd.h
+
+ bool qtotalDefined = false;
+ const void * val;
+ char buf[256];
+ uint8_t len;
+ OSStatus err = kNoErr;
+
+ // <rdar://problem/3987680> Default to queue "lp"
+
+ q->name = L"lp";
+
+ // <rdar://problem/4003710> Default pdl key to be "application/postscript"
+
+ q->pdl = L"application/postscript";
+
+ if ( ( val = TXTRecordGetValuePtr( inTXTSize, inTXT, "rp", &len ) ) != NULL )
+ {
+ // Stringize val ( doesn't have trailing '\0' yet )
+
+ memcpy( buf, val, len );
+ buf[len] = '\0';
+
+ err = UTF8StringToStringObject( buf, q->name );
+ require_noerr( err, exit );
+ }
+
+ if ( ( val = TXTRecordGetValuePtr( inTXTSize, inTXT, "pdl", &len ) ) != NULL )
+ {
+ // Stringize val ( doesn't have trailing '\0' yet )
+
+ memcpy( buf, val, len );
+ buf[len] = '\0';
+
+ err = UTF8StringToStringObject( buf, q->pdl );
+ require_noerr( err, exit );
+ }
+
+ if ( ( ( val = TXTRecordGetValuePtr( inTXTSize, inTXT, "usb_mfg", &len ) ) != NULL ) ||
+ ( ( val = TXTRecordGetValuePtr( inTXTSize, inTXT, "usb_manufacturer", &len ) ) != NULL ) )
+ {
+ // Stringize val ( doesn't have trailing '\0' yet )
+
+ memcpy( buf, val, len );
+ buf[len] = '\0';
+
+ err = UTF8StringToStringObject( buf, q->usb_MFG );
+ require_noerr( err, exit );
+ }
+
+ if ( ( ( val = TXTRecordGetValuePtr( inTXTSize, inTXT, "usb_mdl", &len ) ) != NULL ) ||
+ ( ( val = TXTRecordGetValuePtr( inTXTSize, inTXT, "usb_model", &len ) ) != NULL ) )
+ {
+ // Stringize val ( doesn't have trailing '\0' yet )
+
+ memcpy( buf, val, len );
+ buf[len] = '\0';
+
+ err = UTF8StringToStringObject( buf, q->usb_MDL );
+ require_noerr( err, exit );
+ }
+
+ if ( ( val = TXTRecordGetValuePtr( inTXTSize, inTXT, "ty", &len ) ) != NULL )
+ {
+ // Stringize val ( doesn't have trailing '\0' yet )
+
+ memcpy( buf, val, len );
+ buf[len] = '\0';
+
+ err = UTF8StringToStringObject( buf, q->description );
+ require_noerr( err, exit );
+ }
+
+ if ( ( val = TXTRecordGetValuePtr( inTXTSize, inTXT, "product", &len ) ) != NULL )
+ {
+ // Stringize val ( doesn't have trailing '\0' yet )
+
+ memcpy( buf, val, len );
+ buf[len] = '\0';
+
+ err = UTF8StringToStringObject( buf, q->product );
+ require_noerr( err, exit );
+ }
+
+ if ( ( val = TXTRecordGetValuePtr( inTXTSize, inTXT, "note", &len ) ) != NULL )
+ {
+ // Stringize val ( doesn't have trailing '\0' yet )
+
+ memcpy( buf, val, len );
+ buf[len] = '\0';
+
+ err = UTF8StringToStringObject( buf, q->location );
+ require_noerr( err, exit );
+ }
+
+ if ( ( val = TXTRecordGetValuePtr( inTXTSize, inTXT, "qtotal", &len ) ) != NULL )
+ {
+ // Stringize val ( doesn't have trailing '\0' yet )
+
+ memcpy( buf, val, len );
+ buf[len] = '\0';
+
+ service->qtotal = (unsigned short) atoi( buf );
+ qtotalDefined = true;
+ }
+
+ if ( ( val = TXTRecordGetValuePtr( inTXTSize, inTXT, "priority", &len ) ) != NULL )
+ {
+ // Stringize val ( doesn't have trailing '\0' yet )
+
+ memcpy( buf, val, len );
+ buf[len] = '\0';
+
+ q->priority = atoi( buf );
+ }
+
+ // <rdar://problem/4124524> Was this printer discovered via OS X Printer Sharing?
+
+ if ( TXTRecordContainsKey( inTXTSize, inTXT, "printer-state" ) || TXTRecordContainsKey( inTXTSize, inTXT, "printer-type" ) )
+ {
+ service->printer->isCUPSPrinter = true;
+ }
+
+exit:
+
+ // The following code is to fix a problem with older HP
+ // printers that don't include "qtotal" in their text
+ // record. We'll check to see if the q->name is "TEXT"
+ // and if so, we're going to modify it to be "lp" so
+ // that we don't use the wrong queue
+
+ if ( !err && !qtotalDefined && ( q->name == L"TEXT" ) )
+ {
+ q->name = "lp";
+ }
+
+ return err;
+}
+
+
+Printer*
+CPrinterSetupWizardSheet::Lookup(const char * inName)
+{
+ check( inName );
+
+ Printer * printer = NULL;
+ Printers::iterator it;
+
+ for ( it = m_printers.begin(); it != m_printers.end(); it++ )
+ {
+ if ( (*it)->name == inName )
+ {
+ printer = *it;
+ break;
+ }
+ }
+
+ return printer;
+}
+
+
+bool
+CPrinterSetupWizardSheet::OrderServiceFunc( const Service * a, const Service * b )
+{
+ Queue * q1, * q2;
+
+ q1 = (a->queues.size() > 0) ? a->queues.front() : NULL;
+
+ q2 = (b->queues.size() > 0) ? b->queues.front() : NULL;
+
+ if ( !q1 && !q2 )
+ {
+ return true;
+ }
+ else if ( q1 && !q2 )
+ {
+ return true;
+ }
+ else if ( !q1 && q2 )
+ {
+ return false;
+ }
+ else if ( q1->priority < q2->priority )
+ {
+ return true;
+ }
+ else if ( q1->priority > q2->priority )
+ {
+ return false;
+ }
+ else if ( ( a->type == kPDLServiceType ) || ( ( a->type == kLPRServiceType ) && ( b->type == kIPPServiceType ) ) )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+
+bool
+CPrinterSetupWizardSheet::OrderQueueFunc( const Queue * q1, const Queue * q2 )
+{
+ return ( q1->priority <= q2->priority ) ? true : false;
+}
+
+
+
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardSheet.h b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardSheet.h
new file mode 100644
index 00000000..45110434
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/PrinterSetupWizardSheet.h
@@ -0,0 +1,352 @@
+/* -*- 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
+
+
+#include "secondpage.h"
+#include "thirdpage.h"
+#include "fourthpage.h"
+#include "UtilTypes.h"
+#include "Logger.h"
+#include "dns_sd.h"
+#include <stdexcept>
+#include <map>
+
+using namespace PrinterSetupWizard;
+
+// CPrinterSetupWizardSheet
+
+class CPrinterSetupWizardSheet : public CPropertySheet
+{
+DECLARE_DYNAMIC(CPrinterSetupWizardSheet)
+
+public:
+
+struct WizardException
+{
+ CString text;
+ CString caption;
+};
+
+public:
+
+CPrinterSetupWizardSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
+virtual ~CPrinterSetupWizardSheet();
+
+CPropertyPage*
+GetLastPage();
+
+void
+SetLastPage(CPropertyPage * page );
+
+void
+SetSelectedPrinter(Printer * printer);
+
+Printer*
+GetSelectedPrinter();
+
+OSStatus
+LoadPrinterDriver(const CString & filename);
+
+HCURSOR
+GetCursor();
+
+//
+// handles end of process event
+//
+virtual LRESULT
+OnProcessEvent(WPARAM inWParam, LPARAM inLParam);
+
+virtual LRESULT
+OnSocketEvent(WPARAM inWParam, LPARAM inLParam);
+
+virtual BOOL
+OnCommand(WPARAM wParam, LPARAM lParam);
+
+virtual BOOL
+OnInitDialog();
+
+virtual BOOL
+OnSetCursor(CWnd * pWnd, UINT nHitTest, UINT message);
+
+virtual void
+OnContextMenu(CWnd * pWnd, CPoint pos);
+
+afx_msg void
+OnOK();
+
+OSStatus
+StartResolve( Printer * printer );
+
+OSStatus
+StopResolve( Printer * printer );
+
+Printers m_printers;
+
+HCURSOR m_active;
+HCURSOR m_arrow;
+HCURSOR m_wait;
+
+protected:
+DECLARE_MESSAGE_MAP()
+CSecondPage m_pgSecond;
+CThirdPage m_pgThird;
+CFourthPage m_pgFourth;
+
+void
+OnServiceResolved(
+ Service * service);
+
+void Init(void);
+
+private:
+
+// This is from <cups/http.h>
+typedef enum http_encryption_e /**** HTTP encryption values ****/
+{
+ HTTP_ENCRYPT_IF_REQUESTED, /* Encrypt if requested (TLS upgrade) */
+ HTTP_ENCRYPT_NEVER, /* Never encrypt */
+ HTTP_ENCRYPT_REQUIRED, /* Encryption is required (TLS upgrade) */
+ HTTP_ENCRYPT_ALWAYS /* Always encrypt (SSL) */
+} http_encryption_t;
+
+typedef void* ( *httpConnectEncryptFunc )( const char* host, int port, http_encryption_t encryption );
+typedef http_encryption_t ( *cupsEncryptionFunc )( void );
+typedef void ( *cupsSetEncryptionFunc )( http_encryption_t e );
+typedef char* ( *cupsAdminCreateWindowsPPDFunc )( void * http, const char *dest, char *buffer, int bufsize );
+
+class CUPSLibrary
+{
+public:
+
+CUPSLibrary()
+ :
+ httpConnectEncrypt( NULL ),
+ cupsEncryption( NULL ),
+ cupsSetEncryption( NULL ),
+ cupsAdminCreateWindowsPPD( NULL ),
+ library( NULL )
+{
+#if defined( LIBCUPS_ENABLED )
+ if ( ( library = LoadLibrary( TEXT( "libcups2.dll" ) ) ) != NULL )
+ {
+ httpConnectEncrypt = ( httpConnectEncryptFunc ) GetProcAddress( library, "httpConnectEncrypt" );
+ cupsEncryption = ( cupsEncryptionFunc ) GetProcAddress( library, "cupsEncryption" );
+ cupsSetEncryption = ( cupsSetEncryptionFunc ) GetProcAddress( library, "cupsSetEncryption" );
+ cupsAdminCreateWindowsPPD = ( cupsAdminCreateWindowsPPDFunc ) GetProcAddress( library, "cupsAdminCreateWindowsPPD" );
+ }
+#endif
+}
+
+~CUPSLibrary()
+{
+ if ( library )
+ {
+ FreeLibrary( library );
+ library = NULL;
+ }
+}
+
+BOOL
+IsInstalled()
+{
+ return ( ( httpConnectEncrypt != NULL ) && ( cupsEncryption != NULL ) && ( cupsSetEncryption != NULL ) && ( cupsAdminCreateWindowsPPD != NULL ) );
+}
+
+httpConnectEncryptFunc httpConnectEncrypt;
+cupsEncryptionFunc cupsEncryption;
+cupsSetEncryptionFunc cupsSetEncryption;
+cupsAdminCreateWindowsPPDFunc cupsAdminCreateWindowsPPD;
+
+private:
+
+HMODULE library;
+};
+
+
+static void DNSSD_API
+OnBrowse(
+ DNSServiceRef inRef,
+ DNSServiceFlags inFlags,
+ uint32_t inInterfaceIndex,
+ DNSServiceErrorType inErrorCode,
+ const char * inName,
+ const char * inType,
+ const char * inDomain,
+ void * inContext );
+
+static void DNSSD_API
+OnResolve(
+ DNSServiceRef inRef,
+ DNSServiceFlags inFlags,
+ uint32_t inInterfaceIndex,
+ DNSServiceErrorType inErrorCode,
+ const char * inFullName,
+ const char * inHostName,
+ uint16_t inPort,
+ uint16_t inTXTSize,
+ const char * inTXT,
+ void * inContext );
+
+static void DNSSD_API
+OnQuery(
+ DNSServiceRef inRef,
+ DNSServiceFlags inFlags,
+ uint32_t inInterfaceIndex,
+ DNSServiceErrorType inErrorCode,
+ const char * inFullName,
+ uint16_t inRRType,
+ uint16_t inRRClass,
+ uint16_t inRDLen,
+ const void * inRData,
+ uint32_t inTTL,
+ void * inContext);
+
+Printer*
+OnAddPrinter(
+ uint32_t inInterfaceIndex,
+ const char * inName,
+ const char * inType,
+ const char * inDomain,
+ bool moreComing);
+
+OSStatus
+OnRemovePrinter(
+ Printer * printer,
+ bool moreComing);
+
+OSStatus
+OnAddService(
+ Printer * printer,
+ uint32_t inInterfaceIndex,
+ const char * inName,
+ const char * inType,
+ const char * inDomain);
+
+OSStatus
+OnRemoveService(
+ Service * service);
+
+void
+OnResolveService(
+ Service * service );
+
+static bool
+OrderServiceFunc( const Service * a, const Service * b );
+
+static bool
+OrderQueueFunc( const Queue * q1, const Queue * q2 );
+
+OSStatus
+StartOperation( DNSServiceRef ref );
+
+OSStatus
+StopOperation( DNSServiceRef & ref );
+
+OSStatus
+StartBrowse();
+
+OSStatus
+StopBrowse();
+
+OSStatus
+StartResolve( Service * service );
+
+OSStatus
+StopResolve( Service * service );
+
+OSStatus
+ParseTextRecord( Service * service, Queue * q, uint16_t inTXTSize, const char * inTXT );
+
+OSStatus
+LoadPrinterNames();
+
+Printer*
+Lookup( const char * name );
+
+OSStatus
+InstallPrinter(Printer * printer);
+
+OSStatus
+InstallPrinterPort( Printer * printer, Service * service, DWORD protocol, Logger & log );
+
+OSStatus
+InstallPrinterPDLAndLPR(Printer * printer, Service * service, Logger & log);
+
+OSStatus
+InstallPrinterIPP(Printer * printer, Service * service, Logger & log);
+
+OSStatus
+InstallPrinterCUPS( Printer * printer, Service * service, CUPSLibrary & cupsLib );
+
+OSStatus
+InstallPrinterCUPS(Printer * printer, Service * service, CUPSLibrary & cupsLib, TCHAR * env );
+
+static unsigned WINAPI
+InstallDriverThread( LPVOID inParam );
+
+typedef std::list<CString> PrinterNames;
+typedef std::list<DNSServiceRef> ServiceRefList;
+static CPrinterSetupWizardSheet * m_self;
+PrinterNames m_printerNames;
+Printer * m_selectedPrinter;
+bool m_driverThreadFinished;
+DWORD m_driverThreadExitCode;
+ServiceRefList m_serviceRefList;
+DNSServiceRef m_pdlBrowser;
+DNSServiceRef m_lprBrowser;
+DNSServiceRef m_ippBrowser;
+DNSServiceRef m_resolver;
+
+CPropertyPage * m_lastPage;
+};
+
+
+inline Printer*
+CPrinterSetupWizardSheet::GetSelectedPrinter()
+{
+ return m_selectedPrinter;
+}
+
+
+inline HCURSOR
+CPrinterSetupWizardSheet::GetCursor()
+{
+ return m_active;
+}
+
+
+inline CPropertyPage*
+CPrinterSetupWizardSheet::GetLastPage()
+{
+ return m_lastPage;
+}
+
+
+inline void
+CPrinterSetupWizardSheet::SetLastPage(CPropertyPage * lastPage)
+{
+ m_lastPage = lastPage;
+}
+
+
+// Service Types
+
+#define kPDLServiceType "_pdl-datastream._tcp."
+#define kLPRServiceType "_printer._tcp."
+#define kIPPServiceType "_ipp._tcp."
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/ReadMe.txt b/mDNSResponder/Clients/PrinterSetupWizard/ReadMe.txt
new file mode 100644
index 00000000..9b5eb412
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/ReadMe.txt
@@ -0,0 +1,94 @@
+================================================================================
+ MICROSOFT FOUNDATION CLASS LIBRARY : Wiz97_3 Project Overview
+===============================================================================
+
+The application wizard has created this Wiz97_3 application for
+you. This application not only demonstrates the basics of using the Microsoft
+Foundation Classes but is also a starting point for writing your application.
+
+This file contains a summary of what you will find in each of the files that
+make up your Wiz97_3 application.
+
+Wiz97_3.vcproj
+ This is the main project file for VC++ projects generated using an application wizard.
+ It contains information about the version of Visual C++ that generated the file, and
+ information about the platforms, configurations, and project features selected with the
+ application wizard.
+
+Wiz97_3.h
+ This is the main header file for the application. It includes other
+ project specific headers (including Resource.h) and declares the
+ CWiz97_3App application class.
+
+Wiz97_3.cpp
+ This is the main application source file that contains the application
+ class CWiz97_3App.
+
+Wiz97_3.rc
+ This is a listing of all of the Microsoft Windows resources that the
+ program uses. It includes the icons, bitmaps, and cursors that are stored
+ in the RES subdirectory. This file can be directly edited in Microsoft
+ Visual C++. Your project resources are in 1033.
+
+res\Wiz97_3.ico
+ This is an icon file, which is used as the application's icon. This
+ icon is included by the main resource file Wiz97_3.rc.
+
+res\Wiz97_3.rc2
+ This file contains resources that are not edited by Microsoft
+ Visual C++. You should place all resources not editable by
+ the resource editor in this file.
+
+/////////////////////////////////////////////////////////////////////////////
+
+The application wizard creates one dialog class:
+Wiz97_3Dlg.h, Wiz97_3Dlg.cpp - the dialog
+ These files contain your CWiz97_3Dlg class. This class defines
+ the behavior of your application's main dialog. The dialog's template is
+ in Wiz97_3.rc, which can be edited in Microsoft Visual C++.
+/////////////////////////////////////////////////////////////////////////////
+
+Other Features:
+
+ActiveX Controls
+ The application includes support to use ActiveX controls.
+
+Printing and Print Preview support
+ The application wizard has generated code to handle the print, print setup, and print preview
+ commands by calling member functions in the CView class from the MFC library.
+/////////////////////////////////////////////////////////////////////////////
+
+Other standard files:
+
+StdAfx.h, StdAfx.cpp
+ These files are used to build a precompiled header (PCH) file
+ named Wiz97_3.pch and a precompiled types file named StdAfx.obj.
+
+Resource.h
+ This is the standard header file, which defines new resource IDs.
+ Microsoft Visual C++ reads and updates this file.
+
+Wiz97_3.manifest
+ Application manifest files are used by Windows XP to describe an applications
+ dependency on specific versions of Side-by-Side assemblies. The loader uses this
+ information to load the appropriate assembly from the assembly cache or private
+ from the application. The Application manifest maybe included for redistribution
+ as an external .manifest file that is installed in the same folder as the application
+ executable or it may be included in the executable in the form of a resource.
+/////////////////////////////////////////////////////////////////////////////
+
+Other notes:
+
+The application wizard uses "TODO:" to indicate parts of the source code you
+should add to or customize.
+
+If your application uses MFC in a shared DLL, and your application is in a
+language other than the operating system's current language, you will need
+to copy the corresponding localized resources MFC70XXX.DLL from the Microsoft
+Visual C++ CD-ROM under the Win\System directory to your computer's system or
+system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the
+language abbreviation. For example, MFC70DEU.DLL contains resources
+translated to German.) If you don't do this, some of the UI elements of
+your application will remain in the language of the operating system.
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/SecondPage.cpp b/mDNSResponder/Clients/PrinterSetupWizard/SecondPage.cpp
new file mode 100644
index 00000000..1521d0d9
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/SecondPage.cpp
@@ -0,0 +1,513 @@
+/* -*- 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"
+#include "PrinterSetupWizardApp.h"
+#include "PrinterSetupWizardSheet.h"
+#include "SecondPage.h"
+#include "DebugServices.h"
+#include "WinServices.h"
+#include <winspool.h>
+
+// local variable is initialize but not referenced
+#pragma warning(disable:4189)
+
+// CSecondPage dialog
+
+IMPLEMENT_DYNAMIC(CSecondPage, CPropertyPage)
+CSecondPage::CSecondPage()
+ : CPropertyPage(CSecondPage::IDD)
+{
+ m_psp.dwFlags &= ~(PSP_HASHELP);
+ m_psp.dwFlags |= PSP_DEFAULT|PSP_USEHEADERTITLE|PSP_USEHEADERSUBTITLE;
+
+ m_psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_BROWSE_TITLE);
+ m_psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_BROWSE_SUBTITLE);
+
+ m_emptyListItem = NULL;
+ m_initialized = false;
+ m_waiting = false;
+}
+
+
+CSecondPage::~CSecondPage()
+{
+}
+
+
+void
+CSecondPage::InitBrowseList()
+{
+ CPrinterSetupWizardSheet * psheet;
+ CString text;
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ // Initialize so that nothing is selected when we add to the list
+
+ psheet->SetSelectedPrinter( NULL );
+ m_gotChoice = false;
+ m_browseList.Select( NULL, TVGN_FIRSTVISIBLE );
+
+ //
+ // load the no printers message until something shows up in the browse list
+ //
+ text.LoadString(IDS_NO_PRINTERS);
+
+ LoadTextAndDisableWindow( text );
+
+ //
+ // disable the next button until there's a printer to select
+ //
+ psheet->SetWizardButtons(PSWIZB_BACK);
+
+ //
+ // disable the printer information box
+ //
+ SetPrinterInformationState( FALSE );
+ m_descriptionField.SetWindowText( L"" );
+ m_locationField.SetWindowText( L"" );
+
+exit:
+
+ return;
+}
+
+
+void CSecondPage::DoDataExchange(CDataExchange* pDX)
+{
+ CPropertyPage::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_BROWSE_LIST, m_browseList);
+ DDX_Control(pDX, IDC_PRINTER_INFORMATION, m_printerInformation);
+
+ DDX_Control(pDX, IDC_DESCRIPTION_LABEL, m_descriptionLabel);
+
+ DDX_Control(pDX, IDC_DESCRIPTION_FIELD, m_descriptionField);
+
+ DDX_Control(pDX, IDC_LOCATION_LABEL, m_locationLabel);
+
+ DDX_Control(pDX, IDC_LOCATION_FIELD, m_locationField);
+
+}
+
+
+afx_msg BOOL
+CSecondPage::OnSetCursor(CWnd * pWnd, UINT nHitTest, UINT message)
+{
+ DEBUG_UNUSED(pWnd);
+ DEBUG_UNUSED(nHitTest);
+ DEBUG_UNUSED(message);
+
+ CPrinterSetupWizardSheet * psheet;
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ SetCursor(psheet->GetCursor());
+
+exit:
+
+ return TRUE;
+}
+
+
+BOOL
+CSecondPage::OnSetActive()
+{
+ CPrinterSetupWizardSheet * psheet;
+ Printer * printer;
+ CWnd * pWnd;
+ Printers::iterator it;
+ OSStatus err = kNoErr;
+ BOOL b;
+
+ b = CPropertyPage::OnSetActive();
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_action( psheet, exit, err = kUnknownErr );
+
+ // Stash the selected printer if any
+
+ printer = psheet->GetSelectedPrinter();
+
+ // initialize the browse list...this will remove everything currently
+ // in it, and add the no printers item
+
+ InitBrowseList();
+
+ // Populate the list with any printers that we currently know about
+
+ for ( it = psheet->m_printers.begin(); it != psheet->m_printers.end(); it++ )
+ {
+ OnAddPrinter( *it, false );
+ }
+
+ if ( ( !printer && ( psheet->m_printers.size() > 0 ) ) || ( printer != psheet->GetSelectedPrinter() ) )
+ {
+ if ( !printer )
+ {
+ printer = psheet->m_printers.front();
+ }
+
+ psheet->SetSelectedPrinter( printer );
+ }
+
+ if ( printer )
+ {
+ m_browseList.SelectItem( printer->item );
+ ::SetFocus( m_browseList );
+ }
+
+ // Hide the back button
+ pWnd = ((CPropertySheet*)GetParent())->GetDlgItem(ID_WIZBACK);
+ if ( pWnd != NULL )
+ {
+ pWnd->ShowWindow(SW_HIDE);
+ }
+
+exit:
+
+ return b;
+}
+
+
+BOOL
+CSecondPage::OnKillActive()
+{
+ CPrinterSetupWizardSheet * psheet;
+ CWnd * pWnd;
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ psheet->SetLastPage(this);
+
+ // Show the back button
+ pWnd = ((CPropertySheet*)GetParent())->GetDlgItem(ID_WIZBACK);
+ if ( pWnd != NULL )
+ {
+ pWnd->ShowWindow(SW_SHOW);
+ }
+
+exit:
+
+ return CPropertyPage::OnKillActive();
+}
+
+
+BEGIN_MESSAGE_MAP(CSecondPage, CPropertyPage)
+ ON_NOTIFY(TVN_SELCHANGED, IDC_BROWSE_LIST, OnTvnSelchangedBrowseList)
+ ON_NOTIFY(NM_CLICK, IDC_BROWSE_LIST, OnNmClickBrowseList)
+ ON_NOTIFY(TVN_KEYDOWN, IDC_BROWSE_LIST, OnTvnKeyDownBrowseList)
+ ON_WM_SETCURSOR()
+END_MESSAGE_MAP()
+
+
+// Printer::EventHandler implementation
+OSStatus
+CSecondPage::OnAddPrinter(
+ Printer * printer,
+ bool moreComing )
+{
+ CPrinterSetupWizardSheet * psheet;
+ Printer * selectedPrinter;
+ OSStatus err = kNoErr;
+
+ check( IsWindow( m_hWnd ) );
+
+ m_browseList.SetRedraw(FALSE);
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ if ( printer )
+ {
+ selectedPrinter = psheet->GetSelectedPrinter();
+
+ printer->item = m_browseList.InsertItem(printer->displayName);
+
+ m_browseList.SetItemData( printer->item, (DWORD_PTR) printer );
+
+ m_browseList.SortChildren(TVI_ROOT);
+
+ //
+ // if the searching item is still in the list
+ // get rid of it
+ //
+ // note that order is important here. Insert the printer
+ // item before removing the placeholder so we always have
+ // an item in the list to avoid experiencing the bug
+ // in Microsoft's implementation of CTreeCtrl
+ //
+ if (m_emptyListItem != NULL)
+ {
+ m_browseList.DeleteItem(m_emptyListItem);
+ m_emptyListItem = NULL;
+ m_browseList.EnableWindow(TRUE);
+ }
+
+ if ( !selectedPrinter )
+ {
+ psheet->SetSelectedPrinter( printer );
+ m_browseList.SelectItem( printer->item );
+ ::SetFocus( m_browseList );
+ }
+ }
+
+exit:
+
+ if (!moreComing)
+ {
+ m_browseList.SetRedraw(TRUE);
+ m_browseList.Invalidate();
+ }
+
+ return err;
+}
+
+
+OSStatus
+CSecondPage::OnRemovePrinter(
+ Printer * printer,
+ bool moreComing)
+{
+ CPrinterSetupWizardSheet * psheet;
+ OSStatus err = kNoErr;
+
+ check( IsWindow( m_hWnd ) );
+ check( printer );
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ m_browseList.SetRedraw(FALSE);
+
+ if ( printer )
+ {
+ //
+ // check to make sure if we're the only item in the control...i.e.
+ // the list size is 1.
+ //
+ if (m_browseList.GetCount() > 1)
+ {
+ //
+ // if we're not the only thing in the list, then
+ // simply remove it from the list
+ //
+ m_browseList.DeleteItem( printer->item );
+ }
+ else
+ {
+ //
+ // if we're the only thing in the list, then redisplay
+ // it with the no printers message
+ //
+ InitBrowseList();
+ }
+ }
+
+exit:
+
+ if ( !moreComing )
+ {
+ m_browseList.SetRedraw(TRUE);
+ m_browseList.Invalidate();
+ }
+
+ return err;
+}
+
+
+void
+CSecondPage::OnResolveService( Service * service )
+{
+ CPrinterSetupWizardSheet * psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ check( service );
+
+ Queue * q = service->SelectedQueue();
+
+ check( q );
+
+
+ //
+ // and set it to selected
+ //
+
+ m_selectedName = service->printer->name;
+
+ //
+ // and update the printer information box
+ //
+ SetPrinterInformationState( TRUE );
+
+ m_descriptionField.SetWindowText( q->description );
+ m_locationField.SetWindowText( q->location );
+
+ //
+ // reset the cursor
+ //
+
+ SetCursor(psheet->m_active);
+
+exit:
+
+ return;
+}
+
+
+void CSecondPage::OnTvnSelchangedBrowseList(NMHDR *pNMHDR, LRESULT *pResult)
+{
+ LPNMTREEVIEW pNMTreeView = reinterpret_cast<LPNMTREEVIEW>(pNMHDR);
+ CPrinterSetupWizardSheet * psheet;
+ Printer * printer;
+ int err = 0;
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_action( psheet, exit, err = kUnknownErr );
+
+ // The strange code here is to workaround a bug in the CTreeCtrl, whereupon the item
+ // we selected isn't passed through correctly to this callback routine.
+
+ if ( !m_gotChoice )
+ {
+ printer = psheet->GetSelectedPrinter();
+
+ // If we really haven't selected a printer, then re-select NULL and exit
+
+ if ( !printer )
+ {
+ m_browseList.SelectItem( NULL );
+
+ goto exit;
+ }
+
+ // If we already have selected a printer, fake like we've clicked on it, but only
+ // if the CTreeCtrl hasn't already selected it
+
+ else if ( printer->item != m_browseList.GetSelectedItem() )
+ {
+ m_gotChoice = true;
+
+ m_browseList.SelectItem( printer->item );
+
+ goto exit;
+ }
+ }
+
+ HTREEITEM item = m_browseList.GetSelectedItem();
+ require_quiet( item, exit );
+
+ printer = reinterpret_cast<Printer*>(m_browseList.GetItemData( item ) );
+ require_quiet( printer, exit );
+
+ //
+ // this call will trigger a resolve. When the resolve is complete,
+ // our OnResolve will be called.
+ //
+ err = psheet->StartResolve( printer );
+ require_noerr( err, exit );
+
+ //
+ // And clear out the printer information box
+ //
+ SetPrinterInformationState( FALSE );
+ m_descriptionField.SetWindowText(L"");
+ m_locationField.SetWindowText(L"");
+
+exit:
+
+ if (err != 0)
+ {
+ CString text;
+ CString caption;
+
+ text.LoadString(IDS_ERROR_SELECTING_PRINTER_TEXT);
+ caption.LoadString(IDS_ERROR_SELECTING_PRINTER_CAPTION);
+
+ MessageBox(text, caption, MB_OK|MB_ICONEXCLAMATION);
+ }
+
+ *pResult = 0;
+}
+
+
+void CSecondPage::OnNmClickBrowseList(NMHDR *pNMHDR, LRESULT *pResult)
+{
+ DEBUG_UNUSED( pNMHDR );
+
+ m_gotChoice = true;
+
+ *pResult = 0;
+}
+
+
+void CSecondPage::OnTvnKeyDownBrowseList( NMHDR * pNMHDR, LRESULT * pResult)
+{
+ DEBUG_UNUSED( pNMHDR );
+
+ m_gotChoice = true;
+
+ *pResult = 0;
+}
+
+
+void
+CSecondPage::LoadTextAndDisableWindow( CString & text )
+{
+ m_emptyListItem = m_browseList.InsertItem( text, 0, 0, NULL, TVI_FIRST );
+ m_browseList.SelectItem( NULL );
+
+ //
+ // this will remove everything else in the list...we might be navigating
+ // back to this window, and the browse list might have changed since
+ // we last displayed it.
+ //
+ if ( m_emptyListItem )
+ {
+ HTREEITEM item = m_browseList.GetNextVisibleItem( m_emptyListItem );
+
+ while ( item )
+ {
+ m_browseList.DeleteItem( item );
+ item = m_browseList.GetNextVisibleItem( m_emptyListItem );
+ }
+ }
+
+ m_browseList.EnableWindow( FALSE );
+}
+
+
+void
+CSecondPage::SetPrinterInformationState( BOOL state )
+{
+ m_printerInformation.EnableWindow( state );
+
+ m_descriptionLabel.EnableWindow( state );
+
+ m_descriptionField.EnableWindow( state );
+
+ m_locationLabel.EnableWindow( state );
+
+ m_locationField.EnableWindow( state );
+
+}
+
+
+
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/SecondPage.h b/mDNSResponder/Clients/PrinterSetupWizard/SecondPage.h
new file mode 100644
index 00000000..3fb4c462
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/SecondPage.h
@@ -0,0 +1,105 @@
+/* -*- 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
+
+#include "PrinterSetupWizardSheet.h"
+#include "CommonServices.h"
+#include "UtilTypes.h"
+#include "afxcmn.h"
+#include "dns_sd.h"
+#include "afxwin.h"
+#include <map>
+
+using namespace PrinterSetupWizard;
+
+// CSecondPage dialog
+
+class CSecondPage : public CPropertyPage
+{
+DECLARE_DYNAMIC(CSecondPage)
+
+public:
+CSecondPage();
+virtual ~CSecondPage();
+
+// Dialog Data
+enum { IDD = IDD_SECOND_PAGE };
+
+protected:
+
+void InitBrowseList();
+virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+afx_msg BOOL OnSetCursor(CWnd * pWnd, UINT nHitTest, UINT message);
+virtual BOOL OnSetActive();
+virtual BOOL OnKillActive();
+
+DECLARE_MESSAGE_MAP()
+
+public:
+
+HTREEITEM m_emptyListItem;
+bool m_selectOkay;
+CTreeCtrl m_browseList;
+bool m_initialized;
+bool m_waiting;
+
+afx_msg void OnTvnSelchangedBrowseList(NMHDR *pNMHDR, LRESULT *pResult);
+afx_msg void OnNmClickBrowseList(NMHDR * pNMHDR, LRESULT * pResult);
+afx_msg void OnTvnKeyDownBrowseList(NMHDR * pNMHDR, LRESULT * pResult );
+
+OSStatus
+OnAddPrinter(
+ Printer * printer,
+ bool moreComing);
+
+OSStatus
+OnRemovePrinter(
+ Printer * printer,
+ bool moreComing);
+
+void
+OnResolveService( Service * service );
+
+private:
+
+void
+LoadTextAndDisableWindow( CString & text );
+
+void
+SetPrinterInformationState( BOOL state );
+
+std::string m_selectedName;
+
+
+private:
+
+
+
+CStatic m_printerInformation;
+
+CStatic m_descriptionLabel;
+
+CStatic m_descriptionField;
+
+CStatic m_locationLabel;
+
+CStatic m_locationField;
+
+
+bool m_gotChoice;
+};
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/ThirdPage.cpp b/mDNSResponder/Clients/PrinterSetupWizard/ThirdPage.cpp
new file mode 100644
index 00000000..6caf55cb
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/ThirdPage.cpp
@@ -0,0 +1,1583 @@
+/* -*- 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"
+#include "PrinterSetupWizardApp.h"
+#include "PrinterSetupWizardSheet.h"
+#include "ThirdPage.h"
+#include "tcpxcv.h"
+#include <dns_sd.h>
+#include <winspool.h>
+#include <setupapi.h>
+
+// local variable is initialize but not referenced
+#pragma warning(disable:4189)
+
+//
+// This is the printer description file that is shipped
+// with Windows XP and below
+//
+#define kNTPrintFile L"inf\\ntprint.inf"
+
+//
+// Windows Vista ships with a set of prn*.inf files
+//
+#define kVistaPrintFiles L"inf\\prn*.inf"
+
+//
+// These are pre-defined names for Generic manufacturer and model
+//
+#define kGenericManufacturer L"Generic"
+#define kGenericText L"Generic / Text Only"
+#define kGenericPostscript L"Generic / Postscript"
+#define kGenericPCL L"Generic / PCL"
+#define kPDLPostscriptKey L"application/postscript"
+#define kPDLPCLKey L"application/vnd.hp-pcl"
+#define kGenericPSColorDriver L"HP Color LaserJet 4550 PS"
+#define kGenericPSDriver L"HP LaserJet 4050 Series PS"
+#define kGenericPCLColorDriver L"HP Color LaserJet 4550 PCL"
+#define kGenericPCLDriver L"HP LaserJet 4050 Series PCL"
+
+
+// CThirdPage dialog
+
+IMPLEMENT_DYNAMIC(CThirdPage, CPropertyPage)
+CThirdPage::CThirdPage()
+ : CPropertyPage(CThirdPage::IDD),
+ m_manufacturerSelected( NULL ),
+ m_modelSelected( NULL ),
+ m_genericPostscript( NULL ),
+ m_genericPCL( NULL ),
+ m_initialized(false),
+ m_printerImage( NULL )
+{
+ static const int bufferSize = 32768;
+ TCHAR windowsDirectory[bufferSize];
+ CString header;
+ WIN32_FIND_DATA findFileData;
+ HANDLE findHandle;
+ CString prnFiles;
+ CString ntPrint;
+ OSStatus err;
+ BOOL ok;
+
+ m_psp.dwFlags &= ~(PSP_HASHELP);
+ m_psp.dwFlags |= PSP_DEFAULT|PSP_USEHEADERTITLE|PSP_USEHEADERSUBTITLE;
+
+ m_psp.pszHeaderTitle = MAKEINTRESOURCE(IDS_INSTALL_TITLE);
+ m_psp.pszHeaderSubTitle = MAKEINTRESOURCE(IDS_INSTALL_SUBTITLE);
+
+ //
+ // load printers from ntprint.inf
+ //
+ ok = GetWindowsDirectory( windowsDirectory, bufferSize );
+ err = translate_errno( ok, errno_compat(), kUnknownErr );
+ require_noerr( err, exit );
+
+ //
+ // <rdar://problem/4826126>
+ //
+ // If there are no *prn.inf files, we'll assume that the information
+ // is in ntprint.inf
+ //
+ prnFiles.Format( L"%s\\%s", windowsDirectory, kVistaPrintFiles );
+ findHandle = FindFirstFile( prnFiles, &findFileData );
+
+ if ( findHandle != INVALID_HANDLE_VALUE )
+ {
+ CString absolute;
+
+ absolute.Format( L"%s\\inf\\%s", windowsDirectory, findFileData.cFileName );
+ err = LoadPrintDriverDefsFromFile( m_manufacturers, absolute, false );
+ require_noerr( err, exit );
+
+ while ( FindNextFile( findHandle, &findFileData ) )
+ {
+ absolute.Format( L"%s\\inf\\%s", windowsDirectory, findFileData.cFileName );
+ err = LoadPrintDriverDefsFromFile( m_manufacturers, absolute, false );
+ require_noerr( err, exit );
+ }
+
+ FindClose( findHandle );
+ }
+ else
+ {
+ ntPrint.Format(L"%s\\%s", windowsDirectory, kNTPrintFile);
+ err = LoadPrintDriverDefsFromFile( m_manufacturers, ntPrint, false );
+ require_noerr(err, exit);
+ }
+
+ //
+ // load printer drivers that have been installed on this machine
+ //
+ err = LoadPrintDriverDefs( m_manufacturers );
+ require_noerr(err, exit);
+
+ //
+ // load our own special generic printer defs
+ //
+ err = LoadGenericPrintDriverDefs( m_manufacturers );
+ require_noerr( err, exit );
+
+exit:
+
+ return;
+}
+
+
+void
+CThirdPage::FreeManufacturers( Manufacturers & manufacturers )
+{
+ for ( Manufacturers::iterator it = manufacturers.begin(); it != manufacturers.end(); it++ )
+ {
+ for ( Models::iterator it2 = it->second->models.begin(); it2 != it->second->models.end(); it2++ )
+ {
+ delete *it2;
+ }
+
+ delete it->second;
+ }
+}
+
+
+CThirdPage::~CThirdPage()
+{
+ FreeManufacturers( m_manufacturers );
+}
+
+// ----------------------------------------------------
+// SelectMatch
+//
+// SelectMatch will do all the UI work associated with
+// selected a manufacturer and model of printer. It also
+// makes sure the printer object is update with the
+// latest settings
+//
+// ----------------------------------------------------
+void
+CThirdPage::SelectMatch(Printer * printer, Service * service, Manufacturer * manufacturer, Model * model)
+{
+ LVFINDINFO info;
+ int nIndex;
+
+ check( printer != NULL );
+ check( manufacturer != NULL );
+ check( model != NULL );
+
+ //
+ // select the manufacturer
+ //
+ info.flags = LVFI_STRING;
+ info.psz = manufacturer->name;
+
+ nIndex = m_manufacturerListCtrl.FindItem(&info);
+
+ if (nIndex != -1)
+ {
+ m_manufacturerListCtrl.SetItemState(nIndex, LVIS_SELECTED, LVIS_SELECTED);
+ //
+ //<rdar://problem/4528853> mDNS: When auto-highlighting items in lists, scroll list so highlighted item is in the middle
+ //
+ AutoScroll(m_manufacturerListCtrl, nIndex);
+ }
+
+ //
+ // select the model
+ //
+ info.flags = LVFI_STRING;
+ info.psz = model->displayName;
+
+ nIndex = m_modelListCtrl.FindItem(&info);
+
+ if (nIndex != -1)
+ {
+ m_modelListCtrl.SetItemState(nIndex, LVIS_SELECTED, LVIS_SELECTED);
+ AutoScroll( m_modelListCtrl, nIndex );
+
+ m_modelListCtrl.SetFocus();
+ }
+
+ CopyPrinterSettings( printer, service, manufacturer, model );
+}
+
+void
+CThirdPage::SelectMatch(Manufacturers & manufacturers, Printer * printer, Service * service, Manufacturer * manufacturer, Model * model)
+{
+ PopulateUI( manufacturers );
+
+ SelectMatch( printer, service, manufacturer, model );
+}
+
+// --------------------------------------------------------
+// CopyPrinterSettings
+//
+// This function makes sure that the printer object has the
+// latest settings from the manufacturer and model objects
+// --------------------------------------------------------
+
+void
+CThirdPage::CopyPrinterSettings( Printer * printer, Service * service, Manufacturer * manufacturer, Model * model )
+{
+ DWORD portNameLen;
+
+ printer->manufacturer = manufacturer->name;
+ printer->displayModelName = model->displayName;
+ printer->modelName = model->name;
+ printer->driverInstalled = model->driverInstalled;
+ printer->infFileName = model->infFileName;
+
+ if ( service->type == kPDLServiceType )
+ {
+ printer->portName.Format(L"IP_%s.%d", static_cast<LPCTSTR>(service->hostname), service->portNumber);
+ service->protocol = L"Raw";
+ }
+ else if ( service->type == kLPRServiceType )
+ {
+ Queue * q = service->queues.front();
+ check( q );
+
+ if ( q->name.GetLength() > 0 )
+ {
+ printer->portName.Format(L"LPR_%s.%d.%s", static_cast<LPCTSTR>(service->hostname), service->portNumber, static_cast<LPCTSTR>(q->name) );
+ }
+ else
+ {
+ printer->portName.Format(L"LPR_%s.%d", static_cast<LPCTSTR>(service->hostname), service->portNumber);
+ }
+
+ service->protocol = L"LPR";
+ }
+ else if ( service->type == kIPPServiceType )
+ {
+ Queue * q = service->queues.front();
+ check( q );
+
+ if ( q->name.GetLength() > 0 )
+ {
+ printer->portName.Format(L"http://%s:%d/%s", static_cast<LPCTSTR>(service->hostname), service->portNumber, static_cast<LPCTSTR>(q->name) );
+ }
+ else
+ {
+ printer->portName.Format(L"http://%s:%d/", static_cast<LPCTSTR>(service->hostname), service->portNumber );
+ }
+
+ service->protocol = L"IPP";
+ }
+
+ // If it's not an IPP printr, truncate the portName so that it's valid
+
+ if ( service->type != kIPPServiceType )
+ {
+ portNameLen = printer->portName.GetLength() + 1;
+
+ if ( portNameLen > MAX_PORTNAME_LEN )
+ {
+ printer->portName.Delete( MAX_PORTNAME_LEN - 1, ( portNameLen - MAX_PORTNAME_LEN ) );
+ }
+ }
+}
+
+// --------------------------------------------------------
+// DefaultPrinterExists
+//
+// Checks to see if a default printer has been configured
+// on this machine
+// --------------------------------------------------------
+BOOL
+CThirdPage::DefaultPrinterExists()
+{
+ CPrintDialog dlg(FALSE);
+
+ dlg.m_pd.Flags |= PD_RETURNDEFAULT;
+
+ return dlg.GetDefaults();
+}
+
+// --------------------------------------------------------
+// AutoScroll
+//
+// Ensure selected item is in middle of list
+// --------------------------------------------------------
+void
+CThirdPage::AutoScroll( CListCtrl & list, int nIndex )
+{
+ //
+ //<rdar://problem/4528853> mDNS: When auto-highlighting items in lists, scroll list so highlighted item is in the middle
+ //
+
+ int top;
+ int count;
+
+ list.EnsureVisible( nIndex, FALSE );
+
+ top = list.GetTopIndex();
+ count = list.GetCountPerPage();
+
+ if ( ( nIndex == top ) || ( ( nIndex + 1 ) == ( top + count ) ) )
+ {
+ CRect rect;
+ int rows;
+
+ rows = ( count / 2 );
+
+ if ( nIndex == top )
+ {
+ list.GetItemRect(0, rect, LVIR_BOUNDS);
+ list.Scroll( CPoint( 0, rows * rect.Height() * -1 ) );
+ }
+ else
+ {
+ list.GetItemRect(0, rect, LVIR_BOUNDS);
+ list.Scroll( CPoint( 0, rows * rect.Height() ) );
+ }
+ }
+}
+
+// ------------------------------------------------------
+// LoadPrintDriverDefsFromFile
+//
+// The only potentially opaque thing about this function is the
+// checkForDuplicateModels flag. The problem here is that ntprint.inf
+// doesn't contain duplicate models, and it has hundreds of models
+// listed. You wouldn't check for duplicates there. But oftentimes,
+// loading different windows print driver files contain multiple
+// entries for the same printer. You don't want the UI to display
+// the same printer multiple times, so in that case, you would ask
+// this function to check for multiple models.
+
+OSStatus
+CThirdPage::LoadPrintDriverDefsFromFile(Manufacturers & manufacturers, const CString & filename, bool checkForDuplicateModels )
+{
+ HINF handle = INVALID_HANDLE_VALUE;
+ const TCHAR * section = TEXT( "Manufacturer" );
+ LONG sectionCount;
+ TCHAR line[ 1000 ];
+ CString klass;
+ INFCONTEXT manufacturerContext;
+ BOOL ok;
+ OSStatus err = 0;
+
+ // Make sure we can open the file
+ handle = SetupOpenInfFile( filename, NULL, INF_STYLE_WIN4, NULL );
+ translate_errno( handle != INVALID_HANDLE_VALUE, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+
+ // Make sure it's a printer file
+ ok = SetupGetLineText( NULL, handle, TEXT( "Version" ), TEXT( "Class" ), line, sizeof( line ), NULL );
+ translate_errno( ok, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+ klass = line;
+ require_action( klass == TEXT( "Printer" ), exit, err = kUnknownErr );
+
+ sectionCount = SetupGetLineCount( handle, section );
+ translate_errno( sectionCount != -1, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+
+ memset( &manufacturerContext, 0, sizeof( manufacturerContext ) );
+
+ for ( LONG i = 0; i < sectionCount; i++ )
+ {
+ Manufacturers::iterator iter;
+ Manufacturer * manufacturer;
+ CString manufacturerName;
+ CString temp;
+ CStringList modelSectionNameDecl;
+ CString modelSectionName;
+ CString baseModelName;
+ CString model;
+ INFCONTEXT modelContext;
+ LONG modelCount;
+ POSITION p;
+
+ if ( i == 0 )
+ {
+ ok = SetupFindFirstLine( handle, section, NULL, &manufacturerContext );
+ err = translate_errno( ok, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+ }
+ else
+ {
+ ok = SetupFindNextLine( &manufacturerContext, &manufacturerContext );
+ err = translate_errno( ok, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+ }
+
+ ok = SetupGetStringField( &manufacturerContext, 0, line, sizeof( line ), NULL );
+ err = translate_errno( ok, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+ manufacturerName = line;
+
+ ok = SetupGetLineText( &manufacturerContext, handle, NULL, NULL, line, sizeof( line ), NULL );
+ err = translate_errno( ok, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+
+ // Try to find some model section name that has entries. Explanation of int file structure
+ // can be found at:
+ //
+ // <http://msdn.microsoft.com/en-us/library/ms794359.aspx>
+ Split( line, ',', modelSectionNameDecl );
+
+ p = modelSectionNameDecl.GetHeadPosition();
+ modelSectionName = modelSectionNameDecl.GetNext( p );
+ modelCount = SetupGetLineCount( handle, modelSectionName );
+ baseModelName = modelSectionName;
+
+ while ( modelCount <= 0 && p )
+ {
+ CString targetOSVersion;
+
+ targetOSVersion = modelSectionNameDecl.GetNext( p );
+ modelSectionName = baseModelName + TEXT( "." ) + targetOSVersion;
+ modelCount = SetupGetLineCount( handle, modelSectionName );
+ }
+
+ if ( modelCount > 0 )
+ {
+ manufacturerName = NormalizeManufacturerName( manufacturerName );
+
+ iter = manufacturers.find( manufacturerName );
+
+ if ( iter != manufacturers.end() )
+ {
+ manufacturer = iter->second;
+ require_action( manufacturer, exit, err = kUnknownErr );
+ }
+ else
+ {
+ try
+ {
+ manufacturer = new Manufacturer;
+ }
+ catch (...)
+ {
+ manufacturer = NULL;
+ }
+
+ require_action( manufacturer, exit, err = kNoMemoryErr );
+
+ manufacturer->name = manufacturerName;
+ manufacturers[ manufacturerName ] = manufacturer;
+ }
+
+ memset( &modelContext, 0, sizeof( modelContext ) );
+
+ for ( LONG j = 0; j < modelCount; j++ )
+ {
+ CString modelName;
+ Model * model;
+
+ if ( j == 0 )
+ {
+ ok = SetupFindFirstLine( handle, modelSectionName, NULL, &modelContext );
+ err = translate_errno( ok, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+ }
+ else
+ {
+ SetupFindNextLine( &modelContext, &modelContext );
+ err = translate_errno( ok, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+ }
+
+ ok = SetupGetStringField( &modelContext, 0, line, sizeof( line ), NULL );
+ err = translate_errno( ok, GetLastError(), kUnknownErr );
+ require_noerr( err, exit );
+
+ modelName = line;
+
+ if (checkForDuplicateModels == true)
+ {
+ if ( MatchModel( manufacturer, ConvertToModelName( modelName ) ) != NULL )
+ {
+ continue;
+ }
+ }
+
+ //
+ // Stock Vista printer inf files embed guids in the model
+ // declarations for Epson printers. Let's ignore those.
+ //
+ if ( modelName.Find( TEXT( "{" ), 0 ) != -1 )
+ {
+ continue;
+ }
+
+ try
+ {
+ model = new Model;
+ }
+ catch (...)
+ {
+ model = NULL;
+ }
+
+ require_action( model, exit, err = kNoMemoryErr );
+
+ model->infFileName = filename;
+ model->displayName = modelName;
+ model->name = modelName;
+ model->driverInstalled = false;
+
+ manufacturer->models.push_back(model);
+ }
+ }
+ }
+
+exit:
+
+ if ( handle != INVALID_HANDLE_VALUE )
+ {
+ SetupCloseInfFile( handle );
+ handle = NULL;
+ }
+
+ return err;
+}
+
+
+// -------------------------------------------------------
+// LoadPrintDriverDefs
+//
+// This function is responsible for loading the print driver
+// definitions of all print drivers that have been installed
+// on this machine.
+// -------------------------------------------------------
+OSStatus
+CThirdPage::LoadPrintDriverDefs( Manufacturers & manufacturers )
+{
+ BYTE * buffer = NULL;
+ DWORD bytesReceived = 0;
+ DWORD numPrinters = 0;
+ OSStatus err = 0;
+ BOOL ok;
+
+ //
+ // like a lot of win32 calls, we call this first to get the
+ // size of the buffer we need.
+ //
+ EnumPrinterDrivers(NULL, L"all", 6, NULL, 0, &bytesReceived, &numPrinters);
+
+ if (bytesReceived > 0)
+ {
+ try
+ {
+ buffer = new BYTE[bytesReceived];
+ }
+ catch (...)
+ {
+ buffer = NULL;
+ }
+
+ require_action( buffer, exit, err = kNoMemoryErr );
+
+ //
+ // this call gets the real info
+ //
+ ok = EnumPrinterDrivers(NULL, L"all", 6, buffer, bytesReceived, &bytesReceived, &numPrinters);
+ err = translate_errno( ok, errno_compat(), kUnknownErr );
+ require_noerr( err, exit );
+
+ DRIVER_INFO_6 * info = (DRIVER_INFO_6*) buffer;
+
+ for (DWORD i = 0; i < numPrinters; i++)
+ {
+ Manufacturer * manufacturer;
+ Model * model;
+ CString name;
+
+ //
+ // skip over anything that doesn't have a manufacturer field. This
+ // fixes a bug that I noticed that occurred after I installed
+ // ProComm. This program add a print driver with no manufacturer
+ // that screwed up this wizard.
+ //
+ if (info[i].pszMfgName == NULL)
+ {
+ continue;
+ }
+
+ //
+ // look for manufacturer
+ //
+ Manufacturers::iterator iter;
+
+ //
+ // save the name
+ //
+ name = NormalizeManufacturerName( info[i].pszMfgName );
+
+ iter = manufacturers.find(name);
+
+ if (iter != manufacturers.end())
+ {
+ manufacturer = iter->second;
+ }
+ else
+ {
+ try
+ {
+ manufacturer = new Manufacturer;
+ }
+ catch (...)
+ {
+ manufacturer = NULL;
+ }
+
+ require_action( manufacturer, exit, err = kNoMemoryErr );
+
+ manufacturer->name = name;
+
+ manufacturers[name] = manufacturer;
+ }
+
+ //
+ // now look to see if we have already seen this guy. this could
+ // happen if we have already installed printers that are described
+ // in ntprint.inf. the extant drivers will show up in EnumPrinterDrivers
+ // but we have already loaded their info
+ //
+ //
+ if ( MatchModel( manufacturer, ConvertToModelName( info[i].pName ) ) == NULL )
+ {
+ try
+ {
+ model = new Model;
+ }
+ catch (...)
+ {
+ model = NULL;
+ }
+
+ require_action( model, exit, err = kNoMemoryErr );
+
+ model->displayName = info[i].pName;
+ model->name = info[i].pName;
+ model->driverInstalled = true;
+
+ manufacturer->models.push_back(model);
+ }
+ }
+ }
+
+exit:
+
+ if (buffer != NULL)
+ {
+ delete [] buffer;
+ }
+
+ return err;
+}
+
+// -------------------------------------------------------
+// LoadGenericPrintDriverDefs
+//
+// This function is responsible for loading polymorphic
+// generic print drivers defs. The UI will read
+// something like "Generic / Postscript" and we can map
+// that to any print driver we want.
+// -------------------------------------------------------
+OSStatus
+CThirdPage::LoadGenericPrintDriverDefs( Manufacturers & manufacturers )
+{
+ Manufacturer * manufacturer;
+ Model * model;
+ Manufacturers::iterator iter;
+ CString psDriverName;
+ CString pclDriverName;
+ OSStatus err = 0;
+
+ // <rdar://problem/4030388> Generic drivers don't do color
+
+ // First try and find our generic driver names
+
+ iter = m_manufacturers.find(L"HP");
+ require_action( iter != m_manufacturers.end(), exit, err = kUnknownErr );
+ manufacturer = iter->second;
+
+ // Look for Postscript
+
+ model = manufacturer->find( kGenericPSColorDriver );
+
+ if ( !model )
+ {
+ model = manufacturer->find( kGenericPSDriver );
+ }
+
+ if ( model )
+ {
+ psDriverName = model->name;
+ }
+
+ // Look for PCL
+
+ model = manufacturer->find( kGenericPCLColorDriver );
+
+ if ( !model )
+ {
+ model = manufacturer->find( kGenericPCLDriver );
+ }
+
+ if ( model )
+ {
+ pclDriverName = model->name;
+ }
+
+ // If we found either a generic PS driver, or a generic PCL driver,
+ // then add them to the list
+
+ if ( psDriverName.GetLength() || pclDriverName.GetLength() )
+ {
+ // Try and find generic manufacturer if there is one
+
+ iter = manufacturers.find(L"Generic");
+
+ if (iter != manufacturers.end())
+ {
+ manufacturer = iter->second;
+ }
+ else
+ {
+ try
+ {
+ manufacturer = new Manufacturer;
+ }
+ catch (...)
+ {
+ manufacturer = NULL;
+ }
+
+ require_action( manufacturer, exit, err = kNoMemoryErr );
+
+ manufacturer->name = "Generic";
+ manufacturers[manufacturer->name] = manufacturer;
+ }
+
+ if ( psDriverName.GetLength() > 0 )
+ {
+ try
+ {
+ m_genericPostscript = new Model;
+ }
+ catch (...)
+ {
+ m_genericPostscript = NULL;
+ }
+
+ require_action( m_genericPostscript, exit, err = kNoMemoryErr );
+
+ m_genericPostscript->displayName = kGenericPostscript;
+ m_genericPostscript->name = psDriverName;
+ m_genericPostscript->driverInstalled = false;
+
+ manufacturer->models.push_back( m_genericPostscript );
+ }
+
+ if ( pclDriverName.GetLength() > 0 )
+ {
+ try
+ {
+ m_genericPCL = new Model;
+ }
+ catch (...)
+ {
+ m_genericPCL = NULL;
+ }
+
+ require_action( m_genericPCL, exit, err = kNoMemoryErr );
+
+ m_genericPCL->displayName = kGenericPCL;
+ m_genericPCL->name = pclDriverName;
+ m_genericPCL->driverInstalled = false;
+
+ manufacturer->models.push_back( m_genericPCL );
+ }
+ }
+
+exit:
+
+ return err;
+}
+
+// ------------------------------------------------------
+// ConvertToManufacturerName
+//
+// This function is responsible for tweaking the
+// name so that subsequent string operations won't fail because
+// of capitalizations/different names for the same manufacturer
+// (i.e. Hewlett-Packard/HP/Hewlett Packard)
+//
+CString
+CThirdPage::ConvertToManufacturerName( const CString & name )
+{
+ //
+ // first we're going to convert all the characters to lower
+ // case
+ //
+ CString lower = name;
+ lower.MakeLower();
+
+ //
+ // now we're going to check to see if the string says "hewlett-packard",
+ // because sometimes they refer to themselves as "hewlett-packard", and
+ // sometimes they refer to themselves as "hp".
+ //
+ if ( lower == L"hewlett-packard")
+ {
+ lower = "hp";
+ }
+
+ //
+ // tweak for Xerox Phaser, which doesn't announce itself
+ // as a xerox
+ //
+ else if ( lower.Find( L"phaser", 0 ) != -1 )
+ {
+ lower = "xerox";
+ }
+
+ return lower;
+}
+
+// ------------------------------------------------------
+// ConvertToModelName
+//
+// This function is responsible for ensuring that subsequent
+// string operations don't fail because of differing capitalization
+// schemes and the like
+// ------------------------------------------------------
+
+CString
+CThirdPage::ConvertToModelName( const CString & name )
+{
+ //
+ // convert it to lowercase
+ //
+ CString lower = name;
+ lower.MakeLower();
+
+ return lower;
+}
+
+// ------------------------------------------------------
+// NormalizeManufacturerName
+//
+// This function is responsible for tweaking the manufacturer
+// name so that there are no aliases for vendors
+//
+CString
+CThirdPage::NormalizeManufacturerName( const CString & name )
+{
+ CString normalized = name;
+
+ //
+ // now we're going to check to see if the string says "hewlett-packard",
+ // because sometimes they refer to themselves as "hewlett-packard", and
+ // sometimes they refer to themselves as "hp".
+ //
+ if ( normalized == L"Hewlett-Packard")
+ {
+ normalized = "HP";
+ }
+
+ return normalized;
+}
+
+// -------------------------------------------------------
+// MatchPrinter
+//
+// This function is responsible for matching a printer
+// to a list of manufacturers and models. It calls
+// MatchManufacturer and MatchModel in turn.
+//
+
+OSStatus CThirdPage::MatchPrinter(Manufacturers & manufacturers, Printer * printer, Service * service, bool useCUPSWorkaround)
+{
+ CString normalizedProductName;
+ Manufacturer * manufacturer = NULL;
+ Manufacturer * genericManufacturer = NULL;
+ Model * model = NULL;
+ Model * genericModel = NULL;
+ bool found = false;
+ CString text;
+ OSStatus err = kNoErr;
+
+ check( printer );
+ check( service );
+
+ Queue * q = service->SelectedQueue();
+
+ check( q );
+
+ //
+ // first look to see if we have a usb_MFG descriptor
+ //
+ if ( q->usb_MFG.GetLength() > 0)
+ {
+ manufacturer = MatchManufacturer( manufacturers, ConvertToManufacturerName ( q->usb_MFG ) );
+ }
+
+ if ( manufacturer == NULL )
+ {
+ q->product.Remove('(');
+ q->product.Remove(')');
+
+ manufacturer = MatchManufacturer( manufacturers, ConvertToManufacturerName ( q->product ) );
+ }
+
+ //
+ // if we found the manufacturer, then start looking for the model
+ //
+ if ( manufacturer != NULL )
+ {
+ if ( q->usb_MDL.GetLength() > 0 )
+ {
+ model = MatchModel ( manufacturer, ConvertToModelName ( q->usb_MDL ) );
+ }
+
+ if ( ( model == NULL ) && ( q->product.GetLength() > 0 ) )
+ {
+ q->product.Remove('(');
+ q->product.Remove(')');
+
+ model = MatchModel ( manufacturer, ConvertToModelName ( q->product ) );
+ }
+
+ if ( model != NULL )
+ {
+ // <rdar://problem/4124524> Offer Generic printers if printer advertises Postscript or PCL. Workaround
+ // bug in OS X CUPS printer sharing by selecting Generic driver instead of matched printer.
+
+ bool hasGenericDriver = false;
+
+ if ( MatchGeneric( manufacturers, printer, service, &genericManufacturer, &genericModel ) )
+ {
+ hasGenericDriver = true;
+ }
+
+ // <rdar://problem/4190104> Use "application/octet-stream" to determine if CUPS
+ // shared queue supports raw
+
+ if ( q->pdl.Find( L"application/octet-stream" ) != -1 )
+ {
+ useCUPSWorkaround = false;
+ }
+
+ if ( useCUPSWorkaround && printer->isCUPSPrinter && hasGenericDriver )
+ {
+ //
+ // <rdar://problem/4496652> mDNS: Don't allow user to choose non-working driver
+ //
+ Manufacturers genericManufacturers;
+
+ LoadGenericPrintDriverDefs( genericManufacturers );
+
+ SelectMatch( genericManufacturers, printer, service, genericManufacturer, genericModel );
+
+ FreeManufacturers( genericManufacturers );
+ }
+ else
+ {
+ SelectMatch(manufacturers, printer, service, manufacturer, model);
+ }
+
+ found = true;
+ }
+ }
+
+ //
+ // display a message to the user based on whether we could match
+ // this printer
+ //
+ if (found)
+ {
+ text.LoadString(IDS_PRINTER_MATCH_GOOD);
+ err = kNoErr;
+ }
+ else if ( MatchGeneric( manufacturers, printer, service, &genericManufacturer, &genericModel ) )
+ {
+ if ( printer->isCUPSPrinter )
+ {
+ //
+ // <rdar://problem/4496652> mDNS: Don't allow user to choose non-working driver
+ //
+ Manufacturers genericManufacturers;
+
+ LoadGenericPrintDriverDefs( genericManufacturers );
+
+ SelectMatch( genericManufacturers, printer, service, genericManufacturer, genericModel );
+
+ text.LoadString(IDS_PRINTER_MATCH_GOOD);
+
+ FreeManufacturers( genericManufacturers );
+ }
+ else
+ {
+ SelectMatch( manufacturers, printer, service, genericManufacturer, genericModel );
+ text.LoadString(IDS_PRINTER_MATCH_MAYBE);
+ }
+
+ err = kNoErr;
+ }
+ else
+ {
+ text.LoadString(IDS_PRINTER_MATCH_BAD);
+
+ //
+ // if there was any crud in this list from before, get rid of it now
+ //
+ m_modelListCtrl.DeleteAllItems();
+
+ //
+ // select the manufacturer if we found one
+ //
+ if (manufacturer != NULL)
+ {
+ LVFINDINFO info;
+ int nIndex;
+
+ //
+ // select the manufacturer
+ //
+ info.flags = LVFI_STRING;
+ info.psz = manufacturer->name;
+
+ nIndex = m_manufacturerListCtrl.FindItem(&info);
+
+ if (nIndex != -1)
+ {
+ m_manufacturerListCtrl.SetItemState(nIndex, LVIS_SELECTED, LVIS_SELECTED);
+
+ //
+ //<rdar://problem/4528853> mDNS: When auto-highlighting items in lists, scroll list so highlighted item is in the middle
+ //
+ AutoScroll(m_manufacturerListCtrl, nIndex);
+ }
+ }
+
+ err = kUnknownErr;
+ }
+
+ m_printerSelectionText.SetWindowText(text);
+
+ return err;
+}
+
+// ------------------------------------------------------
+// MatchManufacturer
+//
+// This function is responsible for finding a manufacturer
+// object from a string name. It does a CString::Find, which
+// is like strstr, so it doesn't have to do an exact match
+//
+// If it can't find a match, NULL is returned
+// ------------------------------------------------------
+
+Manufacturer*
+CThirdPage::MatchManufacturer( Manufacturers & manufacturers, const CString & name)
+{
+ Manufacturers::iterator iter;
+
+ for (iter = manufacturers.begin(); iter != manufacturers.end(); iter++)
+ {
+ //
+ // we're going to convert all the manufacturer names to lower case,
+ // so we match the name passed in.
+ //
+ CString lower = iter->second->name;
+ lower.MakeLower();
+
+ //
+ // now try and find the lowered string in the name passed in.
+ //
+ if (name.Find(lower) != -1)
+ {
+ return iter->second;
+ }
+ }
+
+ return NULL;
+}
+
+// -------------------------------------------------------
+// MatchModel
+//
+// This function is responsible for matching a model from
+// a name. It does a CString::Find(), which works like strstr,
+// so it doesn't rely on doing an exact string match.
+//
+
+Model*
+CThirdPage::MatchModel(Manufacturer * manufacturer, const CString & name)
+{
+ Models::iterator iter;
+
+ iter = manufacturer->models.begin();
+
+ for (iter = manufacturer->models.begin(); iter != manufacturer->models.end(); iter++)
+ {
+ Model * model = *iter;
+
+ //
+ // convert the model name to lower case
+ //
+ CString lowered = model->name;
+ lowered.MakeLower();
+
+ if (lowered.Find( name ) != -1)
+ {
+ return model;
+ }
+
+ //
+ // <rdar://problem/3841218>
+ // try removing the first substring and search again
+ //
+
+ if ( name.Find(' ') != -1 )
+ {
+ CString altered = name;
+ altered.Delete( 0, altered.Find(' ') + 1 );
+
+ if ( lowered.Find( altered ) != -1 )
+ {
+ return model;
+ }
+ }
+ }
+
+ return NULL;
+}
+
+// -------------------------------------------------------
+// MatchGeneric
+//
+// This function will attempt to find a generic printer
+// driver for a printer that we weren't able to match
+// specifically
+//
+BOOL
+CThirdPage::MatchGeneric( Manufacturers & manufacturers, Printer * printer, Service * service, Manufacturer ** manufacturer, Model ** model )
+{
+ CString pdl;
+ BOOL ok = FALSE;
+
+ DEBUG_UNUSED( printer );
+
+ check( service );
+
+ Queue * q = service->SelectedQueue();
+
+ check( q );
+
+ Manufacturers::iterator iter = manufacturers.find( kGenericManufacturer );
+ require_action_quiet( iter != manufacturers.end(), exit, ok = FALSE );
+
+ *manufacturer = iter->second;
+
+ pdl = q->pdl;
+ pdl.MakeLower();
+
+ if ( m_genericPCL && ( pdl.Find( kPDLPCLKey ) != -1 ) )
+ {
+ *model = m_genericPCL;
+ ok = TRUE;
+ }
+ else if ( m_genericPostscript && ( pdl.Find( kPDLPostscriptKey ) != -1 ) )
+ {
+ *model = m_genericPostscript;
+ ok = TRUE;
+ }
+
+exit:
+
+ return ok;
+}
+
+// -----------------------------------------------------------
+// OnInitPage
+//
+// This function is responsible for doing initialization that
+// only occurs once during a run of the wizard
+//
+
+OSStatus CThirdPage::OnInitPage()
+{
+ CString header;
+ CString ntPrint;
+ OSStatus err = kNoErr;
+
+ // Load printer icon
+ check( m_printerImage == NULL );
+
+ m_printerImage = (CStatic*) GetDlgItem( 1 ); // 1 == IDR_MANIFEST
+ check( m_printerImage );
+
+ if ( m_printerImage != NULL )
+ {
+ m_printerImage->SetIcon( LoadIcon( GetNonLocalizedResources(), MAKEINTRESOURCE( IDI_PRINTER ) ) );
+ }
+
+ //
+ // The CTreeCtrl widget automatically sends a selection changed
+ // message which initially we want to ignore, because the user
+ // hasn't selected anything
+ //
+ // this flag gets reset in the message handler. Every subsequent
+ // message gets handled.
+ //
+
+ //
+ // we have to make sure that we only do this once. Typically,
+ // we would do this in something like OnInitDialog, but we don't
+ // have this in Wizards, because the window is a PropertySheet.
+ // We're considered fully initialized when we receive the first
+ // selection notice
+ //
+ header.LoadString(IDS_MANUFACTURER_HEADING);
+ m_manufacturerListCtrl.InsertColumn(0, header, LVCFMT_LEFT, -1 );
+ m_manufacturerSelected = NULL;
+
+ header.LoadString(IDS_MODEL_HEADING);
+ m_modelListCtrl.InsertColumn(0, header, LVCFMT_LEFT, -1 );
+ m_modelSelected = NULL;
+
+ return (err);
+}
+
+void CThirdPage::DoDataExchange(CDataExchange* pDX)
+{
+ CPropertyPage::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_PRINTER_MANUFACTURER, m_manufacturerListCtrl);
+ DDX_Control(pDX, IDC_PRINTER_MODEL, m_modelListCtrl);
+ DDX_Control(pDX, IDC_PRINTER_NAME, m_printerName);
+ DDX_Control(pDX, IDC_DEFAULT_PRINTER, m_defaultPrinterCtrl);
+ DDX_Control(pDX, IDC_PRINTER_SELECTION_TEXT, m_printerSelectionText);
+
+}
+
+// ----------------------------------------------------------
+// OnSetActive
+//
+// This function is called by MFC after the window has been
+// activated.
+//
+
+BOOL
+CThirdPage::OnSetActive()
+{
+ CPrinterSetupWizardSheet * psheet;
+ Printer * printer;
+ Service * service;
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ psheet->SetWizardButtons( PSWIZB_BACK );
+
+ printer = psheet->GetSelectedPrinter();
+ require_quiet( printer, exit );
+
+ service = printer->services.front();
+ require_quiet( service, exit );
+
+ //
+ // call OnInitPage once
+ //
+ if (!m_initialized)
+ {
+ OnInitPage();
+ m_initialized = true;
+ }
+
+ //
+ // <rdar://problem/4580061> mDNS: Printers added using Bonjour should be set as the default printer.
+ //
+ if ( DefaultPrinterExists() )
+ {
+ m_defaultPrinterCtrl.SetCheck( BST_UNCHECKED );
+ printer->deflt = false;
+ }
+ else
+ {
+ m_defaultPrinterCtrl.SetCheck( BST_CHECKED );
+ printer->deflt = true;
+ }
+
+ //
+ // update the UI with the printer name
+ //
+ m_printerName.SetWindowText(printer->displayName);
+
+ //
+ // populate the list controls with the manufacturers and models
+ // from ntprint.inf
+ //
+ PopulateUI( m_manufacturers );
+
+ //
+ // and try and match the printer
+ //
+
+ if ( psheet->GetLastPage() == psheet->GetPage(0) )
+ {
+ MatchPrinter( m_manufacturers, printer, service, true );
+
+ if ( ( m_manufacturerSelected != NULL ) && ( m_modelSelected != NULL ) )
+ {
+ GetParent()->PostMessage(PSM_SETCURSEL, 2 );
+ }
+ }
+ else
+ {
+ SelectMatch(printer, service, m_manufacturerSelected, m_modelSelected);
+ }
+
+exit:
+
+ return CPropertyPage::OnSetActive();
+}
+
+BOOL
+CThirdPage::OnKillActive()
+{
+ CPrinterSetupWizardSheet * psheet;
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ psheet->SetLastPage(this);
+
+exit:
+
+ return CPropertyPage::OnKillActive();
+}
+
+// -------------------------------------------------------
+// PopulateUI
+//
+// This function is called to populate the list of manufacturers
+//
+OSStatus
+CThirdPage::PopulateUI(Manufacturers & manufacturers)
+{
+ Manufacturers::iterator iter;
+
+ m_manufacturerListCtrl.DeleteAllItems();
+
+ for (iter = manufacturers.begin(); iter != manufacturers.end(); iter++)
+ {
+ int nIndex;
+
+ Manufacturer * manufacturer = iter->second;
+
+ nIndex = m_manufacturerListCtrl.InsertItem(0, manufacturer->name);
+
+ m_manufacturerListCtrl.SetItemData(nIndex, (DWORD_PTR) manufacturer);
+
+ m_manufacturerListCtrl.SetColumnWidth( 0, LVSCW_AUTOSIZE_USEHEADER );
+ }
+
+ return 0;
+}
+
+BEGIN_MESSAGE_MAP(CThirdPage, CPropertyPage)
+ ON_NOTIFY(LVN_ITEMCHANGED, IDC_PRINTER_MANUFACTURER, OnLvnItemchangedManufacturer)
+ ON_NOTIFY(LVN_ITEMCHANGED, IDC_PRINTER_MODEL, OnLvnItemchangedPrinterModel)
+ ON_BN_CLICKED(IDC_DEFAULT_PRINTER, OnBnClickedDefaultPrinter)
+ ON_BN_CLICKED(IDC_HAVE_DISK, OnBnClickedHaveDisk)
+END_MESSAGE_MAP()
+
+// CThirdPage message handlers
+void CThirdPage::OnLvnItemchangedManufacturer(NMHDR *pNMHDR, LRESULT *pResult)
+{
+ LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
+
+ POSITION p = m_manufacturerListCtrl.GetFirstSelectedItemPosition();
+ int nSelected = m_manufacturerListCtrl.GetNextSelectedItem(p);
+
+ if (nSelected != -1)
+ {
+ m_manufacturerSelected = (Manufacturer*) m_manufacturerListCtrl.GetItemData(nSelected);
+
+ m_modelListCtrl.SetRedraw(FALSE);
+
+ m_modelListCtrl.DeleteAllItems();
+ m_modelSelected = NULL;
+
+ Models::iterator iter;
+
+ for (iter = m_manufacturerSelected->models.begin(); iter != m_manufacturerSelected->models.end(); iter++)
+ {
+ Model * model = *iter;
+
+ int nItem = m_modelListCtrl.InsertItem( 0, model->displayName );
+
+ m_modelListCtrl.SetItemData(nItem, (DWORD_PTR) model);
+
+ m_modelListCtrl.SetColumnWidth( 0, LVSCW_AUTOSIZE_USEHEADER );
+ }
+
+ m_modelListCtrl.SetRedraw(TRUE);
+ }
+
+ *pResult = 0;
+}
+
+void CThirdPage::OnLvnItemchangedPrinterModel(NMHDR *pNMHDR, LRESULT *pResult)
+{
+ LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
+
+ CPrinterSetupWizardSheet * psheet;
+ Printer * printer;
+ Service * service;
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ printer = psheet->GetSelectedPrinter();
+ require_quiet( printer, exit );
+
+ service = printer->services.front();
+ require_quiet( service, exit );
+
+ check ( m_manufacturerSelected );
+
+ POSITION p = m_modelListCtrl.GetFirstSelectedItemPosition();
+ int nSelected = m_modelListCtrl.GetNextSelectedItem(p);
+
+ if (nSelected != -1)
+ {
+ m_modelSelected = (Model*) m_modelListCtrl.GetItemData(nSelected);
+
+ CopyPrinterSettings( printer, service, m_manufacturerSelected, m_modelSelected );
+
+ psheet->SetWizardButtons(PSWIZB_BACK|PSWIZB_NEXT);
+ }
+ else
+ {
+ psheet->SetWizardButtons(PSWIZB_BACK);
+ }
+
+exit:
+
+ *pResult = 0;
+}
+
+void CThirdPage::OnBnClickedDefaultPrinter()
+{
+ CPrinterSetupWizardSheet * psheet;
+ Printer * printer;
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ printer = psheet->GetSelectedPrinter();
+ require_quiet( printer, exit );
+
+ printer->deflt = ( m_defaultPrinterCtrl.GetCheck() == BST_CHECKED ) ? true : false;
+
+exit:
+
+ return;
+}
+
+void CThirdPage::OnBnClickedHaveDisk()
+{
+ CPrinterSetupWizardSheet * psheet;
+ Printer * printer;
+ Service * service;
+ Manufacturers manufacturers;
+
+ CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY|OFN_FILEMUSTEXIST, L"Setup Information (*.inf)|*.inf||", this);
+
+ psheet = reinterpret_cast<CPrinterSetupWizardSheet*>(GetParent());
+ require_quiet( psheet, exit );
+
+ printer = psheet->GetSelectedPrinter();
+ require_quiet( printer, exit );
+
+ service = printer->services.front();
+ require_quiet( service, exit );
+
+ for ( ;; )
+ {
+ if ( dlg.DoModal() == IDOK )
+ {
+ CString filename = dlg.GetPathName();
+
+ LoadPrintDriverDefsFromFile( manufacturers, filename, true );
+
+ // Sanity check
+
+ if ( manufacturers.size() > 0 )
+ {
+ PopulateUI( manufacturers );
+
+ if ( MatchPrinter( manufacturers, printer, service, false ) != kNoErr )
+ {
+ CString errorMessage;
+ CString errorCaption;
+
+ errorMessage.LoadString( IDS_NO_MATCH_INF_FILE );
+ errorCaption.LoadString( IDS_NO_MATCH_INF_FILE_CAPTION );
+
+ MessageBox( errorMessage, errorCaption, MB_OK );
+ }
+
+ break;
+ }
+ else
+ {
+ CString errorMessage;
+ CString errorCaption;
+
+ errorMessage.LoadString( IDS_BAD_INF_FILE );
+ errorCaption.LoadString( IDS_BAD_INF_FILE_CAPTION );
+
+ MessageBox( errorMessage, errorCaption, MB_OK );
+ }
+ }
+ else
+ {
+ break;
+ }
+ }
+
+exit:
+
+ FreeManufacturers( manufacturers );
+ return;
+}
+
+
+void
+CThirdPage::Split( const CString & string, TCHAR ch, CStringList & components )
+{
+ CString temp;
+ int n;
+
+ temp = string;
+
+ while ( ( n = temp.Find( ch ) ) != -1 )
+ {
+ components.AddTail( temp.Left( n ) );
+ temp = temp.Right( temp.GetLength() - ( n + 1 ) );
+ }
+
+ components.AddTail( temp );
+}
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/ThirdPage.h b/mDNSResponder/Clients/PrinterSetupWizard/ThirdPage.h
new file mode 100644
index 00000000..476e2337
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/ThirdPage.h
@@ -0,0 +1,159 @@
+/* -*- 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
+#include "afxcmn.h"
+#include "UtilTypes.h"
+#include <CommonServices.h>
+#include <DebugServices.h>
+#include <dns_sd.h>
+#include <map>
+#include "afxwin.h"
+
+
+// CThirdPage dialog
+
+class CThirdPage : public CPropertyPage
+{
+DECLARE_DYNAMIC(CThirdPage)
+
+public:
+CThirdPage();
+virtual ~CThirdPage();
+
+// Dialog Data
+enum { IDD = IDD_THIRD_PAGE };
+
+protected:
+virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+virtual BOOL OnSetActive();
+virtual BOOL OnKillActive();
+
+DECLARE_MESSAGE_MAP()
+
+private:
+
+//
+//<rdar://problem/4189721> mDNS: Epson shows up twice in the list. Use case insensitive compare
+//
+struct compare_func
+{
+ bool operator()( const CString & s1, const CString & s2 ) const
+ {
+ return s1.CompareNoCase( s2 ) < 0;
+ }
+};
+
+typedef std::map<CString, Manufacturer*, compare_func> Manufacturers;
+
+//
+// LoadPrintDriverDefsFromFile
+//
+// Parses INF file and populates manufacturers
+//
+OSStatus LoadPrintDriverDefsFromFile(Manufacturers & manufacturers, const CString & filename, bool checkForDuplicateModels );
+
+//
+// LoadPrintDriverDefs
+//
+// Loads extant print driver definitions
+//
+OSStatus LoadPrintDriverDefs(Manufacturers & manufacturers);
+
+//
+// LoadGenericPrintDriversDefs
+//
+// Loads generic postscript and pcl print driver defs
+//
+OSStatus LoadGenericPrintDriverDefs( Manufacturers & manufacturers );
+
+//
+// PopulateUI
+//
+// Load print driver defs into UI for browsing/selection
+//
+OSStatus PopulateUI(Manufacturers & manufacturers);
+
+//
+// MatchPrinter
+//
+// Tries to match printer based on manufacturer and model
+//
+OSStatus MatchPrinter(Manufacturers & manufacturers, Printer * printer, Service * service, bool useCUPSWorkaround);
+
+//
+// OnInitPage
+//
+// Called first time page is activated.
+OSStatus OnInitPage();
+
+//
+// these functions will tweak the names so that everything is
+// consistent
+//
+CString ConvertToManufacturerName( const CString & name );
+CString ConvertToModelName( const CString & name );
+CString NormalizeManufacturerName( const CString & name );
+
+Manufacturer * MatchManufacturer( Manufacturers & manufacturer, const CString & name );
+Model * MatchModel( Manufacturer * manufacturer, const CString & name );
+BOOL MatchGeneric( Manufacturers & manufacturers, Printer * printer, Service * service, Manufacturer ** manufacturer, Model ** model );
+void SelectMatch(Printer * printer, Service * service, Manufacturer * manufacturer, Model * model);
+void SelectMatch(Manufacturers & manufacturers, Printer * printer, Service * service, Manufacturer * manufacturer, Model * model);
+void CopyPrinterSettings(Printer * printer, Service * service, Manufacturer * manufacturer, Model * model);
+//
+// <rdar://problem/4580061> mDNS: Printers added using Bonjour should be set as the default printer.
+//
+BOOL DefaultPrinterExists();
+//
+//<rdar://problem/4528853> mDNS: When auto-highlighting items in lists, scroll list so highlighted item is in the middle
+//
+void AutoScroll(CListCtrl & list, int nIndex);
+
+void FreeManufacturers( Manufacturers & manufacturers );
+
+Manufacturers m_manufacturers;
+
+CListCtrl m_manufacturerListCtrl;
+Manufacturer * m_manufacturerSelected;
+
+CListCtrl m_modelListCtrl;
+Model * m_modelSelected;
+
+Model * m_genericPostscript;
+Model * m_genericPCL;
+
+bool m_initialized;
+
+public:
+
+afx_msg void OnLvnItemchangedManufacturer(NMHDR *pNMHDR, LRESULT *pResult);
+CStatic m_printerName;
+afx_msg void OnLvnItemchangedPrinterModel(NMHDR *pNMHDR, LRESULT *pResult);
+afx_msg void OnBnClickedDefaultPrinter();
+private:
+
+void
+Split( const CString & string, TCHAR ch, CStringList & components );
+
+CButton m_defaultPrinterCtrl;
+
+public:
+CStatic m_printerSelectionText;
+CStatic * m_printerImage;
+afx_msg void OnBnClickedHaveDisk();
+};
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/UtilTypes.h b/mDNSResponder/Clients/PrinterSetupWizard/UtilTypes.h
new file mode 100644
index 00000000..dc0ae10e
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/UtilTypes.h
@@ -0,0 +1,280 @@
+/* -*- 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
+
+#include <dns_sd.h>
+#include <string>
+#include <list>
+#include <DebugServices.h>
+
+class CPrinterSetupWizardSheet;
+
+#define kDefaultPriority 50
+#define kDefaultQTotal 1
+
+namespace PrinterSetupWizard
+{
+struct Printer;
+struct Service;
+struct Queue;
+struct Manufacturer;
+struct Model;
+
+typedef std::list<Queue*> Queues;
+typedef std::list<Printer*> Printers;
+typedef std::list<Service*> Services;
+typedef std::list<Model*> Models;
+
+struct Printer
+{
+ Printer();
+
+ ~Printer();
+
+ Service*
+ LookupService
+ (
+ const std::string & type
+ );
+
+ CPrinterSetupWizardSheet * window;
+ HTREEITEM item;
+
+ //
+ // These are from the browse reply
+ //
+ std::string name;
+ CString displayName;
+ CString actualName;
+
+ //
+ // These keep track of the different services associated with this printer.
+ // the services are ordered according to preference.
+ //
+ Services services;
+
+ //
+ // these are derived from the printer matching code
+ //
+ // if driverInstalled is false, then infFileName should
+ // have an absolute path to the printers inf file. this
+ // is used to install the printer from printui.dll
+ //
+ // if driverInstalled is true, then model is the name
+ // of the driver to use in AddPrinter
+ //
+ bool driverInstalled;
+ CString infFileName;
+ CString manufacturer;
+ CString displayModelName;
+ CString modelName;
+ CString portName;
+ bool deflt;
+
+ // This let's us know that this printer was discovered via OSX Printer Sharing.
+ // We use this knowledge to workaround a problem with OS X Printer sharing.
+
+ bool isCUPSPrinter;
+
+ //
+ // state
+ //
+ unsigned resolving;
+ bool installed;
+};
+
+
+struct Service
+{
+ Service();
+
+ ~Service();
+
+ Queue*
+ SelectedQueue();
+
+ void
+ EmptyQueues();
+
+ Printer * printer;
+ uint32_t ifi;
+ std::string type;
+ std::string domain;
+
+ //
+ // these are from the resolve
+ //
+ DNSServiceRef serviceRef;
+ CString hostname;
+ unsigned short portNumber;
+ CString protocol;
+ unsigned short qtotal;
+
+ //
+ // There will usually one be one of these, however
+ // this will handle printers that have multiple
+ // queues. These are ordered according to preference.
+ //
+ Queues queues;
+
+ //
+ // Reference count
+ //
+ unsigned refs;
+};
+
+
+struct Queue
+{
+ Queue();
+
+ ~Queue();
+
+ CString name;
+ uint32_t priority;
+ CString pdl;
+ CString usb_MFG;
+ CString usb_MDL;
+ CString description;
+ CString location;
+ CString product;
+};
+
+
+struct Manufacturer
+{
+ CString name;
+ Models models;
+
+ Model*
+ find( const CString & name );
+};
+
+
+struct Model
+{
+ bool driverInstalled;
+ CString infFileName;
+ CString displayName;
+ CString name;
+};
+
+
+inline
+Printer::Printer()
+ :
+ isCUPSPrinter( false )
+{
+}
+
+inline
+Printer::~Printer()
+{
+ while ( services.size() > 0 )
+ {
+ Service * service = services.front();
+ services.pop_front();
+ delete service;
+ }
+}
+
+inline Service*
+Printer::LookupService
+(
+ const std::string & type
+)
+{
+ Services::iterator it;
+
+ for ( it = services.begin(); it != services.end(); it++ )
+ {
+ Service * service = *it;
+
+ if ( strcmp(service->type.c_str(), type.c_str()) == 0 )
+ {
+ return service;
+ }
+ }
+
+ return NULL;
+}
+
+inline
+Service::Service()
+ :
+ qtotal(kDefaultQTotal)
+{
+}
+
+inline
+Service::~Service()
+{
+ check( serviceRef == NULL );
+
+ EmptyQueues();
+}
+
+inline Queue*
+Service::SelectedQueue()
+{
+ return queues.front();
+}
+
+inline void
+Service::EmptyQueues()
+{
+ while ( queues.size() > 0 )
+ {
+ Queue * q = queues.front();
+ queues.pop_front();
+ delete q;
+ }
+}
+
+inline
+Queue::Queue()
+ :
+ priority(kDefaultPriority)
+{
+}
+
+inline
+Queue::~Queue()
+{
+}
+
+inline Model*
+Manufacturer::find( const CString & name )
+{
+ Models::iterator it;
+
+ for ( it = models.begin(); it != models.end(); it++ )
+ {
+ Model * model = *it;
+
+ if ( model->name == name )
+ {
+ return model;
+ }
+ }
+
+ return NULL;
+}
+}
+
+
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/res/Info.ico b/mDNSResponder/Clients/PrinterSetupWizard/res/Info.ico
new file mode 100644
index 00000000..1a532189
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/res/Info.ico
Binary files differ
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/res/NetworkPrinter.ico b/mDNSResponder/Clients/PrinterSetupWizard/res/NetworkPrinter.ico
new file mode 100644
index 00000000..d2926def
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/res/NetworkPrinter.ico
Binary files differ
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/res/Print.ico b/mDNSResponder/Clients/PrinterSetupWizard/res/Print.ico
new file mode 100644
index 00000000..b737f473
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/res/Print.ico
Binary files differ
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.ico b/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.ico
new file mode 100644
index 00000000..22130b3d
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.ico
Binary files differ
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.manifest b/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.manifest
new file mode 100644
index 00000000..a72bccad
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.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.PrinterSetupWizard" type="win32"/>
+ <description>Printer Setup Wizard</description>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+ <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/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.rc2 b/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.rc2
new file mode 100644
index 00000000..27e049a6
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard.rc2
@@ -0,0 +1,13 @@
+//
+// Wiz97_3.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/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard64.manifest b/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard64.manifest
new file mode 100644
index 00000000..f535d80c
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizard64.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="amd64" name="Apple.Bonjour.PrinterSetupWizard" type="win32"/>
+ <description>Printer Setup Wizard</description>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="amd64" publicKeyToken="6595b64144ccf1df" language="*"/>
+ </dependentAssembly>
+ </dependency>
+</assembly>
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizardLocRes.rc2 b/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizardLocRes.rc2
new file mode 100755
index 00000000..27e049a6
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizardLocRes.rc2
@@ -0,0 +1,13 @@
+//
+// Wiz97_3.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/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizardRes.rc2 b/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizardRes.rc2
new file mode 100755
index 00000000..27e049a6
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/res/PrinterSetupWizardRes.rc2
@@ -0,0 +1,13 @@
+//
+// Wiz97_3.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/mDNSResponder/Clients/PrinterSetupWizard/res/Thumbs.db b/mDNSResponder/Clients/PrinterSetupWizard/res/Thumbs.db
new file mode 100644
index 00000000..f9f63303
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/res/Thumbs.db
Binary files differ
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/res/about.bmp b/mDNSResponder/Clients/PrinterSetupWizard/res/about.bmp
new file mode 100644
index 00000000..83e0bb08
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/res/about.bmp
Binary files differ
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/res/banner_icon.bmp b/mDNSResponder/Clients/PrinterSetupWizard/res/banner_icon.bmp
new file mode 100644
index 00000000..8e62c35c
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/res/banner_icon.bmp
Binary files differ
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/res/watermark.bmp b/mDNSResponder/Clients/PrinterSetupWizard/res/watermark.bmp
new file mode 100644
index 00000000..e76046b6
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/res/watermark.bmp
Binary files differ
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/resource.h b/mDNSResponder/Clients/PrinterSetupWizard/resource.h
new file mode 100644
index 00000000..b1190fb9
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/resource.h
@@ -0,0 +1,29 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+// Include resources for Wizard app
+
+#include "resource_exe.h"
+
+// Include resources for non-localizable resource DLL
+
+#include "resource_res.h"
+
+// Include resources for localizable resource DLL
+
+#include "resource_loc_res.h"
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/resource_exe.h b/mDNSResponder/Clients/PrinterSetupWizard/resource_exe.h
new file mode 100755
index 00000000..33c0c288
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/resource_exe.h
@@ -0,0 +1,94 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by PrinterSetupWizard.rc
+//
+#define IDM_ABOUTBOX 0x0010
+#define IDD_ABOUTBOX 100
+#define IDS_ABOUTBOX 101
+#define IDD_PRINTERSETUPWIZARD_DIALOG 102
+#define IDS_GOODBYE 102
+#define IDS_GREETING 103
+#define IDS_BROWSE_TITLE 104
+#define IDS_BROWSE_SUBTITLE 105
+#define IDS_CAPTION 106
+#define IDD_FIRST_PAGE 107
+#define IDS_GOODBYE_GOOD1 107
+#define IDS_SEARCHING 108
+#define IDD_SECOND_PAGE 109
+#define IDS_GOODBYTE_GOOD2 109
+#define IDS_INSTALL_TITLE 110
+#define IDS_INSTALL_SUBTITLE 111
+#define IDS_ERROR_SELECTING_PRINTER_TEXT 112
+#define IDS_ERROR_SELECTING_PRINTER_CAPTION 113
+#define IDS_INSTALL_ERROR_CAPTION 114
+#define IDS_INSTALL_ERROR_MESSAGE 115
+#define IDS_MANUFACTURER_HEADING 116
+#define IDS_MODEL_HEADING 117
+#define IDS_NO_PRINTERS 118
+#define IDS_NO_MDNSRESPONDER_SERVICE_TEXT 119
+#define IDS_NO_MDNSRESPONDER_SERVICE_CAPTION 120
+#define IDS_PRINTER_MATCH_GOOD 121
+#define IDS_PRINTER_MATCH_BAD 122
+#define IDS_YES 123
+#define IDS_NO 124
+#define IDS_LARGE_FONT 125
+#define IDS_FIREWALL 126
+#define IDS_ERROR_CAPTION 127
+#define IDR_MAINFRAME 128
+#define IDS_FIREWALL_CAPTION 128
+#define IDB_BANNER_ICON 129
+#define IDD_THIRD_PAGE 130
+#define IDB_WATERMARK 131
+#define IDD_FOURTH_PAGE 132
+#define IDI_INFO 136
+#define IDB_ABOUT 138
+#define IDD_DIALOG1 139
+#define IDI_ICON2 141
+#define IDI_PRINTER 141
+#define IDS_REINSTALL 142
+#define IDS_REINSTALL_CAPTION 143
+#define IDC_INFO 144
+#define IDS_PRINTER_UNAVAILABLE 145
+#define IDS_BAD_INF_FILE 150
+#define IDS_BAD_INF_FILE_CAPTION 151
+#define IDS_NO_MATCH_INF_FILE 152
+#define IDS_NO_MATCH_INF_FILE_CAPTION 153
+#define IDC_BUTTON1 1000
+#define IDC_LIST1 1000
+#define IDC_BROWSE_LIST 1000
+#define IDC_RADIO1 1001
+#define IDC_COMBO1 1001
+#define IDC_RADIO2 1002
+#define IDC_GREETING 1003
+#define IDC_CHECK1 1016
+#define IDC_DEFAULT_PRINTER 1016
+#define IDC_PRINTER_IMAGE 1017
+#define IDC_PRINTER_NAME 1018
+#define IDC_PRINTER_MANUFACTURER 1019
+#define IDC_PRINTER_MODEL 1020
+#define IDC_GOODBYE 1021
+#define IDC_PRINTER_PORT 1022
+#define IDC_PRINTER_PROTOCOL 1022
+#define IDC_PRINTER_DEFAULT 1023
+#define IDC_PRINTER_SELECTION_TEXT 1024
+#define IDC_HAVE_DISK 1025
+#define IDC_PRINTER_INFORMATION 1026
+#define IDC_LOCATION_LABEL 1029
+#define IDC_DESCRIPTION_FIELD 1030
+#define IDC_LOCATION_FIELD 1032
+#define IDC_DESCRIPTION_LABEL 1033
+#define IDC_COMPLETE1 1034
+#define IDC_COMPLETE2 1035
+#define IDC_INSTALLING 1036
+#define IDC_PROGRESS 1037
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 142
+#define _APS_NEXT_COMMAND_VALUE 32771
+#define _APS_NEXT_CONTROL_VALUE 1034
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/resource_loc_res.h b/mDNSResponder/Clients/PrinterSetupWizard/resource_loc_res.h
new file mode 100755
index 00000000..deb2e6e6
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/resource_loc_res.h
@@ -0,0 +1,95 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by PrinterSetupWizardLocRes.rc
+//
+#define IDM_ABOUTBOX 0x0010
+#define IDD_ABOUTBOX 100
+#define IDS_ABOUTBOX 101
+#define IDD_PRINTERSETUPWIZARD_DIALOG 102
+#define IDS_GOODBYE 102
+#define IDS_GREETING 103
+#define IDS_BROWSE_TITLE 104
+#define IDS_BROWSE_SUBTITLE 105
+#define IDS_CAPTION 106
+#define IDD_FIRST_PAGE 107
+#define IDS_GOODBYE_GOOD1 107
+#define IDS_SEARCHING 108
+#define IDD_SECOND_PAGE 109
+#define IDS_GOODBYTE_GOOD2 109
+#define IDS_INSTALL_TITLE 110
+#define IDS_INSTALL_SUBTITLE 111
+#define IDS_ERROR_SELECTING_PRINTER_TEXT 112
+#define IDS_ERROR_SELECTING_PRINTER_CAPTION 113
+#define IDS_INSTALL_ERROR_CAPTION 114
+#define IDS_INSTALL_ERROR_MESSAGE 115
+#define IDS_MANUFACTURER_HEADING 116
+#define IDS_MODEL_HEADING 117
+#define IDS_NO_PRINTERS 118
+#define IDS_NO_MDNSRESPONDER_SERVICE_TEXT 119
+#define IDS_NO_MDNSRESPONDER_SERVICE_CAPTION 120
+#define IDS_PRINTER_MATCH_GOOD 121
+#define IDS_PRINTER_MATCH_BAD 122
+#define IDS_PRINTER_MATCH_MAYBE 146
+#define IDS_YES 123
+#define IDS_NO 124
+#define IDS_LARGE_FONT 125
+#define IDS_FIREWALL 126
+#define IDS_ERROR_CAPTION 127
+#define IDR_MAINFRAME 128
+#define IDS_FIREWALL_CAPTION 128
+#define IDB_BANNER_ICON 129
+#define IDD_THIRD_PAGE 130
+#define IDB_WATERMARK 131
+#define IDD_FOURTH_PAGE 132
+#define IDI_INFO 136
+#define IDB_ABOUT 138
+#define IDD_DIALOG1 139
+#define IDI_ICON2 141
+#define IDI_PRINTER 141
+#define IDS_REINSTALL 142
+#define IDS_REINSTALL_CAPTION 143
+#define IDC_INFO 144
+#define IDS_PRINTER_UNAVAILABLE 145
+#define IDS_BAD_INF_FILE 150
+#define IDS_BAD_INF_FILE_CAPTION 151
+#define IDS_NO_MATCH_INF_FILE 152
+#define IDS_NO_MATCH_INF_FILE_CAPTION 153
+#define IDC_BUTTON1 1000
+#define IDC_LIST1 1000
+#define IDC_BROWSE_LIST 1000
+#define IDC_RADIO1 1001
+#define IDC_COMBO1 1001
+#define IDC_RADIO2 1002
+#define IDC_GREETING 1003
+#define IDC_CHECK1 1016
+#define IDC_DEFAULT_PRINTER 1016
+#define IDC_PRINTER_IMAGE 1017
+#define IDC_PRINTER_NAME 1018
+#define IDC_PRINTER_MANUFACTURER 1019
+#define IDC_PRINTER_MODEL 1020
+#define IDC_GOODBYE 1021
+#define IDC_PRINTER_PORT 1022
+#define IDC_PRINTER_PROTOCOL 1022
+#define IDC_PRINTER_DEFAULT 1023
+#define IDC_PRINTER_SELECTION_TEXT 1024
+#define IDC_HAVE_DISK 1025
+#define IDC_PRINTER_INFORMATION 1026
+#define IDC_LOCATION_LABEL 1029
+#define IDC_DESCRIPTION_FIELD 1030
+#define IDC_LOCATION_FIELD 1032
+#define IDC_DESCRIPTION_LABEL 1033
+#define IDC_COMPLETE1 1034
+#define IDC_COMPLETE2 1035
+#define IDC_INSTALLING 1036
+#define IDC_PROGRESS 1037
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 142
+#define _APS_NEXT_COMMAND_VALUE 32771
+#define _APS_NEXT_CONTROL_VALUE 1034
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/resource_res.h b/mDNSResponder/Clients/PrinterSetupWizard/resource_res.h
new file mode 100755
index 00000000..33c0c288
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/resource_res.h
@@ -0,0 +1,94 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by PrinterSetupWizard.rc
+//
+#define IDM_ABOUTBOX 0x0010
+#define IDD_ABOUTBOX 100
+#define IDS_ABOUTBOX 101
+#define IDD_PRINTERSETUPWIZARD_DIALOG 102
+#define IDS_GOODBYE 102
+#define IDS_GREETING 103
+#define IDS_BROWSE_TITLE 104
+#define IDS_BROWSE_SUBTITLE 105
+#define IDS_CAPTION 106
+#define IDD_FIRST_PAGE 107
+#define IDS_GOODBYE_GOOD1 107
+#define IDS_SEARCHING 108
+#define IDD_SECOND_PAGE 109
+#define IDS_GOODBYTE_GOOD2 109
+#define IDS_INSTALL_TITLE 110
+#define IDS_INSTALL_SUBTITLE 111
+#define IDS_ERROR_SELECTING_PRINTER_TEXT 112
+#define IDS_ERROR_SELECTING_PRINTER_CAPTION 113
+#define IDS_INSTALL_ERROR_CAPTION 114
+#define IDS_INSTALL_ERROR_MESSAGE 115
+#define IDS_MANUFACTURER_HEADING 116
+#define IDS_MODEL_HEADING 117
+#define IDS_NO_PRINTERS 118
+#define IDS_NO_MDNSRESPONDER_SERVICE_TEXT 119
+#define IDS_NO_MDNSRESPONDER_SERVICE_CAPTION 120
+#define IDS_PRINTER_MATCH_GOOD 121
+#define IDS_PRINTER_MATCH_BAD 122
+#define IDS_YES 123
+#define IDS_NO 124
+#define IDS_LARGE_FONT 125
+#define IDS_FIREWALL 126
+#define IDS_ERROR_CAPTION 127
+#define IDR_MAINFRAME 128
+#define IDS_FIREWALL_CAPTION 128
+#define IDB_BANNER_ICON 129
+#define IDD_THIRD_PAGE 130
+#define IDB_WATERMARK 131
+#define IDD_FOURTH_PAGE 132
+#define IDI_INFO 136
+#define IDB_ABOUT 138
+#define IDD_DIALOG1 139
+#define IDI_ICON2 141
+#define IDI_PRINTER 141
+#define IDS_REINSTALL 142
+#define IDS_REINSTALL_CAPTION 143
+#define IDC_INFO 144
+#define IDS_PRINTER_UNAVAILABLE 145
+#define IDS_BAD_INF_FILE 150
+#define IDS_BAD_INF_FILE_CAPTION 151
+#define IDS_NO_MATCH_INF_FILE 152
+#define IDS_NO_MATCH_INF_FILE_CAPTION 153
+#define IDC_BUTTON1 1000
+#define IDC_LIST1 1000
+#define IDC_BROWSE_LIST 1000
+#define IDC_RADIO1 1001
+#define IDC_COMBO1 1001
+#define IDC_RADIO2 1002
+#define IDC_GREETING 1003
+#define IDC_CHECK1 1016
+#define IDC_DEFAULT_PRINTER 1016
+#define IDC_PRINTER_IMAGE 1017
+#define IDC_PRINTER_NAME 1018
+#define IDC_PRINTER_MANUFACTURER 1019
+#define IDC_PRINTER_MODEL 1020
+#define IDC_GOODBYE 1021
+#define IDC_PRINTER_PORT 1022
+#define IDC_PRINTER_PROTOCOL 1022
+#define IDC_PRINTER_DEFAULT 1023
+#define IDC_PRINTER_SELECTION_TEXT 1024
+#define IDC_HAVE_DISK 1025
+#define IDC_PRINTER_INFORMATION 1026
+#define IDC_LOCATION_LABEL 1029
+#define IDC_DESCRIPTION_FIELD 1030
+#define IDC_LOCATION_FIELD 1032
+#define IDC_DESCRIPTION_LABEL 1033
+#define IDC_COMPLETE1 1034
+#define IDC_COMPLETE2 1035
+#define IDC_INSTALLING 1036
+#define IDC_PROGRESS 1037
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 142
+#define _APS_NEXT_COMMAND_VALUE 32771
+#define _APS_NEXT_CONTROL_VALUE 1034
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/stdafx.cpp b/mDNSResponder/Clients/PrinterSetupWizard/stdafx.cpp
new file mode 100644
index 00000000..e05ec3d1
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/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/mDNSResponder/Clients/PrinterSetupWizard/stdafx.h b/mDNSResponder/Clients/PrinterSetupWizard/stdafx.h
new file mode 100644
index 00000000..1eec4c39
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/stdafx.h
@@ -0,0 +1,61 @@
+/* -*- 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>
+
diff --git a/mDNSResponder/Clients/PrinterSetupWizard/tcpxcv.h b/mDNSResponder/Clients/PrinterSetupWizard/tcpxcv.h
new file mode 100755
index 00000000..a4b7b5f3
--- /dev/null
+++ b/mDNSResponder/Clients/PrinterSetupWizard/tcpxcv.h
@@ -0,0 +1,107 @@
+/*++
+
+ Copyright (c) 1997 - 1999 Hewlett-Packard Company.
+ Copyright (c) 1997 - 1999 Microsoft Corporation
+ All rights reserved
+
+ Module Name:
+
+ tcpxcv.h
+
+ --*/
+/*
+ * This file is contained in WinDDK 6001.18002
+ */
+
+#ifndef _TCPXCV_
+#define _TCPXCV_
+
+#if (!defined(UNKNOWN_PROTOCOL))
+ #define UNKNOWN_PROTOCOL 0
+ #define PROTOCOL_UNKNOWN_TYPE UNKNOWN_PROTOCOL
+#endif
+
+#if (!defined(RAWTCP))
+#define RAWTCP 1
+#define PROTOCOL_RAWTCP_TYPE RAWTCP
+#endif
+
+#if (!defined(LPR))
+#define LPR 2
+#define PROTOCOL_LPR_TYPE LPR
+#endif
+
+#define MAX_PORTNAME_LEN 63 +1 // port name length
+#define MAX_NETWORKNAME_LEN 48 +1 // host name length
+#define MAX_NETWORKNAME2_LEN 128 // host name or IPv6 address
+#define MAX_SNMP_COMMUNITY_STR_LEN 32 +1 // SNMP Community String Name
+#define MAX_QUEUENAME_LEN 32 +1 // lpr print que name
+#define MAX_IPADDR_STR_LEN 15 +1 // ip address; string version
+#define MAX_ADDRESS_STR_LEN 12 +1 // hw address length
+#define MAX_DEVICEDESCRIPTION_STR_LEN 256+1
+
+
+
+typedef struct _PORT_DATA_1
+{
+ WCHAR sztPortName[MAX_PORTNAME_LEN];
+ DWORD dwVersion;
+ DWORD dwProtocol;
+ DWORD cbSize;
+ DWORD dwReserved;
+ WCHAR sztHostAddress[MAX_NETWORKNAME_LEN];
+ WCHAR sztSNMPCommunity[MAX_SNMP_COMMUNITY_STR_LEN];
+ DWORD dwDoubleSpool;
+ WCHAR sztQueue[MAX_QUEUENAME_LEN];
+ WCHAR sztIPAddress[MAX_IPADDR_STR_LEN];
+ BYTE Reserved[540];
+ DWORD dwPortNumber;
+ DWORD dwSNMPEnabled;
+ DWORD dwSNMPDevIndex;
+} PORT_DATA_1, *PPORT_DATA_1;
+
+typedef struct _PORT_DATA_2
+{
+ WCHAR sztPortName[MAX_PORTNAME_LEN];
+ DWORD dwVersion;
+ DWORD dwProtocol;
+ DWORD cbSize;
+ DWORD dwReserved;
+ WCHAR sztHostAddress [MAX_NETWORKNAME2_LEN];
+ WCHAR sztSNMPCommunity[MAX_SNMP_COMMUNITY_STR_LEN];
+ DWORD dwDoubleSpool;
+ WCHAR sztQueue[MAX_QUEUENAME_LEN];
+ BYTE Reserved[514];
+ DWORD dwPortNumber;
+ DWORD dwSNMPEnabled;
+ DWORD dwSNMPDevIndex;
+ DWORD dwPortMonitorMibIndex;
+} PORT_DATA_2, *PPORT_DATA_2;
+
+
+typedef struct _PORT_DATA_LIST_1
+{
+ DWORD dwVersion;
+ DWORD cPortData;
+ PORT_DATA_2 pPortData[1];
+} PORT_DATA_LIST_1, *PPORT_DATA_LIST_1;
+
+
+typedef struct _DELETE_PORT_DATA_1
+{
+ WCHAR psztPortName[MAX_PORTNAME_LEN];
+ BYTE Reserved[98];
+ DWORD dwVersion;
+ DWORD dwReserved;
+} DELETE_PORT_DATA_1, *PDELETE_PORT_DATA_1;
+
+
+typedef struct _CONFIG_INFO_DATA_1
+{
+ BYTE Reserved[128];
+ DWORD dwVersion;
+} CONFIG_INFO_DATA_1, *PCONFIG_INFO_DATA_1;
+
+
+
+#endif
diff --git a/mDNSResponder/Clients/ReadMe.txt b/mDNSResponder/Clients/ReadMe.txt
new file mode 100644
index 00000000..83dd2428
--- /dev/null
+++ b/mDNSResponder/Clients/ReadMe.txt
@@ -0,0 +1,25 @@
+This directory contains a variety of clients that use the
+"/usr/include/dns_sd.h" APIs.
+
+Some of the clients are command-line oriented; some are graphical.
+
+Some of the clients, like the "dns-sd" command-line tool, can be built
+for a variety of platforms. Some of the clients only build for one
+platform, like "DNS Service Browser" and "DNS Service Registration",
+which use Objective C and Cocoa and only run on OS X 10.3 or later.
+
+Some of the clients can be built more than one way. For example, the
+"dns-sd" command-line tool can be built for OS X using both the XCode
+IDE, or using a simple command-line "make" command.
+
+What all clients have in common is that they all demonstrate how you
+can use the "/usr/include/dns_sd.h" APIs.
+
+The table below gives a summary of which clients build for which platforms.
+
+Client Type OS X OS X Posix
+ XCode Make Make
+
+dns-sd Command-line X X X
+DNS Service Browser Graphical X
+DNS Service Registration Graphical X
diff --git a/mDNSResponder/Clients/SimpleChat.NET/App.ico b/mDNSResponder/Clients/SimpleChat.NET/App.ico
new file mode 100755
index 00000000..3a5525fd
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.NET/App.ico
Binary files differ
diff --git a/mDNSResponder/Clients/SimpleChat.NET/AssemblyInfo.cs b/mDNSResponder/Clients/SimpleChat.NET/AssemblyInfo.cs
new file mode 100755
index 00000000..da6a08c9
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.NET/AssemblyInfo.cs
@@ -0,0 +1,75 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly: AssemblyTitle("")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly: AssemblyVersion("1.0.*")]
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project output directory which is
+// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
+// located in the project directory, you would specify the AssemblyKeyFile
+// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
+[assembly: AssemblyKeyName("")]
diff --git a/mDNSResponder/Clients/SimpleChat.NET/SimpleChat.NET.csproj b/mDNSResponder/Clients/SimpleChat.NET/SimpleChat.NET.csproj
new file mode 100755
index 00000000..e3887f3b
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.NET/SimpleChat.NET.csproj
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <ProjectType>Local</ProjectType>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{726DED99-34D0-45F3-9F4D-C7068DF4BCDA}</ProjectGuid>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ApplicationIcon>App.ico</ApplicationIcon>
+ <AssemblyKeyContainerName>
+ </AssemblyKeyContainerName>
+ <AssemblyName>SimpleChat.NET</AssemblyName>
+ <AssemblyOriginatorKeyFile>
+ </AssemblyOriginatorKeyFile>
+ <DefaultClientScript>JScript</DefaultClientScript>
+ <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
+ <DefaultTargetSchema>IE50</DefaultTargetSchema>
+ <DelaySign>false</DelaySign>
+ <OutputType>WinExe</OutputType>
+ <RootNamespace>SimpleChat.NET</RootNamespace>
+ <StartupObject>
+ </StartupObject>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <UpgradeBackupLocation>
+ </UpgradeBackupLocation>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <OldToolsVersion>2.0</OldToolsVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <OutputPath>bin\Debug\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>true</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <Optimize>false</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>full</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <OutputPath>bin\Release\</OutputPath>
+ <AllowUnsafeBlocks>false</AllowUnsafeBlocks>
+ <BaseAddress>285212672</BaseAddress>
+ <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
+ <ConfigurationOverrideFile>
+ </ConfigurationOverrideFile>
+ <DefineConstants>TRACE</DefineConstants>
+ <DocumentationFile>
+ </DocumentationFile>
+ <DebugSymbols>false</DebugSymbols>
+ <FileAlignment>4096</FileAlignment>
+ <Optimize>true</Optimize>
+ <RegisterForComInterop>false</RegisterForComInterop>
+ <RemoveIntegerChecks>false</RemoveIntegerChecks>
+ <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
+ <WarningLevel>4</WarningLevel>
+ <DebugType>none</DebugType>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System">
+ <Name>System</Name>
+ </Reference>
+ <Reference Include="System.Data">
+ <Name>System.Data</Name>
+ </Reference>
+ <Reference Include="System.Drawing">
+ <Name>System.Drawing</Name>
+ </Reference>
+ <Reference Include="System.Windows.Forms">
+ <Name>System.Windows.Forms</Name>
+ </Reference>
+ <Reference Include="System.XML">
+ <Name>System.XML</Name>
+ </Reference>
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="App.ico" />
+ <Compile Include="AssemblyInfo.cs" />
+ <Compile Include="SimpleChat.cs">
+ <SubType>Form</SubType>
+ </Compile>
+ <EmbeddedResource Include="SimpleChat.resx">
+ <DependentUpon>SimpleChat.cs</DependentUpon>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <COMReference Include="Bonjour">
+ <Guid>{18FBED6D-F2B7-4EC8-A4A4-46282E635308}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ </COMReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <PropertyGroup>
+ <PreBuildEvent>
+ </PreBuildEvent>
+ <PostBuildEvent>
+ </PostBuildEvent>
+ </PropertyGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/SimpleChat.NET/SimpleChat.cs b/mDNSResponder/Clients/SimpleChat.NET/SimpleChat.cs
new file mode 100755
index 00000000..338bdb78
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.NET/SimpleChat.cs
@@ -0,0 +1,601 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 1997-2004 Apple Computer, Inc. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Drawing;
+using System.Collections;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Net;
+using System.Net.Sockets;
+using System.Data;
+using System.Text;
+using Bonjour;
+
+namespace SimpleChat.NET
+{
+ /// <summary>
+ /// Summary description for Form1.
+ /// </summary>
+ ///
+
+ public class SimpleChat : System.Windows.Forms.Form
+ {
+ private System.Windows.Forms.ComboBox comboBox1;
+ private System.Windows.Forms.TextBox textBox2;
+ private System.Windows.Forms.Button button1;
+ private System.Windows.Forms.Label label1;
+
+ private Bonjour.DNSSDEventManager m_eventManager = null;
+ private Bonjour.DNSSDService m_service = null;
+ private Bonjour.DNSSDService m_registrar = null;
+ private Bonjour.DNSSDService m_browser = null;
+ private Bonjour.DNSSDService m_resolver = null;
+ private String m_name;
+ private Socket m_socket = null;
+ private const int BUFFER_SIZE = 1024;
+ public byte[] m_buffer = new byte[BUFFER_SIZE];
+ public bool m_complete = false;
+ public StringBuilder m_sb = new StringBuilder();
+
+ delegate void ReadMessageCallback(String data);
+
+ ReadMessageCallback m_readMessageCallback;
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.Container components = null;
+ private System.Windows.Forms.RichTextBox richTextBox1;
+
+ // ServiceRegistered
+ //
+ // Called by DNSServices core as a result of Register()
+ // call
+ //
+ public void
+ ServiceRegistered
+ (
+ DNSSDService service,
+ DNSSDFlags flags,
+ String name,
+ String regType,
+ String domain
+ )
+ {
+ m_name = name;
+
+ //
+ // Try to start browsing for other instances of this service
+ //
+ try
+ {
+ m_browser = m_service.Browse(0, 0, "_p2pchat._udp", null, m_eventManager);
+ }
+ catch
+ {
+ MessageBox.Show("Browse Failed", "Error");
+ Application.Exit();
+ }
+ }
+
+ //
+ // ServiceFound
+ //
+ // Called by DNSServices core as a result of a Browse call
+ //
+ public void
+ ServiceFound
+ (
+ DNSSDService sref,
+ DNSSDFlags flags,
+ uint ifIndex,
+ String serviceName,
+ String regType,
+ String domain
+ )
+ {
+ if (serviceName != m_name)
+ {
+ PeerData peer = new PeerData();
+
+ peer.InterfaceIndex = ifIndex;
+ peer.Name = serviceName;
+ peer.Type = regType;
+ peer.Domain = domain;
+ peer.Address = null;
+
+ comboBox1.Items.Add(peer);
+
+ if (comboBox1.Items.Count == 1)
+ {
+ comboBox1.SelectedIndex = 0;
+ }
+ }
+ }
+
+ //
+ // ServiceLost
+ //
+ // Called by DNSServices core as a result of a Browse call
+ //
+ public void
+ ServiceLost
+ (
+ DNSSDService sref,
+ DNSSDFlags flags,
+ uint ifIndex,
+ String serviceName,
+ String regType,
+ String domain
+ )
+ {
+ PeerData peer = new PeerData();
+
+ peer.InterfaceIndex = ifIndex;
+ peer.Name = serviceName;
+ peer.Type = regType;
+ peer.Domain = domain;
+ peer.Address = null;
+
+ comboBox1.Items.Remove(peer);
+ }
+
+ //
+ // ServiceResolved
+ //
+ // Called by DNSServices core as a result of DNSService.Resolve()
+ // call
+ //
+ public void
+ ServiceResolved
+ (
+ DNSSDService sref,
+ DNSSDFlags flags,
+ uint ifIndex,
+ String fullName,
+ String hostName,
+ ushort port,
+ TXTRecord txtRecord
+ )
+ {
+ m_resolver.Stop();
+ m_resolver = null;
+
+ PeerData peer = (PeerData)comboBox1.SelectedItem;
+
+ peer.Port = port;
+
+ //
+ // Query for the IP address associated with "hostName"
+ //
+ try
+ {
+ m_resolver = m_service.QueryRecord(0, ifIndex, hostName, DNSSDRRType.kDNSSDType_A, DNSSDRRClass.kDNSSDClass_IN, m_eventManager );
+ }
+ catch
+ {
+ MessageBox.Show("QueryRecord Failed", "Error");
+ Application.Exit();
+ }
+ }
+
+ //
+ // QueryAnswered
+ //
+ // Called by DNSServices core as a result of DNSService.QueryRecord()
+ // call
+ //
+ public void
+ QueryAnswered
+ (
+ DNSSDService service,
+ DNSSDFlags flags,
+ uint ifIndex,
+ String fullName,
+ DNSSDRRType rrtype,
+ DNSSDRRClass rrclass,
+ Object rdata,
+ uint ttl
+ )
+ {
+ //
+ // Stop the resolve to reduce the burden on the network
+ //
+ m_resolver.Stop();
+ m_resolver = null;
+
+ PeerData peer = (PeerData) comboBox1.SelectedItem;
+ uint bits = BitConverter.ToUInt32( (Byte[])rdata, 0);
+ System.Net.IPAddress address = new System.Net.IPAddress(bits);
+
+ peer.Address = address;
+ }
+
+ public void
+ OperationFailed
+ (
+ DNSSDService service,
+ DNSSDError error
+ )
+ {
+ MessageBox.Show("Operation returned an error code " + error, "Error");
+ }
+
+ //
+ // OnReadMessage
+ //
+ // Called when there is data to be read on a socket
+ //
+ // This is called (indirectly) from OnReadSocket()
+ //
+ private void
+ OnReadMessage
+ (
+ String msg
+ )
+ {
+ int rgb = 0;
+
+ for (int i = 0; i < msg.Length && msg[i] != ':'; i++)
+ {
+ rgb = rgb ^ ((int)msg[i] << (i % 3 + 2) * 8);
+
+ }
+
+ Color color = Color.FromArgb(rgb & 0x007F7FFF);
+
+ richTextBox1.SelectionColor = color;
+ richTextBox1.AppendText(msg + Environment.NewLine);
+ }
+
+ //
+ // OnReadSocket
+ //
+ // Called by the .NET core when there is data to be read on a socket
+ //
+ // This is called from a worker thread by the .NET core
+ //
+ private void
+ OnReadSocket
+ (
+ IAsyncResult ar
+ )
+ {
+ try
+ {
+ int read = m_socket.EndReceive(ar);
+
+ if (read > 0)
+ {
+ String msg = Encoding.UTF8.GetString(m_buffer, 0, read);
+ Invoke(m_readMessageCallback, new Object[]{msg});
+ }
+
+ m_socket.BeginReceive(m_buffer, 0, BUFFER_SIZE, 0, new AsyncCallback(OnReadSocket), this);
+ }
+ catch
+ {
+ }
+ }
+
+
+ public SimpleChat()
+ {
+ //
+ // Required for Windows Form Designer support
+ //
+ InitializeComponent();
+
+ try
+ {
+ m_service = new DNSSDService();
+ }
+ catch
+ {
+ MessageBox.Show("Bonjour Service is not available", "Error");
+ Application.Exit();
+ }
+
+ //
+ // Associate event handlers with all the Bonjour events that the app is interested in.
+ //
+ m_eventManager = new DNSSDEventManager();
+ m_eventManager.ServiceRegistered += new _IDNSSDEvents_ServiceRegisteredEventHandler(this.ServiceRegistered);
+ m_eventManager.ServiceFound += new _IDNSSDEvents_ServiceFoundEventHandler(this.ServiceFound);
+ m_eventManager.ServiceLost += new _IDNSSDEvents_ServiceLostEventHandler(this.ServiceLost);
+ m_eventManager.ServiceResolved += new _IDNSSDEvents_ServiceResolvedEventHandler(this.ServiceResolved);
+ m_eventManager.QueryRecordAnswered += new _IDNSSDEvents_QueryRecordAnsweredEventHandler(this.QueryAnswered);
+ m_eventManager.OperationFailed += new _IDNSSDEvents_OperationFailedEventHandler(this.OperationFailed);
+
+ //
+ // Socket read handler
+ //
+ m_readMessageCallback = new ReadMessageCallback(OnReadMessage);
+
+ this.Load += new System.EventHandler(this.Form1_Load);
+
+ this.AcceptButton = button1;
+ }
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ protected override void
+ Dispose( bool disposing )
+ {
+ if( disposing )
+ {
+ if (components != null)
+ {
+ components.Dispose();
+ }
+
+ if (m_registrar != null)
+ {
+ m_registrar.Stop();
+ }
+
+ if (m_browser != null)
+ {
+ m_browser.Stop();
+ }
+
+ if (m_resolver != null)
+ {
+ m_resolver.Stop();
+ }
+
+ m_eventManager.ServiceFound -= new _IDNSSDEvents_ServiceFoundEventHandler(this.ServiceFound);
+ m_eventManager.ServiceLost -= new _IDNSSDEvents_ServiceLostEventHandler(this.ServiceLost);
+ m_eventManager.ServiceResolved -= new _IDNSSDEvents_ServiceResolvedEventHandler(this.ServiceResolved);
+ m_eventManager.QueryRecordAnswered -= new _IDNSSDEvents_QueryRecordAnsweredEventHandler(this.QueryAnswered);
+ m_eventManager.OperationFailed -= new _IDNSSDEvents_OperationFailedEventHandler(this.OperationFailed);
+ }
+ base.Dispose( disposing );
+ }
+
+ #region Windows Form Designer generated code
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.comboBox1 = new System.Windows.Forms.ComboBox();
+ this.textBox2 = new System.Windows.Forms.TextBox();
+ this.button1 = new System.Windows.Forms.Button();
+ this.label1 = new System.Windows.Forms.Label();
+ this.richTextBox1 = new System.Windows.Forms.RichTextBox();
+ this.SuspendLayout();
+ //
+ // comboBox1
+ //
+ this.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right);
+ this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.comboBox1.Location = new System.Drawing.Point(59, 208);
+ this.comboBox1.Name = "comboBox1";
+ this.comboBox1.Size = new System.Drawing.Size(224, 21);
+ this.comboBox1.Sorted = true;
+ this.comboBox1.TabIndex = 5;
+ this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
+ //
+ // textBox2
+ //
+ this.textBox2.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right);
+ this.textBox2.Location = new System.Drawing.Point(8, 248);
+ this.textBox2.Name = "textBox2";
+ this.textBox2.ScrollBars = System.Windows.Forms.ScrollBars.Horizontal;
+ this.textBox2.Size = new System.Drawing.Size(192, 20);
+ this.textBox2.TabIndex = 2;
+ this.textBox2.Text = "";
+ this.textBox2.TextChanged += new System.EventHandler(this.textBox2_TextChanged);
+ //
+ // button1
+ //
+ this.button1.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
+ this.button1.Enabled = false;
+ this.button1.Location = new System.Drawing.Point(208, 248);
+ this.button1.Name = "button1";
+ this.button1.TabIndex = 3;
+ this.button1.Text = "Send";
+ this.button1.Click += new System.EventHandler(this.button1_Click);
+ //
+ // label1
+ //
+ this.label1.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
+ this.label1.Location = new System.Drawing.Point(8, 210);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(48, 16);
+ this.label1.TabIndex = 4;
+ this.label1.Text = "Talk To:";
+ //
+ // richTextBox1
+ //
+ this.richTextBox1.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
+ | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right);
+ this.richTextBox1.Location = new System.Drawing.Point(8, 8);
+ this.richTextBox1.Name = "richTextBox1";
+ this.richTextBox1.ReadOnly = true;
+ this.richTextBox1.Size = new System.Drawing.Size(272, 184);
+ this.richTextBox1.TabIndex = 1;
+ this.richTextBox1.Text = "";
+ //
+ // Form1
+ //
+ this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+ this.ClientSize = new System.Drawing.Size(292, 273);
+ this.Controls.AddRange(new System.Windows.Forms.Control[] {
+ this.richTextBox1,
+ this.label1,
+ this.button1,
+ this.textBox2,
+ this.comboBox1});
+ this.Name = "Form1";
+ this.Text = "SimpleChat.NET";
+ this.ResumeLayout(false);
+
+ }
+ #endregion
+
+ private void Form1_Load(object sender, EventArgs e)
+ {
+ IPEndPoint localEP = new IPEndPoint(System.Net.IPAddress.Any, 0);
+
+ //
+ // create the socket and bind to INADDR_ANY
+ //
+ m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
+ m_socket.Bind(localEP);
+ localEP = (IPEndPoint) m_socket.LocalEndPoint;
+
+ //
+ // start asynchronous read
+ //
+ m_socket.BeginReceive(m_buffer, 0, BUFFER_SIZE, 0, new AsyncCallback(this.OnReadSocket), this);
+
+ try
+ {
+ //
+ // start the register and browse operations
+ //
+ m_registrar = m_service.Register( 0, 0, System.Environment.UserName, "_p2pchat._udp", null, null, ( ushort ) localEP.Port, null, m_eventManager );
+ }
+ catch
+ {
+ MessageBox.Show("Bonjour service is not available", "Error");
+ Application.Exit();
+ }
+ }
+
+ /// <summary>
+ /// The main entry point for the application.
+ /// </summary>
+ [STAThread]
+ static void Main()
+ {
+ Application.Run(new SimpleChat());
+ }
+
+ //
+ // send the message to a peer
+ //
+ private void button1_Click(object sender, System.EventArgs e)
+ {
+ PeerData peer = (PeerData) comboBox1.SelectedItem;
+
+ String message = m_name + ": " + textBox2.Text;
+
+ Byte[] bytes = Encoding.UTF8.GetBytes(message);
+
+ IPEndPoint endPoint = new IPEndPoint( peer.Address, peer.Port );
+
+
+
+ m_socket.SendTo(bytes, endPoint);
+
+ richTextBox1.SelectionColor = Color.Black;
+
+ richTextBox1.AppendText(textBox2.Text + "\n");
+
+ textBox2.Text = "";
+ }
+
+ //
+ // called when typing in message box
+ //
+ private void textBox2_TextChanged(object sender, System.EventArgs e)
+ {
+ PeerData peer = (PeerData) comboBox1.SelectedItem;
+ button1.Enabled = ((peer.Address != null) && (textBox2.Text.Length > 0));
+ }
+
+ //
+ // called when peer target changes
+ //
+ /// <summary>
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="e"></param>
+ private void comboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
+ {
+ PeerData peer = (PeerData) comboBox1.SelectedItem;
+
+ try
+ {
+ m_resolver = m_service.Resolve(0, peer.InterfaceIndex, peer.Name, peer.Type, peer.Domain, m_eventManager);
+ }
+ catch
+ {
+ MessageBox.Show("Unable to Resolve service", "Error");
+ Application.Exit();
+ }
+ }
+ }
+
+ //
+ // PeerData
+ //
+ // Holds onto the information associated with a peer on the network
+ //
+ public class PeerData
+ {
+ public uint InterfaceIndex;
+ public String Name;
+ public String Type;
+ public String Domain;
+ public IPAddress Address;
+ public int Port;
+
+ public override String
+ ToString()
+ {
+ return Name;
+ }
+
+ public override bool
+ Equals(object other)
+ {
+ bool result = false;
+
+ if (other != null)
+ {
+ if ((object)this == other)
+ {
+ result = true;
+ }
+ else if (other is PeerData)
+ {
+ PeerData otherPeerData = (PeerData)other;
+
+ result = (this.Name == otherPeerData.Name);
+ }
+ }
+
+ return result;
+ }
+
+
+ public override int
+ GetHashCode()
+ {
+ return Name.GetHashCode();
+ }
+ };
+}
diff --git a/mDNSResponder/Clients/SimpleChat.NET/SimpleChat.resx b/mDNSResponder/Clients/SimpleChat.NET/SimpleChat.resx
new file mode 100755
index 00000000..56718181
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.NET/SimpleChat.resx
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 1.3
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">1.3</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1">this is my long string</data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ [base64 mime encoded serialized .NET Framework object]
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ [base64 mime encoded string representing a byte array form of the .NET Framework object]
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>1.3</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <data name="$this.Name">
+ <value>SimpleChat.NET</value>
+ </data>
+</root> \ No newline at end of file
diff --git a/mDNSResponder/Clients/SimpleChat.VB/My Project/Application.Designer.vb b/mDNSResponder/Clients/SimpleChat.VB/My Project/Application.Designer.vb
new file mode 100644
index 00000000..9fc20193
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.VB/My Project/Application.Designer.vb
@@ -0,0 +1,38 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.235
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+ 'NOTE: This file is auto-generated; do not modify it directly. To make changes,
+ ' or if you encounter build errors in this file, go to the Project Designer
+ ' (go to Project Properties or double-click the My Project node in
+ ' Solution Explorer), and make changes on the Application tab.
+ '
+ Partial Friend Class MyApplication
+
+ <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
+ Public Sub New()
+ MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
+ Me.IsSingleInstance = false
+ Me.EnableVisualStyles = true
+ Me.SaveMySettingsOnExit = true
+ Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
+ End Sub
+
+ <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
+ Protected Overrides Sub OnCreateMainForm()
+ Me.MainForm = Global.SimpleChat.VB.SimpleChat
+ End Sub
+ End Class
+End Namespace
diff --git a/mDNSResponder/Clients/SimpleChat.VB/My Project/Application.myapp b/mDNSResponder/Clients/SimpleChat.VB/My Project/Application.myapp
new file mode 100644
index 00000000..890288cc
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.VB/My Project/Application.myapp
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-16"?>
+<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <MySubMain>true</MySubMain>
+ <MainForm>SimpleChat</MainForm>
+ <SingleInstance>false</SingleInstance>
+ <ShutdownMode>0</ShutdownMode>
+ <EnableVisualStyles>true</EnableVisualStyles>
+ <AuthenticationMode>0</AuthenticationMode>
+ <SaveMySettingsOnExit>true</SaveMySettingsOnExit>
+</MyApplicationData> \ No newline at end of file
diff --git a/mDNSResponder/Clients/SimpleChat.VB/My Project/AssemblyInfo.vb b/mDNSResponder/Clients/SimpleChat.VB/My Project/AssemblyInfo.vb
new file mode 100644
index 00000000..869313ad
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.VB/My Project/AssemblyInfo.vb
@@ -0,0 +1,35 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+
+' 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.
+
+' Review the values of the assembly attributes
+
+<Assembly: AssemblyTitle("SimpleChat.VB")>
+<Assembly: AssemblyDescription("")>
+<Assembly: AssemblyCompany("Microsoft")>
+<Assembly: AssemblyProduct("SimpleChat.VB")>
+<Assembly: AssemblyCopyright("Copyright © Microsoft 2009")>
+<Assembly: AssemblyTrademark("")>
+
+<Assembly: ComVisible(False)>
+
+'The following GUID is for the ID of the typelib if this project is exposed to COM
+<Assembly: Guid("a07d7322-054b-4fda-a670-d75f589804c8")>
+
+' Version information for an assembly consists of the following four values:
+'
+' Major Version
+' Minor Version
+' Build Number
+' Revision
+'
+' You can specify all the values or you can default the Build and Revision Numbers
+' by using the '*' as shown below:
+' <Assembly: AssemblyVersion("1.0.*")>
+
+<Assembly: AssemblyVersion("1.0.0.0")>
+<Assembly: AssemblyFileVersion("1.0.0.0")>
diff --git a/mDNSResponder/Clients/SimpleChat.VB/My Project/Resources.Designer.vb b/mDNSResponder/Clients/SimpleChat.VB/My Project/Resources.Designer.vb
new file mode 100644
index 00000000..537826c1
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.VB/My Project/Resources.Designer.vb
@@ -0,0 +1,63 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.235
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+Imports System
+
+Namespace My.Resources
+
+ 'This class was auto-generated by the StronglyTypedResourceBuilder
+ 'class via a tool like ResGen or Visual Studio.
+ 'To add or remove a member, edit your .ResX file then rerun ResGen
+ 'with the /str option, or rebuild your VS project.
+ '''<summary>
+ ''' A strongly-typed resource class, for looking up localized strings, etc.
+ '''</summary>
+ <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
+ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+ Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
+ Friend Module Resources
+
+ Private resourceMan As Global.System.Resources.ResourceManager
+
+ Private resourceCulture As Global.System.Globalization.CultureInfo
+
+ '''<summary>
+ ''' Returns the cached ResourceManager instance used by this class.
+ '''</summary>
+ <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+ Get
+ If Object.ReferenceEquals(resourceMan, Nothing) Then
+ Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("SimpleChat.VB.Resources", GetType(Resources).Assembly)
+ resourceMan = temp
+ End If
+ Return resourceMan
+ End Get
+ End Property
+
+ '''<summary>
+ ''' Overrides the current thread's CurrentUICulture property for all
+ ''' resource lookups using this strongly typed resource class.
+ '''</summary>
+ <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+ Friend Property Culture() As Global.System.Globalization.CultureInfo
+ Get
+ Return resourceCulture
+ End Get
+ Set
+ resourceCulture = value
+ End Set
+ End Property
+ End Module
+End Namespace
diff --git a/mDNSResponder/Clients/SimpleChat.VB/My Project/Resources.resx b/mDNSResponder/Clients/SimpleChat.VB/My Project/Resources.resx
new file mode 100644
index 00000000..ffecec85
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.VB/My Project/Resources.resx
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ No newline at end of file
diff --git a/mDNSResponder/Clients/SimpleChat.VB/My Project/Settings.Designer.vb b/mDNSResponder/Clients/SimpleChat.VB/My Project/Settings.Designer.vb
new file mode 100644
index 00000000..54768dd9
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.VB/My Project/Settings.Designer.vb
@@ -0,0 +1,73 @@
+'------------------------------------------------------------------------------
+' <auto-generated>
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.235
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+' </auto-generated>
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+ <Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
+ Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0"), _
+ Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+ Partial Friend NotInheritable Class MySettings
+ Inherits Global.System.Configuration.ApplicationSettingsBase
+
+ Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+ Private Shared addedHandler As Boolean
+
+ Private Shared addedHandlerLockObject As New Object
+
+ <Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
+ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+ If My.Application.SaveMySettingsOnExit Then
+ My.Settings.Save()
+ End If
+ End Sub
+#End If
+#End Region
+
+ Public Shared ReadOnly Property [Default]() As MySettings
+ Get
+
+#If _MyType = "WindowsForms" Then
+ If Not addedHandler Then
+ SyncLock addedHandlerLockObject
+ If Not addedHandler Then
+ AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+ addedHandler = True
+ End If
+ End SyncLock
+ End If
+#End If
+ Return defaultInstance
+ End Get
+ End Property
+ End Class
+End Namespace
+
+Namespace My
+
+ <Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
+ Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
+ Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
+ Friend Module MySettingsProperty
+
+ <Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
+ Friend ReadOnly Property Settings() As Global.SimpleChat.VB.My.MySettings
+ Get
+ Return Global.SimpleChat.VB.My.MySettings.Default
+ End Get
+ End Property
+ End Module
+End Namespace
diff --git a/mDNSResponder/Clients/SimpleChat.VB/My Project/Settings.settings b/mDNSResponder/Clients/SimpleChat.VB/My Project/Settings.settings
new file mode 100644
index 00000000..377f56d6
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.VB/My Project/Settings.settings
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" UseMySettingsClassName="true">
+ <Profiles>
+ <Profile Name="(Default)" />
+ </Profiles>
+ <Settings />
+</SettingsFile>
diff --git a/mDNSResponder/Clients/SimpleChat.VB/SimpleChat.Designer.vb b/mDNSResponder/Clients/SimpleChat.VB/SimpleChat.Designer.vb
new file mode 100644
index 00000000..4cdc2aa9
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.VB/SimpleChat.Designer.vb
@@ -0,0 +1,102 @@
+<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
+Partial Class SimpleChat
+ Inherits System.Windows.Forms.Form
+
+ 'Form overrides dispose to clean up the component list.
+ <System.Diagnostics.DebuggerNonUserCode()> _
+ Protected Overrides Sub Dispose(ByVal disposing As Boolean)
+ Try
+ If disposing AndAlso components IsNot Nothing Then
+ components.Dispose()
+ End If
+ Finally
+ MyBase.Dispose(disposing)
+ End Try
+ End Sub
+
+ 'Required by the Windows Form Designer
+ Private components As System.ComponentModel.IContainer
+
+ 'NOTE: The following procedure is required by the Windows Form Designer
+ 'It can be modified using the Windows Form Designer.
+ 'Do not modify it using the code editor.
+ <System.Diagnostics.DebuggerStepThrough()> _
+ Private Sub InitializeComponent()
+ Me.TextBox1 = New System.Windows.Forms.TextBox
+ Me.TextBox2 = New System.Windows.Forms.TextBox
+ Me.TalkTo = New System.Windows.Forms.Label
+ Me.ComboBox1 = New System.Windows.Forms.ComboBox
+ Me.Button1 = New System.Windows.Forms.Button
+ Me.SuspendLayout()
+ '
+ 'TextBox1
+ '
+ Me.TextBox1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+ Me.TextBox1.Location = New System.Drawing.Point(12, 12)
+ Me.TextBox1.Multiline = True
+ Me.TextBox1.Name = "TextBox1"
+ Me.TextBox1.ReadOnly = True
+ Me.TextBox1.Size = New System.Drawing.Size(459, 362)
+ Me.TextBox1.TabIndex = 0
+ '
+ 'TextBox2
+ '
+ Me.TextBox2.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
+ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+ Me.TextBox2.Location = New System.Drawing.Point(13, 431)
+ Me.TextBox2.Name = "TextBox2"
+ Me.TextBox2.Size = New System.Drawing.Size(374, 20)
+ Me.TextBox2.TabIndex = 1
+ '
+ 'TalkTo
+ '
+ Me.TalkTo.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+ Me.TalkTo.AutoSize = True
+ Me.TalkTo.Location = New System.Drawing.Point(13, 395)
+ Me.TalkTo.Name = "TalkTo"
+ Me.TalkTo.Size = New System.Drawing.Size(43, 13)
+ Me.TalkTo.TabIndex = 2
+ Me.TalkTo.Text = "Talk to:"
+ '
+ 'ComboBox1
+ '
+ Me.ComboBox1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
+ Me.ComboBox1.FormattingEnabled = True
+ Me.ComboBox1.Location = New System.Drawing.Point(63, 392)
+ Me.ComboBox1.Name = "ComboBox1"
+ Me.ComboBox1.Size = New System.Drawing.Size(324, 21)
+ Me.ComboBox1.TabIndex = 3
+ '
+ 'Button1
+ '
+ Me.Button1.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
+ Me.Button1.Location = New System.Drawing.Point(409, 430)
+ Me.Button1.Name = "Button1"
+ Me.Button1.Size = New System.Drawing.Size(59, 23)
+ Me.Button1.TabIndex = 4
+ Me.Button1.Text = "Send"
+ Me.Button1.UseVisualStyleBackColor = True
+ '
+ 'SimpleChat
+ '
+ Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+ Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
+ Me.ClientSize = New System.Drawing.Size(483, 462)
+ Me.Controls.Add(Me.Button1)
+ Me.Controls.Add(Me.ComboBox1)
+ Me.Controls.Add(Me.TalkTo)
+ Me.Controls.Add(Me.TextBox2)
+ Me.Controls.Add(Me.TextBox1)
+ Me.Name = "SimpleChat"
+ Me.Text = "SimpleChat.VB"
+ Me.ResumeLayout(False)
+ Me.PerformLayout()
+
+ End Sub
+ Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
+ Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
+ Friend WithEvents TalkTo As System.Windows.Forms.Label
+ Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
+ Friend WithEvents Button1 As System.Windows.Forms.Button
+
+End Class
diff --git a/mDNSResponder/Clients/SimpleChat.VB/SimpleChat.VB.vbproj b/mDNSResponder/Clients/SimpleChat.VB/SimpleChat.VB.vbproj
new file mode 100644
index 00000000..ee6267c5
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.VB/SimpleChat.VB.vbproj
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{5ACED234-EB98-415E-9974-B54A70789821}</ProjectGuid>
+ <OutputType>WinExe</OutputType>
+ <StartupObject>SimpleChat.VB.My.MyApplication</StartupObject>
+ <RootNamespace>SimpleChat.VB</RootNamespace>
+ <AssemblyName>SimpleChat.VB</AssemblyName>
+ <MyType>WindowsForms</MyType>
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
+ <FileUpgradeFlags>
+ </FileUpgradeFlags>
+ <OldToolsVersion>2.0</OldToolsVersion>
+ <UpgradeBackupLocation />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <DefineDebug>true</DefineDebug>
+ <DefineTrace>true</DefineTrace>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DocumentationFile>SimpleChat.VB.xml</DocumentationFile>
+ <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <DefineDebug>false</DefineDebug>
+ <DefineTrace>true</DefineTrace>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DocumentationFile>SimpleChat.VB.xml</DocumentationFile>
+ <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022,42353,42354,42355</NoWarn>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Deployment" />
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Import Include="Microsoft.VisualBasic" />
+ <Import Include="System" />
+ <Import Include="System.Collections" />
+ <Import Include="System.Collections.Generic" />
+ <Import Include="System.Data" />
+ <Import Include="System.Drawing" />
+ <Import Include="System.Diagnostics" />
+ <Import Include="System.Windows.Forms" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="SimpleChat.vb">
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="SimpleChat.Designer.vb">
+ <DependentUpon>SimpleChat.vb</DependentUpon>
+ <SubType>Form</SubType>
+ </Compile>
+ <Compile Include="My Project\AssemblyInfo.vb" />
+ <Compile Include="My Project\Application.Designer.vb">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Application.myapp</DependentUpon>
+ </Compile>
+ <Compile Include="My Project\Resources.Designer.vb">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ <Compile Include="My Project\Settings.Designer.vb">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ </Compile>
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="SimpleChat.resx">
+ <SubType>Designer</SubType>
+ <DependentUpon>SimpleChat.vb</DependentUpon>
+ </EmbeddedResource>
+ <EmbeddedResource Include="My Project\Resources.resx">
+ <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.vb</LastGenOutput>
+ <CustomToolNamespace>My.Resources</CustomToolNamespace>
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="My Project\Application.myapp">
+ <Generator>MyApplicationCodeGenerator</Generator>
+ <LastGenOutput>Application.Designer.vb</LastGenOutput>
+ </None>
+ <None Include="My Project\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <CustomToolNamespace>My</CustomToolNamespace>
+ <LastGenOutput>Settings.Designer.vb</LastGenOutput>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <COMReference Include="Bonjour">
+ <Guid>{18FBED6D-F2B7-4EC8-A4A4-46282E635308}</Guid>
+ <VersionMajor>1</VersionMajor>
+ <VersionMinor>0</VersionMinor>
+ <Lcid>0</Lcid>
+ <WrapperTool>tlbimp</WrapperTool>
+ <Isolated>False</Isolated>
+ </COMReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/SimpleChat.VB/SimpleChat.resx b/mDNSResponder/Clients/SimpleChat.VB/SimpleChat.resx
new file mode 100644
index 00000000..ff31a6db
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.VB/SimpleChat.resx
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" use="required" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ <xsd:attribute ref="xml:space" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ No newline at end of file
diff --git a/mDNSResponder/Clients/SimpleChat.VB/SimpleChat.vb b/mDNSResponder/Clients/SimpleChat.VB/SimpleChat.vb
new file mode 100644
index 00000000..dae62f38
--- /dev/null
+++ b/mDNSResponder/Clients/SimpleChat.VB/SimpleChat.vb
@@ -0,0 +1,157 @@
+'
+' Copyright (c) 2010 Apple Inc. All rights reserved.
+'
+' Licensed under the Apache License, Version 2.0 (the "License");
+' you may not use this file except in compliance with the License.
+' You may obtain a copy of the License at
+'
+' http://www.apache.org/licenses/LICENSE-2.0
+'
+' Unless required by applicable law or agreed to in writing, software
+' distributed under the License is distributed on an "AS IS" BASIS,
+' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+' See the License for the specific language governing permissions and
+' limitations under the License.
+'
+
+Imports System.Net
+Imports System.Net.Sockets
+Imports System.Data
+Imports System.Text
+
+Public Class SimpleChat
+ '
+ ' Associate Bonjour events with event handlers
+ '
+ Public WithEvents MyEventManager As New Bonjour.DNSSDEventManager
+ Private m_service As New Bonjour.DNSSDService
+ Private m_registrar As Bonjour.DNSSDService
+ Private m_browser As Bonjour.DNSSDService
+ Private m_resolver As Bonjour.DNSSDService
+ Private m_socket As New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
+ Private m_port As Integer
+ Private m_buffer(1024 * 32) As Byte
+ Private m_async As IAsyncResult
+ Public Delegate Sub SocketDelegate(ByVal msg As String)
+ Private m_socketDelegate As SocketDelegate
+ Private m_name As String
+
+ Public Sub New()
+ MyBase.New()
+
+ 'This call is required by the Windows Form Designer.
+ InitializeComponent()
+
+ Button1.Enabled = False
+
+ m_socketDelegate = New SocketDelegate(AddressOf MessageReceived)
+
+ Dim endPoint As New IPEndPoint(IPAddress.Any, 0)
+ m_socket.Bind(endPoint)
+ endPoint = m_socket.LocalEndPoint
+ m_port = endPoint.Port
+
+ Dim txtRecord As Bonjour.TXTRecord
+ m_async = m_socket.BeginReceive(m_buffer, 0, m_buffer.Length, SocketFlags.Partial, New AsyncCallback(AddressOf OnReceive), Me)
+ m_registrar = m_service.Register(0, 0, Environment.UserName, "_p2pchat._udp", vbNullString, vbNullString, m_port, txtRecord, MyEventManager)
+ End Sub
+
+ '
+ ' Called when Bonjour core finished registering a service successfully
+ '
+ Public Sub MyEventManager_ServiceRegistered(ByVal registrar As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal name As String, ByVal regType As String, ByVal domain As String) Handles MyEventManager.ServiceRegistered
+ m_name = name
+ m_browser = m_service.Browse(0, 0, regType, vbNullString, MyEventManager)
+ End Sub
+
+ '
+ ' Called when a service is found
+ '
+ Public Sub MyEventManager_ServiceFound(ByVal browser As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal serviceName As String, ByVal regtype As String, ByVal domain As String) Handles MyEventManager.ServiceFound
+ If (serviceName <> m_name) Then
+ Dim peer As PeerData = New PeerData
+ peer.InterfaceIndex = ifIndex
+ peer.Name = serviceName
+ peer.Type = regtype
+ peer.Domain = domain
+ ComboBox1.Items.Add(peer)
+ ComboBox1.SelectedIndex = 0
+ End If
+ End Sub
+
+ '
+ ' Called when a service is lost
+ '
+ Public Sub MyEventManager_ServiceLost(ByVal browser As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal serviceName As String, ByVal regtype As String, ByVal domain As String) Handles MyEventManager.ServiceLost
+ ComboBox1.Items.Remove(serviceName)
+ End Sub
+
+ '
+ ' Called when a service is resolved
+ '
+ Public Sub MyEventManager_ServiceResolved(ByVal resolver As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal fullname As String, ByVal hostname As String, ByVal port As UShort, ByVal record As Bonjour.TXTRecord) Handles MyEventManager.ServiceResolved
+ m_resolver.Stop()
+ Dim peer As PeerData = ComboBox1.SelectedItem
+ peer.Port = port
+ m_resolver = m_service.QueryRecord(0, ifIndex, hostname, Bonjour.DNSSDRRType.kDNSSDType_A, Bonjour.DNSSDRRClass.kDNSSDClass_IN, MyEventManager)
+ End Sub
+
+ Public Sub MyEventManager_QueryAnswered(ByVal resolver As Bonjour.DNSSDService, ByVal flags As Bonjour.DNSSDFlags, ByVal ifIndex As UInteger, ByVal fullName As String, ByVal rrtype As Bonjour.DNSSDRRType, ByVal rrclass As Bonjour.DNSSDRRClass, ByVal rdata As Object, ByVal ttl As UInteger) Handles MyEventManager.QueryRecordAnswered
+ m_resolver.Stop()
+ Dim peer As PeerData = ComboBox1.SelectedItem
+ Dim bits As UInteger = BitConverter.ToUInt32(rdata, 0)
+ Dim address As IPAddress = New System.Net.IPAddress(bits)
+ peer.Address = address
+ End Sub
+
+ Public Sub MyEventManager_OperationFailed(ByVal registrar As Bonjour.DNSSDService, ByVal errorCode As Bonjour.DNSSDError) Handles MyEventManager.OperationFailed
+ MessageBox.Show("Operation failed error code: " + errorCode)
+ End Sub
+
+ Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
+ Dim peer As PeerData = ComboBox1.SelectedItem
+ Dim message As String = m_name + ": " + TextBox2.Text
+ Dim bytes As Byte() = Encoding.UTF8.GetBytes(message)
+ Dim endPoint As IPEndPoint = New IPEndPoint(peer.Address, peer.Port)
+ m_socket.SendTo(bytes, 0, bytes.Length, 0, endPoint)
+ TextBox1.AppendText(TextBox2.Text + Environment.NewLine)
+ TextBox2.Text = ""
+ End Sub
+
+ Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
+ Dim peer As PeerData = ComboBox1.SelectedItem
+ m_resolver = m_service.Resolve(0, peer.InterfaceIndex, peer.Name, peer.Type, peer.Domain, MyEventManager)
+ End Sub
+ Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged
+ Dim peer As PeerData = ComboBox1.SelectedItem
+ If ((peer.Address IsNot Nothing) And TextBox2.Text.Length > 0) Then
+ Button1.Enabled = True
+ Else
+ Button1.Enabled = False
+ End If
+ End Sub
+ Public Sub MessageReceived(ByVal msg As System.String)
+ TextBox1.AppendText(msg)
+ End Sub
+ Private Sub OnReceive(ByVal ar As IAsyncResult)
+ Dim bytesReceived As Integer = m_socket.EndReceive(ar)
+ If (bytesReceived > 0) Then
+ Dim msg As String = Encoding.UTF8.GetString(m_buffer, 0, bytesReceived)
+ Me.Invoke(m_socketDelegate, msg)
+ End If
+ m_async = m_socket.BeginReceive(m_buffer, 0, m_buffer.Length, SocketFlags.Partial, New AsyncCallback(AddressOf OnReceive), Me)
+ End Sub
+End Class
+
+Public Class PeerData
+ Public InterfaceIndex As UInteger
+ Public Name As String
+ Public Type As String
+ Public Domain As String
+ Public Address As IPAddress
+ Public Port As UShort
+
+ Overrides Function ToString() As String
+ Return Name
+ End Function
+End Class
diff --git a/mDNSResponder/Clients/dns-sd.c b/mDNSResponder/Clients/dns-sd.c
new file mode 100644
index 00000000..8d5e75fe
--- /dev/null
+++ b/mDNSResponder/Clients/dns-sd.c
@@ -0,0 +1,1815 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2002-2013 Apple Inc. All rights reserved.
+ *
+ * Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc.
+ * ("Apple") in consideration of your agreement to the following terms, and your
+ * use, installation, modification or redistribution of this Apple software
+ * constitutes acceptance of these terms. If you do not agree with these terms,
+ * please do not use, install, modify or redistribute this Apple software.
+ *
+ * In consideration of your agreement to abide by the following terms, and subject
+ * to these terms, Apple grants you a personal, non-exclusive license, under Apple's
+ * copyrights in this original Apple software (the "Apple Software"), to use,
+ * reproduce, modify and redistribute the Apple Software, with or without
+ * modifications, in source and/or binary forms; provided that if you redistribute
+ * the Apple Software in its entirety and without modifications, you must retain
+ * this notice and the following text and disclaimers in all such redistributions of
+ * the Apple Software. Neither the name, trademarks, service marks or logos of
+ * Apple Computer, Inc. may be used to endorse or promote products derived from the
+ * Apple Software without specific prior written permission from Apple. Except as
+ * expressly stated in this notice, no other rights or licenses, express or implied,
+ * are granted by Apple herein, including but not limited to any patent rights that
+ * may be infringed by your derivative works or by other works in which the Apple
+ * Software may be incorporated.
+ *
+ * The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO
+ * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
+ * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
+ * COMBINATION WITH YOUR PRODUCTS.
+ *
+ * IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION
+ * OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT
+ * (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ To build this tool, copy and paste the following into a command line:
+
+ OS X:
+ gcc dns-sd.c -o dns-sd
+
+ POSIX systems:
+ gcc dns-sd.c -o dns-sd -I../mDNSShared -ldns_sd
+
+ Windows:
+ cl dns-sd.c -I../mDNSShared -DNOT_HAVE_GETOPT ws2_32.lib ..\mDNSWindows\DLL\Release\dnssd.lib
+ (may require that you run a Visual Studio script such as vsvars32.bat first)
+ */
+
+// For testing changes to dnssd_clientstub.c, uncomment this line and the code will be compiled
+// with an embedded copy of the client stub instead of linking the system library version at runtime.
+// This also useful to work around link errors when you're working on an older version of Mac OS X,
+// and trying to build a newer version of the "dns-sd" command which uses new API entry points that
+// aren't in the system's /usr/lib/libSystem.dylib.
+//#define TEST_NEW_CLIENTSTUB 1
+
+// When building mDNSResponder for Mac OS X 10.4 and earlier, /usr/lib/libSystem.dylib is built using its own private
+// copy of dnssd_clientstub.c, which is old and doesn't have all the entry points defined in the latest version, so
+// when we're building dns-sd.c on Mac OS X 10.4 or earlier, we automatically set TEST_NEW_CLIENTSTUB so that we'll
+// embed a copy of the latest dnssd_clientstub.c instead of trying to link to the incomplete version in libSystem.dylib
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1040
+#define TEST_NEW_CLIENTSTUB 1
+#endif
+
+#include <ctype.h>
+#include <stdio.h> // For stdout, stderr
+#include <stdlib.h> // For exit()
+#include <string.h> // For strlen(), strcpy()
+#include <errno.h> // For errno, EINTR
+#include <time.h>
+#include <sys/types.h> // For u_char
+
+#ifdef _WIN32
+ #include <winsock2.h>
+ #include <ws2tcpip.h>
+ #include <Iphlpapi.h>
+ #include <process.h>
+typedef int pid_t;
+ #define getpid _getpid
+ #define strcasecmp _stricmp
+ #define snprintf _snprintf
+static const char kFilePathSep = '\\';
+ #ifndef HeapEnableTerminationOnCorruption
+ # define HeapEnableTerminationOnCorruption (HEAP_INFORMATION_CLASS)1
+ #endif
+ #if !defined(IFNAMSIZ)
+ #define IFNAMSIZ 16
+ #endif
+ #define if_nametoindex if_nametoindex_win
+ #define if_indextoname if_indextoname_win
+
+typedef PCHAR (WINAPI * if_indextoname_funcptr_t)(ULONG index, PCHAR name);
+typedef ULONG (WINAPI * if_nametoindex_funcptr_t)(PCSTR name);
+
+unsigned if_nametoindex_win(const char *ifname)
+{
+ HMODULE library;
+ unsigned index = 0;
+
+ // Try and load the IP helper library dll
+ if ((library = LoadLibrary(TEXT("Iphlpapi")) ) != NULL )
+ {
+ if_nametoindex_funcptr_t if_nametoindex_funcptr;
+
+ // On Vista and above there is a Posix like implementation of if_nametoindex
+ if ((if_nametoindex_funcptr = (if_nametoindex_funcptr_t) GetProcAddress(library, "if_nametoindex")) != NULL )
+ {
+ index = if_nametoindex_funcptr(ifname);
+ }
+
+ FreeLibrary(library);
+ }
+
+ return index;
+}
+
+char * if_indextoname_win( unsigned ifindex, char *ifname)
+{
+ HMODULE library;
+ char * name = NULL;
+
+ // Try and load the IP helper library dll
+ if ((library = LoadLibrary(TEXT("Iphlpapi")) ) != NULL )
+ {
+ if_indextoname_funcptr_t if_indextoname_funcptr;
+
+ // On Vista and above there is a Posix like implementation of if_indextoname
+ if ((if_indextoname_funcptr = (if_indextoname_funcptr_t) GetProcAddress(library, "if_indextoname")) != NULL )
+ {
+ name = if_indextoname_funcptr(ifindex, ifname);
+ }
+
+ FreeLibrary(library);
+ }
+
+ return name;
+}
+
+static size_t _sa_len(const struct sockaddr *addr)
+{
+ if (addr->sa_family == AF_INET) return (sizeof(struct sockaddr_in));
+ else if (addr->sa_family == AF_INET6) return (sizeof(struct sockaddr_in6));
+ else return (sizeof(struct sockaddr));
+}
+
+# define SA_LEN(addr) (_sa_len(addr))
+
+#else
+ #include <unistd.h> // For getopt() and optind
+ #include <netdb.h> // For getaddrinfo()
+ #include <sys/time.h> // For struct timeval
+ #include <sys/socket.h> // For AF_INET
+ #include <netinet/in.h> // For struct sockaddr_in()
+ #include <arpa/inet.h> // For inet_addr()
+ #include <net/if.h> // For if_nametoindex()
+static const char kFilePathSep = '/';
+// #ifndef NOT_HAVE_SA_LEN
+// #define SA_LEN(addr) ((addr)->sa_len)
+// #else
+ #define SA_LEN(addr) (((addr)->sa_family == AF_INET6) ? sizeof(struct sockaddr_in6) : sizeof(struct sockaddr_in))
+// #endif
+#endif
+
+#if (TEST_NEW_CLIENTSTUB && !defined(__APPLE_API_PRIVATE))
+#define __APPLE_API_PRIVATE 1
+#endif
+
+// DNSServiceSetDispatchQueue is not supported on 10.6 & prior
+#if !TEST_NEW_CLIENTSTUB && defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ - (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ % 10) <= 1060)
+#undef _DNS_SD_LIBDISPATCH
+#endif
+#include "dns_sd.h"
+#include "ClientCommon.h"
+
+#if TEST_NEW_CLIENTSTUB
+#include "../mDNSShared/dnssd_ipc.c"
+#include "../mDNSShared/dnssd_clientlib.c"
+#include "../mDNSShared/dnssd_clientstub.c"
+#endif
+
+#if _DNS_SD_LIBDISPATCH
+#include <dispatch/private.h>
+#endif
+
+// The "+0" is to cope with the case where _DNS_SD_H is defined but empty (e.g. on Mac OS X 10.4 and earlier)
+#if _DNS_SD_H+0 >= 116
+#define HAS_NAT_PMP_API 1
+#define HAS_ADDRINFO_API 1
+#else
+#define kDNSServiceFlagsReturnIntermediates 0
+#endif
+
+//*************************************************************************************************************
+// Globals
+
+#define DS_FIXED_SIZE 4
+typedef struct
+{
+ unsigned short keyTag;
+ unsigned char alg;
+ unsigned char digestType;
+ unsigned char *digest;
+} rdataDS;
+
+#define DNSKEY_FIXED_SIZE 4
+typedef struct
+{
+ unsigned short flags;
+ unsigned char proto;
+ unsigned char alg;
+ unsigned char *data;
+} rdataDNSKey;
+
+//size of rdataRRSIG excluding signerName and signature (which are variable fields)
+#define RRSIG_FIXED_SIZE 18
+typedef struct
+{
+ unsigned short typeCovered;
+ unsigned char alg;
+ unsigned char labels;
+ unsigned int origTTL;
+ unsigned int sigExpireTime;
+ unsigned int sigInceptTime;
+ unsigned short keyTag;
+ char signerName[256];
+ //unsigned char *signature
+} rdataRRSig;
+
+#define RR_TYPE_SIZE 16
+
+typedef union { unsigned char b[2]; unsigned short NotAnInteger; } Opaque16;
+
+static int operation;
+static uint32_t opinterface = kDNSServiceInterfaceIndexAny;
+static DNSServiceRef client = NULL;
+static DNSServiceRef client_pa = NULL; // DNSServiceRef for RegisterProxyAddressRecord
+static DNSServiceRef sc1, sc2, sc3; // DNSServiceRefs for kDNSServiceFlagsShareConnection testing
+
+static int num_printed;
+static char addtest = 0;
+static DNSRecordRef record = NULL;
+static char myhinfoW[14] = "\002PC\012Windows XP";
+static char myhinfoX[ 9] = "\003Mac\004OS X";
+static char updatetest[3] = "\002AA";
+static char bigNULL[8192]; // 8K is maximum rdata we support
+
+#if _DNS_SD_LIBDISPATCH
+dispatch_queue_t main_queue;
+dispatch_source_t timer_source;
+#endif
+
+// Note: the select() implementation on Windows (Winsock2) fails with any timeout much larger than this
+#define LONG_TIME 100000000
+
+static volatile int stopNow = 0;
+static volatile int timeOut = LONG_TIME;
+
+#if _DNS_SD_LIBDISPATCH
+#define EXIT_IF_LIBDISPATCH_FATAL_ERROR(E) \
+ if (main_queue && (E) == kDNSServiceErr_ServiceNotRunning) { fprintf(stderr, "Error code %d\n", (E)); exit(0); }
+#else
+#define EXIT_IF_LIBDISPATCH_FATAL_ERROR(E)
+#endif
+
+//*************************************************************************************************************
+// Supporting Utility Functions
+static uint16_t GetRRClass(const char *s)
+{
+ if (!strcasecmp(s, "IN"))
+ return kDNSServiceClass_IN;
+ else
+ return(atoi(s));
+}
+
+static uint16_t GetRRType(const char *s)
+{
+ if (!strcasecmp(s, "A" )) return(kDNSServiceType_A);
+ else if (!strcasecmp(s, "NS" )) return(kDNSServiceType_NS);
+ else if (!strcasecmp(s, "MD" )) return(kDNSServiceType_MD);
+ else if (!strcasecmp(s, "MF" )) return(kDNSServiceType_MF);
+ else if (!strcasecmp(s, "CNAME" )) return(kDNSServiceType_CNAME);
+ else if (!strcasecmp(s, "SOA" )) return(kDNSServiceType_SOA);
+ else if (!strcasecmp(s, "MB" )) return(kDNSServiceType_MB);
+ else if (!strcasecmp(s, "MG" )) return(kDNSServiceType_MG);
+ else if (!strcasecmp(s, "MR" )) return(kDNSServiceType_MR);
+ else if (!strcasecmp(s, "NULL" )) return(kDNSServiceType_NULL);
+ else if (!strcasecmp(s, "WKS" )) return(kDNSServiceType_WKS);
+ else if (!strcasecmp(s, "PTR" )) return(kDNSServiceType_PTR);
+ else if (!strcasecmp(s, "HINFO" )) return(kDNSServiceType_HINFO);
+ else if (!strcasecmp(s, "MINFO" )) return(kDNSServiceType_MINFO);
+ else if (!strcasecmp(s, "MX" )) return(kDNSServiceType_MX);
+ else if (!strcasecmp(s, "TXT" )) return(kDNSServiceType_TXT);
+ else if (!strcasecmp(s, "RP" )) return(kDNSServiceType_RP);
+ else if (!strcasecmp(s, "AFSDB" )) return(kDNSServiceType_AFSDB);
+ else if (!strcasecmp(s, "X25" )) return(kDNSServiceType_X25);
+ else if (!strcasecmp(s, "ISDN" )) return(kDNSServiceType_ISDN);
+ else if (!strcasecmp(s, "RT" )) return(kDNSServiceType_RT);
+ else if (!strcasecmp(s, "NSAP" )) return(kDNSServiceType_NSAP);
+ else if (!strcasecmp(s, "NSAP_PTR")) return(kDNSServiceType_NSAP_PTR);
+ else if (!strcasecmp(s, "SIG" )) return(kDNSServiceType_SIG);
+ else if (!strcasecmp(s, "KEY" )) return(kDNSServiceType_KEY);
+ else if (!strcasecmp(s, "PX" )) return(kDNSServiceType_PX);
+ else if (!strcasecmp(s, "GPOS" )) return(kDNSServiceType_GPOS);
+ else if (!strcasecmp(s, "AAAA" )) return(kDNSServiceType_AAAA);
+ else if (!strcasecmp(s, "LOC" )) return(kDNSServiceType_LOC);
+ else if (!strcasecmp(s, "NXT" )) return(kDNSServiceType_NXT);
+ else if (!strcasecmp(s, "EID" )) return(kDNSServiceType_EID);
+ else if (!strcasecmp(s, "NIMLOC" )) return(kDNSServiceType_NIMLOC);
+ else if (!strcasecmp(s, "SRV" )) return(kDNSServiceType_SRV);
+ else if (!strcasecmp(s, "ATMA" )) return(kDNSServiceType_ATMA);
+ else if (!strcasecmp(s, "NAPTR" )) return(kDNSServiceType_NAPTR);
+ else if (!strcasecmp(s, "KX" )) return(kDNSServiceType_KX);
+ else if (!strcasecmp(s, "CERT" )) return(kDNSServiceType_CERT);
+ else if (!strcasecmp(s, "A6" )) return(kDNSServiceType_A6);
+ else if (!strcasecmp(s, "DNAME" )) return(kDNSServiceType_DNAME);
+ else if (!strcasecmp(s, "SINK" )) return(kDNSServiceType_SINK);
+ else if (!strcasecmp(s, "OPT" )) return(kDNSServiceType_OPT);
+ else if (!strcasecmp(s, "TKEY" )) return(kDNSServiceType_TKEY);
+ else if (!strcasecmp(s, "TSIG" )) return(kDNSServiceType_TSIG);
+ else if (!strcasecmp(s, "IXFR" )) return(kDNSServiceType_IXFR);
+ else if (!strcasecmp(s, "AXFR" )) return(kDNSServiceType_AXFR);
+ else if (!strcasecmp(s, "MAILB" )) return(kDNSServiceType_MAILB);
+ else if (!strcasecmp(s, "MAILA" )) return(kDNSServiceType_MAILA);
+ else if (!strcasecmp(s, "dnskey" )) return(kDNSServiceType_DNSKEY);
+ else if (!strcasecmp(s, "ds" )) return(kDNSServiceType_DS);
+ else if (!strcasecmp(s, "rrsig" )) return(kDNSServiceType_RRSIG);
+ else if (!strcasecmp(s, "nsec" )) return(kDNSServiceType_NSEC);
+ else if (!strcasecmp(s, "ANY" )) return(kDNSServiceType_ANY);
+ else return(atoi(s));
+}
+
+static char *DNSTypeName(unsigned short rr_type)
+{
+ switch (rr_type)
+ {
+ case kDNSServiceType_A: return("Addr");
+ case kDNSServiceType_NS: return("NS");
+ case kDNSServiceType_MX: return("MX");
+ case kDNSServiceType_CNAME: return("CNAME");
+ case kDNSServiceType_SOA: return("SOA");
+ case kDNSServiceType_PTR: return("PTR");
+ case kDNSServiceType_AAAA: return("AAAA");
+ case kDNSServiceType_NSEC: return("NSEC");
+ case kDNSServiceType_TSIG: return("TSIG");
+ case kDNSServiceType_RRSIG: return("RRSIG");
+ case kDNSServiceType_DNSKEY: return("DNSKEY");
+ case kDNSServiceType_DS: return("DS");
+ default:
+ {
+ static char buffer[RR_TYPE_SIZE];
+ snprintf(buffer, sizeof(buffer), "TYPE%d", rr_type);
+ return(buffer);
+ }
+ }
+}
+
+static unsigned short swap16(unsigned short x)
+{
+ unsigned char *ptr = (unsigned char *)&x;
+ return (unsigned short)((unsigned short)ptr[0] << 8 | ptr[1]);
+}
+
+static unsigned int swap32(unsigned int x)
+{
+ unsigned char *ptr = (unsigned char *)&x;
+ return (unsigned int)((unsigned int)ptr[0] << 24 | (unsigned int)ptr[1] << 16 | (unsigned int)ptr[2] << 8 | ptr[3]);
+}
+static unsigned int keytag(unsigned char *key, unsigned int keysize)
+{
+ unsigned long ac;
+ unsigned int i;
+
+ for (ac = 0, i = 0; i < keysize; ++i)
+ ac += (i & 1) ? key[i] : key[i] << 8;
+ ac += (ac >> 16) & 0xFFFF;
+ return ac & 0xFFFF;
+}
+
+static void base64Encode(char *buffer, int buflen, void *rdata, unsigned int rdlen)
+{
+#if _DNS_SD_LIBDISPATCH
+ const void *result = NULL;
+ size_t size;
+ dispatch_data_t src_data = NULL, dest_data = NULL, null_str = NULL, data = NULL, map = NULL;
+
+ src_data = dispatch_data_create(rdata, rdlen, dispatch_get_global_queue(0, 0), ^{});
+ if (!src_data)
+ goto done;
+
+ dest_data = dispatch_data_create_with_transform(src_data, DISPATCH_DATA_FORMAT_TYPE_NONE, DISPATCH_DATA_FORMAT_TYPE_BASE64);
+ if (!dest_data)
+ goto done;
+
+ null_str = dispatch_data_create("", 1, dispatch_get_global_queue(0, 0), ^{});
+ if (!null_str)
+ goto done;
+
+ data = dispatch_data_create_concat(dest_data, null_str);
+ if (!data)
+ goto done;
+
+ map = dispatch_data_create_map(data, &result, &size);
+ if (!map)
+ goto done;
+
+ snprintf(buffer, buflen, " %s", (char *)result);
+
+done:
+ if (src_data) dispatch_release(src_data);
+ if (dest_data) dispatch_release(dest_data);
+ if (data) dispatch_release(data);
+ if (null_str) dispatch_release(null_str);
+ if (map) dispatch_release(map);
+ return;
+#else //_DNS_SD_LIBDISPATCH
+ snprintf(buffer, buflen, " %s", ".");
+ return;
+#endif //_DNS_SD_LIBDISPATCH
+}
+
+#if HAS_NAT_PMP_API | HAS_ADDRINFO_API
+static DNSServiceProtocol GetProtocol(const char *s)
+{
+ if (!strcasecmp(s, "v4" )) return(kDNSServiceProtocol_IPv4);
+ else if (!strcasecmp(s, "v6" )) return(kDNSServiceProtocol_IPv6);
+ else if (!strcasecmp(s, "v4v6" )) return(kDNSServiceProtocol_IPv4 | kDNSServiceProtocol_IPv6);
+ else if (!strcasecmp(s, "v6v4" )) return(kDNSServiceProtocol_IPv4 | kDNSServiceProtocol_IPv6);
+ else if (!strcasecmp(s, "udp" )) return(kDNSServiceProtocol_UDP);
+ else if (!strcasecmp(s, "tcp" )) return(kDNSServiceProtocol_TCP);
+ else if (!strcasecmp(s, "udptcp" )) return(kDNSServiceProtocol_UDP | kDNSServiceProtocol_TCP);
+ else if (!strcasecmp(s, "tcpudp" )) return(kDNSServiceProtocol_UDP | kDNSServiceProtocol_TCP);
+ else return(atoi(s));
+}
+#endif
+
+
+//*************************************************************************************************************
+// Sample callback functions for each of the operation types
+
+static void printtimestamp(void)
+{
+ struct tm tm;
+ int ms;
+ static char date[16];
+ static char new_date[16];
+#ifdef _WIN32
+ SYSTEMTIME sysTime;
+ time_t uct = time(NULL);
+ tm = *localtime(&uct);
+ GetLocalTime(&sysTime);
+ ms = sysTime.wMilliseconds;
+#else
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ localtime_r((time_t*)&tv.tv_sec, &tm);
+ ms = tv.tv_usec/1000;
+#endif
+ strftime(new_date, sizeof(new_date), "%a %d %b %Y", &tm);
+ if (strncmp(date, new_date, sizeof(new_date)))
+ {
+ printf("DATE: ---%s---\n", new_date); //display date only if it has changed
+ strncpy(date, new_date, sizeof(date));
+ }
+ printf("%2d:%02d:%02d.%03d ", tm.tm_hour, tm.tm_min, tm.tm_sec, ms);
+}
+
+// formating time to RFC 4034 format
+static void FormatTime(unsigned long te, unsigned char *buf, int bufsize)
+{
+ struct tm tmTime;
+#ifdef _WIN32
+ __time32_t t = (__time32_t) te;
+ _gmtime32_s(&tmTime, &t);
+#else
+ // Time since epoch : strftime takes "tm". Convert seconds to "tm" using
+ // gmtime_r first and then use strftime
+ time_t t = (time_t)te;
+ gmtime_r(&t, &tmTime);
+#endif
+ strftime((char *)buf, bufsize, "%Y%m%d%H%M%S", &tmTime);
+}
+
+static void print_usage(const char *arg0, int print_all)
+{
+ fprintf(stderr, "%s -E (Enumerate recommended registration domains)\n", arg0);
+ fprintf(stderr, "%s -F (Enumerate recommended browsing domains)\n", arg0);
+ fprintf(stderr, "%s -R <Name> <Type> <Domain> <Port> [<TXT>...] (Register a service)\n", arg0);
+ fprintf(stderr, "%s -B <Type> <Domain> (Browse for services instances)\n", arg0);
+ fprintf(stderr, "%s -L <Name> <Type> <Domain> (Look up a service instance)\n", arg0);
+ fprintf(stderr, "%s -P <Name> <Type> <Domain> <Port> <Host> <IP> [<TXT>...] (Proxy)\n", arg0);
+ fprintf(stderr, "%s -q <name> <rrtype> <rrclass> (Generic query for any record type)\n", arg0);
+ fprintf(stderr, "%s -D <name> <rrtype> <rrclass>(Validate query for any record type with DNSSEC)\n", arg0);
+ fprintf(stderr, "%s -Z <Type> <Domain> (Output results in Zone File format)\n", arg0);
+#if HAS_ADDRINFO_API
+ fprintf(stderr, "%s -G v4/v6/v4v6 <name> (Get address information for hostname)\n", arg0);
+ fprintf(stderr, "%s -g v4/v6/v4v6 <name> (Validate address info for hostname with DNSSEC)\n", arg0);
+#endif
+ fprintf(stderr, "%s -V (Get version of currently running daemon / system service)\n", arg0);
+
+ if (print_all) //Print all available options for dns-sd tool
+ {
+ fprintf(stderr, "%s -C <FQDN> <rrtype> <rrclass> (Query; reconfirming each result)\n", arg0);
+#if HAS_NAT_PMP_API
+ fprintf(stderr, "%s -X udp/tcp/udptcp <IntPort> <ExtPort> <TTL> (NAT Port Mapping)\n", arg0);
+#endif
+ fprintf(stderr, "%s -A (Test Adding/Updating/Deleting a record)\n", arg0);
+ fprintf(stderr, "%s -U (Test updating a TXT record)\n", arg0);
+ fprintf(stderr, "%s -N (Test adding a large NULL record)\n", arg0);
+ fprintf(stderr, "%s -T (Test creating a large TXT record)\n", arg0);
+ fprintf(stderr, "%s -M (Test creating a registration with multiple TXT records)\n", arg0);
+ fprintf(stderr, "%s -I (Test registering and then immediately updating TXT record)\n", arg0);
+ fprintf(stderr, "%s -S (Test multiple operations on a shared socket)\n", arg0);
+ fprintf(stderr, "%s -i <Interface> (Run dns-sd cmd on a specific interface (en0/en1)\n", arg0);
+ fprintf(stderr, "%s -lo (Run dns-sd cmd using local only interface)\n", arg0);
+ fprintf(stderr, "%s -p2p (Use kDNSServiceInterfaceIndexP2P)\n", arg0);
+ fprintf(stderr, "%s -includep2p (Set kDNSServiceFlagsIncludeP2P flag)\n", arg0);
+ fprintf(stderr, "%s -includeAWDL (Set kDNSServiceFlagsIncludeAWDL flag)\n", arg0);
+ fprintf(stderr, "%s -optional (Set kDNSServiceFlagsValidateOptional flag)\n", arg0);
+ fprintf(stderr, "%s -tc (Set kDNSServiceFlagsBackgroundTrafficClass flag)\n", arg0);
+ fprintf(stderr, "%s -unicastResponse (Set kDNSServiceFlagsUnicastResponse flag)\n", arg0);
+ fprintf(stderr, "%s -t1 (Set kDNSServiceFlagsThresholdOne flag)\n", arg0);
+ fprintf(stderr, "%s -tFinder (Set kDNSServiceFlagsThresholdFinder flag)\n", arg0);
+ fprintf(stderr, "%s -timeout (Set kDNSServiceFlagsTimeout flag)\n", arg0);
+ }
+}
+
+#define DomainMsg(X) (((X) &kDNSServiceFlagsDefault) ? "(Default)" : \
+ ((X) &kDNSServiceFlagsAdd) ? "Added" : "Removed")
+
+#define MAX_LABELS 128
+
+static void DNSSD_API enum_reply(DNSServiceRef sdref, const DNSServiceFlags flags, uint32_t ifIndex,
+ DNSServiceErrorType errorCode, const char *replyDomain, void *context)
+{
+ DNSServiceFlags partialflags = flags & ~(kDNSServiceFlagsMoreComing | kDNSServiceFlagsAdd | kDNSServiceFlagsDefault);
+ int labels = 0, depth = 0, i, initial = 0;
+ char text[64];
+ const char *label[MAX_LABELS];
+
+ (void)sdref; // Unused
+ (void)ifIndex; // Unused
+ (void)context; // Unused
+ EXIT_IF_LIBDISPATCH_FATAL_ERROR(errorCode);
+
+ // 1. Print the header
+ if (num_printed++ == 0) printf("Timestamp Recommended %s domain\n", operation == 'E' ? "Registration" : "Browsing");
+ printtimestamp();
+ if (errorCode)
+ printf("Error code %d\n", errorCode);
+ else if (!*replyDomain)
+ printf("Error: No reply domain\n");
+ else
+ {
+ printf("%-10s", DomainMsg(flags));
+ printf("%-8s", (flags & kDNSServiceFlagsMoreComing) ? "(More)" : "");
+ if (partialflags) printf("Flags: %4X ", partialflags);
+ else printf(" ");
+
+ // 2. Count the labels
+ while (replyDomain && *replyDomain && labels < MAX_LABELS)
+ {
+ label[labels++] = replyDomain;
+ replyDomain = GetNextLabel(replyDomain, text);
+ }
+
+ // 3. Decide if we're going to clump the last two or three labels (e.g. "apple.com", or "nicta.com.au")
+ if (labels >= 3 && replyDomain - label[labels-1] <= 3 && label[labels-1] - label[labels-2] <= 4) initial = 3;
+ else if (labels >= 2 && replyDomain - label[labels-1] <= 4) initial = 2;
+ else initial = 1;
+ labels -= initial;
+
+ // 4. Print the initial one-, two- or three-label clump
+ for (i=0; i<initial; i++)
+ {
+ GetNextLabel(label[labels+i], text);
+ if (i>0) printf(".");
+ printf("%s", text);
+ }
+ printf("\n");
+
+ // 5. Print the remainder of the hierarchy
+ for (depth=0; depth<labels; depth++)
+ {
+ printf(" ");
+ for (i=0; i<=depth; i++) printf("- ");
+ GetNextLabel(label[labels-1-depth], text);
+ printf("> %s\n", text);
+ }
+ }
+
+ if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout);
+}
+
+static int CopyLabels(char *dst, const char *lim, const char **srcp, int labels)
+{
+ const char *src = *srcp;
+ while (*src != '.' || --labels > 0)
+ {
+ if (*src == '\\') *dst++ = *src++; // Make sure "\." doesn't confuse us
+ if (!*src || dst >= lim) return -1;
+ *dst++ = *src++;
+ if (!*src || dst >= lim) return -1;
+ }
+ *dst++ = 0;
+ *srcp = src + 1; // skip over final dot
+ return 0;
+}
+
+static void DNSSD_API zonedata_resolve(DNSServiceRef sdref, const DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode,
+ const char *fullname, const char *hosttarget, uint16_t opaqueport, uint16_t txtLen, const unsigned char *txt, void *context)
+{
+ union { uint16_t s; u_char b[2]; } port = { opaqueport };
+ uint16_t PortAsNumber = ((uint16_t)port.b[0]) << 8 | port.b[1];
+
+ const char *p = fullname;
+ char n[kDNSServiceMaxDomainName];
+ char t[kDNSServiceMaxDomainName];
+
+ const unsigned char *max = txt + txtLen;
+
+ (void)sdref; // Unused
+ (void)ifIndex; // Unused
+ (void)context; // Unused
+
+ //if (!(flags & kDNSServiceFlagsAdd)) return;
+ if (errorCode) { printf("Error code %d\n", errorCode); return; }
+
+ if (CopyLabels(n, n + kDNSServiceMaxDomainName, &p, 3)) return; // Fetch name+type
+ p = fullname;
+ if (CopyLabels(t, t + kDNSServiceMaxDomainName, &p, 1)) return; // Skip first label
+ if (CopyLabels(t, t + kDNSServiceMaxDomainName, &p, 2)) return; // Fetch next two labels (service type)
+
+ if (num_printed++ == 0)
+ {
+ printf("\n");
+ printf("; To direct clients to browse a different domain, substitute that domain in place of '@'\n");
+ printf("%-47s PTR %s\n", "lb._dns-sd._udp", "@");
+ printf("\n");
+ printf("; In the list of services below, the SRV records will typically reference dot-local Multicast DNS names.\n");
+ printf("; When transferring this zone file data to your unicast DNS server, you'll need to replace those dot-local\n");
+ printf("; names with the correct fully-qualified (unicast) domain name of the target host offering the service.\n");
+ }
+
+ printf("\n");
+ printf("%-47s PTR %s\n", t, n);
+ printf("%-47s SRV 0 0 %d %s ; Replace with unicast FQDN of target host\n", n, PortAsNumber, hosttarget);
+ printf("%-47s TXT ", n);
+
+ while (txt < max)
+ {
+ const unsigned char *const end = txt + 1 + txt[0];
+ txt++; // Skip over length byte
+ printf(" \"");
+ while (txt<end)
+ {
+ if (*txt == '\\' || *txt == '\"') printf("\\");
+ printf("%c", *txt++);
+ }
+ printf("\"");
+ }
+ printf("\n");
+
+ DNSServiceRefDeallocate(sdref);
+ free(context);
+
+ if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout);
+}
+
+static void DNSSD_API zonedata_browse(DNSServiceRef sdref, const DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode,
+ const char *replyName, const char *replyType, const char *replyDomain, void *context)
+{
+ DNSServiceRef *newref;
+
+ (void)sdref; // Unused
+ (void)context; // Unused
+ EXIT_IF_LIBDISPATCH_FATAL_ERROR(errorCode);
+
+ if (!(flags & kDNSServiceFlagsAdd)) return;
+ if (errorCode) { printf("Error code %d\n", errorCode); return; }
+
+ newref = malloc(sizeof(*newref));
+ *newref = client;
+ DNSServiceResolve(newref, kDNSServiceFlagsShareConnection, ifIndex, replyName, replyType, replyDomain, zonedata_resolve, newref);
+}
+
+static void DNSSD_API browse_reply(DNSServiceRef sdref, const DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode,
+ const char *replyName, const char *replyType, const char *replyDomain, void *context)
+{
+ char *op = (flags & kDNSServiceFlagsAdd) ? "Add" : "Rmv";
+ (void)sdref; // Unused
+ (void)context; // Unused
+ EXIT_IF_LIBDISPATCH_FATAL_ERROR(errorCode);
+
+ if (num_printed++ == 0) printf("Timestamp A/R Flags if %-20s %-20s %s\n", "Domain", "Service Type", "Instance Name");
+ printtimestamp();
+ if (errorCode)
+ printf("Error code %d\n", errorCode);
+ else
+ printf("%s %8X %3d %-20s %-20s %s\n",
+ op, flags, ifIndex, replyDomain, replyType, replyName);
+ if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout);
+
+ // To test selective cancellation of operations of shared sockets,
+ // cancel the current operation when we've got a multiple of five results
+ //if (operation == 'S' && num_printed % 5 == 0) DNSServiceRefDeallocate(sdref);
+}
+
+static void ShowTXTRecord(uint16_t txtLen, const unsigned char *txtRecord)
+{
+ const unsigned char *ptr = txtRecord;
+ const unsigned char *max = txtRecord + txtLen;
+ while (ptr < max)
+ {
+ const unsigned char *const end = ptr + 1 + ptr[0];
+ if (end > max) { printf("<< invalid data >>"); break; }
+ if (++ptr < end) printf(" "); // As long as string is non-empty, begin with a space
+ while (ptr<end)
+ {
+ // We'd like the output to be shell-friendly, so that it can be copied and pasted unchanged into a "dns-sd -R" command.
+ // However, this is trickier than it seems. Enclosing a string in double quotes doesn't necessarily make it
+ // shell-safe, because shells still expand variables like $foo even when they appear inside quoted strings.
+ // Enclosing a string in single quotes is better, but when using single quotes even backslash escapes are ignored,
+ // meaning there's simply no way to represent a single quote (or apostrophe) inside a single-quoted string.
+ // The only remaining solution is not to surround the string with quotes at all, but instead to use backslash
+ // escapes to encode spaces and all other known shell metacharacters.
+ // (If we've missed any known shell metacharacters, please let us know.)
+ // In addition, non-printing ascii codes (0-31) are displayed as \xHH, using a two-digit hex value.
+ // Because '\' is itself a shell metacharacter (the shell escape character), it has to be escaped as "\\" to survive
+ // the round-trip to the shell and back. This means that a single '\' is represented here as EIGHT backslashes:
+ // The C compiler eats half of them, resulting in four appearing in the output.
+ // The shell parses those four as a pair of "\\" sequences, passing two backslashes to the "dns-sd -R" command.
+ // The "dns-sd -R" command interprets this single "\\" pair as an escaped literal backslash. Sigh.
+ if (strchr(" &;`'\"|*?~<>^()[]{}$", *ptr)) printf("\\");
+ if (*ptr == '\\') printf("\\\\\\\\");
+ else if (*ptr >= ' ' ) printf("%c", *ptr);
+ else printf("\\\\x%02X", *ptr);
+ ptr++;
+ }
+ }
+}
+
+static void DNSSD_API resolve_reply(DNSServiceRef sdref, const DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode,
+ const char *fullname, const char *hosttarget, uint16_t opaqueport, uint16_t txtLen, const unsigned char *txtRecord, void *context)
+{
+ union { uint16_t s; u_char b[2]; } port = { opaqueport };
+ uint16_t PortAsNumber = ((uint16_t)port.b[0]) << 8 | port.b[1];
+
+ (void)sdref; // Unused
+ (void)ifIndex; // Unused
+ (void)context; // Unused
+ EXIT_IF_LIBDISPATCH_FATAL_ERROR(errorCode);
+
+ if (errorCode)
+ printf("Error code %d\n", errorCode);
+ else
+ {
+ printtimestamp();
+ printf("%s can be reached at %s:%u (interface %d)", fullname, hosttarget, PortAsNumber, ifIndex);
+ if (flags) printf(" Flags: %X", flags);
+ // Don't show degenerate TXT records containing nothing but a single empty string
+ if (txtLen > 1) { printf("\n"); ShowTXTRecord(txtLen, txtRecord); }
+ printf("\n");
+ }
+
+ if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout);
+}
+
+static void myTimerCallBack(void)
+{
+ DNSServiceErrorType err = kDNSServiceErr_Unknown;
+
+ switch (operation)
+ {
+ case 'A':
+ {
+ switch (addtest)
+ {
+ case 0: printf("Adding Test HINFO record\n");
+ err = DNSServiceAddRecord(client, &record, 0, kDNSServiceType_HINFO, sizeof(myhinfoW), &myhinfoW[0], 0);
+ addtest = 1;
+ break;
+ case 1: printf("Updating Test HINFO record\n");
+ err = DNSServiceUpdateRecord(client, record, 0, sizeof(myhinfoX), &myhinfoX[0], 0);
+ addtest = 2;
+ break;
+ case 2: printf("Removing Test HINFO record\n");
+ err = DNSServiceRemoveRecord(client, record, 0);
+ addtest = 0;
+ break;
+ }
+ }
+ break;
+
+ case 'U':
+ {
+ if (updatetest[1] != 'Z') updatetest[1]++;
+ else updatetest[1] = 'A';
+ updatetest[0] = 3 - updatetest[0];
+ updatetest[2] = updatetest[1];
+ printtimestamp();
+ printf("Updating Test TXT record to %c\n", updatetest[1]);
+ err = DNSServiceUpdateRecord(client, NULL, 0, 1+updatetest[0], &updatetest[0], 0);
+ }
+ break;
+
+ case 'N':
+ {
+ printf("Adding big NULL record\n");
+ err = DNSServiceAddRecord(client, &record, 0, kDNSServiceType_NULL, sizeof(bigNULL), &bigNULL[0], 0);
+ if (err) printf("Failed: %d\n", err);else printf("Succeeded\n");
+ timeOut = LONG_TIME;
+#if _DNS_SD_LIBDISPATCH
+ if (timer_source)
+ dispatch_source_set_timer(timer_source, dispatch_time(DISPATCH_TIME_NOW, (uint64_t)timeOut * NSEC_PER_SEC),
+ (uint64_t)timeOut * NSEC_PER_SEC, 0);
+#endif
+ }
+ break;
+ }
+
+ if (err != kDNSServiceErr_NoError)
+ {
+ fprintf(stderr, "DNSService add/update/remove failed %ld\n", (long int)err);
+ stopNow = 1;
+ }
+}
+
+static void DNSSD_API reg_reply(DNSServiceRef sdref, const DNSServiceFlags flags, DNSServiceErrorType errorCode,
+ const char *name, const char *regtype, const char *domain, void *context)
+{
+ (void)sdref; // Unused
+ (void)flags; // Unused
+ (void)context; // Unused
+ EXIT_IF_LIBDISPATCH_FATAL_ERROR(errorCode);
+
+ printtimestamp();
+ printf("Got a reply for service %s.%s%s: ", name, regtype, domain);
+
+ if (errorCode == kDNSServiceErr_NoError)
+ {
+ if (flags & kDNSServiceFlagsAdd) printf("Name now registered and active\n");
+ else printf("Name registration removed\n");
+ if (operation == 'A' || operation == 'U' || operation == 'N')
+ {
+ timeOut = 5;
+#if _DNS_SD_LIBDISPATCH
+ if (timer_source)
+ dispatch_source_set_timer(timer_source, dispatch_time(DISPATCH_TIME_NOW, (uint64_t)timeOut * NSEC_PER_SEC),
+ (uint64_t)timeOut * NSEC_PER_SEC, 0);
+#endif
+ }
+ }
+ else if (errorCode == kDNSServiceErr_NameConflict)
+ {
+ printf("Name in use, please choose another\n");
+ exit(-1);
+ }
+ else
+ printf("Error %d\n", errorCode);
+
+ if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout);
+}
+
+// Output the wire-format domainname pointed to by rd
+static int snprintd(char *p, int max, const unsigned char **rd)
+{
+ const char *const buf = p;
+ const char *const end = p + max;
+ while (**rd)
+ {
+ p += snprintf(p, end-p, "%.*s.", **rd, *rd+1);
+ *rd += 1 + **rd;
+ }
+ *rd += 1; // Advance over the final zero byte
+ return(p-buf);
+}
+
+static void ParseDNSSECRecords(uint16_t rrtype, char *rdb, char *p, unsigned const char *rd, uint16_t rdlen)
+{
+ int rdb_size = 1000;
+ switch (rrtype)
+ {
+ case kDNSServiceType_DS:
+ {
+ unsigned char *ptr;
+ int i;
+ rdataDS *rrds = (rdataDS *)rd;
+ p += snprintf(p, rdb + rdb_size - p, "%d %d %d ",
+ rrds->alg, swap16(rrds->keyTag), rrds->digestType);
+ ptr = (unsigned char *)(rd + DS_FIXED_SIZE);
+ for (i = 0; i < (rdlen - DS_FIXED_SIZE); i++)
+ p += snprintf(p, rdb + rdb_size - p, "%x", ptr[i]);
+ break;
+ }
+
+ case kDNSServiceType_DNSKEY:
+ {
+ rdataDNSKey *rrkey = (rdataDNSKey *)rd;
+ p += snprintf(p, rdb + rdb_size - p, "%d %d %d %u", swap16(rrkey->flags), rrkey->proto,
+ rrkey->alg, (unsigned int)keytag((unsigned char *)rrkey, rdlen));
+ base64Encode(p, rdb + rdb_size - p, (unsigned char *)(rd + DNSKEY_FIXED_SIZE), rdlen - DNSKEY_FIXED_SIZE);
+ break;
+ }
+
+ case kDNSServiceType_NSEC:
+ {
+ unsigned char *next = (unsigned char *)rd;
+ int len, bitmaplen;
+ int win, wlen, type;
+ unsigned char *bmap;
+ char *l = NULL;
+
+ l = p;
+ p += snprintd(p, rdb + rdb_size - p, &rd);
+ len = p - l + 1;
+
+ bitmaplen = rdlen - len;
+ bmap = (unsigned char *)((unsigned char *)next + len);
+
+ while (bitmaplen > 0)
+ {
+ int i;
+
+ if (bitmaplen < 3)
+ {
+ printf("Case NSEC: malformed nsec, bitmaplen %d short\n", bitmaplen);
+ break;
+ }
+
+ win = *bmap++;
+ wlen = *bmap++;
+ bitmaplen -= 2;
+ if (bitmaplen < wlen || wlen < 1 || wlen > 32)
+ {
+ printf("Case NSEC: malformed nsec, bitmaplen %d wlen %d\n", bitmaplen, wlen);
+ break;
+ }
+ if (win < 0 || win >= 256)
+ {
+ printf("Case NSEC: malformed nsec, bad window win %d\n", win);
+ break;
+ }
+ type = win * 256;
+ for (i = 0; i < wlen * 8; i++)
+ {
+ if (bmap[i>>3] & (128 >> (i&7)))
+ p += snprintf(p, rdb + rdb_size - p, " %s ", DNSTypeName(type + i));
+ }
+ bmap += wlen;
+ bitmaplen -= wlen;
+ }
+ break;
+ }
+
+ case kDNSServiceType_RRSIG:
+ {
+ rdataRRSig *rrsig = (rdataRRSig *)rd;
+ unsigned char expTimeBuf[64];
+ unsigned char inceptTimeBuf[64];
+ unsigned long inceptClock;
+ unsigned long expClock;
+ const unsigned char *q = NULL;
+ char *k = NULL;
+ int len;
+
+ expClock = (unsigned long)swap32(rrsig->sigExpireTime);
+ FormatTime(expClock, expTimeBuf, sizeof(expTimeBuf));
+
+ inceptClock = (unsigned long)swap32(rrsig->sigInceptTime);
+ FormatTime(inceptClock, inceptTimeBuf, sizeof(inceptTimeBuf));
+
+ p += snprintf(p, rdb + rdb_size - p, " %-7s %d %d %d %s %s %7d ",
+ DNSTypeName(swap16(rrsig->typeCovered)), rrsig->alg, rrsig->labels, swap32(rrsig->origTTL),
+ expTimeBuf, inceptTimeBuf, swap16(rrsig->keyTag));
+
+ q = (const unsigned char *)&rrsig->signerName;
+ k = p;
+ p += snprintd(p, rdb + rdb_size - p, &q);
+ len = p - k + 1;
+
+ base64Encode(p, rdb + rdb_size - p, (unsigned char *)(rd + len + RRSIG_FIXED_SIZE), rdlen - (len + RRSIG_FIXED_SIZE));
+ break;
+ }
+ }
+ return;
+}
+
+static void DNSSD_API qr_reply(DNSServiceRef sdref, const DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode,
+ const char *fullname, uint16_t rrtype, uint16_t rrclass, uint16_t rdlen, const void *rdata, uint32_t ttl, void *context)
+{
+ char *op = (flags & kDNSServiceFlagsAdd) ? "Add" : "Rmv";
+ const unsigned char *rd = rdata;
+ const unsigned char *end = (const unsigned char *) rdata + rdlen;
+ char rdb[1000] = "0.0.0.0", *p = rdb;
+ int unknowntype = 0;
+ char dnssec_status[15] = "Unknown";
+ char rr_type[RR_TYPE_SIZE];
+ char rr_class[3];
+ DNSServiceFlags check_flags = flags;//local flags for dnssec status checking
+
+ (void)sdref; // Unused
+ (void)ifIndex; // Unused
+ (void)ttl; // Unused
+ (void)context; // Unused
+ EXIT_IF_LIBDISPATCH_FATAL_ERROR(errorCode);
+
+ if (num_printed++ == 0)
+ {
+ if (operation == 'D')
+ printf("Timestamp A/R if %-30s%-6s%-7s%-18s Rdata\n", "Name", "Type", "Class", "DNSSECStatus");
+ else
+ printf("Timestamp A/R Flags if %-30s%-6s%-7s Rdata\n", "Name", "Type", "Class");
+ }
+ printtimestamp();
+
+ switch (rrclass)
+ {
+ case kDNSServiceClass_IN:
+ strncpy(rr_class, "IN", sizeof(rr_class));
+ break;
+ default:
+ snprintf(rr_class, sizeof(rr_class), "%d", rrclass);
+ break;
+ }
+ strncpy(rr_type, DNSTypeName(rrtype), sizeof(rr_type));
+
+ if (!errorCode) //to avoid printing garbage in rdata
+ {
+ if (!(check_flags & (kDNSServiceFlagsValidate | kDNSServiceFlagsValidateOptional)))
+ {
+ switch (rrtype)
+ {
+ case kDNSServiceType_A:
+ snprintf(rdb, sizeof(rdb), "%d.%d.%d.%d", rd[0], rd[1], rd[2], rd[3]);
+ break;
+
+ case kDNSServiceType_NS:
+ case kDNSServiceType_CNAME:
+ case kDNSServiceType_PTR:
+ case kDNSServiceType_DNAME:
+ p += snprintd(p, sizeof(rdb), &rd);
+ break;
+
+ case kDNSServiceType_SOA:
+ p += snprintd(p, rdb + sizeof(rdb) - p, &rd); // mname
+ p += snprintf(p, rdb + sizeof(rdb) - p, " ");
+ p += snprintd(p, rdb + sizeof(rdb) - p, &rd); // rname
+ p += snprintf(p, rdb + sizeof(rdb) - p, " Ser %d Ref %d Ret %d Exp %d Min %d",
+ ntohl(((uint32_t*)rd)[0]), ntohl(((uint32_t*)rd)[1]), ntohl(((uint32_t*)rd)[2]), ntohl(((uint32_t*)rd)[3]), ntohl(((uint32_t*)rd)[4]));
+ break;
+
+ case kDNSServiceType_AAAA:
+ snprintf(rdb, sizeof(rdb), "%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X",
+ rd[0x0], rd[0x1], rd[0x2], rd[0x3], rd[0x4], rd[0x5], rd[0x6], rd[0x7],
+ rd[0x8], rd[0x9], rd[0xA], rd[0xB], rd[0xC], rd[0xD], rd[0xE], rd[0xF]);
+ break;
+
+ case kDNSServiceType_SRV:
+ p += snprintf(p, rdb + sizeof(rdb) - p, "%d %d %d ", // priority, weight, port
+ ntohs(*(unsigned short*)rd), ntohs(*(unsigned short*)(rd+2)), ntohs(*(unsigned short*)(rd+4)));
+ rd += 6;
+ p += snprintd(p, rdb + sizeof(rdb) - p, &rd); // target host
+ break;
+
+ case kDNSServiceType_DS:
+ case kDNSServiceType_DNSKEY:
+ case kDNSServiceType_NSEC:
+ case kDNSServiceType_RRSIG:
+ ParseDNSSECRecords(rrtype, rdb, p, rd, rdlen);
+ break;
+
+ default:
+ snprintf(rdb, sizeof(rdb), "%d bytes%s", rdlen, rdlen ? ":" : "");
+ unknowntype = 1;
+ break;
+ }
+ }
+ else
+ {
+ strncpy(rdb, "----", sizeof(rdb));
+ //Clear all o/p bits, and then check for dnssec status
+ check_flags &= ~kDNSServiceOutputFlags;
+ if (check_flags & kDNSServiceFlagsSecure)
+ strncpy(dnssec_status, "Secure", sizeof(dnssec_status));
+ else if (check_flags & kDNSServiceFlagsInsecure)
+ strncpy(dnssec_status, "Insecure", sizeof(dnssec_status));
+ else if (check_flags & kDNSServiceFlagsIndeterminate)
+ strncpy(dnssec_status, "Indeterminate", sizeof(dnssec_status));
+ else if (check_flags & kDNSServiceFlagsBogus)
+ strncpy(dnssec_status, "Bogus", sizeof(dnssec_status));
+ }
+ }
+
+ if (operation == 'D')
+ printf("%s%3d %-30s%-6s%-7s%-18s %s", op, ifIndex, fullname, rr_type, rr_class, dnssec_status, rdb);
+ else
+ printf("%s%6X%3d %-30s%-7s%-6s %s", op, flags, ifIndex, fullname, rr_type, rr_class, rdb);
+ if (unknowntype)
+ {
+ while (rd < end)
+ printf(" %02X", *rd++);
+ }
+ if (errorCode)
+ {
+ if (errorCode == kDNSServiceErr_NoSuchRecord)
+ printf(" No Such Record");
+ else if (errorCode == kDNSServiceErr_Timeout)
+ {
+ printf(" No Such Record\n");
+ printf("Query Timed Out\n");
+ exit(1);
+ }
+ }
+ printf("\n");
+
+ if (operation == 'C')
+ if (flags & kDNSServiceFlagsAdd)
+ DNSServiceReconfirmRecord(flags, ifIndex, fullname, rrtype, rrclass, rdlen, rdata);
+
+ if (!(flags & kDNSServiceFlagsMoreComing))
+ fflush(stdout);
+}
+
+#if HAS_NAT_PMP_API
+static void DNSSD_API port_mapping_create_reply(DNSServiceRef sdref, DNSServiceFlags flags, uint32_t ifIndex, DNSServiceErrorType errorCode, uint32_t publicAddress, uint32_t protocol, uint16_t privatePort, uint16_t publicPort, uint32_t ttl, void *context)
+{
+ (void)sdref; // Unused
+ (void)flags; // Unused
+ (void)context; // Unused
+ EXIT_IF_LIBDISPATCH_FATAL_ERROR(errorCode);
+
+ if (num_printed++ == 0) printf("Timestamp if %-20s %-15s %-15s %-15s %-6s\n", "External Address", "Protocol", "Internal Port", "External Port", "TTL");
+ printtimestamp();
+ if (errorCode && errorCode != kDNSServiceErr_DoubleNAT) printf("Error code %d\n", errorCode);
+ else
+ {
+ const unsigned char *digits = (const unsigned char *)&publicAddress;
+ char addr[256];
+
+ snprintf(addr, sizeof(addr), "%d.%d.%d.%d", digits[0], digits[1], digits[2], digits[3]);
+ printf("%-4d %-20s %-15d %-15d %-15d %-6d%s\n", ifIndex, addr, protocol, ntohs(privatePort), ntohs(publicPort), ttl, errorCode == kDNSServiceErr_DoubleNAT ? " Double NAT" : "");
+ }
+
+ if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout);
+}
+#endif
+
+#if HAS_ADDRINFO_API
+static void DNSSD_API addrinfo_reply(DNSServiceRef sdref, const DNSServiceFlags flags, uint32_t interfaceIndex, DNSServiceErrorType errorCode, const char *hostname, const struct sockaddr *address, uint32_t ttl, void *context)
+{
+ char *op = (flags & kDNSServiceFlagsAdd) ? "Add" : "Rmv";
+ char addr[256] = "";
+ char dnssec_status[15] = "Unknown";
+ DNSServiceFlags check_flags = flags;
+ (void) sdref;
+ (void) context;
+
+ EXIT_IF_LIBDISPATCH_FATAL_ERROR(errorCode);
+
+ if (num_printed++ == 0)
+ {
+ if (operation == 'g')
+ printf("Timestamp A/R if %-25s %-44s %-18s\n", "Hostname", "Address", "DNSSECStatus");
+ else
+ printf("Timestamp A/R Flags if %-38s %-44s %s\n", "Hostname", "Address", "TTL");
+ }
+ printtimestamp();
+
+ if (address && address->sa_family == AF_INET)
+ {
+ const unsigned char *b = (const unsigned char *) &((struct sockaddr_in *)address)->sin_addr;
+ snprintf(addr, sizeof(addr), "%d.%d.%d.%d", b[0], b[1], b[2], b[3]);
+ }
+ else if (address && address->sa_family == AF_INET6)
+ {
+ char if_name[IFNAMSIZ]; // Older Linux distributions don't define IF_NAMESIZE
+ const struct sockaddr_in6 *s6 = (const struct sockaddr_in6 *)address;
+ const unsigned char *b = (const unsigned char * )&s6->sin6_addr;
+ if (!if_indextoname(s6->sin6_scope_id, if_name))
+ snprintf(if_name, sizeof(if_name), "<%d>", s6->sin6_scope_id);
+ snprintf(addr, sizeof(addr), "%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X:%02X%02X%%%s",
+ b[0x0], b[0x1], b[0x2], b[0x3], b[0x4], b[0x5], b[0x6], b[0x7],
+ b[0x8], b[0x9], b[0xA], b[0xB], b[0xC], b[0xD], b[0xE], b[0xF], if_name);
+ }
+
+ //go through this only if you have a dnssec validation status
+ if (!errorCode && (check_flags & (kDNSServiceFlagsValidate | kDNSServiceFlagsValidateOptional)))
+ {
+ strncpy(addr, "----", sizeof(addr));
+ //Clear all o/p bits, and then check for dnssec status
+ check_flags &= ~kDNSServiceOutputFlags;
+ if (check_flags & kDNSServiceFlagsSecure)
+ strncpy(dnssec_status, "Secure", sizeof(dnssec_status));
+ else if (check_flags & kDNSServiceFlagsInsecure)
+ strncpy(dnssec_status, "Insecure", sizeof(dnssec_status));
+ else if (check_flags & kDNSServiceFlagsIndeterminate)
+ strncpy(dnssec_status, "Indeterminate", sizeof(dnssec_status));
+ else if (check_flags & kDNSServiceFlagsBogus)
+ strncpy(dnssec_status, "Bogus", sizeof(dnssec_status));
+ }
+
+ if (operation == 'g')
+ printf("%s%3d %-25s %-44s %-18s", op, interfaceIndex, hostname, addr, dnssec_status);
+ else
+ printf("%s%6X%3d %-38s %-44s %d", op, flags, interfaceIndex, hostname, addr, ttl);
+ if (errorCode)
+ {
+ if (errorCode == kDNSServiceErr_NoSuchRecord)
+ printf(" No Such Record");
+ else
+ printf(" Error code %d", errorCode);
+ }
+ printf("\n");
+
+ if (!(flags & kDNSServiceFlagsMoreComing))
+ fflush(stdout);
+}
+#endif
+
+//*************************************************************************************************************
+// The main test function
+
+static void HandleEvents(void)
+#if _DNS_SD_LIBDISPATCH
+{
+ main_queue = dispatch_get_main_queue();
+ if (client) DNSServiceSetDispatchQueue(client, main_queue);
+ if (client_pa) DNSServiceSetDispatchQueue(client_pa, main_queue);
+ if (operation == 'A' || operation == 'U' || operation == 'N')
+ {
+ timer_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, main_queue);
+ if (timer_source)
+ {
+ // Start the timer "timeout" seconds into the future and repeat it every "timeout" seconds
+ dispatch_source_set_timer(timer_source, dispatch_time(DISPATCH_TIME_NOW, (uint64_t)timeOut * NSEC_PER_SEC),
+ (uint64_t)timeOut * NSEC_PER_SEC, 0);
+ dispatch_source_set_event_handler(timer_source, ^{myTimerCallBack();});
+ dispatch_resume(timer_source);
+ }
+ }
+ dispatch_main();
+}
+#else
+{
+ int dns_sd_fd = client ? DNSServiceRefSockFD(client ) : -1;
+ int dns_sd_fd2 = client_pa ? DNSServiceRefSockFD(client_pa) : -1;
+ int nfds = dns_sd_fd + 1;
+ fd_set readfds;
+ struct timeval tv;
+ int result;
+
+ if (dns_sd_fd2 > dns_sd_fd) nfds = dns_sd_fd2 + 1;
+
+ while (!stopNow)
+ {
+ // 1. Set up the fd_set as usual here.
+ // This example client has no file descriptors of its own,
+ // but a real application would call FD_SET to add them to the set here
+ FD_ZERO(&readfds);
+
+ // 2. Add the fd for our client(s) to the fd_set
+ if (client ) FD_SET(dns_sd_fd, &readfds);
+ if (client_pa) FD_SET(dns_sd_fd2, &readfds);
+
+ // 3. Set up the timeout.
+ tv.tv_sec = timeOut;
+ tv.tv_usec = 0;
+
+ result = select(nfds, &readfds, (fd_set*)NULL, (fd_set*)NULL, &tv);
+ if (result > 0)
+ {
+ DNSServiceErrorType err = kDNSServiceErr_NoError;
+ if (client && FD_ISSET(dns_sd_fd, &readfds)) err = DNSServiceProcessResult(client );
+ else if (client_pa && FD_ISSET(dns_sd_fd2, &readfds)) err = DNSServiceProcessResult(client_pa);
+ if (err) { fprintf(stderr, "DNSServiceProcessResult returned %d\n", err); stopNow = 1; }
+ }
+ else if (result == 0)
+ myTimerCallBack();
+ else
+ {
+ printf("select() returned %d errno %d %s\n", result, errno, strerror(errno));
+ if (errno != EINTR) stopNow = 1;
+ }
+ }
+}
+#endif
+
+static int getfirstoption(int argc, char **argv, const char *optstr, int *pOptInd)
+// Return the recognized option in optstr and the option index of the next arg.
+#if NOT_HAVE_GETOPT
+{
+ int i;
+ for (i=1; i < argc; i++)
+ {
+ if (argv[i][0] == '-' && &argv[i][1] &&
+ NULL != strchr(optstr, argv[i][1]))
+ {
+ *pOptInd = i + 1;
+ return argv[i][1];
+ }
+ }
+ return -1;
+}
+#else
+{
+ int o = getopt(argc, (char *const *)argv, optstr);
+ *pOptInd = optind;
+ return o;
+}
+#endif
+
+static void DNSSD_API MyRegisterRecordCallback(DNSServiceRef service, DNSRecordRef rec, const DNSServiceFlags flags,
+ DNSServiceErrorType errorCode, void *context)
+{
+ char *name = (char *)context;
+
+ (void)service; // Unused
+ (void)rec; // Unused
+ (void)flags; // Unused
+ EXIT_IF_LIBDISPATCH_FATAL_ERROR(errorCode);
+
+ printtimestamp();
+ printf("Got a reply for record %s: ", name);
+
+ switch (errorCode)
+ {
+ case kDNSServiceErr_NoError: printf("Name now registered and active\n"); break;
+ case kDNSServiceErr_NameConflict: printf("Name in use, please choose another\n"); exit(-1);
+ default: printf("Error %d\n", errorCode); break;
+ }
+ if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout);
+ // DNSServiceRemoveRecord(service, rec, 0); to test record removal
+
+#if 0 // To test updating of individual records registered via DNSServiceRegisterRecord
+ if (!errorCode)
+ {
+ int x = 0x11111111;
+ printf("Updating\n");
+ DNSServiceUpdateRecord(service, rec, 0, sizeof(x), &x, 0);
+ }
+#endif
+
+ if (!(flags & kDNSServiceFlagsMoreComing)) fflush(stdout);
+}
+
+static void getip(const char *const name, struct sockaddr_storage *result)
+{
+ struct addrinfo *addrs = NULL;
+ int err = getaddrinfo(name, NULL, NULL, &addrs);
+ if (err) fprintf(stderr, "getaddrinfo error %d for %s", err, name);
+ else memcpy(result, addrs->ai_addr, SA_LEN(addrs->ai_addr));
+ if (addrs) freeaddrinfo(addrs);
+}
+
+static DNSServiceErrorType RegisterProxyAddressRecord(DNSServiceRef sdref, const char *host, const char *ip, DNSServiceFlags flags)
+{
+ // Call getip() after the call DNSServiceCreateConnection().
+ // On the Win32 platform, WinSock must be initialized for getip() to succeed.
+ // Any DNSService* call will initialize WinSock for us, so we make sure
+ // DNSServiceCreateConnection() is called before getip() is.
+ struct sockaddr_storage hostaddr;
+ getip(ip, &hostaddr);
+ flags |= kDNSServiceFlagsUnique;
+ if (hostaddr.ss_family == AF_INET)
+ return(DNSServiceRegisterRecord(sdref, &record, flags, opinterface, host,
+ kDNSServiceType_A, kDNSServiceClass_IN, 4, &((struct sockaddr_in *)&hostaddr)->sin_addr, 240, MyRegisterRecordCallback, (void*)host));
+ else if (hostaddr.ss_family == AF_INET6)
+ return(DNSServiceRegisterRecord(sdref, &record, flags, opinterface, host,
+ kDNSServiceType_AAAA, kDNSServiceClass_IN, 16, &((struct sockaddr_in6*)&hostaddr)->sin6_addr, 240, MyRegisterRecordCallback, (void*)host));
+ else return(kDNSServiceErr_BadParam);
+}
+
+#define HexVal(X) ( ((X) >= '0' && (X) <= '9') ? ((X) - '0' ) : \
+ ((X) >= 'A' && (X) <= 'F') ? ((X) - 'A' + 10) : \
+ ((X) >= 'a' && (X) <= 'f') ? ((X) - 'a' + 10) : 0)
+
+#define HexPair(P) ((HexVal((P)[0]) << 4) | HexVal((P)[1]))
+
+static DNSServiceErrorType RegisterService(DNSServiceRef *sdref,
+ const char *nam, const char *typ, const char *dom, const char *host, const char *port, int argc, char **argv, DNSServiceFlags flags)
+{
+ uint16_t PortAsNumber = atoi(port);
+ Opaque16 registerPort = { { PortAsNumber >> 8, PortAsNumber & 0xFF } };
+ unsigned char txt[2048] = "";
+ unsigned char *ptr = txt;
+ int i;
+
+ if (nam[0] == '.' && nam[1] == 0) nam = ""; // We allow '.' on the command line as a synonym for empty string
+ if (dom[0] == '.' && dom[1] == 0) dom = ""; // We allow '.' on the command line as a synonym for empty string
+
+ printf("Registering Service %s.%s%s%s", nam[0] ? nam : "<<Default>>", typ, dom[0] ? "." : "", dom);
+ if (host && *host) printf(" host %s", host);
+ printf(" port %s", port);
+
+ if (argc)
+ {
+ for (i = 0; i < argc; i++)
+ {
+ const char *p = argv[i];
+ *ptr = 0;
+ while (*p && *ptr < 255 && ptr + 1 + *ptr < txt+sizeof(txt))
+ {
+ if (p[0] != '\\' || p[1] == 0) { ptr[++*ptr] = *p; p+=1; }
+ else if (p[1] == 'x' && isxdigit(p[2]) && isxdigit(p[3])) { ptr[++*ptr] = HexPair(p+2); p+=4; }
+ else { ptr[++*ptr] = p[1]; p+=2; }
+ }
+ ptr += 1 + *ptr;
+ }
+ printf(" TXT");
+ ShowTXTRecord(ptr-txt, txt);
+ }
+ printf("\n");
+
+ //flags |= kDNSServiceFlagsAllowRemoteQuery;
+ //flags |= kDNSServiceFlagsNoAutoRename;
+
+ return(DNSServiceRegister(sdref, flags, opinterface, nam, typ, dom, host, registerPort.NotAnInteger, (uint16_t) (ptr-txt), txt, reg_reply, NULL));
+}
+
+#define TypeBufferSize 80
+static char *gettype(char *buffer, char *typ)
+{
+ if (!typ || !*typ || (typ[0] == '.' && typ[1] == 0)) typ = "_http._tcp";
+ if (!strchr(typ, '.')) { snprintf(buffer, TypeBufferSize, "%s._tcp", typ); typ = buffer; }
+ return(typ);
+}
+
+int main(int argc, char **argv)
+{
+ DNSServiceErrorType err;
+ char buffer[TypeBufferSize], *typ, *dom;
+ int opi;
+ DNSServiceFlags flags = 0;
+ int optional = 0;
+
+ // Extract the program name from argv[0], which by convention contains the path to this executable.
+ // Note that this is just a voluntary convention, not enforced by the kernel --
+ // the process calling exec() can pass bogus data in argv[0] if it chooses to.
+ const char *a0 = strrchr(argv[0], kFilePathSep) + 1;
+ if (a0 == (const char *)1) a0 = argv[0];
+
+#if defined(_WIN32)
+ HeapSetInformation(NULL, HeapEnableTerminationOnCorruption, NULL, 0);
+#endif
+
+#if TEST_NEW_CLIENTSTUB
+ printf("Using embedded copy of dnssd_clientstub instead of system library\n");
+ if (sizeof(argv) == 8) printf("Running in 64-bit mode\n");
+#endif
+
+ // Test code for TXTRecord functions
+ //TXTRecordRef txtRecord;
+ //TXTRecordCreate(&txtRecord, 0, NULL);
+ //TXTRecordSetValue(&txtRecord, "aaa", 1, "b");
+ //printf("%d\n", TXTRecordContainsKey(TXTRecordGetLength(&txtRecord), TXTRecordGetBytesPtr(&txtRecord), "Aaa"));
+
+ if (argc > 1 && !strcmp(argv[1], "-lo"))
+ {
+ argc--;
+ argv++;
+ opinterface = kDNSServiceInterfaceIndexLocalOnly;
+ printf("Using LocalOnly\n");
+ }
+
+ if (argc > 1 && (!strcmp(argv[1], "-p2p") || !strcmp(argv[1], "-P2P")))
+ {
+ argc--;
+ argv++;
+ opinterface = kDNSServiceInterfaceIndexP2P;
+ }
+
+ if (argc > 1 && !strcasecmp(argv[1], "-includep2p"))
+ {
+ argc--;
+ argv++;
+ flags |= kDNSServiceFlagsIncludeP2P;
+ printf("Setting kDNSServiceFlagsIncludeP2P\n");
+ }
+
+ if (argc > 1 && !strcasecmp(argv[1], "-includeAWDL"))
+ {
+ argc--;
+ argv++;
+ flags |= kDNSServiceFlagsIncludeAWDL;
+ printf("Setting kDNSServiceFlagsIncludeAWDL\n");
+ }
+
+ if (argc > 1 && !strcasecmp(argv[1], "-tc"))
+ {
+ argc--;
+ argv++;
+ flags |= kDNSServiceFlagsBackgroundTrafficClass;
+ printf("Setting kDNSServiceFlagsBackgroundTrafficClass\n");
+ }
+
+ if (argc > 1 && !strcasecmp(argv[1], "-t1"))
+ {
+ argc--;
+ argv++;
+ flags |= kDNSServiceFlagsThresholdOne;
+ printf("Setting kDNSServiceFlagsThresholdOne\n");
+ }
+
+ if (argc > 1 && !strcasecmp(argv[1], "-tFinder"))
+ {
+ argc--;
+ argv++;
+ flags |= kDNSServiceFlagsThresholdFinder;
+ printf("Setting kDNSServiceFlagsThresholdFinder\n");
+ }
+
+ if (argc > 1 && !strcasecmp(argv[1], "-wo"))
+ {
+ argc--;
+ argv++;
+ flags |= kDNSServiceFlagsWakeOnlyService;
+ printf("Setting kDNSServiceFlagsWakeOnlyService\n");
+ }
+
+ if (argc > 1 && !strcasecmp(argv[1], "-unicastResponse"))
+ {
+ argc--;
+ argv++;
+ flags |= kDNSServiceFlagsUnicastResponse;
+ printf("Setting kDNSServiceFlagsUnicastResponse\n");
+ }
+ if (argc > 1 && !strcasecmp(argv[1], "-timeout"))
+ {
+ argc--;
+ argv++;
+ flags |= kDNSServiceFlagsTimeout;
+ printf("Setting kDNSServiceFlagsTimeout\n");
+ }
+ if (argc > 1 && !strcasecmp(argv[1], "-optional"))
+ {
+ argc--;
+ argv++;
+ optional = 1;
+ printf("Setting DNSSEC optional flag\n");
+ }
+
+ if (argc > 2 && !strcmp(argv[1], "-i"))
+ {
+ opinterface = if_nametoindex(argv[2]);
+ if (!opinterface) opinterface = atoi(argv[2]);
+ if (!opinterface) { fprintf(stderr, "Unknown interface %s\n", argv[2]); goto Fail; }
+ argc -= 2;
+ argv += 2;
+ }
+
+ if (argc < 2) goto Fail; // Minimum command line is the command name and one argument
+ operation = getfirstoption(argc, argv, "EFBZLlRPQqCAUNTMISVHhD"
+ #if HAS_NAT_PMP_API
+ "X"
+ #endif
+ #if HAS_ADDRINFO_API
+ "Gg"
+ #endif
+ , &opi);
+ if (operation == -1) goto Fail;
+
+ if (opinterface) printf("Using interface %d\n", opinterface);
+
+ switch (operation)
+ {
+ case 'E': printf("Looking for recommended registration domains:\n");
+ err = DNSServiceEnumerateDomains(&client, kDNSServiceFlagsRegistrationDomains, opinterface, enum_reply, NULL);
+ break;
+
+ case 'F': printf("Looking for recommended browsing domains:\n");
+ err = DNSServiceEnumerateDomains(&client, kDNSServiceFlagsBrowseDomains, opinterface, enum_reply, NULL);
+ //enum_reply(client, kDNSServiceFlagsAdd, 0, 0, "nicta.com.au.", NULL);
+ //enum_reply(client, kDNSServiceFlagsAdd, 0, 0, "bonjour.nicta.com.au.", NULL);
+ //enum_reply(client, kDNSServiceFlagsAdd, 0, 0, "ibm.com.", NULL);
+ //enum_reply(client, kDNSServiceFlagsAdd, 0, 0, "dns-sd.ibm.com.", NULL);
+ break;
+
+ case 'B': typ = (argc < opi+1) ? "" : argv[opi+0];
+ dom = (argc < opi+2) ? "" : argv[opi+1]; // Missing domain argument is the same as empty string i.e. use system default(s)
+ typ = gettype(buffer, typ);
+ if (dom[0] == '.' && dom[1] == 0) dom[0] = 0; // We allow '.' on the command line as a synonym for empty string
+ printf("Browsing for %s%s%s\n", typ, dom[0] ? "." : "", dom);
+ err = DNSServiceBrowse(&client, flags, opinterface, typ, dom, browse_reply, NULL);
+ break;
+
+ case 'Z': typ = (argc < opi+1) ? "" : argv[opi+0];
+ dom = (argc < opi+2) ? "" : argv[opi+1]; // Missing domain argument is the same as empty string i.e. use system default(s)
+ typ = gettype(buffer, typ);
+ if (dom[0] == '.' && dom[1] == 0) dom[0] = 0; // We allow '.' on the command line as a synonym for empty string
+ printf("Browsing for %s%s%s\n", typ, dom[0] ? "." : "", dom);
+ err = DNSServiceCreateConnection(&client);
+ sc1 = client;
+ err = DNSServiceBrowse(&sc1, kDNSServiceFlagsShareConnection, opinterface, typ, dom, zonedata_browse, NULL);
+ break;
+
+ case 'l':
+ case 'L': {
+ if (argc < opi+2) goto Fail;
+ typ = (argc < opi+2) ? "" : argv[opi+1];
+ dom = (argc < opi+3) ? "local" : argv[opi+2];
+ typ = gettype(buffer, typ);
+ if (dom[0] == '.' && dom[1] == 0) dom = "local"; // We allow '.' on the command line as a synonym for "local"
+ printf("Lookup %s.%s.%s\n", argv[opi+0], typ, dom);
+ if (operation == 'l') flags |= kDNSServiceFlagsWakeOnResolve;
+ err = DNSServiceResolve(&client, flags, opinterface, argv[opi+0], typ, dom, resolve_reply, NULL);
+ break;
+ }
+
+ case 'R': if (argc < opi+4) goto Fail;
+ typ = (argc < opi+2) ? "" : argv[opi+1];
+ dom = (argc < opi+3) ? "" : argv[opi+2];
+ typ = gettype(buffer, typ);
+ if (dom[0] == '.' && dom[1] == 0) dom[0] = 0; // We allow '.' on the command line as a synonym for empty string
+ err = RegisterService(&client, argv[opi+0], typ, dom, NULL, argv[opi+3], argc-(opi+4), argv+(opi+4), flags);
+ break;
+
+
+ case 'P': if (argc < opi+6) goto Fail;
+ err = DNSServiceCreateConnection(&client_pa);
+ if (err) { fprintf(stderr, "DNSServiceCreateConnection returned %d\n", err); return(err); }
+ err = RegisterProxyAddressRecord(client_pa, argv[opi+4], argv[opi+5], flags);
+ if (err) break;
+ err = RegisterService(&client, argv[opi+0], gettype(buffer, argv[opi+1]), argv[opi+2], argv[opi+4], argv[opi+3], argc-(opi+6), argv+(opi+6), flags);
+ break;
+
+ case 'D':
+ case 'q':
+ case 'Q':
+ case 'C': {
+ uint16_t rrtype, rrclass;
+ flags |= kDNSServiceFlagsReturnIntermediates;
+ if (operation == 'q')
+ flags |= kDNSServiceFlagsSuppressUnusable;
+ if (argc < opi+1)
+ goto Fail;
+ rrtype = (argc <= opi+1) ? kDNSServiceType_A : GetRRType(argv[opi+1]);
+ rrclass = (argc <= opi+2) ? kDNSServiceClass_IN : GetRRClass(argv[opi+2]);
+ if (rrtype == kDNSServiceType_TXT || rrtype == kDNSServiceType_PTR)
+ flags |= kDNSServiceFlagsLongLivedQuery;
+ if (operation == 'D')
+ {
+ flags |= kDNSServiceFlagsSuppressUnusable;
+ if (optional)
+ flags |= kDNSServiceFlagsValidateOptional;
+ else
+ flags |= kDNSServiceFlagsValidate;
+ }
+ err = DNSServiceQueryRecord(&client, flags, opinterface, argv[opi+0], rrtype, rrclass, qr_reply, NULL);
+ break;
+ }
+
+ case 'A':
+ case 'U':
+ case 'N': {
+ Opaque16 registerPort = { { 0x12, 0x34 } };
+ static const char TXT[] = "\xC" "First String" "\xD" "Second String" "\xC" "Third String";
+ printf("Registering Service Test._testupdate._tcp.local.\n");
+ err = DNSServiceRegister(&client, 0, opinterface, "Test", "_testupdate._tcp.", "", NULL, registerPort.NotAnInteger, sizeof(TXT)-1, TXT, reg_reply, NULL);
+ break;
+ }
+
+ case 'T': {
+ Opaque16 registerPort = { { 0x23, 0x45 } };
+ char TXT[1024];
+ unsigned int i;
+ for (i=0; i<sizeof(TXT); i++)
+ if ((i & 0x1F) == 0) TXT[i] = 0x1F;else TXT[i] = 'A' + (i >> 5);
+ printf("Registering Service Test._testlargetxt._tcp.local.\n");
+ err = DNSServiceRegister(&client, 0, opinterface, "Test", "_testlargetxt._tcp.", "", NULL, registerPort.NotAnInteger, sizeof(TXT), TXT, reg_reply, NULL);
+ break;
+ }
+
+ case 'M': {
+ pid_t pid = getpid();
+ Opaque16 registerPort = { { pid >> 8, pid & 0xFF } };
+ static const char TXT1[] = "\xC" "First String" "\xD" "Second String" "\xC" "Third String";
+ static const char TXT2[] = "\xD" "Fourth String" "\xC" "Fifth String" "\xC" "Sixth String";
+ printf("Registering Service Test._testdualtxt._tcp.local.\n");
+ err = DNSServiceRegister(&client, flags, opinterface, "Test", "_testdualtxt._tcp.", "", NULL, registerPort.NotAnInteger, sizeof(TXT1)-1, TXT1, reg_reply, NULL);
+ if (!err) err = DNSServiceAddRecord(client, &record, flags, kDNSServiceType_TXT, sizeof(TXT2)-1, TXT2, 0);
+ break;
+ }
+
+ case 'I': {
+ pid_t pid = getpid();
+ Opaque16 registerPort = { { pid >> 8, pid & 0xFF } };
+ static const char TXT[] = "\x09" "Test Data";
+ printf("Registering Service Test._testtxt._tcp.local.\n");
+ err = DNSServiceRegister(&client, 0, opinterface, "Test", "_testtxt._tcp.", "", NULL, registerPort.NotAnInteger, 0, NULL, reg_reply, NULL);
+ if (!err) err = DNSServiceUpdateRecord(client, NULL, 0, sizeof(TXT)-1, TXT, 0);
+ break;
+ }
+
+#if HAS_NAT_PMP_API
+ case 'X': {
+ if (argc == opi) // If no arguments, just fetch IP address
+ err = DNSServiceNATPortMappingCreate(&client, 0, 0, 0, 0, 0, 0, port_mapping_create_reply, NULL);
+ else if (argc >= opi+2 && atoi(argv[opi+0]) == 0)
+ {
+ DNSServiceProtocol prot = GetProtocol(argv[opi+0]); // Must specify TCP or UDP
+ uint16_t IntPortAsNumber = atoi(argv[opi+1]); // Must specify internal port
+ uint16_t ExtPortAsNumber = (argc < opi+3) ? 0 : atoi(argv[opi+2]); // Optional desired external port
+ uint32_t ttl = (argc < opi+4) ? 0 : atoi(argv[opi+3]); // Optional desired lease lifetime
+ Opaque16 intp = { { IntPortAsNumber >> 8, IntPortAsNumber & 0xFF } };
+ Opaque16 extp = { { ExtPortAsNumber >> 8, ExtPortAsNumber & 0xFF } };
+ err = DNSServiceNATPortMappingCreate(&client, 0, 0, prot, intp.NotAnInteger, extp.NotAnInteger, ttl, port_mapping_create_reply, NULL);
+ }
+ else goto Fail;
+ break;
+ }
+#endif
+
+#if HAS_ADDRINFO_API
+ case 'g':
+ case 'G': {
+ flags |= kDNSServiceFlagsReturnIntermediates;
+ if (operation == 'g')
+ {
+ flags |= kDNSServiceFlagsSuppressUnusable;
+ if (optional)
+ flags |= kDNSServiceFlagsValidateOptional;
+ else
+ flags |= kDNSServiceFlagsValidate;
+ }
+ if (argc != opi+2)
+ goto Fail;
+ else
+ err = DNSServiceGetAddrInfo(&client, flags, opinterface, GetProtocol(argv[opi+0]), argv[opi+1], addrinfo_reply, NULL);
+ break;
+ }
+#endif
+
+ case 'S': {
+ Opaque16 registerPort = { { 0x23, 0x45 } }; // 9029 decimal
+ unsigned char txtrec[16] = "\xF" "/path=test.html";
+ DNSRecordRef rec;
+ unsigned char nulrec[4] = "1234";
+
+ err = DNSServiceCreateConnection(&client);
+ if (err) { fprintf(stderr, "DNSServiceCreateConnection failed %ld\n", (long int)err); return (-1); }
+
+ sc1 = client;
+ err = DNSServiceBrowse(&sc1, kDNSServiceFlagsShareConnection, opinterface, "_http._tcp", "", browse_reply, NULL);
+ if (err) { fprintf(stderr, "DNSServiceBrowse _http._tcp failed %ld\n", (long int)err); return (-1); }
+
+ sc2 = client;
+ err = DNSServiceBrowse(&sc2, kDNSServiceFlagsShareConnection, opinterface, "_ftp._tcp", "", browse_reply, NULL);
+ if (err) { fprintf(stderr, "DNSServiceBrowse _ftp._tcp failed %ld\n", (long int)err); return (-1); }
+
+ sc3 = client;
+ err = DNSServiceRegister(&sc3, kDNSServiceFlagsShareConnection, opinterface, "kDNSServiceFlagsShareConnection",
+ "_http._tcp", "local", NULL, registerPort.NotAnInteger, 0, NULL, reg_reply, NULL);
+ if (err) { fprintf(stderr, "SharedConnection DNSServiceRegister failed %ld\n", (long int)err); return (-1); }
+
+ err = DNSServiceUpdateRecord(sc3, NULL, 0, sizeof(txtrec), txtrec, 0);
+ if (err) { fprintf(stderr, "SharedConnection DNSServiceUpdateRecord failed %ld\n", (long int)err); return (-1); }
+
+ err = DNSServiceAddRecord(sc3, &rec, 0, kDNSServiceType_NULL, sizeof(nulrec), nulrec, 0);
+ if (err) { fprintf(stderr, "SharedConnection DNSServiceAddRecord failed %ld\n", (long int)err); return (-1); }
+
+ err = DNSServiceRemoveRecord(sc3, rec, 0);
+ if (err) { fprintf(stderr, "SharedConnection DNSServiceRemoveRecord failed %ld\n", (long int)err); return (-1); }
+
+ break;
+ }
+
+ case 'V': {
+ uint32_t v;
+ uint32_t size = sizeof(v);
+ err = DNSServiceGetProperty(kDNSServiceProperty_DaemonVersion, &v, &size);
+ if (err) fprintf(stderr, "DNSServiceGetProperty failed %ld\n", (long int)err);
+ else printf("Currently running daemon (system service) is version %d.%d.%d\n", v / 10000, v / 100 % 100, v % 100);
+ exit(0);
+ }
+
+ case 'H': goto Fail;
+
+ default: goto Fail;
+ }
+
+ if (!client || err != kDNSServiceErr_NoError) { fprintf(stderr, "DNSService call failed %ld\n", (long int)err); return (-1); }
+ printtimestamp();
+ printf("...STARTING...\n");
+ HandleEvents();
+
+ // Be sure to deallocate the DNSServiceRef when you're finished
+ if (client ) DNSServiceRefDeallocate(client );
+ if (client_pa) DNSServiceRefDeallocate(client_pa);
+ return 0;
+
+Fail:
+ if (operation == 'H') print_usage(a0,1);
+ else print_usage(a0,0);
+ return 0;
+
+}
+
+// Note: The C preprocessor stringify operator ('#') makes a string from its argument, without macro expansion
+// e.g. If "version" is #define'd to be "4", then STRINGIFY_AWE(version) will return the string "version", not "4"
+// To expand "version" to its value before making the string, use STRINGIFY(version) instead
+#define STRINGIFY_ARGUMENT_WITHOUT_EXPANSION(s) # s
+#define STRINGIFY(s) STRINGIFY_ARGUMENT_WITHOUT_EXPANSION(s)
+
+// NOT static -- otherwise the compiler may optimize it out
+// The "@(#) " pattern is a special prefix the "what" command looks for
+const char VersionString_SCCS[] = "@(#) dns-sd " STRINGIFY(mDNSResponderVersion) " (" __DATE__ " " __TIME__ ")";
+
+#if _BUILDING_XCODE_PROJECT_
+// If the process crashes, then this string will be magically included in the automatically-generated crash log
+const char *__crashreporter_info__ = VersionString_SCCS + 5;
+asm (".desc ___crashreporter_info__, 0x10");
+#endif
diff --git a/mDNSResponder/Clients/dnsctl.c b/mDNSResponder/Clients/dnsctl.c
new file mode 100644
index 00000000..f040e1fb
--- /dev/null
+++ b/mDNSResponder/Clients/dnsctl.c
@@ -0,0 +1,177 @@
+/* -*- Mode: C; tab-width: 4 -*-
+ *
+ * Copyright (c) 2012 Apple Inc. All rights reserved.
+ *
+ * dnsctl.c
+ * Command-line tool using libdns_services.dylib
+ *
+ * To build only this tool, copy and paste the following on the command line:
+ * On Apple 64bit Platforms ONLY OSX/iOS:
+ * clang -Wall dnsctl.c /usr/lib/libdns_services.dylib -o dnsctl
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/time.h>
+#include <net/if.h> // if_nametoindex()
+
+#include <dispatch/dispatch.h>
+#include "dns_services.h"
+
+//*************************************************************************************************************
+// Globals:
+//*************************************************************************************************************
+
+static const char kFilePathSep = '/';
+static DNSXConnRef ClientRef = NULL;
+
+//*************************************************************************************************************
+// Utility Funcs:
+//*************************************************************************************************************
+
+static void printtimestamp(void)
+{
+ struct tm tm;
+ int ms;
+ static char date[16];
+ static char new_date[16];
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ localtime_r((time_t*)&tv.tv_sec, &tm);
+ ms = tv.tv_usec/1000;
+ strftime(new_date, sizeof(new_date), "%a %d %b %Y", &tm);
+ //display date only if it has changed
+ if (strncmp(date, new_date, sizeof(new_date)))
+ {
+ printf("DATE: ---%s---\n", new_date);
+ strncpy(date, new_date, sizeof(date));
+ }
+ printf("%2d:%02d:%02d.%03d ", tm.tm_hour, tm.tm_min, tm.tm_sec, ms);
+}
+
+static void print_usage(const char *arg0)
+{
+ fprintf(stderr, "%s USAGE: \n", arg0);
+ fprintf(stderr, "%s -DP Enable DNS Proxy with Default Parameters \n", arg0);
+ fprintf(stderr, "%s -DP [-o <output interface>] [-i <input interface(s)>] Enable DNS Proxy \n", arg0);
+}
+
+//*************************************************************************************************************
+// CallBack Funcs:
+//*************************************************************************************************************
+
+// DNSXEnableProxy Callback from the Daemon
+static void dnsproxy_reply(DNSXConnRef connRef, DNSXErrorType errCode)
+{
+ (void) connRef;
+ printtimestamp();
+ switch (errCode)
+ {
+ case kDNSX_NoError : printf(" SUCCESS \n"); break;
+ case kDNSX_DictError : printf(" DICT ERROR \n"); break;
+ case kDNSX_DaemonNotRunning : printf(" NO DAEMON \n");
+ DNSXRefDeAlloc(ClientRef); break;
+ case kDNSX_Engaged : printf(" ENGAGED \n");
+ DNSXRefDeAlloc(ClientRef); break;
+ case kDNSX_UnknownErr :
+ default : printf("UNKNOWN ERR \n");
+ DNSXRefDeAlloc(ClientRef); break;
+ }
+
+}
+
+//*************************************************************************************************************
+
+int main(int argc, char **argv)
+{
+ DNSXErrorType err;
+
+ // Default i/p intf is lo0 and o/p intf is primary interface
+ IfIndex Ipintfs[MaxInputIf] = {1, 0, 0, 0, 0};
+ IfIndex Opintf = kDNSIfindexAny;
+
+ // Extract program name from argv[0], which by convention contains the path to this executable
+ const char *a0 = strrchr(argv[0], kFilePathSep) + 1;
+ if (a0 == (const char *)1)
+ a0 = argv[0];
+
+ // Must run as root
+ if (0 != geteuid())
+ {
+ fprintf(stderr, "%s MUST run as root!!\n", a0);
+ exit(-1);
+ }
+ if ((sizeof(argv) == 8))
+ printf("dnsctl running in 64-bit mode\n");
+ else if ((sizeof(argv) == 4))
+ printf("dnsctl running in 32-bit mode\n");
+
+ // expects atleast one argument
+ if (argc < 2)
+ goto Usage;
+
+ if ( !strcmp(argv[1], "-DP") || !strcmp(argv[1], "-dp") )
+ {
+ if (argc == 2)
+ {
+ printtimestamp();
+ printf("Proceeding to Enable DNSProxy on mDNSResponder with Default Parameters\n");
+ dispatch_queue_t my_Q = dispatch_queue_create("com.apple.dnsctl.callback_queue", NULL);
+ err = DNSXEnableProxy(&ClientRef, kDNSProxyEnable, Ipintfs, Opintf, my_Q, dnsproxy_reply);
+ }
+ else if (argc > 2)
+ {
+ argc--;
+ argv++;
+ if (!strcmp(argv[1], "-o"))
+ {
+ Opintf = if_nametoindex(argv[2]);
+ if (!Opintf)
+ Opintf = atoi(argv[2]);
+ if (!Opintf)
+ {
+ fprintf(stderr, "Could not parse o/p interface [%s]: Passing default primary \n", argv[2]);
+ Opintf = kDNSIfindexAny;
+ }
+ argc -= 2;
+ argv += 2;
+ }
+ if (argc > 2 && !strcmp(argv[1], "-i"))
+ {
+ int i;
+ argc--;
+ argv++;
+ for (i = 0; i < MaxInputIf && argc > 1; i++)
+ {
+ Ipintfs[i] = if_nametoindex(argv[1]);
+ if (!Ipintfs[i])
+ Ipintfs[i] = atoi(argv[1]);
+ if (!Ipintfs[i])
+ {
+ fprintf(stderr, "Could not parse i/p interface [%s]: Passing default lo0 \n", argv[2]);
+ Ipintfs[i] = 1;
+ }
+ argc--;
+ argv++;
+ }
+ }
+ printtimestamp();
+ printf("Proceeding to Enable DNSProxy on mDNSResponder \n");
+ dispatch_queue_t my_Q = dispatch_queue_create("com.apple.dnsctl.callback_queue", NULL);
+ err = DNSXEnableProxy(&ClientRef, kDNSProxyEnable, Ipintfs, Opintf, my_Q, dnsproxy_reply);
+ }
+ }
+ else
+ {
+ goto Usage;
+ }
+
+ dispatch_main();
+
+Usage:
+ print_usage(a0);
+ return 0;
+}
+
diff --git a/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.manifest b/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.manifest
new file mode 100755
index 00000000..554f590b
--- /dev/null
+++ b/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.manifest
@@ -0,0 +1,12 @@
+<?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.mDNSNetMonitor" type="win32"/>
+ <description>mDNSNetMonitor command line utility.</description>
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+</assembly>
diff --git a/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.rc b/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.rc
new file mode 100644
index 00000000..2c0b25c3
--- /dev/null
+++ b/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.rc
@@ -0,0 +1,103 @@
+// 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"
+ "\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 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", MASTER_COMPANY_NAME
+ VALUE "FileDescription", "Bonjour Network Utility"
+ VALUE "FileVersion", MASTER_PROD_VERS_STR
+ VALUE "InternalName", "mDNSNetMonitor.exe"
+ VALUE "LegalCopyright", MASTER_LEGAL_COPYRIGHT
+ VALUE "OriginalFilename", "mDNSNetMonitor.exe"
+ 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/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcproj b/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcproj
new file mode 100755
index 00000000..82e17e38
--- /dev/null
+++ b/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcproj
@@ -0,0 +1,296 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="mDNSNetMonitor"
+ ProjectGUID="{AF35C285-528D-46A1-8A0E-47B0733DC718}"
+ RootNamespace="mDNSNetMonitor"
+ Keyword="Win32Proj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="1"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../mDNSWindows/SystemService;../../mDNSWindows;../../mDNSShared;../../mDNSCore;&quot;$(VCInstallDir)include&quot;;&quot;$(VCInstallDir)atlmfc\include&quot;;&quot;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include&quot;"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;MDNS_DEBUGMSGS=0;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE=&quot;&quot;&quot;&quot;;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_USE_32BIT_TIME_T"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="4"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"
+ AdditionalDependencies="ws2_32.lib iphlpapi.lib crypt32.lib netapi32.lib powrprof.lib"
+ LinkIncremental="2"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="mDNSNetMonitor.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"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="../../mDNSWindows/SystemService;../../mDNSWindows;../../mDNSShared;../../mDNSCore;&quot;$(VCInstallDir)include&quot;;&quot;$(VCInstallDir)atlmfc\include&quot;;&quot;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include&quot;"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;MDNS_DEBUGMSGS=0;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE=&quot;&quot;&quot;&quot;;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_USE_32BIT_TIME_T"
+ RuntimeLibrary="2"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="true"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ AdditionalIncludeDirectories="../../mDNSWindows"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/NXCOMPAT /DYNAMICBASE /SAFESEH"
+ AdditionalDependencies="ws2_32.lib iphlpapi.lib crypt32.lib netapi32.lib powrprof.lib"
+ LinkIncremental="1"
+ GenerateDebugInformation="true"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ AdditionalManifestFiles="mDNSNetMonitor.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;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+ >
+ <File
+ RelativePath="..\..\mDNSCore\DNSCommon.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSCore\DNSDigest.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSShared\dnssd_ipc.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\SystemService\Firewall.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSShared\GenLinkedList.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSShared\mDNSDebug.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\mDNSWin32.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSPosix\NetMonitor.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\PosixCompat.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\Secret.c"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSCore\uDNS.c"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+ >
+ <File
+ RelativePath="..\..\mDNSCore\DNSCommon.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSShared\dnssd_ipc.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\SystemService\Firewall.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSShared\GenLinkedList.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSCore\mDNSDebug.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSCore\mDNSEmbeddedAPI.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\mDNSWin32.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\PosixCompat.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\RegNames.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSWindows\Secret.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\mDNSCore\uDNS.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=".\mDNSNetMonitor.rc"
+ >
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj b/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj
new file mode 100755
index 00000000..89a27a4d
--- /dev/null
+++ b/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj
@@ -0,0 +1,241 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{AF35C285-528D-46A1-8A0E-47B0733DC718}</ProjectGuid>
+ <RootNamespace>mDNSNetMonitor</RootNamespace>
+ <Keyword>Win32Proj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../mDNSWindows/SystemService;../../mDNSWindows;../../mDNSShared;../../mDNSCore;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;MDNS_DEBUGMSGS=0;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE=;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MinimalRebuild>true</MinimalRebuild>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;crypt32.lib;netapi32.lib;powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <TargetMachine>MachineX86</TargetMachine>
+ <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>mDNSNetMonitor.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../../mDNSWindows/SystemService;../../mDNSWindows;../../mDNSShared;../../mDNSCore;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0501;MDNS_DEBUGMSGS=0;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE=;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;crypt32.lib;netapi32.lib;powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>mDNSNetMonitor.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../mDNSWindows/SystemService;../../mDNSWindows;../../mDNSShared;../../mDNSCore;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;MDNS_DEBUGMSGS=0;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE=;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;_USE_32BIT_TIME_T;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE /SAFESEH %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;crypt32.lib;netapi32.lib;powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <TargetMachine>MachineX86</TargetMachine>
+ <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>mDNSNetMonitor.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <AdditionalIncludeDirectories>../../mDNSWindows/SystemService;../../mDNSWindows;../../mDNSShared;../../mDNSCore;$(VCInstallDir)include;$(VCInstallDir)atlmfc\include;C:/Program Files/Microsoft SDKs/Windows/v6.1/Include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_WIN32_WINNT=0x0501;MDNS_DEBUGMSGS=0;TARGET_OS_WIN32;WIN32_LEAN_AND_MEAN;USE_TCP_LOOPBACK;PLATFORM_NO_STRSEP;PLATFORM_NO_EPIPE;PLATFORM_NO_RLIMIT;PID_FILE=;UNICODE;_UNICODE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <PrecompiledHeader>
+ </PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <ResourceCompile>
+ <AdditionalIncludeDirectories>../../mDNSWindows;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Link>
+ <AdditionalOptions>/NXCOMPAT /DYNAMICBASE %(AdditionalOptions)</AdditionalOptions>
+ <AdditionalDependencies>ws2_32.lib;iphlpapi.lib;crypt32.lib;netapi32.lib;powrprof.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
+ </Link>
+ <Manifest>
+ <AdditionalManifestFiles>mDNSNetMonitor.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
+ </Manifest>
+ <PostBuildEvent>
+ <Command>if not "%RC_XBS%" == "YES" goto END
+if not exist "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)" mkdir "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"
+xcopy /I/Y "$(TargetPath)" "$(DSTROOT)\Program Files\Bonjour SDK\bin\$(Platform)"
+:END
+</Command>
+ </PostBuildEvent>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\mDNSCore\anonymous.c" />
+ <ClCompile Include="..\..\mDNSCore\CryptoAlg.c" />
+ <ClCompile Include="..\..\mDNSCore\DNSCommon.c" />
+ <ClCompile Include="..\..\mDNSCore\DNSDigest.c" />
+ <ClCompile Include="..\..\mDNSShared\dnssd_ipc.c" />
+ <ClCompile Include="..\..\mDNSWindows\Poll.c" />
+ <ClCompile Include="..\..\mDNSWindows\SystemService\Firewall.cpp" />
+ <ClCompile Include="..\..\mDNSShared\GenLinkedList.c" />
+ <ClCompile Include="..\..\mDNSShared\mDNSDebug.c" />
+ <ClCompile Include="..\..\mDNSWindows\mDNSWin32.c" />
+ <ClCompile Include="..\..\mDNSPosix\NetMonitor.c" />
+ <ClCompile Include="..\..\mDNSWindows\PosixCompat.c" />
+ <ClCompile Include="..\..\mDNSWindows\Secret.c" />
+ <ClCompile Include="..\..\mDNSCore\uDNS.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\mDNSCore\anonymous.h" />
+ <ClInclude Include="..\..\mDNSCore\CryptoAlg.h" />
+ <ClInclude Include="..\..\mDNSCore\DNSCommon.h" />
+ <ClInclude Include="..\..\mDNSShared\dnssd_ipc.h" />
+ <ClInclude Include="..\..\mDNSWindows\Poll.h" />
+ <ClInclude Include="..\..\mDNSWindows\SystemService\Firewall.h" />
+ <ClInclude Include="..\..\mDNSShared\GenLinkedList.h" />
+ <ClInclude Include="..\..\mDNSCore\mDNSDebug.h" />
+ <ClInclude Include="..\..\mDNSCore\mDNSEmbeddedAPI.h" />
+ <ClInclude Include="..\..\mDNSWindows\mDNSWin32.h" />
+ <ClInclude Include="..\..\mDNSWindows\PosixCompat.h" />
+ <ClInclude Include="..\..\mDNSWindows\RegNames.h" />
+ <ClInclude Include="..\..\mDNSWindows\Secret.h" />
+ <ClInclude Include="..\..\mDNSCore\uDNS.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="mDNSNetMonitor.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\mDNSWindows\SystemService\Service.vcxproj">
+ <Project>{c1d98254-ba27-4427-a3be-a68ca2cc5f69}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj.filters b/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj.filters
new file mode 100755
index 00000000..b9a25beb
--- /dev/null
+++ b/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/mDNSNetMonitor.vcxproj.filters
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\mDNSCore\DNSCommon.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSCore\DNSDigest.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSShared\dnssd_ipc.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSWindows\SystemService\Firewall.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSShared\GenLinkedList.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSShared\mDNSDebug.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSWindows\mDNSWin32.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSPosix\NetMonitor.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSWindows\PosixCompat.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSWindows\Secret.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSCore\uDNS.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSWindows\Poll.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSCore\anonymous.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\mDNSCore\CryptoAlg.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\..\mDNSCore\DNSCommon.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSShared\dnssd_ipc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSWindows\SystemService\Firewall.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSShared\GenLinkedList.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSCore\mDNSDebug.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSCore\mDNSEmbeddedAPI.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSWindows\mDNSWin32.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSWindows\PosixCompat.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSWindows\RegNames.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSWindows\Secret.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSCore\uDNS.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSWindows\Poll.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSCore\anonymous.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\..\mDNSCore\CryptoAlg.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="mDNSNetMonitor.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/resource.h b/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/resource.h
new file mode 100644
index 00000000..31ad9f0e
--- /dev/null
+++ b/mDNSResponder/Clients/mDNSNetMonitor.VisualStudio/resource.h
@@ -0,0 +1,14 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by mDNSNetMonitor.rc
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 101
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1001
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif