aboutsummaryrefslogtreecommitdiff
path: root/block-raw-win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'block-raw-win32.c')
-rw-r--r--block-raw-win32.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block-raw-win32.c b/block-raw-win32.c
index db9995c046..43d3f6c4c2 100644
--- a/block-raw-win32.c
+++ b/block-raw-win32.c
@@ -105,6 +105,8 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags)
#else
overlapped = FILE_FLAG_OVERLAPPED;
#endif
+ if (flags & BDRV_O_DIRECT)
+ overlapped |= FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH;
s->hfile = CreateFile(filename, access_flags,
FILE_SHARE_READ, NULL,
create_flags, overlapped, NULL);
@@ -473,6 +475,8 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
#else
overlapped = FILE_FLAG_OVERLAPPED;
#endif
+ if (flags & BDRV_O_DIRECT)
+ overlapped |= FILE_FLAG_NO_BUFFERING | FILE_FLAG_WRITE_THROUGH;
s->hfile = CreateFile(filename, access_flags,
FILE_SHARE_READ, NULL,
create_flags, overlapped, NULL);