Windows: Do not recycle deleted scache on refcnt 0
[openafs.git] / src / WINNT / afsd / afsd_flushvol.h
1 //
2 //      AFSD_FLUSHVOL.H
3 //
4 //      Include file for routines that handle flushing AFS volumes
5 //      in response to System Power event notification such as
6 //      Hibernate request.
7 //
8 /////////////////////////////////////////////////////////////////////
9
10 #ifndef _AFSD_FLUSHVOL_H_
11 #define _AFSD_FLUSHVOL_H_
12
13 #include <Winnetwk.h>
14 #include "fs_utils.h"
15
16 // handles
17 typedef struct _tagFLUSHVOLTHREADINFO {
18         HANDLE  hEventPowerEvent;
19         HANDLE  hEventResumeMain;
20         HANDLE  hEventTerminate;
21 } FLUSHVOLTHREADINFO, *PFLUSHVOLTHREADINFO;
22
23 // invokes fs.exe pioctl
24 static afs_int32        afsd_ServicePerformFlushVolumeCmd(char *data);
25
26 // thread callback
27 static DWORD WINAPI afsd_ServiceFlushVolumesThreadProc(LPVOID lpParameter);
28
29 // helper function
30 static VOID     CheckAndCloseHandle(HANDLE thisHandle);
31
32 // thread construction/notification/destruction
33 BOOL    PowerNotificationThreadCreate(VOID);
34 BOOL    PowerNotificationThreadNotify(VOID);
35 VOID    PowerNotificationThreadExit(VOID);
36
37 // impersonation helper(s)
38 static HANDLE   GetUserToken(DWORD access);
39 static BOOL     ImpersonateClient(void);
40
41 // event logging
42 static VOID LogTimingEvent(DWORD dwEventID, LPTSTR lpString1, DWORD dwTime);
43
44 #endif  // _AFSD_FLUSHVOL_H_
45