From 995542c1b79e356bd728e294d38bad4d033c9a54 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 29 Jun 2021 00:42:11 -0700 Subject: [PATCH] win32: only define FSCTL_SET_PERSISTENT_VOLUME_STATE if not yet defined The MinGW headers define this (and the related struct and constant) now, which is causing a build error. Also use CTL_CODE() rather than a raw number. --- include/wimlib/win32_common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/wimlib/win32_common.h b/include/wimlib/win32_common.h index 70114c8d..a886b56d 100644 --- a/include/wimlib/win32_common.h +++ b/include/wimlib/win32_common.h @@ -30,7 +30,9 @@ typedef struct _RTL_RELATIVE_NAME_U { PRTLP_CURDIR_REF CurDirRef; } RTL_RELATIVE_NAME_U, *PRTL_RELATIVE_NAME_U; -#define FSCTL_SET_PERSISTENT_VOLUME_STATE 0x90238 +#ifndef FSCTL_SET_PERSISTENT_VOLUME_STATE +#define FSCTL_SET_PERSISTENT_VOLUME_STATE \ + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 142, METHOD_BUFFERED, FILE_ANY_ACCESS) #define PERSISTENT_VOLUME_STATE_SHORT_NAME_CREATION_DISABLED 0x00000001 @@ -40,6 +42,7 @@ typedef struct _FILE_FS_PERSISTENT_VOLUME_INFORMATION { ULONG Version; ULONG Reserved; } FILE_FS_PERSISTENT_VOLUME_INFORMATION, *PFILE_FS_PERSISTENT_VOLUME_INFORMATION; +#endif /* FSCTL_SET_PERSISTENT_VOLUME_STATE */ /* ntdll functions */ -- 2.43.0