win-xp-sp2-20040325
[openafs.git] / src / WINNT / win9xpanel / cafs.h
1 //cafs.h
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 //#define DOSTITLE "_AFS File System_"
11 //#define DOSTITLEFINISH "Finished - _AFS File System_"
12 #define DOSTITLE "AFS Client Console"
13 #define DOSTITLEFINISH "Finished - AFS Client Console"
14 #define APPTITLE "AFS"
15 #define APPTITLEFINISH "Finished - AFSD"
16 #ifdef DEV_IDE
17 #ifdef _DEBUG
18 #define CMDLINE "AFSD.EXE -startup"
19 #else
20 #define CMDLINE ".//release//AFSD.EXE -startup"
21 #endif
22 #else
23 #define CMDLINE "AFSD.PIF -startup"
24 #endif
25
26 #ifndef __CAFS__
27 #define __CAFS__
28 #include "share.h"
29
30 class CProgress
31 {
32 public:
33         CProgress(CWnd *wnd, UINT mode);
34         ~CProgress();
35         void Next();
36         void Finish();
37         void SetTitle(const char *,const char *,const char *);
38 private:
39         CWnd *m_pWnd;
40 };
41
42 class CAfs
43 {
44         friend CProgress;
45 public:
46         const char * MountName(){return m_sMountName;}
47         CAfs(){m_sDosAppName=DOSTITLE;m_sMountName="";};
48         ~CAfs();
49         BOOL Mount(CString &msg,const char *drvLetter,const char *path);
50         BOOL Create(CString &msg,CString sCompName,PROCESS_INFORMATION &procInfo);
51         BOOL Authencate(CString &msg,const char * username,const char * password);
52         BOOL Dismount(CString &msg,const char * drive,BOOL force=FALSE);
53         BOOL StartExployer(CString &msg, const char *drive);
54         BOOL Shutdown(CString &msg);
55         BOOL Init(CWnd *,CString &);
56         UINT TestTokenTime(CString&);
57         BOOL ScanTokens(CString&);
58         HWND & GetLoadWindowHandle(){return m_hAfsLoad;}
59         void FinishProgress();
60         BOOL CheckNet(CString &);
61 private:
62         CString m_sMountName;
63         static CString m_sDosAppName;
64         STARTUPINFO m_startUpInfo;
65         PROCESS_INFORMATION m_procProgBar;
66         static HWND m_hAfsLoad;
67         static HWND m_hAfsLoadFinish;
68         static BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam);
69         static BOOL CALLBACK EnumWindowsProcShutdown(HWND hWnd, LPARAM lParam);
70         char m_cCell[256];                      //cell name
71
72         DWORD m_dTokenEndTime;
73         CTimeSpan m_tTotalSpanTime;
74 };
75
76 #endif
77