HRESULT CNdasDiskUnit::UnitInitialize( __in INdasDevice* pNdasDevice, __in DWORD UnitNo, __in NDAS_DISK_UNIT_TYPE DiskType, __in const NDAS_UNITDEVICE_HARDWARE_INFO& HardwareInfo, __in const NDAS_LOGICALUNIT_DEFINITION& NdasLogicalUnitDefinition, __in DWORD LuSequence, __in UINT64 UserBlocks, __in PVOID pRaidInfo, __in const NDAS_CONTENT_ENCRYPT& Encryption, __in NDAS_DIB_V2* pDIBv2, __in BLOCK_ACCESS_CONTROL_LIST *pBlockAcl) { HRESULT hr = CNdasUnitImpl::ImplInitialize( pNdasDevice, UnitNo, NDAS_UNITDEVICE_TYPE_DISK, CreateSubType(DiskType), HardwareInfo, NdasLogicalUnitDefinition, LuSequence); if (FAILED(hr)) { ATLASSERT(FALSE); return hr; } ATLASSERT(NULL != pDIBv2); m_ulUserBlocks = UserBlocks; m_pNdasLogicalUnitRaidInfo.Attach(pRaidInfo); m_contentEncrypt = Encryption; m_pDIBv2.Attach(pDIBv2); m_pBACL.Attach(pBlockAcl); m_diskType = DiskType; // // 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", CNdasUnitDeviceId(m_unitDeviceId).ToStringA()); return S_OK; }
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()); }