目的是看这个u盘会不会因为这样导致这个flash块快速损坏
std::string szDiscFile( "\\\\.\\H:");
HANDLE hDisc = CreateFile(szDiscFile.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
SetFilePointer(hDisc, 0, NULL, FILE_BEGIN);
DWORD dwSectorNum =1;
DWORD dwRead = dwSectorNum << 9,
dwRealRead = 0;
long cc=0;
while (1)
{
cc++;
char pBuf[1024]={0};
SetFilePointer(hDisc, 0, NULL, FILE_BEGIN);
ReadFile(hDisc, pBuf, dwRead, &dwRealRead, NULL);
pBuf[0]=time(NULL);
SetFilePointer(hDisc, 0, NULL, FILE_BEGIN);
BOOL rs= WriteFile(hDisc, pBuf, dwRead, &dwRealRead, NULL);
printf("count = %d",cc);
}
CloseHandle(hDisc);