1 | /**
|
---|
2 | * This file is part of the mingw-w64 runtime package.
|
---|
3 | * No warranty is given; refer to the file DISCLAIMER within this package.
|
---|
4 | */
|
---|
5 |
|
---|
6 | #ifndef _FILEHC_H_
|
---|
7 | #define _FILEHC_H_
|
---|
8 | #include <winapifamily.h>
|
---|
9 |
|
---|
10 | #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
|
---|
11 |
|
---|
12 | #ifndef WINAPI
|
---|
13 | #if defined(_ARM_)
|
---|
14 | #define WINAPI
|
---|
15 | #else
|
---|
16 | #define WINAPI __stdcall
|
---|
17 | #endif
|
---|
18 | #endif
|
---|
19 |
|
---|
20 | #ifdef _FILEHC_IMPLEMENTATION_
|
---|
21 | #define FILEHC_EXPORT __declspec (dllexport)
|
---|
22 | #else
|
---|
23 | #define FILEHC_EXPORT __declspec (dllimport)
|
---|
24 | #endif
|
---|
25 |
|
---|
26 | #ifdef __cplusplus
|
---|
27 | extern "C" {
|
---|
28 | #endif
|
---|
29 |
|
---|
30 | typedef VOID (*PFN_IO_COMPLETION) (struct FIO_CONTEXT *pContext, struct FH_OVERLAPPED *lpo, DWORD cb, DWORD dwCompletionStatus);
|
---|
31 |
|
---|
32 | struct FH_OVERLAPPED {
|
---|
33 | UINT_PTR Internal;
|
---|
34 | UINT_PTR InternalHigh;
|
---|
35 | DWORD Offset;
|
---|
36 | DWORD OffsetHigh;
|
---|
37 | HANDLE hEvent;
|
---|
38 | PFN_IO_COMPLETION pfnCompletion;
|
---|
39 | UINT_PTR Reserved1;
|
---|
40 | UINT_PTR Reserved2;
|
---|
41 | UINT_PTR Reserved3;
|
---|
42 | UINT_PTR Reserved4;
|
---|
43 | };
|
---|
44 |
|
---|
45 | typedef struct FH_OVERLAPPED *PFH_OVERLAPPED;
|
---|
46 |
|
---|
47 | struct FIO_CONTEXT {
|
---|
48 | DWORD m_dwTempHack;
|
---|
49 | DWORD m_dwSignature;
|
---|
50 | HANDLE m_hFile;
|
---|
51 | DWORD m_dwLinesOffset;
|
---|
52 | DWORD m_dwHeaderLength;
|
---|
53 | };
|
---|
54 |
|
---|
55 | typedef FIO_CONTEXT *PFIO_CONTEXT;
|
---|
56 |
|
---|
57 | struct NAME_CACHE_CONTEXT {
|
---|
58 | DWORD m_dwSignature;
|
---|
59 | };
|
---|
60 |
|
---|
61 | typedef struct NAME_CACHE_CONTEXT *PNAME_CACHE_CONTEXT;
|
---|
62 |
|
---|
63 | typedef HANDLE (WINAPI *FCACHE_CREATE_CALLBACK) (LPSTR lpstrName, LPVOID lpvData, DWORD *cbFileSize, DWORD *cbFileSizeHigh);
|
---|
64 | typedef HANDLE (WINAPI *FCACHE_RICHCREATE_CALLBACK) (LPSTR lpstrName, LPVOID lpvData, DWORD *cbFileSize, DWORD *cbFileSizeHigh, WINBOOL *pfDidWeScanIt, WINBOOL *pfIsStuffed, WINBOOL *pfStoredWithDots, WINBOOL *pfStoredWithTerminatingDot);
|
---|
65 | typedef int (WINAPI *CACHE_KEY_COMPARE) (DWORD cbKey1, LPBYTE lpbKey1, DWORD cbKey2, LPBYTE lpbKey2);
|
---|
66 | typedef DWORD (WINAPI *CACHE_KEY_HASH) (LPBYTE lpbKey, DWORD cbKey);
|
---|
67 | typedef WINBOOL (WINAPI *CACHE_READ_CALLBACK) (DWORD cb, LPBYTE lpb, LPVOID lpvContext);
|
---|
68 | typedef void (WINAPI *CACHE_DESTROY_CALLBACK) (DWORD cb, LPBYTE lpb);
|
---|
69 | typedef WINBOOL (WINAPI *CACHE_ACCESS_CHECK) (PSECURITY_DESCRIPTOR pSecurityDescriptor, HANDLE hClientToken, DWORD dwDesiredAccess, PGENERIC_MAPPING GenericMapping, PRIVILEGE_SET *PrivilegeSet, LPDWORD PrivilegeSetLength, LPDWORD GrantedAccess, LPBOOL AccessStatus);
|
---|
70 |
|
---|
71 | FILEHC_EXPORT WINBOOL WINAPI FIOInitialize (DWORD dwFlags);
|
---|
72 | FILEHC_EXPORT WINBOOL WINAPI FIOTerminate (VOID);
|
---|
73 | FILEHC_EXPORT WINBOOL WINAPI FIOReadFile (PFIO_CONTEXT pContext, LPVOID lpBuffer, DWORD BytesToRead, FH_OVERLAPPED *lpo);
|
---|
74 | FILEHC_EXPORT WINBOOL WINAPI FIOReadFileEx (PFIO_CONTEXT pContext, LPVOID lpBuffer, DWORD BytesToRead, DWORD BytesAvailable, FH_OVERLAPPED *lpo, WINBOOL fFinalWrite, WINBOOL fIncludeTerminator);
|
---|
75 | FILEHC_EXPORT WINBOOL WINAPI FIOWriteFile (PFIO_CONTEXT pContext, LPCVOID lpBuffer, DWORD BytesToWrite, FH_OVERLAPPED *lpo);
|
---|
76 | FILEHC_EXPORT WINBOOL WINAPI FIOWriteFileEx (PFIO_CONTEXT pContext, LPVOID lpBuffer, DWORD BytesToWrite, DWORD BytesAvailable, FH_OVERLAPPED *lpo, WINBOOL fFinalWrite, WINBOOL fIncludeTerminator);
|
---|
77 | FILEHC_EXPORT WINBOOL WINAPI InitializeCache ();
|
---|
78 | FILEHC_EXPORT WINBOOL WINAPI TerminateCache ();
|
---|
79 | FILEHC_EXPORT PFIO_CONTEXT WINAPI AssociateFile (HANDLE hFile);
|
---|
80 | FILEHC_EXPORT PFIO_CONTEXT WINAPI AssociateFileEx (HANDLE hFile, WINBOOL fStoreWithDots, WINBOOL fStoredWithTerminatingDot);
|
---|
81 | FILEHC_EXPORT void WINAPI AddRefContext (PFIO_CONTEXT);
|
---|
82 | FILEHC_EXPORT void WINAPI ReleaseContext (PFIO_CONTEXT);
|
---|
83 | FILEHC_EXPORT WINBOOL WINAPI CloseNonCachedFile (PFIO_CONTEXT);
|
---|
84 | FILEHC_EXPORT FIO_CONTEXT * WINAPI CacheCreateFile (LPSTR lpstrName, FCACHE_CREATE_CALLBACK pfnCallBack, LPVOID lpv, WINBOOL fAsyncContext);
|
---|
85 | FILEHC_EXPORT FIO_CONTEXT * WINAPI CacheRichCreateFile (LPSTR lpstrName, FCACHE_RICHCREATE_CALLBACK pfnCallBack, LPVOID lpv, WINBOOL fAsyncContext);
|
---|
86 | FILEHC_EXPORT void WINAPI CacheRemoveFiles (LPSTR lpstrName, WINBOOL fAllPrefixes);
|
---|
87 | FILEHC_EXPORT WINBOOL WINAPI InsertFile (LPSTR lpstrName, FIO_CONTEXT *pContext, WINBOOL fKeepReference);
|
---|
88 | FILEHC_EXPORT DWORD WINAPI GetFileSizeFromContext (FIO_CONTEXT *pContext, DWORD *pcbFileSizeHigh);
|
---|
89 | FILEHC_EXPORT PNAME_CACHE_CONTEXT WINAPI FindOrCreateNameCache (LPSTR lpstrName, CACHE_KEY_COMPARE pfnKeyCompare, CACHE_KEY_HASH pfnKeyHash, CACHE_DESTROY_CALLBACK pfnKeyDestroy, CACHE_DESTROY_CALLBACK pfnDataDestroy);
|
---|
90 | FILEHC_EXPORT __LONG32 WINAPI ReleaseNameCache (PNAME_CACHE_CONTEXT pNameCache);
|
---|
91 | FILEHC_EXPORT WINBOOL WINAPI SetNameCacheSecurityFunction (PNAME_CACHE_CONTEXT pNameCache, CACHE_ACCESS_CHECK pfnAccessCheck);
|
---|
92 | FILEHC_EXPORT WINBOOL WINAPI FindContextFromName (PNAME_CACHE_CONTEXT pNameCache, LPBYTE lpbName, DWORD cbName, CACHE_READ_CALLBACK pfnCallback, LPVOID lpvClientContext, HANDLE hToken, ACCESS_MASK accessMask, FIO_CONTEXT **ppContext);
|
---|
93 | FILEHC_EXPORT WINBOOL WINAPI FindSyncContextFromName (PNAME_CACHE_CONTEXT pNameCache, LPBYTE lpbName, DWORD cbName, CACHE_READ_CALLBACK pfnCallback, LPVOID lpvClientContext, HANDLE hToken, ACCESS_MASK accessMask, FIO_CONTEXT **ppContext);
|
---|
94 | FILEHC_EXPORT WINBOOL WINAPI AssociateContextWithName (PNAME_CACHE_CONTEXT pNameCache, LPBYTE lpbName, DWORD cbName, LPBYTE lpbData, DWORD cbData, PGENERIC_MAPPING pGenericMapping, PSECURITY_DESCRIPTOR pSecurityDescriptor, FIO_CONTEXT *pContext, WINBOOL fKeepReference);
|
---|
95 | FILEHC_EXPORT WINBOOL WINAPI InvalidateName (PNAME_CACHE_CONTEXT pNameCache, LPBYTE lpbName, DWORD cbName);
|
---|
96 | FILEHC_EXPORT FIO_CONTEXT * WINAPI ProduceDotStuffedContext (FIO_CONTEXT *pContext, LPSTR lpstrName, WINBOOL fWantItDotStuffed);
|
---|
97 | FILEHC_EXPORT WINBOOL WINAPI ProduceDotStuffedContextInContext (FIO_CONTEXT *pContextSource, FIO_CONTEXT *pContextDestination, WINBOOL fWantItDotStuffed, WINBOOL *pfModified);
|
---|
98 | FILEHC_EXPORT WINBOOL WINAPI GetIsFileDotTerminated (FIO_CONTEXT *pContext);
|
---|
99 | FILEHC_EXPORT void WINAPI SetIsFileDotTerminated (FIO_CONTEXT *pContext, WINBOOL fIsDotTerminated);
|
---|
100 | FILEHC_EXPORT WINBOOL WINAPI SetDotStuffingOnWrites (FIO_CONTEXT *pContext, WINBOOL fEnable, WINBOOL fStripDots);
|
---|
101 | FILEHC_EXPORT WINBOOL WINAPI SetDotScanningOnWrites (FIO_CONTEXT *pContext, WINBOOL fEnable);
|
---|
102 | FILEHC_EXPORT void WINAPI CompleteDotStuffingOnWrites (FIO_CONTEXT *pContext, WINBOOL fStripDots);
|
---|
103 | FILEHC_EXPORT WINBOOL WINAPI SetDotScanningOnReads (FIO_CONTEXT *pContext, WINBOOL fEnable);
|
---|
104 | FILEHC_EXPORT WINBOOL WINAPI GetDotStuffState (FIO_CONTEXT *pContext, WINBOOL fReads, WINBOOL *pfStuffed, WINBOOL *pfStoredWithDots);
|
---|
105 | FILEHC_EXPORT void WINAPI SetDotStuffState (FIO_CONTEXT *pContext, WINBOOL fKnown, WINBOOL fRequiresStuffing);
|
---|
106 |
|
---|
107 | #ifdef __cplusplus
|
---|
108 | }
|
---|
109 | #endif
|
---|
110 |
|
---|
111 | #endif
|
---|
112 | #endif
|
---|