26struct TPhRapiCloseHandle
36class CRapiFileApiT :
public TYP
48 virtual HANDLE GetHandle(
void)
const
57 virtual void SetHandle(HANDLE h)
62 virtual BOOL ApiGetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION P)
const
67 P->dwFileAttributes = ::GetFileAttributes(GetOpenName());
68 r &= ::CeGetFileTime(hFile, &P->ftCreationTime, &P->ftLastAccessTime, &P->ftLastWriteTime);
69 P->nFileSizeLow = ::CeGetFileSize(hFile, &P->nFileSizeHigh);
70 ::SetLastError(::CeGetLastError());
74 virtual HANDLE ApiCreateFile(LPCTSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes,
75 DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
78 HANDLE h = ::CeCreateFile(
CUnicode(lpFileName), dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
79 ::SetLastError(::CeGetLastError());
83 virtual DWORD ApiGetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh)
const
86 DWORD r = ::CeGetFileSize(hFile, lpFileSizeHigh);
87 ::SetLastError(::CeGetLastError());
91 virtual DWORD ApiSetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod)
const
94 DWORD r = ::CeSetFilePointer(hFile, lDistanceToMove, lpDistanceToMoveHigh, dwMoveMethod);
95 ::SetLastError(::CeGetLastError());
99 virtual BOOL ApiReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped)
const
102 BOOL r = ::CeReadFile(hFile, lpBuffer, nNumberOfBytesToRead, lpNumberOfBytesRead, lpOverlapped);
103 ::SetLastError(::CeGetLastError());
107 virtual BOOL ApiSetFileTime(HANDLE hFile, CONST
FILETIME *lpCreationTime, CONST
FILETIME *lpLastAccessTime, CONST
FILETIME *lpLastWriteTime)
113 BOOL r = ::CeSetFileTime(hFile, &f1, &f2, &f3);
114 ::SetLastError(::CeGetLastError());
118 virtual BOOL ApiSetEndOfFile(HANDLE hFile)
121 BOOL r = ::CeSetEndOfFile(hFile);
122 ::SetLastError(::CeGetLastError());
126 virtual BOOL ApiWriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped)
129 BOOL r = ::CeWriteFile(hFile, lpBuffer, nNumberOfBytesToWrite, lpNumberOfBytesWritten, lpOverlapped);
130 ::SetLastError(::CeGetLastError());
134 mutable CRapiHandleHandle m_hhFile;
static bool IsSupported(void)
[確認] サポート確認.
static bool Startup(void)
[設定] RAPI 初期化.
TNB::CStrT< WCHAR > CUnicode
UNICODE文字列クラス
void Zero(V &value)
[設定] ゼロクリア.