4 // Include file for routines that handle flushing AFS volumes
5 // in response to System Power event notification such as
8 /////////////////////////////////////////////////////////////////////
10 #ifndef _AFSD_FLUSHVOL_H_
11 #define _AFSD_FLUSHVOL_H_
17 typedef struct _tagFLUSHVOLTHREADINFO {
18 HANDLE hEventPowerEvent;
19 HANDLE hEventResumeMain;
20 HANDLE hEventTerminate;
21 } FLUSHVOLTHREADINFO, *PFLUSHVOLTHREADINFO;
23 // invokes fs.exe pioctl
24 static afs_int32 afsd_ServicePerformFlushVolumeCmd(char *data);
27 static DWORD WINAPI afsd_ServiceFlushVolumesThreadProc(LPVOID lpParameter);
30 static VOID CheckAndCloseHandle(HANDLE thisHandle);
32 // thread construction/notification/destruction
33 BOOL PowerNotificationThreadCreate(VOID);
34 BOOL PowerNotificationThreadNotify(VOID);
35 VOID PowerNotificationThreadExit(VOID);
37 // impersonation helper(s)
38 static HANDLE GetUserToken(DWORD access);
39 static BOOL ImpersonateClient(void);
42 static VOID LogTimingEvent(DWORD dwEventID, LPTSTR lpString1, DWORD dwTime);
44 #endif // _AFSD_FLUSHVOL_H_