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