MCPcopy Create free account
hub / github.com/HoShiMin/Kernel-Bridge / FilesAPI

Class FilesAPI

Kernel-Bridge/API/FilesAPI.h:24–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22};
23
24class FilesAPI final {
25private:
26 HANDLE hFile;
27 NTSTATUS CreationStatus;
28public:
29 enum CREATE_FILE_TYPE {
30 fCreateEmpty,
31 fOpenExisting,
32 fOpenOrCreate
33 };
34
35 FilesAPI(
36 LPCWSTR FilePath,
37 CREATE_FILE_TYPE Type,
38 ACCESS_MASK AccessMask,
39 ULONG ShareAccess
40 );
41 ~FilesAPI() { Close(); }
42
43 NTSTATUS GetCreationStatus() const { return CreationStatus; }
44
45 NTSTATUS Read(OUT PVOID Buffer, ULONG Size, OPTIONAL UINT64 Offset = 0) const;
46 NTSTATUS Write(IN PVOID Buffer, ULONG Size, OPTIONAL UINT64 Offset = 0) const;
47 NTSTATUS Close();
48
49 static NTSTATUS CreateDir(LPCWSTR DirPath);
50 static NTSTATUS DeleteFile(LPCWSTR FilePath);
51 static NTSTATUS RenameFile(LPCWSTR OriginalFile, LPCWSTR NewName);
52 static NTSTATUS MoveFile(LPCWSTR OriginalFile, LPCWSTR Destination);
53 static NTSTATUS CopyFile(LPCWSTR OriginalFile, LPCWSTR Destination);
54 static SIZE_T GetFileSize(LPCWSTR FilePath);
55 static BOOLEAN IsFileExists(LPCWSTR FilePath);
56 static BOOLEAN IsDirExists(LPCWSTR DirPath);
57};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected