cvolumeimpdrv98.h
来自「PGP8.0源码 请认真阅读您的文件包然后写出其具体功能」· C头文件 代码 · 共 94 行
H
94 行
/*____________________________________________________________________________
Copyright (C) 2002 PGP Corporation
All rights reserved.
$Id: CVolumeImpDrv98.h,v 1.5 2002/08/06 20:09:31 dallen Exp $
____________________________________________________________________________*/
#ifndef Included_CVolumeImpDrv98_h // [
#define Included_CVolumeImpDrv98_h
#include "CString.h"
#include "CVolumeImp.h"
#include "CDcb.h"
#include "CIop.h"
_PGP_BEGIN
// Constants
#define LOCKP_ALLOW_WRITES 0x01 // Bit 0 set - allow writes
#define LOCKP_FAIL_WRITES 0x00 // Bit 0 clear - fail writes
#define LOCKP_FAIL_MEM_MAPPING 0x02 // Bit 1 set - fail memory mappings
#define LOCKP_ALLOW_MEM_MAPPING 0x00 // Bit 1 clear - allow memory mappings
#define LOCKP_USER_MASK 0x03 // Mask for user lock flags
#define LOCKP_LOCK_FOR_FORMAT 0x04 // Level 0 lock for format
// Class CVolumeImpDrv98
class CVolumeImpDrv98 : public CVolumeImp
{
friend class CDriverImpFactoryDrv98;
public:
typedef void (_cdecl *IopDispatchFunc)(CIop& iop, void *refPtr);
private:
enum LockLevel {LockLevelNone, LockLevel1, LockLevel2, LockLevel3,
LockLevel0, LockLevel0MR};
private:
CVolumeImpDrv98();
~CVolumeImpDrv98();
const char * DeviceName() const {return mDeviceName;}
PGPBoolean HasOpenFiles();
CComboError AttachVolume(const char *root, const char *deviceName);
void DetachVolume();
CComboError Mount(const char *deviceName, const char *root,
PGPUInt64 totalBlocks, PGPUInt32 blockSize,
const void *iopDispatchFunc, void *refPtr, PGPBoolean readOnly);
CComboError Unmount(PGPBoolean isForced);
CComboError LockForIO();
CComboError LockForFormat();
CComboError UnlockVolume();
CComboError Read(void *buf, PGPUInt64 pos, PGPUInt32 nBlocks) const;
CComboError Write(const void *buf, PGPUInt64 pos, PGPUInt32 nBlocks);
private:
CDcb mDcb;
CString mDeviceName;
IopDispatchFunc mDispatchFunc;
void *mRefPtr;
CComboError GetLockLevel(LockLevel& lockLevel) const;
CComboError SetLockLevel(LockLevel lockLevel,
PGPUInt8 permissions = LOCKP_ALLOW_WRITES);
CComboError AcquireFormatLock();
CComboError ReleaseFormatLock();
CComboError FillInBlockInfo();
void InitDcb(PGPUInt8 drive, PGPUInt64 totalBlocks,
PGPUInt32 blockSize, PGPBoolean readOnly);
CComboError DiskAccess(PGPUInt16 func, void *buf, PGPUInt64 pos,
PGPUInt32 nBlocks) const;
void DispatchIopAux(CIop& iop);
static void DispatchIopStub(PIOP pIop);
static void DispatchIop(PIOP pIop);
};
_PGP_END
#endif // ] Included_CVolumeImpDrv98_h
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?