From: SMTP%"htolley@lardav.com" 30-DEC-1997 17:40:53.13 To: ntdev@atria.com CC: Subj: Re: [ntdev] physical sector read from hard disk Return-Path: owner-ntdev@atria.com Received: by arisia.gce.com (UCX V4.1-12C, OpenVMS V7.1 VAX); Tue, 30 Dec 1997 17:38:17 -0500 Received: from gw.atria.com (gw.atria.com [192.88.237.2]) by mercury.mv.net (8.8.8/mem-971025) with SMTP id PAA10439 for ; Tue, 30 Dec 1997 15:45:17 -0500 (EST) Received: by gw.atria.com id Tue, 30 Dec 1997 12:27:31 -0500 Received: from pub.lardav.com by gw.atria.com id Tue, 30 Dec 1997 12:27:28 -0500 Received: from dino.lardav.com (mailhost.54.141.207.in-addr.arpa [207.141.54.45] (may be forged)) by pub.lardav.com (8.8.8/8.8.3) with SMTP id KAA11561 for ; Tue, 30 Dec 1997 10:26:57 -0700 (MST) Received: from lardav.com by dino.lardav.com (SMI-8.6/SMI-SVR4) id KAA23652; Tue, 30 Dec 1997 10:26:56 -0700 Received: from LDI/SpoolDir by lardav.com (Mercury 1.21); 30 Dec 97 10:26:56 -0700 Received: from SpoolDir by LDI (Mercury 1.30); 30 Dec 97 10:26:45 -0700 From: "Hal D. Tolley ... Sensar" Organization: Larson-Davis, Inc. To: ntdev@atria.com Date: Tue, 30 Dec 1997 10:26:44 MST7MDT Subject: Re: [ntdev] physical sector read from hard disk Reply-to: htolley@lardav.com In-reply-to: <34A87CEC.BD14F713@opentech.stpn.soft.net> X-mailer: Pegasus Mail for Windows (v2.53/R1) Message-ID: <131944A01F4@lardav.com> Sender: owner-ntdev@atria.com Precedence: bulk X-Majordomo-Taboo: ntdev > Hell guys. Can any body tell me how to read or write to physical > sector of a hard disk. > > Thanks in advance. > > HANDLE hDisk = CreateFile("\\\\.\\PHYSICALDRIVE1", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, NULL); You need to ensure that when you read a sector you have your memory buffer aligned and that you request read sizes in intergral amounts of the sector size. Consult the documentation for CreateFile for more info. -Hal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntdev-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]