]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSWindows/ControlPanel/ConfigPropertySheet.h
mDNSResponder-107.tar.gz
[apple/mdnsresponder.git] / mDNSWindows / ControlPanel / ConfigPropertySheet.h
1 /*
2 * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22
23 Change History (most recent first):
24
25 $Log: ConfigPropertySheet.h,v $
26 Revision 1.4 2005/03/03 19:55:21 shersche
27 <rdar://problem/4034481> ControlPanel source code isn't saving CVS log info
28
29
30 */
31
32 #ifndef _ConfigPropertySheet_h
33 #define _ConfigPropertySheet_h
34
35 #include "stdafx.h"
36 #include "FirstPage.h"
37 #include "SecondPage.h"
38 #include "ThirdPage.h"
39
40 #include <RegNames.h>
41 #include <dns_sd.h>
42 #include <list>
43
44
45 //---------------------------------------------------------------------------------------------------------------------------
46 // CConfigPropertySheet
47 //---------------------------------------------------------------------------------------------------------------------------
48
49 class CConfigPropertySheet : public CPropertySheet
50 {
51 public:
52
53 CConfigPropertySheet();
54 virtual ~CConfigPropertySheet();
55
56 typedef std::list<CString> StringList;
57
58 StringList m_browseDomains;
59 StringList m_regDomains;
60
61 protected:
62
63 CFirstPage m_firstPage;
64 CSecondPage m_secondPage;
65 CThirdPage m_thirdPage;
66
67 //{{AFX_VIRTUAL(CConfigPropertySheet)
68 //}}AFX_VIRTUAL
69
70 DECLARE_DYNCREATE(CConfigPropertySheet)
71
72 //{{AFX_MSG(CConfigPropertySheet)
73 //}}AFX_MSG
74 DECLARE_MESSAGE_MAP()
75
76 afx_msg BOOL OnInitDialog();
77 afx_msg BOOL OnCommand( WPARAM wParam, LPARAM lParam );
78 afx_msg LONG OnDataReady( WPARAM inWParam, LPARAM inLParam );
79 afx_msg LONG OnRegistryChanged( WPARAM inWParam, LPARAM inLParam );
80 void OnEndDialog();
81
82 private:
83
84 OSStatus
85 SetupBrowsing();
86
87 OSStatus
88 TearDownBrowsing();
89
90 OSStatus
91 SetupRegistryNotifications();
92
93 OSStatus
94 TearDownRegistryNotifications();
95
96 OSStatus
97 DecodeDomainName( const char * raw, CString & decoded );
98
99 const char*
100 GetNextLabel( const char * cstr, char label[64] );
101
102 static void DNSSD_API
103 BrowseDomainsReply
104 (
105 DNSServiceRef sdRef,
106 DNSServiceFlags flags,
107 uint32_t interfaceIndex,
108 DNSServiceErrorType errorCode,
109 const char * replyDomain,
110 void * context
111 );
112
113 static void DNSSD_API
114 RegDomainsReply
115 (
116 DNSServiceRef sdRef,
117 DNSServiceFlags flags,
118 uint32_t interfaceIndex,
119 DNSServiceErrorType errorCode,
120 const char * replyDomain,
121 void * context
122 );
123
124 // This thread will watch for registry changes
125
126 static unsigned WINAPI
127 WatchRegistry
128 (
129 LPVOID inParam
130 );
131
132 HKEY m_statusKey;
133 HANDLE m_thread;
134 HANDLE m_threadExited;
135 DNSServiceRef m_browseDomainsRef;
136 DNSServiceRef m_regDomainsRef;
137 CRITICAL_SECTION m_lock;
138 };
139
140
141 #endif