亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? main.cpp

?? 枚舉windows操作系統(tǒng)中物理磁盤和邏輯磁盤的信息
?? CPP
字號(hào):
#pragma warning(disable:4786)
#include <windows.h>
#include <cfgmgr32.h>
#include <Setupapi.h>
#include <cfgmgr32.h>
#include <initguid.h>
#include <iostream>
#include <string>
#include <vector>
#include "scsicmd.h"
#include "DeviceList.h"
using namespace std;
DEFINE_GUID(HARDDISK_GUID, 0x53f56307, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
DEFINE_GUID(VOLUME_GUID, 0x53f5630d, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b);
//DEFINE_GUID(xxqaz,0x36FC9E60, 0xC465, 0x11CF, 0x80, 0x56, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00);
struct DISKGEOMETRY{
	DWORD Cylinders,Heads,Sectors,BytesPerSector;
	DISKGEOMETRY():Cylinders(0),Heads(0),Sectors(0){}
};
struct DEVICEINFO{
	wstring Ring3Interface,FriendlyName,DeviceDesc,PhysicalDeviceObjectName,Service;
	wstring ParentInstanceID,ParentDeviceDesc;
	wstring StorageManagerName;
	DWORD StorageDeviceNumber;
	DWORD Sectors,BytesPerSector;
	DISKGEOMETRY DiskGeometry;
	DEVICEINFO():StorageDeviceNumber(-1),Sectors(0),BytesPerSector(0){}
};
DWORD GetDeviceInfo(GUID const*const guid,vector<DEVICEINFO>&DeviceVect,bool const QuestSCSIInfo=false);
void OutputMsg(wstring const msg,bool const end=true);
void main(){
	vector<DEVICEINFO>PhysicalDrive,Volume;
	GetDeviceInfo(&HARDDISK_GUID,PhysicalDrive,true);
	GetDeviceInfo(&VOLUME_GUID,Volume);
	vector<DEVICEINFO>::const_iterator pcx=Volume.begin();
	for(;pcx!=Volume.end();++pcx){
		wcout<<L"FriendlyName:"<<pcx->FriendlyName<<endl;
		wcout<<L"PhysicalDeviceObjectName:"<<pcx->PhysicalDeviceObjectName<<endl;
		wcout<<L"Service:"<<pcx->Service<<endl;
		wcout<<L"SerialNo."<<pcx->ParentInstanceID<<endl;
		wcout<<L"Device Type:"<<pcx->ParentDeviceDesc<<endl;
		wcout<<L"StorageManagerNumber:0x"<<hex<<pcx->StorageDeviceNumber<<dec<<L"  StorageManagerName:"<<pcx->StorageManagerName<<endl;
		vector<wstring>const AliasNames=GetAliasNames(pcx->PhysicalDeviceObjectName);
		vector<wstring>::const_iterator pcy=AliasNames.begin();
		for(;pcy!=AliasNames.end();++pcy){
			wcout<<L"  AliasName:"<<pcy->c_str()<<endl;
		}
		wcout<<endl;
	}
	vector<DEVICEINFO>::const_iterator pc=PhysicalDrive.begin();
	for(;pc!=PhysicalDrive.end();++pc){
		wcout<<L"FriendlyName:"<<pc->FriendlyName<<endl;
		wcout<<L"PhysicalDeviceObjectName:"<<pc->PhysicalDeviceObjectName<<endl;
		wcout<<L"Service:"<<pc->Service<<endl;
		wcout<<L"SerialNo."<<pc->ParentInstanceID<<endl;
		wcout<<L"Device Type:"<<pc->ParentDeviceDesc<<endl;
		wcout<<L"Capacity:"<<double(pc->Sectors)/2048<<L" MegaBytes  SectorSize:"
			<<pc->BytesPerSector<<L"(0x"<<hex<<pc->BytesPerSector<<L")"<<endl;
		wcout<<L"Cylinders:"<<dec<<pc->DiskGeometry.Cylinders
			<<L"(0x"<<hex<<pc->DiskGeometry.Cylinders;
		wcout<<L"),Heads:"<<dec<<pc->DiskGeometry.Heads
			<<L"(0x"<<hex<<pc->DiskGeometry.Heads;
		wcout<<L"),Sectors:"<<dec<<pc->DiskGeometry.Sectors
			<<L"(0x"<<hex<<pc->DiskGeometry.Sectors;
		wcout<<L"),SectorSize:"<<dec<<pc->DiskGeometry.BytesPerSector
			<<L"(0x"<<hex<<pc->DiskGeometry.BytesPerSector<<dec<<L")"<<endl;
		if(pc->BytesPerSector!=pc->DiskGeometry.BytesPerSector)
			wcout<<L"Warning Sector Sizes are Conflicted."<<endl;
		DWORD const tmpSectors=pc->DiskGeometry.Cylinders*pc->DiskGeometry.Heads*pc->DiskGeometry.Sectors;
		if(pc->Sectors!=tmpSectors)
			wcout<<L"Warning Total Sectors are Conflicted:"<<dec<<pc->Sectors<<hex<<L"(0x"<<pc->Sectors
			<<L"):"<<dec<<tmpSectors<<hex<<L"(0x"<<tmpSectors<<L")"<<endl;
		vector<DEVICEINFO>::const_iterator pcx=Volume.begin();
		for(;pcx!=Volume.end();++pcx){
			if((pc->StorageDeviceNumber==pcx->StorageDeviceNumber)&&(pc->StorageDeviceNumber==pcx->StorageDeviceNumber)){
				OutputMsg(L"  "+pcx->DeviceDesc+L"  "+pcx->PhysicalDeviceObjectName,false);
				vector<wstring>const AliasNames=GetAliasNames(pcx->PhysicalDeviceObjectName);
				vector<wstring>::const_iterator pcy=AliasNames.begin();
				for(;pcy!=AliasNames.end();++pcy){
					if(2==pcy->size())
						if((pcy->at(1)==L':')&&(((pcy->at(0)>=L'A')&&(pcy->at(0)<=L'Z'))||((pcy->at(0)>=L'a')&&(pcy->at(0)<=L'z')))){
							wcout<<L"  DriveLetter "<<pcy->c_str();
						}
				}
				wcout<<endl;
			}
		}
		wcout<<endl;
	}
}
wstring GetRegistryPropertyW(HDEVINFO const info,SP_DEVINFO_DATA const&did,DWORD const Property);
bool GetParentID(DEVINST const DevInst,DEVINST&dnDevInst,wstring&IDName,wstring&ParentDeviceDesc);
bool GetStorageInfo(wstring const Ring3Interface,DWORD&StorageDeviceNumber,wstring&StorageManagerName);
DWORD GetDeviceInfo(GUID const*const guid,vector<DEVICEINFO>&DeviceVect,bool const QuestSCSIInfo){
	HDEVINFO info=SetupDiGetClassDevsW(guid,NULL,NULL,DIGCF_PRESENT|DIGCF_INTERFACEDEVICE);
	if(INVALID_HANDLE_VALUE==info){
		return 0;
	}
	DWORD ErrorCount=0;
	SP_INTERFACE_DEVICE_DATA ifdata;
	ifdata.cbSize=sizeof(ifdata);
	DWORD devindex;
	for(devindex=0;SetupDiEnumDeviceInterfaces(info,NULL,guid,devindex,&ifdata);++devindex){
		DEVICEINFO tmpinfo;
		DWORD needed=0;
		SetupDiGetDeviceInterfaceDetailW(info,&ifdata,NULL,0,&needed,NULL);
		PSP_INTERFACE_DEVICE_DETAIL_DATA_W detail=(PSP_INTERFACE_DEVICE_DETAIL_DATA_W)new char[needed];
		detail->cbSize=sizeof(SP_INTERFACE_DEVICE_DETAIL_DATA_W);
		SP_DEVINFO_DATA did={sizeof(SP_DEVINFO_DATA)};
		if(!SetupDiGetDeviceInterfaceDetailW(info,&ifdata,detail,needed,&needed,&did)){
			ErrorCount++;
			delete[](char*)detail;detail=NULL;needed=0;
			continue;
		}
		tmpinfo.Ring3Interface=detail->DevicePath;
		delete[](char*)detail;detail=NULL;needed=0;
		tmpinfo.FriendlyName=GetRegistryPropertyW(info,did,SPDRP_FRIENDLYNAME);
		tmpinfo.DeviceDesc=GetRegistryPropertyW(info,did,SPDRP_DEVICEDESC);
		tmpinfo.PhysicalDeviceObjectName=GetRegistryPropertyW(info,did,SPDRP_PHYSICAL_DEVICE_OBJECT_NAME);
		tmpinfo.Service=GetRegistryPropertyW(info,did,SPDRP_SERVICE);
		DEVINST ParentInst;
		GetParentID(did.DevInst,ParentInst,tmpinfo.ParentInstanceID,tmpinfo.ParentDeviceDesc);
		GetStorageInfo(tmpinfo.Ring3Interface,tmpinfo.StorageDeviceNumber,tmpinfo.StorageManagerName);
		if(QuestSCSIInfo){
			GetCapacity(tmpinfo.Ring3Interface,tmpinfo.Sectors,tmpinfo.BytesPerSector);
			GetGeometry(tmpinfo.Ring3Interface,tmpinfo.DiskGeometry.Cylinders,tmpinfo.DiskGeometry.Heads,tmpinfo.DiskGeometry.Sectors,tmpinfo.DiskGeometry.BytesPerSector);
		}
		DeviceVect.push_back(tmpinfo);
	}
	SetupDiDestroyDeviceInfoList(info);
	return ErrorCount;
}
wstring GetRegistryPropertyW(HDEVINFO const info,SP_DEVINFO_DATA const&did,DWORD const Property){
	DWORD needed=0;
	SetupDiGetDeviceRegistryPropertyW(info,(PSP_DEVINFO_DATA)&did,Property,NULL,NULL,0,&needed);
	PBYTE pBuf=new BYTE[needed];
	if(SetupDiGetDeviceRegistryPropertyW(info,(PSP_DEVINFO_DATA)&did,Property,NULL,pBuf,needed,&needed)){
		wstring const tmp=wstring::pointer(pBuf);
		delete[]pBuf;
		return tmp;
	}else{
		delete[]pBuf;
		return wstring();
	}
}
bool GetParentID(DEVINST const DevInst,DEVINST&dnDevInst,wstring&IDName,wstring&ParentDeviceDesc){
	bool success=false;
	dnDevInst=0;
	IDName.erase();
	if(CR_SUCCESS==CM_Get_Parent(&dnDevInst,DevInst,0)){
		DWORD needed=0;
		if(CR_SUCCESS==CM_Get_Device_ID_Size(&needed,dnDevInst,0)){
			IDName.resize(needed);
			if(CR_SUCCESS==CM_Get_Device_IDW(dnDevInst,wstring::pointer(IDName.c_str()),needed,0)){
				HDEVINFO const info=SetupDiCreateDeviceInfoList(NULL,NULL);
				if(INVALID_HANDLE_VALUE!=info){
					SP_DEVINFO_DATA did={sizeof(SP_DEVINFO_DATA)};
					if(SetupDiOpenDeviceInfoW(info,IDName.c_str(),NULL,0,&did)){
						ParentDeviceDesc=GetRegistryPropertyW(info,did,SPDRP_DEVICEDESC);
						success=true;
					}
					SetupDiDestroyDeviceInfoList(info);
				}
			}else
				IDName.erase();
		}
	}
	return success;
}
bool GetStorageInfo(wstring const Ring3Interface,DWORD&StorageDeviceNumber,wstring&StorageManagerName){
	StorageDeviceNumber=-1;
	StorageManagerName.erase();
	DISK_PERFORMANCE DiskPerf;
	DWORD needed;
	bool success=false;
	HANDLE const hDevice=CreateFileW(Ring3Interface.c_str(),0,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL);
	if(DeviceIoControl(hDevice,IOCTL_DISK_PERFORMANCE,NULL,0,(void*)&DiskPerf,sizeof(DISK_PERFORMANCE),&needed,NULL)){
		StorageDeviceNumber=DiskPerf.StorageDeviceNumber;
		StorageManagerName.assign(DiskPerf.StorageManagerName,sizeof(DiskPerf.StorageManagerName));
		success=true;
	}
	return success;
}
void OutputMsg(wstring const msg,bool const end){
	DWORD tmp;
	WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE),msg.c_str(),msg.size(),&tmp,NULL);
	if(end)
		wcout<<endl;
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品国产三级国产普通话99| 欧美日韩国产另类一区| 国产欧美日韩在线视频| 国产乱码精品一区二区三| 国产欧美一区二区精品婷婷| 99精品视频中文字幕| 一区二区久久久久久| 欧美一区二区精品在线| 国产做a爰片久久毛片| 国产精品污www在线观看| 一本色道a无线码一区v| 亚洲成人在线网站| 久久丝袜美腿综合| 91丝袜美腿高跟国产极品老师| 亚洲乱码一区二区三区在线观看| 精品视频999| 国产在线不卡视频| 亚洲四区在线观看| 欧美日韩另类国产亚洲欧美一级| 美女在线视频一区| 中文字幕在线视频一区| 欧美日韩一区二区在线观看| 精品亚洲免费视频| 亚洲欧美日韩国产成人精品影院| 在线不卡a资源高清| 国产成人高清在线| 亚洲一级二级三级| 久久一区二区三区国产精品| 色婷婷综合久久久中文一区二区| 日本亚洲免费观看| 国产精品护士白丝一区av| 777奇米四色成人影色区| 国产成人啪免费观看软件| 亚洲一二三四久久| 久久精品视频一区二区三区| 欧美亚洲国产bt| 国产91精品久久久久久久网曝门| 五月综合激情网| 中文一区二区在线观看| 91麻豆精品国产综合久久久久久| 成人中文字幕合集| 美女mm1313爽爽久久久蜜臀| 亚洲人成在线观看一区二区| 久久午夜色播影院免费高清| 欧美私人免费视频| 99久久久精品| 国产精品原创巨作av| 日本在线不卡视频| 一区二区三区中文字幕| 欧美激情在线观看视频免费| 欧美一二三四区在线| 在线视频一区二区三区| 粉嫩一区二区三区在线看| 免费的国产精品| 亚洲午夜一区二区| 亚洲人成在线播放网站岛国| 中文字幕乱码久久午夜不卡| 日韩小视频在线观看专区| 欧美日韩一区二区三区四区| 99视频国产精品| 国产mv日韩mv欧美| 国产一区 二区| 六月丁香婷婷色狠狠久久| 天堂久久久久va久久久久| 亚洲精品日日夜夜| 日韩理论在线观看| 成人欧美一区二区三区小说| 国产精品情趣视频| 欧美激情一区二区| 国产色爱av资源综合区| 精品国产成人在线影院| 精品卡一卡二卡三卡四在线| 欧美一卡在线观看| 日韩美女主播在线视频一区二区三区| 91精品欧美一区二区三区综合在 | 精品在线你懂的| 视频一区在线播放| 日日骚欧美日韩| 日韩不卡一区二区| 免费日本视频一区| 蜜臀av性久久久久蜜臀aⅴ| 另类调教123区| 国产一区二区美女诱惑| 国产精品中文有码| 成人激情午夜影院| av激情亚洲男人天堂| 一本大道久久a久久精二百| 在线亚洲人成电影网站色www| 在线亚洲欧美专区二区| 91麻豆精品国产综合久久久久久| 欧美一区二区视频在线观看| 精品日本一线二线三线不卡| 国产亚洲成av人在线观看导航| 国产精品成人免费在线| 亚洲综合网站在线观看| 丝袜亚洲精品中文字幕一区| 精品在线免费观看| 成人禁用看黄a在线| 日本精品一级二级| 欧美一区二区三区人| 国产亚洲精品中文字幕| 亚洲视频电影在线| 日本 国产 欧美色综合| 国产精品1区二区.| 欧美在线色视频| 欧美成人一区二区三区| 国产精品激情偷乱一区二区∴| 亚洲一卡二卡三卡四卡无卡久久| 日本午夜精品视频在线观看 | 欧美高清一级片在线| 亚洲精品一线二线三线无人区| 欧美国产成人精品| 亚洲国产综合91精品麻豆| 理论片日本一区| 色婷婷av一区二区三区大白胸| 日韩一区二区精品在线观看| 中文字幕av不卡| 日本大胆欧美人术艺术动态| 成人不卡免费av| 91精品久久久久久久久99蜜臂| 国产欧美日韩另类视频免费观看| 亚洲午夜精品网| 国产精品一区二区在线看| 欧美亚洲精品一区| 欧美极品美女视频| 日韩高清电影一区| aaa亚洲精品一二三区| 日韩欧美一区二区免费| 亚洲日本丝袜连裤袜办公室| 国模套图日韩精品一区二区| 日本精品视频一区二区| 国产女同性恋一区二区| 欧美中文字幕一区| 精品国产乱子伦一区| 亚洲国产综合视频在线观看| 不卡视频免费播放| 精品免费99久久| 午夜视频在线观看一区二区| www.成人网.com| 亚洲精品一线二线三线| 秋霞国产午夜精品免费视频| 色狠狠色噜噜噜综合网| 国产精品午夜免费| 黄色精品一二区| 欧美一区二区久久久| 亚洲一区免费视频| 色综合天天综合网天天看片 | 国产精品每日更新| 看片的网站亚洲| 91麻豆精品国产91久久久久久久久| 日韩毛片精品高清免费| 粉嫩aⅴ一区二区三区四区 | 欧美精品一二三| 一区二区三区视频在线观看| 播五月开心婷婷综合| 国产亚洲福利社区一区| 精品一区二区三区不卡| 在线电影一区二区三区| 午夜成人免费电影| 欧美日韩国产综合一区二区| 一区二区欧美视频| 欧美私人免费视频| 亚洲成a人片综合在线| 欧美中文字幕一区二区三区| 一区二区三区四区中文字幕| 色综合久久久久久久久| 亚洲四区在线观看| 一本大道av一区二区在线播放| 自拍偷在线精品自拍偷无码专区| 欧美一区二区视频免费观看| 日韩高清在线电影| 精品日韩一区二区三区| 久久福利资源站| 久久综合九色欧美综合狠狠| 国产一区二区三区综合| 国产欧美精品在线观看| 夫妻av一区二区| 亚洲天堂2016| 欧美日韩国产一级| 麻豆一区二区三| 久久精品一区蜜桃臀影院| 福利一区在线观看| 亚洲黄色免费网站| 91麻豆精品国产无毒不卡在线观看| 久久精品国产亚洲高清剧情介绍 | 欧美一级二级三级乱码| 美女www一区二区| 欧美韩国日本综合| 91激情五月电影| 免费视频最近日韩| 国产精品午夜在线观看| 欧美性感一类影片在线播放| 免费欧美高清视频| 国产亚洲一区二区三区在线观看| 99久久久无码国产精品| 午夜久久电影网| 久久人人97超碰com| 一本色道综合亚洲| 免费成人在线视频观看| 国产欧美va欧美不卡在线|