Initial import of KFW 3.2.2 Leash32 code
[krb5.git] / src / windows / leash / Leash.h
1 //      **************************************************************************************
2 //      File:                   Leash.h
3 //      By:                             Arthur David Leather
4 //      Created:                12/02/98
5 //      Copyright               @1998 Massachusetts Institute of Technology - All rights reserved.
6 //      Description:    H file for Leash.cpp. Contains variables and functions
7 //                                      for Leash
8 //
9 //      History:
10 //
11 //      MM/DD/YY        Inits   Description of Change
12 //      12/02/98        ADL             Original
13 //      **************************************************************************************
14
15
16 #if !defined(AFX_Leash_H__6F45AD91_561B_11D0_8FCF_00C04FC2A0C2__INCLUDED_)
17 #define AFX_Leash_H__6F45AD91_561B_11D0_8FCF_00C04FC2A0C2__INCLUDED_
18
19 #if _MSC_VER >= 1000
20 #pragma once
21 #endif // _MSC_VER >= 1000
22
23 #ifndef __AFXWIN_H__
24         #error include 'stdafx.h' before including this file for PCH
25 #endif
26
27 // Help
28 #define HID_GET_TICKETS_COMMAND                 98312
29 #define HID_DESTROY_TICKETS_COMMAND     98313
30 #define HID_SYNCHRONIZE_TIME_OPTION     98314
31 #define HID_CHANGE_PASSWORD_COMMAND             98315
32 #define HID_UPDATE_DISPLAY_COMMAND      98316
33 #define HID_DEBUG_WINDOW_OPTION                 98317
34 #define HID_LEASH_PROGRAM               98319
35 #define HID_ABOUT_KERBEROS              98320
36 #define HID_LARGE_ICONS_OPTION          98322
37 #define HID_DESTROY_TICKETS_ON_EXIT             98321
38 #define HID_UPPERCASE_REALM_OPTION      98323
39 #define HID_RESET_WINDOW_OPTION                 98326
40 #define HID_AFS_PROPERTIES_COMMAND              98327
41 #define HID_KRB4_PROPERTIES_COMMAND             98329
42 #define HID_KRB5_PROPERTIES_COMMAND             98330
43 #define HID_LEASH_PROPERTIES_COMMAND    98331
44 #define HID_LOW_TICKET_ALARM_OPTION             98334
45 #define HID_KRBCHECK_OPTION                             98335
46 #define HID_KERBEROS_PROPERTIES_COMMAND 98337
47 #define HID_HELP_CONTENTS               98340
48 #define HID_WHY_USE_LEASH32                             98341
49
50 #define HID_ABOUT_LEASH32_COMMAND       123200
51 #define HID_EXIT_COMMAND                123201
52 #define HID_TOOLBAR_OPTION                              124928
53 #define HID_STATUS_BAR_OPTION           124929
54 #define HID_LEASH_COMMANDS              131200
55 #define HID_ABOUT_LEASH32_MODULES       131225
56 #define HID_DEBUG_WINDOW                                131229
57 #define HID_KRB4_PROPERTIES_EDIT            131232
58 #define HID_KERBEROS_PROPERTIES_EDIT    131233
59 #define HID_LEASH_PROPERTIES_EDIT               131239
60 #define HID_KRB5_PROPERTIES_FORWARDING  131240
61 #define HID_KRB5_PROPERTIES_EDIT            131241
62 #define HID_KERBEROS_PROPERTIES_LISTRLM 131250
63 #define HID_KERBEROS_PROPERTIES_ADDRLM  131253
64 #define HID_KERBEROS_PROPERTIES_EDITRLM 131254
65 #define HID_KERBEROS_PROPERTIES_ADDDOM  131255
66 #define HID_KERBEROS_PROPERTIES_EDITDOM 131256
67 #define HID_KERBEROS_PROPERTIES_ADDHOST 131269
68 #define HID_KERBEROS_PROPERTIES_EDITHOST 131271
69 #define HID_KERBEROS_PROPERTIES_LISTDOM 131279
70
71 #define USE_HTMLHELP
72
73 #ifdef USE_HTMLHELP
74 #if _MSC_VER >= 1300
75 #define CALL_HTMLHELP
76 #endif
77 #endif
78
79 #include "resource.h"       // main symbols
80 #include "lglobals.h"
81
82 /////////////////////////////////////////////////////////////////////////////
83 // CLeashApp:
84 // See Leash.cpp for the implementation of this class
85 //
86
87 class CLeashApp : public CWinApp
88 {
89 private:
90         CString         m_leashDLL;
91         CString         m_krbDLL;
92     CString     m_helpFile;
93         CString         m_msgError;
94
95         BOOL            InitDLLs();
96         BOOL            FirstInstance();
97
98 public:
99         static HWND                     m_hProgram;
100         static HINSTANCE        m_hLeashDLL;
101         static HINSTANCE        m_hKrb4DLL;
102         static HINSTANCE        m_hKrb5DLL;
103         static HINSTANCE        m_hKrb5ProfileDLL;
104         static HINSTANCE        m_hAfsDLL;
105         static HINSTANCE        m_hPsapi;
106         static HINSTANCE        m_hToolHelp32;
107         static krb5_context m_krbv5_context;
108         static profile_t    m_krbv5_profile;
109         static HINSTANCE    m_hKrbLSA;
110
111         CLeashApp();
112         virtual ~CLeashApp();
113
114     static BOOL  GetProfileFile(LPSTR confname, UINT szConfname);
115     static BOOL  GetKrb4ConFile(LPSTR confname, UINT szConfname);
116     static BOOL  GetKrb4RealmFile(LPSTR confname, UINT szConfname);
117     static void  ValidateConfigFiles();
118     static void  ObtainTicketsViaUserIfNeeded(HWND hWnd);
119     static DWORD GetNumOfIpAddrs(void);
120     static UINT  IpAddrChangeMonitor(void *);
121            DWORD IpAddrChangeMonitorInit(HWND hWnd);
122     static BOOL  ProbeKDC(void);
123     static UINT  InitWorker(void *);
124
125         // Overrides
126         // ClassWizard generated virtual function overrides
127         //{{AFX_VIRTUAL(CLeashApp)
128         public:
129         virtual BOOL InitInstance();
130 #ifdef USE_HTMLHELP
131 #if _MSC_VER < 1300
132     virtual void WinHelp(DWORD dwData, UINT nCmd);
133 #endif
134 #endif
135     //}}AFX_VIRTUAL
136
137     virtual void ParseParam (LPCTSTR lpszParam,BOOL bFlag,BOOL bLast );
138
139   protected:
140 // Implementation
141
142         //{{AFX_MSG(CLeashApp)
143     //}}AFX_MSG
144         DECLARE_MESSAGE_MAP()
145 };
146
147 extern CLeashApp theApp;
148
149 /////////////////////////////////////////////////////////////////////////////
150
151 //{{AFX_INSERT_LOCATION}}
152 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
153
154
155
156 #endif // !defined(AFX_Leash_H__6F45AD91_561B_11D0_8FCF_00C04FC2A0C2__INCLUDED_)