Beispiel #1
0
CNdasUnitDevice::CNdasUnitDevice(
	CNdasDevicePtr pParentDevice, 
	DWORD dwUnitNo, 
	NDAS_UNITDEVICE_TYPE type,
	NDAS_UNITDEVICE_SUBTYPE subType,
	const NDAS_UNITDEVICE_HARDWARE_INFO& unitDeviceInfo,
	const NDAS_LOGICALDEVICE_GROUP& ldGroup,
	DWORD ldSequence) :
	CStringizerA<32>("%s.%02d", pParentDevice->ToStringA(), dwUnitNo),
	m_pParentDevice(pParentDevice),
	m_unitDeviceId(pCreateUnitDeviceId(pParentDevice,dwUnitNo)),
	m_type(type),
	m_subType(subType),
	m_status(NDAS_UNITDEVICE_STATUS_NOT_MOUNTED),
	m_lastError(NDAS_UNITDEVICE_ERROR_NONE),
	m_udinfo(unitDeviceInfo),
	m_ldGroup(ldGroup),
	m_ldSequence(ldSequence),
	m_bSupposeFault(FALSE)
{
	XTLTRACE2(NDASSVC_NDASUNITDEVICE, TRACE_LEVEL_INFORMATION,
		__FUNCTION__ " %s\n", ToStringA());

	::ZeroMemory(
		&m_PrimaryHostInfo, 
		sizeof(NDAS_UNITDEVICE_PRIMARY_HOST_INFO));

	COMVERIFY( StringCchPrintf(
		m_szRegContainer,
		30,
		_T("Devices\\%04d\\%04d"),
		pParentDevice->GetSlotNo(),
		m_unitDeviceId.UnitNo));
}
Beispiel #2
0
CNdasUnitDiskDevice::~CNdasUnitDiskDevice()
{
	XTLTRACE2(NDASSVC_NDASUNITDEVICE, TRACE_LEVEL_VERBOSE, 
		"%s\n", ToStringA());

	if (NULL != m_pAddTargetInfo) 
	{
		XTLVERIFY( HeapFree(::GetProcessHeap(), 0, m_pAddTargetInfo) );
		m_pAddTargetInfo = NULL;
	}
	if (NULL != m_pDIBv2) 
	{
		XTLVERIFY( HeapFree(::GetProcessHeap(), 0, m_pDIBv2) );
		m_pDIBv2  = NULL;
	}
	if (NULL != m_pBACL) 
	{
		XTLVERIFY( HeapFree(::GetProcessHeap(), 0, m_pBACL) );
		m_pBACL  = NULL;
	}
}
Beispiel #3
0
CNdasUnitDiskDevice::CNdasUnitDiskDevice(
	CNdasDevicePtr pParentDevice, 
	DWORD dwUnitNo, 
	NDAS_UNITDEVICE_DISK_TYPE diskType,
	const NDAS_UNITDEVICE_HARDWARE_INFO& unitDevInfo,
	const NDAS_LOGICALDEVICE_GROUP& ldGroup,
	DWORD ldSequence,
	UINT64 ulUserBlocks,
	PVOID pAddTargetInfo,
	const NDAS_CONTENT_ENCRYPT& contentEncrypt,
	NDAS_DIB_V2* pDIBv2,
	BLOCK_ACCESS_CONTROL_LIST *pBACL) :
	m_ulUserBlocks(ulUserBlocks),
	m_pAddTargetInfo(pAddTargetInfo),
	m_contentEncrypt(contentEncrypt),
	m_pDIBv2(pDIBv2),
	m_pBACL(pBACL),
	m_diskType(diskType),
	CNdasUnitDevice(
		pParentDevice, 
		dwUnitNo, 
		NDAS_UNITDEVICE_TYPE_DISK,
		CreateSubType(diskType),
		unitDevInfo,
		ldGroup,
		ldSequence)
{
	//
	// m_pDIBv2 and m_pAddTargetInfo will be deleted 
	// by this class on destruction
	//
	XTLASSERT(
		(NDAS_CONTENT_ENCRYPT_METHOD_NONE == m_contentEncrypt.Method &&
		m_contentEncrypt.KeyLength == 0) ||
		(NDAS_CONTENT_ENCRYPT_METHOD_NONE != m_contentEncrypt.Method &&
		m_contentEncrypt.KeyLength > 0));

	XTLTRACE2(NDASSVC_NDASUNITDEVICE, TRACE_LEVEL_VERBOSE, 
		"%s\n", ToStringA());
}
Beispiel #4
0
//
// Destructor
//
CNdasUnitDevice::~CNdasUnitDevice()
{
	XTLTRACE2(NDASSVC_NDASUNITDEVICE, TRACE_LEVEL_INFORMATION,
		__FUNCTION__ " %s\n", ToStringA());
}
Beispiel #5
0
	operator LPCSTR()
	{
		return ToStringA();
	}
Beispiel #6
0
 clStringA MD5Calculater::ToStringA()
 {
   clStringA t;
   return ToStringA(t);
 }