跳至主要內容

iSUDiskSDK


接口

iSUDisk封装了非常方便的SDK接口,有需要定制开发需求的企业欢迎咨询

enum {
	emSUDiskMaxString = 64,
	emSUDiskMaxBuffer = 1024,
};

enum emSUDiskEncryptType
{
	emSUDiskEncryptNone,
	emSUDiskEncryptQuick,
	emSUDiskEncryptAES128,
	emSUDiskEncryptAES256,
	emSUDiskEncryptSM4,
};

struct SUDiskRegistration 
{
	emSUDiskEncryptType EncryptType;
	ULONG Reserved;
	ULONGLONG DiskSize;
	LPCWSTR Password;
	LPCWSTR DiskLabel;			// MAX_LENGTH = emSUDiskMaxString
	LPCWSTR DiskRegisterName;	// MAX_LENGTH = emSUDiskMaxString
	UCHAR DiskCustomData[emSUDiskMaxBuffer];
};

struct SUDiskInfo 
{
	emSUDiskEncryptType EncryptType;
	ULONG IsNeedPassword : 1;
	ULONG Reserved : 31;
	WCHAR DiskLabel[emSUDiskMaxString];
	WCHAR DiskRegisterName[emSUDiskMaxString];
	UCHAR DiskCustomData[emSUDiskMaxBuffer];
};

interface __declspec (uuid(SUDISK_IID_MOUNT_CONTEXT)) ISUDiskMountContext : public IUnknown
{
	virtual LPCWSTR	GetMountPath		(void) = 0;
	virtual HRESULT	SetAutoUnmount		(bool Enable) = 0;
	virtual HRESULT	ExploreMountPath	(void) = 0;
};

interface __declspec (uuid(SUDISK_IID_SUDISK)) ISUDisk : public IUnknown
{
	virtual HRESULT Register			(LPCWSTR DiskPath, const SUDiskRegistration& Registration) = 0;
	virtual HRESULT Unregister			(LPCWSTR DiskPath) = 0;
	virtual HRESULT	Mount				(LPCWSTR DiskPath, LPCWSTR MountPath, LPCWSTR Password, ISUDiskMountContext** Context) = 0;
	virtual HRESULT MountRamDisk		(ULONGLONG DiskSize, LPCWSTR MountPath, ISUDiskMountContext** Context) = 0;
	virtual HRESULT Unmount				(LPCWSTR MountPath) = 0;
	virtual HRESULT GetDiskInfo			(LPCWSTR DiskPath, SUDiskInfo* Info) = 0;
	virtual HRESULT GetVerifiedDiskInfo	(LPCWSTR DiskPath, LPCWSTR Password, SUDiskInfo* Info) = 0;
	virtual HRESULT	ResetPassword		(LPCWSTR DiskPath, LPCWSTR Password, LPCWSTR NewPassword) = 0;
};