🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.comp.hardware
Article #23

Re: Windows 2003 �� 2T ����?

#23
From: Moses
Date: Wed, 03 Feb 2010 01:17
58 lines
3250 bytes
第一次编译, 复制过去运行, 出现 "应用程序配置不正确" 的那个错误
改为 /Mt 编译, 运行, 显示 read successful, 但在程序目录下找不到 PHYSICALDRIVE0 文件?




"snnn" <snnn119@gmail.com> wrote in message news:hk927s$ihe$2@www.shinco.com...
> 有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: <hkaiqf$reb$1@www.shinco.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-out.readnews.com!news-xxxfer.readnews.com!panix!bloom-beacon.mit.edu!61.160.235.197.MISMATCH!www.shinco.com!not-for-mail
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> <hk927s$ihe$2@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: Chinese,GB
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-out.readnews.com!news-xxxfer.readnews.com!panix!bloom-beacon.mit.edu!61.160.235.197.MISMATCH!www.shinco.com!not-for-mail
From: "Moses" <moses.mason@gmail.com>
Newsgroups: cn.comp.hardware,cn.comp.os.winxp,cn.fan
Subject: Re: Windows 2003 �� 2T ����?
Date: Wed, 3 Feb 2010 09:17:03 +0800
Organization: A poorly-installed InterNetNews site
Lines: 58
Message-ID: <hkaiqf$reb$1@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> <hk927s$ihe$2@www.shinco.com>
Reply-To: "Moses" <moses.mason@gmail.com>
NNTP-Posting-Host: 117.88.121.215
Mime-Version: 1.0
Content-Type: text/plain;
 format=flowed;
 charset="gb2312";
 reply-type=response
Content-Transfer-Encoding: quoted-printable
X-Trace: www.shinco.com 1265159823 28107 117.88.121.215 (3 Feb 2010 01:17:03 GMT)
X-Complaints-To: news@www.shinco.com
NNTP-Posting-Date: Wed, 3 Feb 2010 01:17:03 +0000 (UTC)
In-Reply-To: <hk927s$ihe$2@www.shinco.com>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726