OpenAFS
OpenAFS distributed network file system
|
00001 // 00002 // AFSD_FLUSHVOL.H 00003 // 00004 // Include file for routines that handle flushing AFS volumes 00005 // in response to System Power event notification such as 00006 // Hibernate request. 00007 // 00009 00010 #ifndef _AFSD_FLUSHVOL_H_ 00011 #define _AFSD_FLUSHVOL_H_ 00012 00013 #include <Winnetwk.h> 00014 #include "fs_utils.h" 00015 00016 // handles 00017 typedef struct _tagFLUSHVOLTHREADINFO { 00018 HANDLE hEventPowerEvent; 00019 HANDLE hEventResumeMain; 00020 HANDLE hEventTerminate; 00021 } FLUSHVOLTHREADINFO, *PFLUSHVOLTHREADINFO; 00022 00023 // invokes fs.exe pioctl 00024 static afs_int32 afsd_ServicePerformFlushVolumeCmd(char *data); 00025 00026 // thread callback 00027 static DWORD WINAPI afsd_ServiceFlushVolumesThreadProc(LPVOID lpParameter); 00028 00029 // helper function 00030 static VOID CheckAndCloseHandle(HANDLE thisHandle); 00031 00032 // thread construction/notification/destruction 00033 BOOL PowerNotificationThreadCreate(VOID); 00034 BOOL PowerNotificationThreadNotify(VOID); 00035 VOID PowerNotificationThreadExit(VOID); 00036 00037 // impersonation helper(s) 00038 static HANDLE GetUserToken(DWORD access); 00039 static BOOL ImpersonateClient(void); 00040 00041 // event logging 00042 static VOID LogTimingEvent(DWORD dwEventID, LPTSTR lpString1, DWORD dwTime); 00043 00044 #endif // _AFSD_FLUSHVOL_H_ 00045