本文整理汇总了C++中KDiskDeviceManager::NextDiskSystem方法的典型用法代码示例。如果您正苦于以下问题:C++ KDiskDeviceManager::NextDiskSystem方法的具体用法?C++ KDiskDeviceManager::NextDiskSystem怎么用?C++ KDiskDeviceManager::NextDiskSystem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KDiskDeviceManager
的用法示例。
在下文中一共展示了KDiskDeviceManager::NextDiskSystem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
status_t
_user_get_next_disk_system_info(int32 *_cookie, user_disk_system_info *_info)
{
if (_info == NULL)
return B_BAD_VALUE;
if (!IS_USER_ADDRESS(_info))
return B_BAD_ADDRESS;
int32 cookie;
status_t result = copy_from_user_value(cookie, _cookie);
if (result != B_OK)
return result;
result = B_ENTRY_NOT_FOUND;
KDiskDeviceManager *manager = KDiskDeviceManager::Default();
if (ManagerLocker locker = manager) {
KDiskSystem *diskSystem = manager->NextDiskSystem(&cookie);
if (diskSystem != NULL) {
user_disk_system_info info;
diskSystem->GetInfo(&info);
result = copy_to_user_value(_info, info);
}
}
status_t error = copy_to_user_value(_cookie, cookie);
if (error != B_OK)
result = error;
return result;
}
示例2: sizeof
status_t
_user_get_next_disk_system_info(int32 *_cookie, user_disk_system_info *_info)
{
if (!_cookie || !_info)
return B_BAD_VALUE;
int32 cookie;
user_memcpy(&cookie, _cookie, sizeof(cookie));
status_t result = B_ENTRY_NOT_FOUND;
KDiskDeviceManager *manager = KDiskDeviceManager::Default();
if (ManagerLocker locker = manager) {
if (KDiskSystem *diskSystem = manager->NextDiskSystem(&cookie)) {
user_disk_system_info info;
diskSystem->GetInfo(&info);
user_memcpy(_info, &info, sizeof(info));
result = B_OK;
}
}
user_memcpy(_cookie, &cookie, sizeof(cookie));
return result;
}