Lines Matching refs:drive
77 int GetBytesPerSector(HANDLE drive) in GetBytesPerSector() argument
83 if (DeviceIoControl(drive, IOCTL_DISK_GET_DRIVE_GEOMETRY, NULL, 0, in GetBytesPerSector()
94 HANDLE drive; in FixMBR() local
100 drive = CreateFile(driveName, in FixMBR()
105 if (drive == INVALID_HANDLE_VALUE) { in FixMBR()
114 if (GetBytesPerSector(drive) != SECTOR_SIZE) { in FixMBR()
117 GetBytesPerSector(drive), SECTOR_SIZE); in FixMBR()
122 if (ReadFile(drive, sector, sizeof(sector), &howMany, NULL) == 0) { in FixMBR()
154 SetFilePointer(drive, 0, NULL, FILE_BEGIN); in FixMBR()
156 if (WriteFile(drive, sector, sizeof(sector), &howMany, NULL) == 0) { in FixMBR()
167 if (!CloseHandle(drive)) { in FixMBR()