Article View: cn.comp.hardware
Article #22Re: Windows 2003 的 2T 上限?
From: snnn
Date: Tue, 02 Feb 2010 11:28
Date: Tue, 02 Feb 2010 11:28
42 lines
2431 bytes
2431 bytes
��VC��
����������
http://snnn.googlecode.com/svn/trunk/readmbr/readmbr
#include <iostream>
#include <locale.h>
#include <cstdio>
#include <vector>
#include <io.h>
#include <windows.h>
#include <Fcntl.h>
#include "diskmbr.h"
#if _MSC_VER > 1400
#define fdopen _fdopen
#endif
static void getPartitions(std::FILE* file){
char buf[512];
memset(buf,0,sizeof(buf));
size_t len=fread(buf,1,sizeof(buf),file);
if(len<sizeof(buf)) return dosPartitions;
//TODO: print content to stdout
}
int main(int argc,char* argv[]){
setlocale(LC_ALL,"");
HANDLE
hDev=CreateFileW(L"\\\\.\\PHYSICALDRIVE0",GENERIC_READ,FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL);
if(hDev==INVALID_HANDLE_VALUE) return 0;
int fd=_open_osfhandle((intptr_t)hDev,_O_RDONLY);
if(fd<0) return 0;
std::FILE* file=fdopen(fd,"r");
getPartitions(file);
return 0;
}
Technical Details
Message-ID:
<hk927s$ihe$2@www.shinco.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!news-out.readnews.com!transit3.readnews.com!teleglobe.net!newsgate.cuhk.edu.hk!www.shinco.com!not-for-mailReferences:
<hk0gvu$vka$1@moses.motzarella.org> <hk2o9q$edd$1@www.shinco.com> <hk5cbf$1lo$1@moses.motzarella.org> <hk5k08$i9j$1@www.shinco.com> <hk8lq8$75a$1@www.shinco.com> <hk8rj4$oqv$2@www.shinco.com> <hk91n3$hq1$1@www.shinco.com> <hk91v5$ihe$1@www.shinco.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 3473bcdd2c,1d64f11a53a9accf X-Google-Attributes: gid3473bcdd2c,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!news-out.readnews.com!transit3.readnews.com!teleglobe.net!newsgate.cuhk.edu.hk!www.shinco.com!not-for-mail From: snnn <snnn119@gmail.com> Newsgroups: cn.comp.hardware,cn.comp.os.winxp,cn.fan Subject: Re: Windows 2003 的 2T 上限? Date: Tue, 02 Feb 2010 19:28:01 +0800 Organization: wanmei.inc Lines: 44 Message-ID: <hk927s$ihe$2@www.shinco.com> References: <hk0gvu$vka$1@moses.motzarella.org> <hk2o9q$edd$1@www.shinco.com> <hk5cbf$1lo$1@moses.motzarella.org> <hk5k08$i9j$1@www.shinco.com> <hk8lq8$75a$1@www.shinco.com> <hk8rj4$oqv$2@www.shinco.com> <hk91n3$hq1$1@www.shinco.com> <hk91v5$ihe$1@www.shinco.com> NNTP-Posting-Host: 124.200.52.18 Mime-Version: 1.0 Content-Type: text/plain; charset=x-gbk; format=flowed Content-Transfer-Encoding: 8bit X-Trace: www.shinco.com 1265110076 18990 124.200.52.18 (2 Feb 2010 11:27:56 GMT) X-Complaints-To: news@www.shinco.com NNTP-Posting-Date: Tue, 2 Feb 2010 11:27:56 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 In-Reply-To: <hk91v5$ihe$1@www.shinco.com>