]> wimlib.net Git - wimlib/commitdiff
win32: only define FSCTL_SET_PERSISTENT_VOLUME_STATE if not yet defined
authorEric Biggers <ebiggers3@gmail.com>
Tue, 29 Jun 2021 07:42:11 +0000 (00:42 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Tue, 29 Jun 2021 07:42:11 +0000 (00:42 -0700)
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

index 70114c8dac7aa86938c3e5bac0db6f0d9d73a352..a886b56daafe44fc6fefe8673394bd45e9c7df03 100644 (file)
@@ -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  */