You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
836 B
C++
39 lines
836 B
C++
/////////////////////////////////////////////////////////////////////////////
|
|
//主要功能:
|
|
// 文件映射类
|
|
//
|
|
//程序编写: 2008-11-09
|
|
//
|
|
//
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
#include "filemappingbase.h"
|
|
|
|
namespace NFile64
|
|
{
|
|
|
|
class CFileMapping :
|
|
public CFileMappingBase
|
|
{
|
|
DECLARE_DYNAMIC(CFileMapping)
|
|
|
|
public:
|
|
CFileMapping(void);
|
|
virtual ~CFileMapping(void);
|
|
|
|
//需要锁定时必须手动调用
|
|
BOOL CreateMutex(LPCTSTR mapName); //根据映射名称生成互斥信号
|
|
BOOL OpenMutex(LPCTSTR mapName); //获得已存在的互斥信号使用权
|
|
BOOL Lock(DWORD dwMilliSeconds = INFINITE); //互斥锁定共享内存
|
|
BOOL Unlock(); //互斥解锁共享内存
|
|
void CloseMutex(void); //关闭互斥信号
|
|
|
|
virtual void CloseAll(void);
|
|
|
|
private:
|
|
HANDLE m_hFileOperation; //文件操作互斥量
|
|
};
|
|
|
|
};
|