FreeRDP
|
#include <winpr/config.h>
#include <winpr/debug.h>
#include <winpr/assert.h>
#include <winpr/wtypes.h>
#include <winpr/crt.h>
#include <winpr/file.h>
#include "../log.h"
#include <winpr/wlog.h>
#include <winpr/string.h>
#include "file.h"
#include <errno.h>
#include <fcntl.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/statvfs.h>
Macros | |
#define | TAG WINPR_TAG("file") |
#define | MIN(x, y) (((x) < (y)) ? (x) : (y)) |
#define | STATVFS statvfs |
Functions | |
static BOOL | FileIsHandled (HANDLE handle) |
static int | FileGetFd (HANDLE handle) |
static BOOL | FileCloseHandle (HANDLE handle) |
static BOOL | FileSetEndOfFile (HANDLE hFile) |
static DWORD | FileSetFilePointer (HANDLE hFile, LONG lDistanceToMove, const PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod) |
static BOOL | FileSetFilePointerEx (HANDLE hFile, LARGE_INTEGER liDistanceToMove, PLARGE_INTEGER lpNewFilePointer, DWORD dwMoveMethod) |
static BOOL | FileRead (PVOID Object, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped) |
static BOOL | FileWrite (PVOID Object, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped) |
static DWORD | FileGetFileSize (HANDLE Object, LPDWORD lpFileSizeHigh) |
static BOOL | FileGetFileInformationByHandle (HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation) |
static BOOL | FileLockFileEx (HANDLE hFile, DWORD dwFlags, DWORD dwReserved, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped) |
static BOOL | FileUnlockFile (HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh) |
static BOOL | FileUnlockFileEx (HANDLE hFile, DWORD dwReserved, DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped) |
static UINT64 | FileTimeToUS (const FILETIME *ft) |
static BOOL | FileSetFileTime (HANDLE hFile, const FILETIME *lpCreationTime, const FILETIME *lpLastAccessTime, const FILETIME *lpLastWriteTime) |
static const char * | FileGetMode (DWORD dwDesiredAccess, DWORD dwCreationDisposition, BOOL *create) |
UINT32 | map_posix_err (int fs_errno) |
static HANDLE | FileCreateFileA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) |
static BOOL | IsFileDevice (LPCTSTR lpDeviceName) |
HANDLE_CREATOR * | GetFileHandleCreator (void) |
static WINPR_FILE * | FileHandle_New (FILE *fp) |
HANDLE | GetStdHandle (DWORD nStdHandle) |
BOOL | SetStdHandle (DWORD nStdHandle, HANDLE hHandle) |
BOOL | SetStdHandleEx (DWORD dwStdHandle, HANDLE hNewHandle, HANDLE *phOldHandle) |
BOOL | GetDiskFreeSpaceA (LPCSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters) |
BOOL | GetDiskFreeSpaceW (LPCWSTR lpwRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters) |
BOOL | ValidFileNameComponent (LPCWSTR lpFileName) |
HANDLE | GetFileHandleForFileDescriptor (int fd) |
FILE * | winpr_fopen (const char *path, const char *mode) |
Variables | |
static HANDLE_OPS | fileOps |
static HANDLE_OPS | shmOps |
static HANDLE_CREATOR | FileHandleCreator = { IsFileDevice, FileCreateFileA } |
#define STATVFS statvfs |
#define TAG WINPR_TAG("file") |
WinPR: Windows Portable Runtime File Functions
Copyright 2015 Thincast Technologies GmbH Copyright 2015 Bernhard Miklautz bernh Copyright 2016 David PHAM-VAN ard. mikla utz@ thinc ast. 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 |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
BOOL GetDiskFreeSpaceA | ( | LPCSTR | lpRootPathName, |
LPDWORD | lpSectorsPerCluster, | ||
LPDWORD | lpBytesPerSector, | ||
LPDWORD | lpNumberOfFreeClusters, | ||
LPDWORD | lpTotalNumberOfClusters | ||
) |
BOOL GetDiskFreeSpaceW | ( | LPCWSTR | lpwRootPathName, |
LPDWORD | lpSectorsPerCluster, | ||
LPDWORD | lpBytesPerSector, | ||
LPDWORD | lpNumberOfFreeClusters, | ||
LPDWORD | lpTotalNumberOfClusters | ||
) |
HANDLE_CREATOR* GetFileHandleCreator | ( | void | ) |
HANDLE GetFileHandleForFileDescriptor | ( | int | fd | ) |
HANDLE GetStdHandle | ( | DWORD | nStdHandle | ) |
|
static |
UINT32 map_posix_err | ( | int | fs_errno | ) |
BOOL SetStdHandle | ( | DWORD | nStdHandle, |
HANDLE | hHandle | ||
) |
BOOL SetStdHandleEx | ( | DWORD | dwStdHandle, |
HANDLE | hNewHandle, | ||
HANDLE * | phOldHandle | ||
) |
BOOL ValidFileNameComponent | ( | LPCWSTR | lpFileName | ) |
Check if a file name component is valid.
Some file names are not valid on Windows. See "Naming Files, Paths, and Namespaces": https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
FILE* winpr_fopen | ( | const char * | path, |
const char * | mode | ||
) |
|
static |
|
static |