SetFilePointer(hDisk, (_nsect * SIZE_OF_BLOCK), 0, FILE_BEGIN) set pointer to the sector on the disk that we want to write to Printf("Error attempting to get a handle to the device! (%s)\n", errMsg) MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errMsg, 255, NULL) make sure we have a handle to the specified volume or physical driveįormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), HANDLE hDisk = CreateFile(_dsk, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) attempt to get a handle to the specified volume or physical drive Unsigned int _nsect, // sector number, starting with 0 short WriteSectorĬhar *
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |