daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Mar 19th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. for (int i = 0; i < 26; i++)
  2. {
  3.     wstring s = std::wstring(L"\\.\") + wchar_t('A' + i) + L":";
  4.  
  5.     PARTITION_INFORMATION diskInfo;
  6.     DWORD dwResult;
  7.     HANDLE dev = CreateFile(LPWSTR(s.c_str()), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, NULL);
  8.     DeviceIoControl(dev, IOCTL_DISK_GET_PARTITION_INFO, NULL, 0, &diskInfo, sizeof(diskInfo), &dwResult, NULL);
  9.     CloseHandle(dev);
  10.     if (diskInfo.PartitionType == PARTITION_IFS)
  11.     {
  12.         ...
  13.     }
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top