forked from Yonsm/AheadLib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMapFile.h
More file actions
executable file
·32 lines (23 loc) · 926 Bytes
/
MapFile.h
File metadata and controls
executable file
·32 lines (23 loc) · 926 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 预处理
#pragma once
#include <Windows.h>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CMapFile 类
class CMapFile
{
public:
HANDLE m_hFile; // 文件句柄
HANDLE m_hMapping; // 映射句柄
PVOID m_pvFile; // 映射地址
DWORD m_dwSize; // 文件大小
public:
// 构造函数,映射文件为只读
WINAPI CMapFile(PCTSTR ptzFileName);
// 构造函数,映射文件为可读写
WINAPI CMapFile(PCTSTR ptzFileName, DWORD dwSize);
// 析构函数
WINAPI ~CMapFile();
};
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////