]> git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSWindows/ControlPanel/ConfigPropertySheet.h
mDNSResponder-107.6.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.5 2006/08/14 23:25:28 cheshire
21 Re-licensed mDNSResponder daemon source code under Apache License, Version 2.0
22
23 Revision 1.4 2005/03/03 19:55:21 shersche
24 <rdar://problem/4034481> ControlPanel source code isn't saving CVS log info
25
26
27 */
28
29 #ifndef _ConfigPropertySheet_h
30 #define _ConfigPropertySheet_h
31
32 #include "stdafx.h"
33 #include "FirstPage.h"
34 #include "SecondPage.h"
35 #include "ThirdPage.h"
36
37 #include <RegNames.h>
38 #include <dns_sd.h>
39 #include <list>
40
41
42 //---------------------------------------------------------------------------------------------------------------------------
43 // CConfigPropertySheet
44 //---------------------------------------------------------------------------------------------------------------------------
45
46 class CConfigPropertySheet : public CPropertySheet
47 {
48 public:
49
50 CConfigPropertySheet();
51 virtual ~CConfigPropertySheet();
52
53 typedef std::list<CString> StringList;
54
55 StringList m_browseDomains;
56 StringList m_regDomains;
57
58 protected:
59
60 CFirstPage m_firstPage;
61 CSecondPage m_secondPage;
62 CThirdPage m_thirdPage;
63
64 //{{AFX_VIRTUAL(CConfigPropertySheet)
65 //}}AFX_VIRTUAL
66
67 DECLARE_DYNCREATE(CConfigPropertySheet)
68
69 //{{AFX_MSG(CConfigPropertySheet)
70 //}}AFX_MSG
71 DECLARE_MESSAGE_MAP()
72
73 afx_msg BOOL OnInitDialog();
74 afx_msg BOOL OnCommand( WPARAM wParam, LPARAM lParam );
75
76 afx_msg LONG OnDataReady( WPARAM inWParam, LPARAM inLParam );
77
78 afx_msg LONG OnRegistryChanged( WPARAM inWParam, LPARAM inLParam );
79
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