source: Daodan/MSYS2/mingw32/i686-w64-mingw32/include/fileapi.h

Last change on this file was 1166, checked in by rossy, 3 years ago

Daodan: Replace MinGW build env with an up-to-date MSYS2 env

File size: 13.8 KB
Line 
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#ifndef _APISETFILE_
6#define _APISETFILE_
7
8#include <apiset.h>
9#include <apisetcconv.h>
10#include <minwindef.h>
11#include <minwinbase.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
18#define CREATE_NEW 1
19#define CREATE_ALWAYS 2
20#define OPEN_EXISTING 3
21#define OPEN_ALWAYS 4
22#define TRUNCATE_EXISTING 5
23
24#define INVALID_FILE_SIZE ((DWORD)0xffffffff)
25#define INVALID_SET_FILE_POINTER ((DWORD)-1)
26#define INVALID_FILE_ATTRIBUTES ((DWORD)-1)
27#endif
28
29#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= _WIN32_WINNT_WIN10
30#define CreateFile __MINGW_NAME_AW(CreateFile)
31WINBASEAPI DWORD WINAPI GetFileAttributesW (LPCWSTR lpFileName);
32#define GetFileAttributes __MINGW_NAME_AW(GetFileAttributes)
33WINBASEAPI DWORD WINAPI SetFilePointer (HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod);
34#endif
35#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || defined(WINSTORECOMPAT)
36 typedef struct _BY_HANDLE_FILE_INFORMATION {
37 DWORD dwFileAttributes;
38 FILETIME ftCreationTime;
39 FILETIME ftLastAccessTime;
40 FILETIME ftLastWriteTime;
41 DWORD dwVolumeSerialNumber;
42 DWORD nFileSizeHigh;
43 DWORD nFileSizeLow;
44 DWORD nNumberOfLinks;
45 DWORD nFileIndexHigh;
46 DWORD nFileIndexLow;
47 } BY_HANDLE_FILE_INFORMATION, *PBY_HANDLE_FILE_INFORMATION,
48 *LPBY_HANDLE_FILE_INFORMATION;
49 WINBASEAPI WINBOOL WINAPI GetFileInformationByHandle (HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation);
50#endif
51
52#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
53 WINBASEAPI HANDLE WINAPI CreateFileA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
54 WINBASEAPI WINBOOL WINAPI DefineDosDeviceW (DWORD dwFlags, LPCWSTR lpDeviceName, LPCWSTR lpTargetPath);
55 WINBASEAPI WINBOOL WINAPI FindCloseChangeNotification (HANDLE hChangeHandle);
56 WINBASEAPI HANDLE WINAPI FindFirstChangeNotificationA (LPCSTR lpPathName, WINBOOL bWatchSubtree, DWORD dwNotifyFilter);
57 WINBASEAPI HANDLE WINAPI FindFirstChangeNotificationW (LPCWSTR lpPathName, WINBOOL bWatchSubtree, DWORD dwNotifyFilter);
58 WINBASEAPI HANDLE WINAPI FindFirstVolumeW (LPWSTR lpszVolumeName, DWORD cchBufferLength);
59 WINBASEAPI WINBOOL WINAPI FindNextChangeNotification (HANDLE hChangeHandle);
60 WINBASEAPI WINBOOL WINAPI FindNextVolumeW (HANDLE hFindVolume, LPWSTR lpszVolumeName, DWORD cchBufferLength);
61 WINBASEAPI WINBOOL WINAPI FindVolumeClose (HANDLE hFindVolume);
62#endif
63#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || defined(WINSTORECOMPAT)
64 WINBASEAPI HANDLE WINAPI CreateFileW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
65 WINBASEAPI DWORD WINAPI GetFileSize (HANDLE hFile, LPDWORD lpFileSizeHigh);
66#endif
67#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP) || _WIN32_WINNT >= _WIN32_WINNT_WIN10
68 WINBASEAPI LONG WINAPI CompareFileTime (CONST FILETIME *lpFileTime1, CONST FILETIME *lpFileTime2);
69 WINBASEAPI WINBOOL WINAPI DeleteVolumeMountPointW (LPCWSTR lpszVolumeMountPoint);
70 WINBASEAPI WINBOOL WINAPI FileTimeToLocalFileTime (CONST FILETIME *lpFileTime, LPFILETIME lpLocalFileTime);
71 WINBASEAPI HANDLE WINAPI FindFirstFileA (LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData);
72 WINBASEAPI HANDLE WINAPI FindFirstFileW (LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData);
73 WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceA (LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters);
74 WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceW (LPCWSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters);
75 WINBASEAPI UINT WINAPI GetDriveTypeA (LPCSTR lpRootPathName);
76 WINBASEAPI UINT WINAPI GetDriveTypeW (LPCWSTR lpRootPathName);
77 WINBASEAPI DWORD WINAPI GetFileAttributesA (LPCSTR lpFileName);
78 WINBASEAPI WINBOOL WINAPI GetFileSizeEx (HANDLE hFile, PLARGE_INTEGER lpFileSize);
79 WINBASEAPI WINBOOL WINAPI GetFileTime (HANDLE hFile, LPFILETIME lpCreationTime, LPFILETIME lpLastAccessTime, LPFILETIME lpLastWriteTime);
80 WINBASEAPI DWORD WINAPI GetFileType (HANDLE hFile);
81 WINBASEAPI DWORD WINAPI GetFullPathNameA (LPCSTR lpFileName, DWORD nBufferLength, LPSTR lpBuffer, LPSTR *lpFilePart);
82 WINBASEAPI DWORD WINAPI GetFullPathNameW (LPCWSTR lpFileName, DWORD nBufferLength, LPWSTR lpBuffer, LPWSTR *lpFilePart);
83 WINBASEAPI DWORD WINAPI GetLogicalDrives (VOID);
84#define FindFirstFile __MINGW_NAME_AW(FindFirstFile)
85#define GetDiskFreeSpace __MINGW_NAME_AW(GetDiskFreeSpace)
86#define GetDriveType __MINGW_NAME_AW(GetDriveType)
87#define GetFullPathName __MINGW_NAME_AW(GetFullPathName)
88#endif
89#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
90 WINBASEAPI DWORD WINAPI GetLogicalDriveStringsW (DWORD nBufferLength, LPWSTR lpBuffer);
91 WINBASEAPI DWORD WINAPI GetShortPathNameW (LPCWSTR lpszLongPath, LPWSTR lpszShortPath, DWORD cchBuffer);
92 WINBASEAPI WINBOOL WINAPI GetVolumePathNameW (LPCWSTR lpszFileName, LPWSTR lpszVolumePathName, DWORD cchBufferLength);
93 WINBASEAPI DWORD WINAPI QueryDosDeviceW (LPCWSTR lpDeviceName, LPWSTR lpTargetPath, DWORD ucchMax);
94 WINBASEAPI WINBOOL WINAPI ReadFileScatter (HANDLE hFile, FILE_SEGMENT_ELEMENT aSegmentArray[], DWORD nNumberOfBytesToRead, LPDWORD lpReserved, LPOVERLAPPED lpOverlapped);
95 WINBASEAPI WINBOOL WINAPI SetFileValidData (HANDLE hFile, LONGLONG ValidDataLength);
96 WINBASEAPI WINBOOL WINAPI WriteFileGather (HANDLE hFile, FILE_SEGMENT_ELEMENT aSegmentArray[], DWORD nNumberOfBytesToWrite, LPDWORD lpReserved, LPOVERLAPPED lpOverlapped);
97 WINBASEAPI WINBOOL WINAPI GetVolumeNameForVolumeMountPointW (LPCWSTR lpszVolumeMountPoint, LPWSTR lpszVolumeName, DWORD cchBufferLength);
98 WINBASEAPI WINBOOL WINAPI GetVolumePathNamesForVolumeNameW (LPCWSTR lpszVolumeName, LPWCH lpszVolumePathNames, DWORD cchBufferLength, PDWORD lpcchReturnLength);
99
100#ifdef UNICODE
101#define DefineDosDevice DefineDosDeviceW
102#define DeleteVolumeMountPoint DeleteVolumeMountPointW
103#define FindFirstVolume FindFirstVolumeW
104#define FindNextVolume FindNextVolumeW
105#define GetLogicalDriveStrings GetLogicalDriveStringsW
106#define GetShortPathName GetShortPathNameW
107#define GetVolumeInformation GetVolumeInformationW
108#define GetVolumePathName GetVolumePathNameW
109#define QueryDosDevice QueryDosDeviceW
110#define GetVolumeNameForVolumeMountPoint GetVolumeNameForVolumeMountPointW
111#define GetVolumePathNamesForVolumeName GetVolumePathNamesForVolumeNameW
112#endif
113#define FindFirstChangeNotification __MINGW_NAME_AW(FindFirstChangeNotification)
114#define GetLongPathName __MINGW_NAME_AW(GetLongPathName)
115#define GetTempFileName __MINGW_NAME_AW(GetTempFileName)
116
117
118#if _WIN32_WINNT >= 0x0600
119 WINBASEAPI WINBOOL WINAPI GetVolumeInformationByHandleW (HANDLE hFile, LPWSTR lpVolumeNameBuffer, DWORD nVolumeNameSize, LPDWORD lpVolumeSerialNumber, LPDWORD lpMaximumComponentLength, LPDWORD lpFileSystemFlags, LPWSTR lpFileSystemNameBuffer, DWORD nFileSystemNameSize);
120#endif
121#endif
122
123#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_APP)
124 WINBASEAPI DWORD WINAPI GetLongPathNameA (LPCSTR lpszShortPath, LPSTR lpszLongPath, DWORD cchBuffer);
125 WINBASEAPI DWORD WINAPI GetLongPathNameW (LPCWSTR lpszShortPath, LPWSTR lpszLongPath, DWORD cchBuffer);
126 WINBASEAPI UINT WINAPI GetTempFileNameA (LPCSTR lpPathName, LPCSTR lpPrefixString, UINT uUnique, LPSTR lpTempFileName);
127 WINBASEAPI UINT WINAPI GetTempFileNameW (LPCWSTR lpPathName, LPCWSTR lpPrefixString, UINT uUnique, LPWSTR lpTempFileName);
128 WINBASEAPI WINBOOL WINAPI GetVolumeInformationW (LPCWSTR lpRootPathName, LPWSTR lpVolumeNameBuffer, DWORD nVolumeNameSize, LPDWORD lpVolumeSerialNumber, LPDWORD lpMaximumComponentLength, LPDWORD lpFileSystemFlags, LPWSTR lpFileSystemNameBuffer, DWORD nFileSystemNameSize);
129 WINBASEAPI WINBOOL WINAPI LocalFileTimeToFileTime (CONST FILETIME *lpLocalFileTime, LPFILETIME lpFileTime);
130 WINBASEAPI WINBOOL WINAPI LockFile (HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh);
131 WINBASEAPI WINBOOL WINAPI ReadFileEx (HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPOVERLAPPED lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
132 WINBASEAPI WINBOOL WINAPI SetFileTime (HANDLE hFile, CONST FILETIME *lpCreationTime, CONST FILETIME *lpLastAccessTime, CONST FILETIME *lpLastWriteTime);
133 WINBASEAPI WINBOOL WINAPI UnlockFile (HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh);
134 WINBASEAPI WINBOOL WINAPI WriteFileEx (HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPOVERLAPPED lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine);
135
136#if _WIN32_WINNT >= 0x0600
137 WINBASEAPI DWORD WINAPI GetFinalPathNameByHandleA (HANDLE hFile, LPSTR lpszFilePath, DWORD cchFilePath, DWORD dwFlags);
138 WINBASEAPI DWORD WINAPI GetFinalPathNameByHandleW (HANDLE hFile, LPWSTR lpszFilePath, DWORD cchFilePath, DWORD dwFlags);
139
140#define GetFinalPathNameByHandle __MINGW_NAME_AW(GetFinalPathNameByHandle)
141#endif
142 typedef struct _WIN32_FILE_ATTRIBUTE_DATA {
143 DWORD dwFileAttributes;
144 FILETIME ftCreationTime;
145 FILETIME ftLastAccessTime;
146 FILETIME ftLastWriteTime;
147 DWORD nFileSizeHigh;
148 DWORD nFileSizeLow;
149 } WIN32_FILE_ATTRIBUTE_DATA, *LPWIN32_FILE_ATTRIBUTE_DATA;
150
151#if _WIN32_WINNT >= 0x0602
152 typedef struct _CREATEFILE2_EXTENDED_PARAMETERS {
153 DWORD dwSize;
154 DWORD dwFileAttributes;
155 DWORD dwFileFlags;
156 DWORD dwSecurityQosFlags;
157 LPSECURITY_ATTRIBUTES lpSecurityAttributes;
158 HANDLE hTemplateFile;
159 } CREATEFILE2_EXTENDED_PARAMETERS, *PCREATEFILE2_EXTENDED_PARAMETERS,
160 *LPCREATEFILE2_EXTENDED_PARAMETERS;
161#endif
162
163 WINBASEAPI WINBOOL WINAPI CreateDirectoryA (LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
164 WINBASEAPI WINBOOL WINAPI CreateDirectoryW (LPCWSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes);
165 WINBASEAPI WINBOOL WINAPI DeleteFileA (LPCSTR lpFileName);
166 WINBASEAPI WINBOOL WINAPI DeleteFileW (LPCWSTR lpFileName);
167 WINBASEAPI WINBOOL WINAPI FindClose (HANDLE hFindFile);
168 WINBASEAPI HANDLE WINAPI FindFirstFileExA (LPCSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, LPVOID lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, LPVOID lpSearchFilter, DWORD dwAdditionalFlags);
169 WINBASEAPI HANDLE WINAPI FindFirstFileExW (LPCWSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, LPVOID lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, LPVOID lpSearchFilter, DWORD dwAdditionalFlags);
170 WINBASEAPI WINBOOL WINAPI FindNextFileA (HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData);
171 WINBASEAPI WINBOOL WINAPI FindNextFileW (HANDLE hFindFile, LPWIN32_FIND_DATAW lpFindFileData);
172 WINBASEAPI WINBOOL WINAPI FlushFileBuffers (HANDLE hFile);
173 WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceExA (LPCSTR lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailableToCaller, PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER lpTotalNumberOfFreeBytes);
174 WINBASEAPI WINBOOL WINAPI GetDiskFreeSpaceExW (LPCWSTR lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailableToCaller, PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER lpTotalNumberOfFreeBytes);
175 WINBASEAPI WINBOOL WINAPI GetFileAttributesExA (LPCSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation);
176 WINBASEAPI WINBOOL WINAPI GetFileAttributesExW (LPCWSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation);
177 WINBASEAPI WINBOOL WINAPI LockFileEx (HANDLE hFile, DWORD dwFlags, DWORD dwReserved, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped);
178 WINBASEAPI WINBOOL WINAPI ReadFile (HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped);
179 WINBASEAPI WINBOOL WINAPI RemoveDirectoryA (LPCSTR lpPathName);
180 WINBASEAPI WINBOOL WINAPI RemoveDirectoryW (LPCWSTR lpPathName);
181 WINBASEAPI WINBOOL WINAPI SetEndOfFile (HANDLE hFile);
182 WINBASEAPI WINBOOL WINAPI SetFileAttributesA (LPCSTR lpFileName, DWORD dwFileAttributes);
183 WINBASEAPI WINBOOL WINAPI SetFileAttributesW (LPCWSTR lpFileName, DWORD dwFileAttributes);
184 WINBASEAPI WINBOOL WINAPI SetFilePointerEx (HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod);
185 WINBASEAPI WINBOOL WINAPI UnlockFileEx (HANDLE hFile, DWORD dwReserved, DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped);
186 WINBASEAPI WINBOOL WINAPI WriteFile (HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped);
187 WINBASEAPI DWORD WINAPI GetTempPathA (DWORD nBufferLength, LPSTR lpBuffer);
188 WINBASEAPI DWORD WINAPI GetTempPathW (DWORD nBufferLength, LPWSTR lpBuffer);
189
190#define CreateDirectory __MINGW_NAME_AW(CreateDirectory)
191#define DeleteFile __MINGW_NAME_AW(DeleteFile)
192#define FindFirstFileEx __MINGW_NAME_AW(FindFirstFileEx)
193#define FindNextFile __MINGW_NAME_AW(FindNextFile)
194#define GetDiskFreeSpaceEx __MINGW_NAME_AW(GetDiskFreeSpaceEx)
195#define GetFileAttributesEx __MINGW_NAME_AW(GetFileAttributesEx)
196#define RemoveDirectory __MINGW_NAME_AW(RemoveDirectory)
197#define SetFileAttributes __MINGW_NAME_AW(SetFileAttributes)
198#define GetTempPath __MINGW_NAME_AW(GetTempPath)
199
200#if _WIN32_WINNT >= 0x0600
201 WINBASEAPI WINBOOL WINAPI SetFileInformationByHandle (HANDLE hFile, FILE_INFO_BY_HANDLE_CLASS FileInformationClass, LPVOID lpFileInformation, DWORD dwBufferSize);
202#endif
203#if _WIN32_WINNT >= 0x0602
204 WINBASEAPI HANDLE WINAPI CreateFile2 (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, DWORD dwCreationDisposition, LPCREATEFILE2_EXTENDED_PARAMETERS pCreateExParams);
205#endif
206#endif
207
208#ifdef __cplusplus
209}
210#endif
211#endif
Note: See TracBrowser for help on using the repository browser.