Voici une source qui permet de lire le secteur du disque physique n°0
qui se situe au de la de 128 Go.
Je dispose d'un DD de 160 Go Hitashi PATA
#include "stdafx.h"
#include <windows.h>
int main(int argc, char* argv[])
{
char buf[512];
printf("Hello World!\n");
//\\.\PHYSICALDRIVE0
//Ne pas specifier GENERIC_WRITE
HANDLE
h=CreateFile("\\\\.\\PHYSICALDRIVE0",GENERIC_READ,FILE_SHARE_READ,0,OPEN_EXISTING,FILE_FLAG_NO_BUFFERING,0);
//parametre ne doit être changer !!!
DWORD lpn;
long lpi=32; //32*4 Go = 128 Go
//long lpi=2097151;
SetFilePointer(h,0,&lpi,FILE_BEGIN);
lpn=0;
ReadFile(h,buf,512,&lpn,0);
CloseHandle(h);
FILE *f;
f=fopen("teste","wb");
fwrite(buf,512,1,f); //Sauvegarde du resultat
fclose(f);
return 0;
}
Resultat : Ca lit le secteur de partition , le secteur n°0
Je n'ai pas installer la pack 1 ni la pack 2.
Windows XP Pro,
processeur Intel Pentium 4 2Ghz datant de Juillet 2002.
Voilà !
Même pas la peine de limitation dans le service des disques logiques à
128 Go , il m'affiche 153 Go.
Bug ne provenant pas de Microsoft , sure et certain !
If lpDistanceToMoveHigh is not NULL, the function returns the low order DWORD of the new file pointer, and puts the high order DWORD of the new file pointer into the LONG pointed to by that parameter.
If lpDistanceToMoveHigh is not NULL, the function returns the low order
DWORD of the new file pointer, and puts the high order DWORD of the new file
pointer into the LONG pointed to by that parameter.
If lpDistanceToMoveHigh is not NULL, the function returns the low order DWORD of the new file pointer, and puts the high order DWORD of the new file pointer into the LONG pointed to by that parameter.