本文整理汇总了C++中CDiskObjectPtr::GetAccessMask方法的典型用法代码示例。如果您正苦于以下问题:C++ CDiskObjectPtr::GetAccessMask方法的具体用法?C++ CDiskObjectPtr::GetAccessMask怎么用?C++ CDiskObjectPtr::GetAccessMask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDiskObjectPtr
的用法示例。
在下文中一共展示了CDiskObjectPtr::GetAccessMask方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCommandSet
CCommandSet CAggrDiskUIHandler::GetCommandSet(CDiskObjectPtr obj) const
{
CCommandSet setCommand;
setCommand.push_back(
CCommand(IDM_TOOL_UNBIND, obj->GetAccessMask() & GENERIC_WRITE)
);
return setCommand;
}
示例2:
CCommandSet CRAID0DiskUIHandler::GetCommandSet(CDiskObjectPtr obj) const
{
CCommandSet setCommand;
// AING_TO_DO : add IDM_RAID0_UNBIND
setCommand.push_back(
CCommand(IDM_TOOL_UNBIND, obj->GetAccessMask() & GENERIC_WRITE)
);
return setCommand;
}
示例3: GetParentSheet
//////////////////////////////////////////////////////////////////////////
// Page 1
//////////////////////////////////////////////////////////////////////////
LRESULT CDiskPropertyPage1::OnInitDialog(HWND /*hWndFocus*/, LPARAM /*lParam*/)
{
WTL::CString strCaption;
strCaption.LoadString(IDS_DISKPROPERTYPAGE_CAPTION);
GetParent().SetWindowText(strCaption);
CDiskObjectPtr disk = GetParentSheet()->GetDiskObject();
const CObjectUIHandler *phandler = CObjectUIHandler::GetUIHandler( disk );
WTL::CString strText;
if(disk->IsUnitDisk())
{
GetDlgItem(IDC_EDIT_NAME).SetWindowText( disk->GetTitle() );
GetDlgItem(IDC_EDIT_ID).SetWindowText(
phandler->GetStringID(disk) );
}
else
{
GetDlgItem(IDC_EDIT_NAME).SetWindowText(phandler->GetTitle(disk));
GetDlgItem(IDC_DEVICE_ID).ShowWindow(SW_HIDE);
GetDlgItem(IDC_EDIT_ID).ShowWindow(SW_HIDE);
}
if ( (disk->GetAccessMask() & GENERIC_WRITE) != 0 )
{
strText.LoadString( IDS_DISKPROPERTYPAGE_WRITEKEY_PRESENT );
GetDlgItem(IDC_EDIT_WRITEKEY).SetWindowText( strText );
}
else
{
strText.LoadString( IDS_DISKPROPERTYPAGE_WRITEKEY_NOT_PRESENT );
GetDlgItem(IDC_EDIT_WRITEKEY).SetWindowText( strText );
}
WTL::CString strCapacity;
strCapacity.FormatMessage(
IDS_DISKPROPERTYPAGE_SIZE_IN_GB,
phandler->GetSizeInMB( disk ) / 1024,
(phandler->GetSizeInMB( disk ) % 1024) / 10
);
GetDlgItem(IDC_EDIT_CAPACITY).SetWindowText( strCapacity );
//
// If the object is composite disk with 2 mirrored disk of DIB V1,
// display 'Migrate' button and message.
//
if(!disk->IsUnitDisk() && // bound disk
disk->GetParent()->IsRoot() && // top disk
2 == disk->GetDiskCount()) // 2 disks only
{
CDiskObjectCompositePtr pDiskObjectComposite =
boost::dynamic_pointer_cast<CDiskObjectComposite>(disk);
if(NMT_MIRROR == pDiskObjectComposite->GetNDASMediaType())
{
GetDlgItem(IDC_TEXT_MIGRATE).ShowWindow( SW_SHOW );
GetDlgItem(IDC_BTN_MIGRATE).ShowWindow( SW_SHOW );
GetDlgItem(IDC_ST_MIGRATE).ShowWindow( SW_SHOW );
}
}
return 0;
}
示例4: IsWritable
BOOL IsWritable(CDiskObjectPtr obj)
{
return obj->GetAccessMask() & GENERIC_WRITE;
}