windows-64-bit-type-safety-20051105
[openafs.git] / src / WINNT / afssvrmgr / svrmgr.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 #ifndef SVRMGR_H
11 #define SVRMGR_H
12
13
14 /*
15  * COMMON HEADERS _____________________________________________________________
16  *
17  */
18
19 #include <windows.h>
20 #include <WINNT/AfsAppLib.h>
21 #include <WINNT/AfsClass.h>
22
23
24 /*
25  * DEFINITIONS ________________________________________________________________
26  *
27  */
28
29 #ifdef _DEBUG
30 #ifndef DEBUG
31 #define DEBUG
32 #endif
33 #endif
34
35 #ifndef cb1KB
36 #define cb1KB  1024L
37 #endif
38
39 #ifndef ck1MB
40 #define ck1MB  1024L
41 #endif
42
43 #ifndef cb1MB
44 #define cb1MB  1048576L
45 #endif
46
47 #ifndef ck1GB
48 #define ck1GB  1048576L
49 #endif
50
51 #ifndef ck1TB
52 #define ck1TB  (unsigned long)0x40000000  // 1073741824L == 1024^3
53 #endif
54
55 #define cszENDING_REPLICA  TEXT(".readonly")
56 #define cszENDING_CLONE    TEXT(".clone")
57
58 #define REGSTR_SETTINGS_BASE  HKCU
59 #define REGSTR_SETTINGS_PATH  TEXT("Software\\TransarcCorporation\\AFS Server Manager")
60 #define REGVAL_SETTINGS       TEXT("Settings")
61 #define REGSTR_SETTINGS_PREFS TEXT("Software\\TransarcCorporation\\AFS Server Manager\\Preferences")
62 #define REGSTR_SETTINGS_CELLS REGSTR_SETTINGS_PREFS
63
64
65 /*
66  * INCLUSIONS _________________________________________________________________
67  *
68  */
69
70 #include "resource.h"
71 #include "window.h"
72 #include "dispatch.h"
73 #include "alert.h"
74 #include "general.h"
75 #include "subset.h"
76 #include "prefs.h"
77
78 #include "help.hid"
79 #define cszHELPFILENAME  TEXT("TaAfsSvrMgr.hlp")
80
81
82 /*
83  * STRUCTURES _________________________________________________________________
84  *
85  */
86
87 typedef enum // CHILDTAB
88    {
89    tabINVALID = -1,
90    tabFILESETS = 0,
91    tabAGGREGATES,
92    tabSERVICES
93    } CHILDTAB;
94
95 typedef struct // DISPLAYINFO
96    {
97    LONG cSplitter;      // splitter between servers and tabs
98    VIEWINFO viewSvr;
99    } DISPLAYINFO;
100
101 typedef struct // SERVER_PREF
102    {
103    OBJECTALERTS oa;
104
105    short perWarnAggFull;        // ==0 to disable warning
106    short perWarnSetFull;        // ==0 to disable warning
107    BOOL fWarnSvcStop;   // ==FALSE to disable warning
108    BOOL fWarnSvrTimeout;        // ==FALSE to disable warning
109    BOOL fWarnSetNoVLDB; // ==FALSE to disable warning
110    BOOL fWarnSetNoServ; // ==FALSE to disable warning
111    BOOL fWarnAggNoServ; // ==FALSE to disable warning
112    BOOL fWarnAggAlloc;  // ==FALSE to disable warning
113
114    RECT rLast;
115    BOOL fOpen;
116    BOOL fIsMonitored;
117    BOOL fExpandTree;
118    SERVERSTATUS ssLast;
119    } SERVER_PREF, *LPSERVER_PREF;
120
121 #define wVerSERVER_PREF  MAKEVERSION(2,1)
122
123
124 typedef struct // SERVICE_PREF
125    {
126    OBJECTALERTS oa;
127
128    BOOL fWarnSvcStop;
129    TCHAR szLogFile[ MAX_PATH ];
130
131    SERVICESTATUS ssLast;
132    } SERVICE_PREF, *LPSERVICE_PREF;
133
134 #define wVerSERVICE_PREF  MAKEVERSION(1,0)
135
136
137 typedef struct // AGGREGATE_PREF
138    {
139    OBJECTALERTS oa;
140    short perWarnAggFull;        // ==0 to disable, ==-1 for svr default
141    BOOL fWarnAggAlloc;  // ==FALSE to disable warning
142
143    TCHAR szDevice[ cchNAME ];
144    AGGREGATESTATUS asLast;
145    BOOL fExpandTree;
146    } AGGREGATE_PREF, *LPAGGREGATE_PREF;
147
148 #define wVerAGGREGATE_PREF  MAKEVERSION(2,1)
149
150
151 typedef struct // FILESET_PREF
152    {
153    OBJECTALERTS oa;
154    short perWarnSetFull;        // ==0 to disable, ==-1 for svr default
155
156    FILESETSTATUS fsLast;
157    LPIDENT lpiRW;
158    } FILESET_PREF, *LPFILESET_PREF;
159
160 #define wVerFILESET_PREF  MAKEVERSION(1,1)
161
162
163 typedef enum // ICONVIEW
164    {
165    ivTWOICONS,
166    ivONEICON,
167    ivSTATUS
168    } ICONVIEW, *LPICONVIEW;
169
170 typedef struct
171    {
172    HINSTANCE hInst;
173    HWND hMain;
174    HWND hAction;
175    HACCEL hAccel;
176    int rc;
177    LPIDENT lpiCell;
178
179    LPSUBSET sub;
180    UINT_PTR hCreds;
181    } GLOBALS;
182
183 typedef struct
184    {
185    // Window placement
186    //
187    RECT rMain;
188    RECT rMainPreview;
189    RECT rServerLast;
190    RECT rActions;
191    BOOL fPreview;
192    BOOL fVert;
193    BOOL fActions;
194
195    // How is information viewed?
196    //
197    CHILDTAB tabLast;
198    VIEWINFO viewSvc;
199    VIEWINFO viewAgg;
200    VIEWINFO viewSet;
201    VIEWINFO viewRep;
202    VIEWINFO viewAggMove;
203    VIEWINFO viewAggCreate;
204    VIEWINFO viewAggRestore;
205    VIEWINFO viewAct;
206    VIEWINFO viewKey;
207    DISPLAYINFO diHorz;
208    DISPLAYINFO diVert;
209    RECT rViewLog;
210    size_t cbQuotaUnits;
211    BOOL fOpenMonitors;
212    BOOL fCloseUnmonitors;
213    BOOL fServerLongNames;
214    BOOL fDoubleClickOpens;  // 0=Properties, 1=Open, 2=Depends (PreviewPane)
215    BOOL fWarnBadCreds;
216    ICONVIEW ivSvr;
217    ICONVIEW ivAgg;
218    ICONVIEW ivSet;
219    ICONVIEW ivSvc;
220    } GLOBALS_RESTORED;
221
222 #define wVerGLOBALS_RESTORED  MAKEVERSION(2,3)
223
224
225 extern GLOBALS g;
226 extern GLOBALS_RESTORED gr;
227
228 /*
229  * OTHER INCLUSIONS ___________________________________________________________
230  *
231  */
232
233 #include "task.h"
234 #include "helpfunc.h"
235
236
237 /*
238  * PROTOTYPES _________________________________________________________________
239  *
240  */
241
242 void Quit (int rc);
243
244 void PumpMessage (MSG *lpm);
245
246 // StartThread() accepts any 32-bit quantity as its second parameter;
247 // it uses '...' so you won't have to cast the thing regardless of what it
248 // is--an HWND fits through just as easily as an LPIDENT.
249 //
250 BOOL cdecl StartThread (DWORD (WINAPI *lpfnStart)(PVOID lp), ...);
251
252
253 #endif
254