+/* Try to enable short name support on the target volume. If successful, return
+ * true. If unsuccessful, issue a warning and return false. */
+static bool
+try_to_enable_short_names(struct win32_apply_ctx *ctx)
+{
+ FILE_FS_PERSISTENT_VOLUME_INFORMATION info;
+ NTSTATUS status;
+
+ info.VolumeFlags = 0;
+ info.FlagMask = PERSISTENT_VOLUME_STATE_SHORT_NAME_CREATION_DISABLED;
+ info.Version = 1;
+ info.Reserved = 0;
+
+ status = (*func_NtFsControlFile)(ctx->h_target, NULL, NULL, NULL,
+ &ctx->iosb,
+ FSCTL_SET_PERSISTENT_VOLUME_STATE,
+ &info, sizeof(info), NULL, 0);
+ if (!NT_SUCCESS(status)) {
+ WARNING("Failed to enable short name support on target volume "
+ "(status=0x%08"PRIx32")", (u32)status);
+ return false;
+ }
+
+ return true;
+}
+