]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSWindows/ControlPanel/ConfigPropertySheet.h
mDNSResponder-214.3.2.tar.gz
[apple/mdnsresponder.git] / mDNSWindows / ControlPanel / ConfigPropertySheet.h
1 /* -*- Mode: C; tab-width: 4 -*-
2 *
3 * Copyright (c) 2002-2004 Apple Computer, Inc. All rights reserved.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16
17 Change History (most recent first):
18
19 $Log: ConfigPropertySheet.h,v $
20 Revision 1.7 2009/07/01 19:20:37 herscher
21 <rdar://problem/6713286> UI changes for configuring sleep proxy settings.
22
23 Revision 1.6 2009/03/30 19:58:47 herscher
24 <rdar://problem/5925472> Current Bonjour code does not compile on Windows
25 <rdar://problem/5187308> Move build train to Visual Studio 2005
26
27 Revision 1.5 2006/08/14 23:25:28 cheshire
28 Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
29
30 Revision 1.4 2005/03/03 19:55:21 shersche
31 <rdar://problem/4034481> ControlPanel source code isn't saving CVS log info
32
33
34 */
35
36 #ifndef _ConfigPropertySheet_h
37 #define _ConfigPropertySheet_h
38
39 #include "stdafx.h"
40 #include "FirstPage.h"
41 #include "SecondPage.h"
42 #include "ThirdPage.h"
43 #include "FourthPage.h"
44
45 #include <RegNames.h>
46 #include <dns_sd.h>
47 #include <list>
48
49
50 //---------------------------------------------------------------------------------------------------------------------------
51 // CConfigPropertySheet
52 //---------------------------------------------------------------------------------------------------------------------------
53
54 class CConfigPropertySheet : public CPropertySheet
55 {
56 public:
57
58 CConfigPropertySheet();
59 virtual ~CConfigPropertySheet();
60
61 typedef std::list<CString> StringList;
62
63 StringList m_browseDomains;
64 StringList m_regDomains;
65
66 protected:
67
68 CFirstPage m_firstPage;
69 CSecondPage m_secondPage;
70 CThirdPage m_thirdPage;
71 CFourthPage m_fourthPage;
72
73 //{{AFX_VIRTUAL(CConfigPropertySheet)
74 //}}AFX_VIRTUAL
75
76 DECLARE_DYNCREATE(CConfigPropertySheet)
77
78 //{{AFX_MSG(CConfigPropertySheet)
79 //}}AFX_MSG
80 DECLARE_MESSAGE_MAP()
81
82 afx_msg BOOL OnInitDialog();
83 afx_msg BOOL OnCommand( WPARAM wParam, LPARAM lParam );
84 afx_msg LRESULT OnDataReady( WPARAM inWParam, LPARAM inLParam );
85 afx_msg LRESULT OnRegistryChanged( WPARAM inWParam, LPARAM inLParam );
86 void OnEndDialog();
87
88 private:
89
90 OSStatus
91 SetupBrowsing();
92
93 OSStatus
94 TearDownBrowsing();
95
96 OSStatus
97 SetupRegistryNotifications();
98
99 OSStatus
100 TearDownRegistryNotifications();
101
102 OSStatus
103 DecodeDomainName( const char * raw, CString & decoded );
104
105 const char*
106 GetNextLabel( const char * cstr, char label[64] );
107
108 static void DNSSD_API
109 BrowseDomainsReply
110 (
111 DNSServiceRef sdRef,
112 DNSServiceFlags flags,
113 uint32_t interfaceIndex,
114 DNSServiceErrorType errorCode,
115 const char * replyDomain,
116 void * context
117 );
118
119 static void DNSSD_API
120 RegDomainsReply
121 (
122 DNSServiceRef sdRef,
123 DNSServiceFlags flags,
124 uint32_t interfaceIndex,
125 DNSServiceErrorType errorCode,
126 const char * replyDomain,
127 void * context
128 );
129
130 // This thread will watch for registry changes
131
132 static unsigned WINAPI
133 WatchRegistry
134 (
135 LPVOID inParam
136 );
137
138 HKEY m_statusKey;
139 HANDLE m_thread;
140 HANDLE m_threadExited;
141 DNSServiceRef m_browseDomainsRef;
142 DNSServiceRef m_regDomainsRef;
143 CRITICAL_SECTION m_lock;
144 };
145
146
147 #endif