FreeRDP
|
#include <winpr/config.h>
#include <winpr/crt.h>
#include <winpr/string.h>
#include <winpr/path.h>
#include <winpr/file.h>
#include "../log.h"
#include <winpr/assert.h>
#include <pthread.h>
#include <dirent.h>
#include <libgen.h>
#include <errno.h>
#include <sys/un.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/statvfs.h>
#include "../handle/handle.h"
#include "../pipe/pipe.h"
#include "file.h"
#include "../comm/comm.h"
Macros | |
#define | TAG WINPR_TAG("file") |
Functions | |
HANDLE_CREATOR * | GetNamedPipeClientHandleCreator (void) |
static void | HandleCreatorsInit (void) |
HANDLE | CreateFileA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) |
HANDLE | CreateFileW (LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) |
BOOL | DeleteFileA (LPCSTR lpFileName) |
BOOL | DeleteFileW (LPCWSTR lpFileName) |
BOOL | ReadFile (HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped) |
BOOL | ReadFileEx (HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPOVERLAPPED lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) |
BOOL | ReadFileScatter (HANDLE hFile, FILE_SEGMENT_ELEMENT aSegmentArray[], DWORD nNumberOfBytesToRead, LPDWORD lpReserved, LPOVERLAPPED lpOverlapped) |
BOOL | WriteFile (HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) |
BOOL | WriteFileEx (HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPOVERLAPPED lpOverlapped, LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine) |
BOOL | WriteFileGather (HANDLE hFile, FILE_SEGMENT_ELEMENT aSegmentArray[], DWORD nNumberOfBytesToWrite, LPDWORD lpReserved, LPOVERLAPPED lpOverlapped) |
BOOL | FlushFileBuffers (HANDLE hFile) |
BOOL WINAPI | GetFileAttributesExA (LPCSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation) |
BOOL WINAPI | GetFileAttributesExW (LPCWSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation) |
DWORD WINAPI | GetFileAttributesA (LPCSTR lpFileName) |
DWORD WINAPI | GetFileAttributesW (LPCWSTR lpFileName) |
BOOL | GetFileInformationByHandle (HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation) |
static char * | append (char *buffer, size_t size, const char *append) |
static const char * | flagsToStr (char *buffer, size_t size, DWORD flags) |
BOOL | SetFileAttributesA (LPCSTR lpFileName, DWORD dwFileAttributes) |
BOOL | SetFileAttributesW (LPCWSTR lpFileName, DWORD dwFileAttributes) |
BOOL | SetEndOfFile (HANDLE hFile) |
DWORD WINAPI | GetFileSize (HANDLE hFile, LPDWORD lpFileSizeHigh) |
DWORD | SetFilePointer (HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod) |
BOOL | SetFilePointerEx (HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod) |
BOOL | LockFile (HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh) |
BOOL | LockFileEx (HANDLE hFile, DWORD dwFlags, DWORD dwReserved, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped) |
BOOL | UnlockFile (HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh) |
BOOL | UnlockFileEx (HANDLE hFile, DWORD dwReserved, DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped) |
BOOL WINAPI | SetFileTime (HANDLE hFile, const FILETIME *lpCreationTime, const FILETIME *lpLastAccessTime, const FILETIME *lpLastWriteTime) |
static WIN32_FILE_SEARCH * | file_search_new (const char *name, size_t namelen, const char *pattern, size_t patternlen) |
static BOOL | is_valid_file_search_handle (HANDLE handle) |
static BOOL | FindDataFromStat (const char *path, const struct stat *fileStat, LPWIN32_FIND_DATAA lpFindFileData) |
HANDLE | FindFirstFileA (LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData) |
static BOOL | ConvertFindDataAToW (LPWIN32_FIND_DATAA lpFindFileDataA, LPWIN32_FIND_DATAW lpFindFileDataW) |
HANDLE | FindFirstFileW (LPCWSTR lpFileName, LPWIN32_FIND_DATAW lpFindFileData) |
HANDLE | FindFirstFileExA (LPCSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, LPVOID lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, LPVOID lpSearchFilter, DWORD dwAdditionalFlags) |
HANDLE | FindFirstFileExW (LPCWSTR lpFileName, FINDEX_INFO_LEVELS fInfoLevelId, LPVOID lpFindFileData, FINDEX_SEARCH_OPS fSearchOp, LPVOID lpSearchFilter, DWORD dwAdditionalFlags) |
BOOL | FindNextFileA (HANDLE hFindFile, LPWIN32_FIND_DATAA lpFindFileData) |
BOOL | FindNextFileW (HANDLE hFindFile, LPWIN32_FIND_DATAW lpFindFileData) |
BOOL | FindClose (HANDLE hFindFile) |
BOOL | CreateDirectoryA (LPCSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes) |
BOOL | CreateDirectoryW (LPCWSTR lpPathName, LPSECURITY_ATTRIBUTES lpSecurityAttributes) |
BOOL | RemoveDirectoryA (LPCSTR lpPathName) |
BOOL | RemoveDirectoryW (LPCWSTR lpPathName) |
BOOL | MoveFileExA (LPCSTR lpExistingFileName, LPCSTR lpNewFileName, DWORD dwFlags) |
BOOL | MoveFileExW (LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName, DWORD dwFlags) |
BOOL | MoveFileA (LPCSTR lpExistingFileName, LPCSTR lpNewFileName) |
BOOL | MoveFileW (LPCWSTR lpExistingFileName, LPCWSTR lpNewFileName) |
int | UnixChangeFileMode (const char *filename, int flags) |
Variables | |
static wArrayList * | HandleCreators |
static pthread_once_t | HandleCreatorsInitialized = PTHREAD_ONCE_INIT |
static const char | file_search_magic [] = "file_srch_magic" |
#define TAG WINPR_TAG("file") |
WinPR: Windows Portable Runtime File Functions
Copyright 2012 Marc-Andre Moreau marca Copyright 2014 Hewlett-Packard Development Company, L.P. Copyright 2016 David PHAM-VAN ndre .more au@g mail. comd.pha mvan @inuv ika. com
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
static |
|
static |
BOOL CreateDirectoryA | ( | LPCSTR | lpPathName, |
LPSECURITY_ATTRIBUTES | lpSecurityAttributes | ||
) |
BOOL CreateDirectoryW | ( | LPCWSTR | lpPathName, |
LPSECURITY_ATTRIBUTES | lpSecurityAttributes | ||
) |
HANDLE CreateFileA | ( | LPCSTR | lpFileName, |
DWORD | dwDesiredAccess, | ||
DWORD | dwShareMode, | ||
LPSECURITY_ATTRIBUTES | lpSecurityAttributes, | ||
DWORD | dwCreationDisposition, | ||
DWORD | dwFlagsAndAttributes, | ||
HANDLE | hTemplateFile | ||
) |
HANDLE CreateFileW | ( | LPCWSTR | lpFileName, |
DWORD | dwDesiredAccess, | ||
DWORD | dwShareMode, | ||
LPSECURITY_ATTRIBUTES | lpSecurityAttributes, | ||
DWORD | dwCreationDisposition, | ||
DWORD | dwFlagsAndAttributes, | ||
HANDLE | hTemplateFile | ||
) |
BOOL DeleteFileA | ( | LPCSTR | lpFileName | ) |
BOOL DeleteFileW | ( | LPCWSTR | lpFileName | ) |
|
static |
BOOL FindClose | ( | HANDLE | hFindFile | ) |
|
static |
HANDLE FindFirstFileA | ( | LPCSTR | lpFileName, |
LPWIN32_FIND_DATAA | lpFindFileData | ||
) |
HANDLE FindFirstFileExA | ( | LPCSTR | lpFileName, |
FINDEX_INFO_LEVELS | fInfoLevelId, | ||
LPVOID | lpFindFileData, | ||
FINDEX_SEARCH_OPS | fSearchOp, | ||
LPVOID | lpSearchFilter, | ||
DWORD | dwAdditionalFlags | ||
) |
HANDLE FindFirstFileExW | ( | LPCWSTR | lpFileName, |
FINDEX_INFO_LEVELS | fInfoLevelId, | ||
LPVOID | lpFindFileData, | ||
FINDEX_SEARCH_OPS | fSearchOp, | ||
LPVOID | lpSearchFilter, | ||
DWORD | dwAdditionalFlags | ||
) |
HANDLE FindFirstFileW | ( | LPCWSTR | lpFileName, |
LPWIN32_FIND_DATAW | lpFindFileData | ||
) |
BOOL FindNextFileA | ( | HANDLE | hFindFile, |
LPWIN32_FIND_DATAA | lpFindFileData | ||
) |
BOOL FindNextFileW | ( | HANDLE | hFindFile, |
LPWIN32_FIND_DATAW | lpFindFileData | ||
) |
|
static |
BOOL FlushFileBuffers | ( | HANDLE | hFile | ) |
DWORD WINAPI GetFileAttributesA | ( | LPCSTR | lpFileName | ) |
BOOL WINAPI GetFileAttributesExA | ( | LPCSTR | lpFileName, |
GET_FILEEX_INFO_LEVELS | fInfoLevelId, | ||
LPVOID | lpFileInformation | ||
) |
BOOL WINAPI GetFileAttributesExW | ( | LPCWSTR | lpFileName, |
GET_FILEEX_INFO_LEVELS | fInfoLevelId, | ||
LPVOID | lpFileInformation | ||
) |
DWORD WINAPI GetFileAttributesW | ( | LPCWSTR | lpFileName | ) |
BOOL GetFileInformationByHandle | ( | HANDLE | hFile, |
LPBY_HANDLE_FILE_INFORMATION | lpFileInformation | ||
) |
DWORD WINAPI GetFileSize | ( | HANDLE | hFile, |
LPDWORD | lpFileSizeHigh | ||
) |
HANDLE_CREATOR * GetNamedPipeClientHandleCreator | ( | void | ) |
|
static |
|
static |
BOOL LockFile | ( | HANDLE | hFile, |
DWORD | dwFileOffsetLow, | ||
DWORD | dwFileOffsetHigh, | ||
DWORD | nNumberOfBytesToLockLow, | ||
DWORD | nNumberOfBytesToLockHigh | ||
) |
BOOL LockFileEx | ( | HANDLE | hFile, |
DWORD | dwFlags, | ||
DWORD | dwReserved, | ||
DWORD | nNumberOfBytesToLockLow, | ||
DWORD | nNumberOfBytesToLockHigh, | ||
LPOVERLAPPED | lpOverlapped | ||
) |
BOOL MoveFileA | ( | LPCSTR | lpExistingFileName, |
LPCSTR | lpNewFileName | ||
) |
BOOL MoveFileExA | ( | LPCSTR | lpExistingFileName, |
LPCSTR | lpNewFileName, | ||
DWORD | dwFlags | ||
) |
BOOL MoveFileExW | ( | LPCWSTR | lpExistingFileName, |
LPCWSTR | lpNewFileName, | ||
DWORD | dwFlags | ||
) |
BOOL MoveFileW | ( | LPCWSTR | lpExistingFileName, |
LPCWSTR | lpNewFileName | ||
) |
BOOL ReadFile | ( | HANDLE | hFile, |
LPVOID | lpBuffer, | ||
DWORD | nNumberOfBytesToRead, | ||
LPDWORD | lpNumberOfBytesRead, | ||
LPOVERLAPPED | lpOverlapped | ||
) |
BOOL ReadFileEx | ( | HANDLE | hFile, |
LPVOID | lpBuffer, | ||
DWORD | nNumberOfBytesToRead, | ||
LPOVERLAPPED | lpOverlapped, | ||
LPOVERLAPPED_COMPLETION_ROUTINE | lpCompletionRoutine | ||
) |
BOOL ReadFileScatter | ( | HANDLE | hFile, |
FILE_SEGMENT_ELEMENT | aSegmentArray[], | ||
DWORD | nNumberOfBytesToRead, | ||
LPDWORD | lpReserved, | ||
LPOVERLAPPED | lpOverlapped | ||
) |
BOOL RemoveDirectoryA | ( | LPCSTR | lpPathName | ) |
BOOL RemoveDirectoryW | ( | LPCWSTR | lpPathName | ) |
BOOL SetEndOfFile | ( | HANDLE | hFile | ) |
BOOL SetFileAttributesA | ( | LPCSTR | lpFileName, |
DWORD | dwFileAttributes | ||
) |
BOOL SetFileAttributesW | ( | LPCWSTR | lpFileName, |
DWORD | dwFileAttributes | ||
) |
DWORD SetFilePointer | ( | HANDLE | hFile, |
LONG | lDistanceToMove, | ||
PLONG | lpDistanceToMoveHigh, | ||
DWORD | dwMoveMethod | ||
) |
BOOL SetFilePointerEx | ( | HANDLE | hFile, |
LARGE_INTEGER | liDistanceToMove, | ||
PLARGE_INTEGER | lpNewFilePointer, | ||
DWORD | dwMoveMethod | ||
) |
BOOL WINAPI SetFileTime | ( | HANDLE | hFile, |
const FILETIME * | lpCreationTime, | ||
const FILETIME * | lpLastAccessTime, | ||
const FILETIME * | lpLastWriteTime | ||
) |
int UnixChangeFileMode | ( | const char * | filename, |
int | flags | ||
) |
BOOL UnlockFile | ( | HANDLE | hFile, |
DWORD | dwFileOffsetLow, | ||
DWORD | dwFileOffsetHigh, | ||
DWORD | nNumberOfBytesToUnlockLow, | ||
DWORD | nNumberOfBytesToUnlockHigh | ||
) |
BOOL UnlockFileEx | ( | HANDLE | hFile, |
DWORD | dwReserved, | ||
DWORD | nNumberOfBytesToUnlockLow, | ||
DWORD | nNumberOfBytesToUnlockHigh, | ||
LPOVERLAPPED | lpOverlapped | ||
) |
BOOL WriteFile | ( | HANDLE | hFile, |
LPCVOID | lpBuffer, | ||
DWORD | nNumberOfBytesToWrite, | ||
LPDWORD | lpNumberOfBytesWritten, | ||
LPOVERLAPPED | lpOverlapped | ||
) |
BOOL WriteFileEx | ( | HANDLE | hFile, |
LPCVOID | lpBuffer, | ||
DWORD | nNumberOfBytesToWrite, | ||
LPOVERLAPPED | lpOverlapped, | ||
LPOVERLAPPED_COMPLETION_ROUTINE | lpCompletionRoutine | ||
) |
BOOL WriteFileGather | ( | HANDLE | hFile, |
FILE_SEGMENT_ELEMENT | aSegmentArray[], | ||
DWORD | nNumberOfBytesToWrite, | ||
LPDWORD | lpReserved, | ||
LPOVERLAPPED | lpOverlapped | ||
) |
|
static |
|
static |
api-ms-win-core-file-l1-2-0.dll:
CreateFileA CreateFileW CreateFile2 DeleteFileA DeleteFileW CreateDirectoryA CreateDirectoryW RemoveDirectoryA RemoveDirectoryW CompareFileTime DefineDosDeviceW DeleteVolumeMountPointW FileTimeToLocalFileTime LocalFileTimeToFileTime FindClose FindCloseChangeNotification FindFirstChangeNotificationA FindFirstChangeNotificationW FindFirstFileA FindFirstFileExA FindFirstFileExW FindFirstFileW FindFirstVolumeW FindNextChangeNotification FindNextFileA FindNextFileW FindNextVolumeW FindVolumeClose GetDiskFreeSpaceA GetDiskFreeSpaceExA GetDiskFreeSpaceExW GetDiskFreeSpaceW GetDriveTypeA GetDriveTypeW GetFileAttributesA GetFileAttributesExA GetFileAttributesExW GetFileAttributesW GetFileInformationByHandle GetFileSize GetFileSizeEx GetFileTime GetFileType GetFinalPathNameByHandleA GetFinalPathNameByHandleW GetFullPathNameA GetFullPathNameW GetLogicalDrives GetLogicalDriveStringsW GetLongPathNameA GetLongPathNameW GetShortPathNameW GetTempFileNameW GetTempPathW GetVolumeInformationByHandleW GetVolumeInformationW GetVolumeNameForVolumeMountPointW GetVolumePathNamesForVolumeNameW GetVolumePathNameW QueryDosDeviceW SetFileAttributesA SetFileAttributesW SetFileTime SetFileValidData SetFileInformationByHandle ReadFile ReadFileEx ReadFileScatter WriteFile WriteFileEx WriteFileGather FlushFileBuffers SetEndOfFile SetFilePointer SetFilePointerEx LockFile LockFileEx UnlockFile UnlockFileEx File System Behavior in the Microsoft Windows Environment: http://download.microsoft.com/download/4/3/8/43889780-8d45-4b2e-9d3a-c696a890309f/File%20System%20Behavior%20Overview.pdf Asynchronous I/O - The GNU C Library: http://www.gnu.org/software/libc/manual/html_node/Asynchronous-I_002fO.html aio.h - asynchronous input and output: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/aio.h.html Asynchronous I/O User Guide: http://code.google.com/p/kernel/wiki/AIOUserGuide
|
static |