X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=os%2Fos-windows.h;h=4f4e2bb38e74994e4c42a8c5e3c38885174b8a7a;hp=09f9c5438d2ff1580d16ab2b5586da488866b648;hb=5aa23eb8d6ae67c5a5e31737164307675b36518e;hpb=cab2440c23426b06e7e8327c5353fbd8373dcb5a diff --git a/os/os-windows.h b/os/os-windows.h index 09f9c543..4f4e2bb3 100644 --- a/os/os-windows.h +++ b/os/os-windows.h @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -112,6 +113,9 @@ static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) { int rc = 0; HANDLE hFile; + GET_LENGTH_INFORMATION info; + DWORD outBytes; + LARGE_INTEGER size; if (f->hFile == NULL) { hFile = CreateFile(f->file_name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, @@ -120,9 +124,6 @@ static inline int blockdev_size(struct fio_file *f, unsigned long long *bytes) hFile = f->hFile; } - GET_LENGTH_INFORMATION info; - DWORD outBytes; - LARGE_INTEGER size; size.QuadPart = 0; if (DeviceIoControl(hFile, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, &info, sizeof(info), &outBytes, NULL)) *bytes = info.Length.QuadPart;