ronantakizawa/codereview-bench huggingface dataset:
Repository: files-community/Files
File: src/Files.App/ViewModels/Settings/AboutViewModel.cs (C#)

Code before:
		public Task SupportUs()
		{
			return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.SupportUsUrl)).AsTask();
		}

		public string GetAppVersion()
		{
			return string.Format($"{AppVersion.Major}.{AppVersion.Minor}.{AppVersion.Build}.{AppVersion.Revision}");
		}

		public string GetWindowsVersion()
		{
			return SystemInformation.Instance.OperatingSystemVersion.ToString();
		}
		
		public string GetUserId()
		{
			return GeneralSettingsService.UserId;
		}

		public string GetVersionsQueryString()
		{
			var query = System.Web.HttpUtility.ParseQueryString(string.Empty);
			query["files_version"] = GetAppVersion();
			query["windows_version"] = GetWindowsVersion();
			query["user_id"] = GetUserId();
			return query.ToString() ?? string.Empty;
		}
	}
}


Review comment (suggestion):
```suggestion
			query["user_id"] = GetUserID();
```

Code after:
		public Task SupportUs()
		{
			return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.SupportUsUrl)).AsTask();
		}

		public string GetAppVersion()
		{
			return string.Format($"{AppVersion.Major}.{AppVersion.Minor}.{AppVersion.Build}.{AppVersion.Revision}");
		}

		public string GetWindowsVersion()
		{
			return SystemInformation.Instance.OperatingSystemVersion.ToString();
		}
		
		public string GetUserID()
		{
			return GeneralSettingsService.UserId;
		}

		public string GetVersionsQueryString()
		{
			var query = System.Web.HttpUtility.ParseQueryString(string.Empty);
			query["files_version"] = GetAppVersion();
			query["windows_version"] = GetWindowsVersion();
			query["user_id"] = GetUserID();
			return query.ToString() ?? string.Empty;
		}
	}
}
Repository: files-community/Files
File: src/Files.App/ViewModels/Settings/AboutViewModel.cs (C#)

Code before:
			{
				DataPackage dataPackage = new DataPackage();
				dataPackage.RequestedOperation = DataPackageOperation.Copy;
				dataPackage.SetText(GetUserId());
				Clipboard.SetContent(dataPackage);
			});
		}

		public Task SupportUs()
		{
			return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.SupportUsUrl)).AsTask();
		}

		public string GetAppVersion()
		{
			return string.Format($"{AppVersion.Major}.{AppVersion.Minor}.{AppVersion.Build}.{AppVersion.Revision}");
		}

		public string GetWindowsVersion()
		{
			return SystemInformation.Instance.OperatingSystemVersion.ToString();
		}
		
		public string GetUserId()
		{
			return GeneralSettingsService.UserId;
		}

		public string GetVersionsQueryString()
		{
			var query = System.Web.HttpUtility.ParseQueryString(string.Empty);
			query["files_version"] = GetAppVersion();
			query["windows_version"] = GetWindowsVersion();
			query["user_id"] = GetUserId();
			return query.ToString() ?? string.Empty;
		}
	}
}


Review comment (suggestion):
```suggestion
		public string GetUserID()
		{
			return GeneralSettingsService.UserID;
```

Code after:
			{
				DataPackage dataPackage = new DataPackage();
				dataPackage.RequestedOperation = DataPackageOperation.Copy;
				dataPackage.SetText(GetUserID());
				Clipboard.SetContent(dataPackage);
			});
		}

		public Task SupportUs()
		{
			return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.SupportUsUrl)).AsTask();
		}

		public string GetAppVersion()
		{
			return string.Format($"{AppVersion.Major}.{AppVersion.Minor}.{AppVersion.Build}.{AppVersion.Revision}");
		}

		public string GetWindowsVersion()
		{
			return SystemInformation.Instance.OperatingSystemVersion.ToString();
		}
		
		public string GetUserID()
		{
			return GeneralSettingsService.UserId;
		}

		public string GetVersionsQueryString()
		{
			var query = System.Web.HttpUtility.ParseQueryString(string.Empty);
			query["files_version"] = GetAppVersion();
			query["windows_version"] = GetWindowsVersion();
			query["user_id"] = GetUserID();
			return query.ToString() ?? string.Empty;
		}
	}
}
Repository: files-community/Files
File: src/Files.App/ViewModels/Settings/AboutViewModel.cs (C#)

Code before:
			{
				DataPackage dataPackage = new DataPackage();
				dataPackage.RequestedOperation = DataPackageOperation.Copy;
				dataPackage.SetText(GetAppVersion());
				Clipboard.SetContent(dataPackage);
			});
		}

		public void CopyWindowsVersion()
		{
			SafetyExtensions.IgnoreExceptions(() =>
			{
				DataPackage dataPackage = new DataPackage();
				dataPackage.RequestedOperation = DataPackageOperation.Copy;
				dataPackage.SetText(GetWindowsVersion());
				Clipboard.SetContent(dataPackage);
			});
		}
		
		public void CopyUserId()
		{
			SafetyExtensions.IgnoreExceptions(() =>
			{
				DataPackage dataPackage = new DataPackage();
				dataPackage.RequestedOperation = DataPackageOperation.Copy;
				dataPackage.SetText(GetUserId());
				Clipboard.SetContent(dataPackage);
			});
		}

		public Task SupportUs()
		{
			return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.SupportUsUrl)).AsTask();
		}

		public string GetAppVersion()
		{
			return string.Format($"{AppVersion.Major}.{AppVersion.Minor}.{AppVersion.Build}.{AppVersion.Revision}");
		}

		public string GetWindowsVersion()
		{
			return SystemInformation.Instance.OperatingSystemVersion.ToString();
		}
		
		public string GetUserId()
		{
			return GeneralSettingsService.UserId;
		}

		public string GetVersionsQueryString()

Review comment (suggestion):
```suggestion
				dataPackage.SetText(GetUserID());
```

Code after:
			{
				DataPackage dataPackage = new DataPackage();
				dataPackage.RequestedOperation = DataPackageOperation.Copy;
				dataPackage.SetText(GetAppVersion());
				Clipboard.SetContent(dataPackage);
			});
		}

		public void CopyWindowsVersion()
		{
			SafetyExtensions.IgnoreExceptions(() =>
			{
				DataPackage dataPackage = new DataPackage();
				dataPackage.RequestedOperation = DataPackageOperation.Copy;
				dataPackage.SetText(GetWindowsVersion());
				Clipboard.SetContent(dataPackage);
			});
		}
		
		public void CopyUserID()
		{
			SafetyExtensions.IgnoreExceptions(() =>
			{
				DataPackage dataPackage = new DataPackage();
				dataPackage.RequestedOperation = DataPackageOperation.Copy;
				dataPackage.SetText(GetUserID());
				Clipboard.SetContent(dataPackage);
			});
		}

		public Task SupportUs()
		{
			return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.SupportUsUrl)).AsTask();
		}

		public string GetAppVersion()
		{
			return string.Format($"{AppVersion.Major}.{AppVersion.Minor}.{AppVersion.Build}.{AppVersion.Revision}");
		}

		public string GetWindowsVersion()
		{
			return SystemInformation.Instance.OperatingSystemVersion.ToString();
		}
		
		public string GetUserID()
		{
			return GeneralSettingsService.UserId;
		}

		public string GetVersionsQueryString()
Repository: files-community/Files
File: src/Files.App/ViewModels/Settings/AboutViewModel.cs (C#)

Code before:
			{
				DataPackage dataPackage = new DataPackage();
				dataPackage.RequestedOperation = DataPackageOperation.Copy;
				dataPackage.SetText(GetUserID());
				Clipboard.SetContent(dataPackage);
			});
		}

		public Task SupportUs()
		{
			return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.SupportUsUrl)).AsTask();
		}

		public string GetAppVersion()
		{
			return string.Format($"{AppVersion.Major}.{AppVersion.Minor}.{AppVersion.Build}.{AppVersion.Revision}");
		}

		public string GetWindowsVersion()
		{
			return SystemInformation.Instance.OperatingSystemVersion.ToString();
		}
		
		public string GetUserID()
		{
			return GeneralSettingsService.UserID;
		}

		public string GetVersionsQueryString()
		{
			var query = System.Web.HttpUtility.ParseQueryString(string.Empty);
			query["files_version"] = GetAppVersion();
			query["windows_version"] = GetWindowsVersion();
			query["user_id"] = GetUserID();
			return query.ToString() ?? string.Empty;
		}
	}
}


Review comment (suggestion):
```suggestion
			return GeneralSettingsService.UserId;
```

Code after:
			{
				DataPackage dataPackage = new DataPackage();
				dataPackage.RequestedOperation = DataPackageOperation.Copy;
				dataPackage.SetText(GetUserID());
				Clipboard.SetContent(dataPackage);
			});
		}

		public Task SupportUs()
		{
			return Launcher.LaunchUriAsync(new Uri(Constants.ExternalUrl.SupportUsUrl)).AsTask();
		}

		public string GetAppVersion()
		{
			return string.Format($"{AppVersion.Major}.{AppVersion.Minor}.{AppVersion.Build}.{AppVersion.Revision}");
		}

		public string GetWindowsVersion()
		{
			return SystemInformation.Instance.OperatingSystemVersion.ToString();
		}
		
		public string GetUserID()
		{
			return GeneralSettingsService.UserId;
		}

		public string GetVersionsQueryString()
		{
			var query = System.Web.HttpUtility.ParseQueryString(string.Empty);
			query["files_version"] = GetAppVersion();
			query["windows_version"] = GetWindowsVersion();
			query["user_id"] = GetUserID();
			return query.ToString() ?? string.Empty;
		}
	}
}
Repository: files-community/Files
File: src/Files.App/ViewModels/Dialogs/BulkRenameDialogViewModel.cs (C#)

Code before:
﻿// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Windows.Storage;

namespace Files.App.ViewModels.Dialogs
{
	public sealed class BulkRenameDialogViewModel : ObservableObject
	{
		private IContentPageContext context { get; } = Ioc.Default.GetRequiredService<IContentPageContext>();

		// Properties

		public bool IsNameValid =>
			FilesystemHelpers.IsValidForFilename(fileName) && !fileName.Contains(".");

		public bool ShowNameWarning =>
			!string.IsNullOrEmpty(fileName) && !IsNameValid;


		private string fileName = string.Empty;
		public string FileName
		{
			get => fileName;
			set
			{
				if (SetProperty(ref fileName, value))
				{
					OnPropertyChanged(nameof(IsNameValid));
					OnPropertyChanged(nameof(ShowNameWarning));
				}
			}
		}

		// Commands
		public IAsyncRelayCommand CommitRenameCommand { get; private set; }

		public BulkRenameDialogViewModel()
		{
			CommitRenameCommand = new AsyncRelayCommand(DoCommitRenameAsync);
		}

		private async Task DoCommitRenameAsync()
		{
			if (context.ShellPage is null)
				return;

Review comment (suggestion):
```suggestion
		private string _FileName = string.Empty;
```

Code after:
﻿// Copyright (c) 2024 Files Community
// Licensed under the MIT License. See the LICENSE.

using Windows.Storage;

namespace Files.App.ViewModels.Dialogs
{
	public sealed class BulkRenameDialogViewModel : ObservableObject
	{
		private IContentPageContext context { get; } = Ioc.Default.GetRequiredService<IContentPageContext>();

		// Properties

		public bool IsNameValid =>
			FilesystemHelpers.IsValidForFilename(_FileName) && !_FileName.Contains(".");

		public bool ShowNameWarning =>
			!string.IsNullOrEmpty(_FileName) && !IsNameValid;

		private string _FileName = string.Empty;
		public string FileName
		{
			get => _FileName;
			set
			{
				if (SetProperty(ref _FileName, value))
				{
					OnPropertyChanged(nameof(IsNameValid));
					OnPropertyChanged(nameof(ShowNameWarning));
				}
			}
		}

		// Commands

		public IAsyncRelayCommand CommitRenameCommand { get; private set; }

		public BulkRenameDialogViewModel()
		{
			CommitRenameCommand = new AsyncRelayCommand(DoCommitRenameAsync);
		}

		private async Task DoCommitRenameAsync()
		{
			if (context.ShellPage is null)
				return;
Repository: files-community/Files
File: src/Files.App/Actions/FileSystem/RenameAction.cs (C#)

Code before:
			=> "Rename".GetLocalizedResource();

		public string Description
			=> "RenameDescription".GetLocalizedResource();

		public HotKey HotKey
			=> new(Keys.F2);

		public RichGlyph Glyph
			=> new(themedIconStyle: "App.ThemedIcons.Rename");

		public bool IsExecutable =>
			context.ShellPage is not null &&
			IsPageTypeValid() &&
			context.ShellPage.SlimContentPage is not null &&
			IsSelectionValid();

		public RenameAction()
		{
			context = Ioc.Default.GetRequiredService<IContentPageContext>();

			context.PropertyChanged += Context_PropertyChanged;
		}

		public Task ExecuteAsync(object? parameter = null)
		{
			context.ShellPage?.SlimContentPage?.ItemManipulationModel.StartRenameItem();

			return Task.CompletedTask;
		}

		private bool IsSelectionValid()
		{
			return context.HasSelection && context.SelectedItems.Count == 1;
		}

		private bool IsPageTypeValid()
		{
			return
				context.PageType != ContentPageTypes.None &&
				context.PageType != ContentPageTypes.Home &&
				context.PageType != ContentPageTypes.RecycleBin &&
				context.PageType != ContentPageTypes.ZipFolder;
		}

		private void Context_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
		{
			switch (e.PropertyName)
			{
				case nameof(IContentPageContext.ShellPage):
				case nameof(IContentPageContext.PageType):

Review comment (suggestion):
```suggestion
		{
		// Check if multiple items are selected for bulk rename
```

Code after:
			=> "Rename".GetLocalizedResource();

		public string Description
			=> "RenameDescription".GetLocalizedResource();

		public HotKey HotKey
			=> new(Keys.F2);

		public RichGlyph Glyph
			=> new(themedIconStyle: "App.ThemedIcons.Rename");

		public bool IsExecutable =>
			context.ShellPage is not null &&
			IsPageTypeValid() &&
			context.ShellPage.SlimContentPage is not null &&
			context.HasSelection;

		public RenameAction()
		{
			context = Ioc.Default.GetRequiredService<IContentPageContext>();

			context.PropertyChanged += Context_PropertyChanged;
		}

		public async Task ExecuteAsync(object? parameter = null)
		{
			if (context.SelectedItems.Count > 1)
			{
				var viewModel = new BulkRenameDialogViewModel();
				var dialogService = Ioc.Default.GetRequiredService<IDialogService>();
				var result = await dialogService.ShowDialogAsync(viewModel);
			}
			else
			{
				context.ShellPage?.SlimContentPage?.ItemManipulationModel.StartRenameItem();
			}
		}

		private bool IsPageTypeValid()
		{
			return
				context.PageType != ContentPageTypes.None &&
				context.PageType != ContentPageTypes.Home &&
				context.PageType != ContentPageTypes.RecycleBin &&
				context.PageType != ContentPageTypes.ZipFolder;
		}

		private void Context_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
		{
			switch (e.PropertyName)
			{
Repository: files-community/Files
File: src/Files.App/Actions/FileSystem/RenameAction.cs (C#)

Code before:

		public string Label
			=> "Rename".GetLocalizedResource();

		public string Description
			=> "RenameDescription".GetLocalizedResource();

		public HotKey HotKey
			=> new(Keys.F2);

		public RichGlyph Glyph
			=> new(themedIconStyle: "App.ThemedIcons.Rename");

		public bool IsExecutable =>
			context.ShellPage is not null &&
			IsPageTypeValid() &&
			context.ShellPage.SlimContentPage is not null &&
			IsSelectionValid();

		public RenameAction()
		{
			context = Ioc.Default.GetRequiredService<IContentPageContext>();

			context.PropertyChanged += Context_PropertyChanged;
		}

		public Task ExecuteAsync(object? parameter = null)
		{
			context.ShellPage?.SlimContentPage?.ItemManipulationModel.StartRenameItem();

			return Task.CompletedTask;
		}

		private bool IsSelectionValid()
		{
			return context.HasSelection && context.SelectedItems.Count == 1;
		}

		private bool IsPageTypeValid()
		{
			return
				context.PageType != ContentPageTypes.None &&
				context.PageType != ContentPageTypes.Home &&
				context.PageType != ContentPageTypes.RecycleBin &&
				context.PageType != ContentPageTypes.ZipFolder;
		}

		private void Context_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
		{
			switch (e.PropertyName)
			{

Review comment (suggestion):
```suggestion

		// Execute the rename action
```

Code after:

		public string Label
			=> "Rename".GetLocalizedResource();

		public string Description
			=> "RenameDescription".GetLocalizedResource();

		public HotKey HotKey
			=> new(Keys.F2);

		public RichGlyph Glyph
			=> new(themedIconStyle: "App.ThemedIcons.Rename");

		public bool IsExecutable =>
			context.ShellPage is not null &&
			IsPageTypeValid() &&
			context.ShellPage.SlimContentPage is not null &&
			context.HasSelection;

		public RenameAction()
		{
			context = Ioc.Default.GetRequiredService<IContentPageContext>();

			context.PropertyChanged += Context_PropertyChanged;
		}

		public async Task ExecuteAsync(object? parameter = null)
		{
			if (context.SelectedItems.Count > 1)
			{
				var viewModel = new BulkRenameDialogViewModel();
				var dialogService = Ioc.Default.GetRequiredService<IDialogService>();
				var result = await dialogService.ShowDialogAsync(viewModel);
			}
			else
			{
				context.ShellPage?.SlimContentPage?.ItemManipulationModel.StartRenameItem();
			}
		}

		private bool IsPageTypeValid()
		{
			return
				context.PageType != ContentPageTypes.None &&
				context.PageType != ContentPageTypes.Home &&
				context.PageType != ContentPageTypes.RecycleBin &&
				context.PageType != ContentPageTypes.ZipFolder;
		}

		private void Context_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
		{
Repository: files-community/Files
File: src/Files.App/Actions/FileSystem/RenameAction.cs (C#)

Code before:
		public RichGlyph Glyph
			=> new(themedIconStyle: "App.ThemedIcons.Rename");

		public bool IsExecutable =>
			context.ShellPage is not null &&
			IsPageTypeValid() &&
			context.ShellPage.SlimContentPage is not null &&
			IsSelectionValid();

		public RenameAction()
		{
			context = Ioc.Default.GetRequiredService<IContentPageContext>();

			context.PropertyChanged += Context_PropertyChanged;
		}

		public Task ExecuteAsync(object? parameter = null)
		{
			context.ShellPage?.SlimContentPage?.ItemManipulationModel.StartRenameItem();

			return Task.CompletedTask;
		}

		private bool IsSelectionValid()
		{
			return context.HasSelection && context.SelectedItems.Count == 1;
		}

		private bool IsPageTypeValid()
		{
			return
				context.PageType != ContentPageTypes.None &&
				context.PageType != ContentPageTypes.Home &&
				context.PageType != ContentPageTypes.RecycleBin &&
				context.PageType != ContentPageTypes.ZipFolder;
		}

		private void Context_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
		{
			switch (e.PropertyName)
			{
				case nameof(IContentPageContext.ShellPage):
				case nameof(IContentPageContext.PageType):
				case nameof(IContentPageContext.HasSelection):
				case nameof(IContentPageContext.SelectedItems):
					OnPropertyChanged(nameof(IsExecutable));
					break;
			}
		}
	}
}

Review comment (suggestion):
```suggestion
			{
			// Start renaming a single selected item
```

Code after:
		public RichGlyph Glyph
			=> new(themedIconStyle: "App.ThemedIcons.Rename");

		public bool IsExecutable =>
			context.ShellPage is not null &&
			IsPageTypeValid() &&
			context.ShellPage.SlimContentPage is not null &&
			context.HasSelection;

		public RenameAction()
		{
			context = Ioc.Default.GetRequiredService<IContentPageContext>();

			context.PropertyChanged += Context_PropertyChanged;
		}

		public async Task ExecuteAsync(object? parameter = null)
		{
			if (context.SelectedItems.Count > 1)
			{
				var viewModel = new BulkRenameDialogViewModel();
				var dialogService = Ioc.Default.GetRequiredService<IDialogService>();
				var result = await dialogService.ShowDialogAsync(viewModel);
			}
			else
			{
				context.ShellPage?.SlimContentPage?.ItemManipulationModel.StartRenameItem();
			}
		}

		private bool IsPageTypeValid()
		{
			return
				context.PageType != ContentPageTypes.None &&
				context.PageType != ContentPageTypes.Home &&
				context.PageType != ContentPageTypes.RecycleBin &&
				context.PageType != ContentPageTypes.ZipFolder;
		}

		private void Context_PropertyChanged(object? sender, System.ComponentModel.PropertyChangedEventArgs e)
		{
			switch (e.PropertyName)
			{
				case nameof(IContentPageContext.ShellPage):
				case nameof(IContentPageContext.PageType):
				case nameof(IContentPageContext.HasSelection):
				case nameof(IContentPageContext.SelectedItems):
					OnPropertyChanged(nameof(IsExecutable));
					break;
			}
		}
Repository: files-community/Files
File: src/Files.App/Helpers/Win32/Win32Helper.Storage.cs (C#)

Code before:
				lpFileName,
				Win32PInvoke.GENERIC_READ | Win32PInvoke.GENERIC_WRITE,
				FILE_SHARE_MODE.FILE_SHARE_READ | FILE_SHARE_MODE.FILE_SHARE_WRITE,
				lpSecurityAttributes: null,
				FILE_CREATION_DISPOSITION.OPEN_EXISTING,
				FILE_FLAGS_AND_ATTRIBUTES.FILE_ATTRIBUTE_NORMAL,
				hTemplateFile: null);

			if (hFile.IsInvalid)
				return false;

			var bytesReturned = 0u;
			var compressionFormat = isCompressed
				? Win32PInvoke.COMPRESSION_FORMAT_DEFAULT
				: Win32PInvoke.COMPRESSION_FORMAT_NONE;

			var result = PInvoke.DeviceIoControl(
				new(hFile.DangerousGetHandle()),
				Win32PInvoke.FSCTL_SET_COMPRESSION,
				&compressionFormat,
				sizeof(ushort),
				(void*)IntPtr.Zero,
				0u,
				&bytesReturned);

			if (result.Value == 0)
				return false;

			return true;
		}

		public static string ReadStringFromFile(string filePath)
		{
			IntPtr hFile = Win32PInvoke.CreateFileFromApp(filePath,
				Win32PInvoke.GENERIC_READ,
				Win32PInvoke.FILE_SHARE_READ,
				IntPtr.Zero,
				Win32PInvoke.OPEN_EXISTING,
				(uint)Win32PInvoke.File_Attributes.BackupSemantics,
				IntPtr.Zero);

			if (hFile.ToInt64() == -1)
			{
				return null;
			}

			const int BUFFER_LENGTH = 4096;
			byte[] buffer = new byte[BUFFER_LENGTH];
			int dwBytesRead;
			string szRead = string.Empty;


Review comment (suggestion):
BOOL is a struct and has implicit operator overloads for conversion between BOOL and bool.
```suggestion
			if (!result)
```


Code after:
		}

		public static unsafe bool CanCompressContent(string path)
		{
			path = Path.GetPathRoot(path) ?? string.Empty;
			uint dwFileSystemFlags = 0;

			var success = PInvoke.GetVolumeInformation(
				path,
				null,
				0u,
				null,
				null,
				&dwFileSystemFlags,
				null,
				0u);

			if (!success)
				return false;

			return (dwFileSystemFlags & PInvoke.FILE_FILE_COMPRESSION) != 0;
		}

		public static unsafe bool SetCompressionAttributeIoctl(string lpFileName, bool isCompressed)
		{
			// GENERIC_READ | GENERIC_WRITE flags are needed here
			// FILE_FLAG_BACKUP_SEMANTICS is used to open directories
			using var hFile = PInvoke.CreateFile(
				lpFileName,
				(uint)(FILE_ACCESS_RIGHTS.FILE_GENERIC_READ | FILE_ACCESS_RIGHTS.FILE_GENERIC_WRITE | FILE_ACCESS_RIGHTS.FILE_WRITE_ATTRIBUTES),
				FILE_SHARE_MODE.FILE_SHARE_READ | FILE_SHARE_MODE.FILE_SHARE_WRITE,
				lpSecurityAttributes: null,
				FILE_CREATION_DISPOSITION.OPEN_EXISTING,
				FILE_FLAGS_AND_ATTRIBUTES.FILE_ATTRIBUTE_NORMAL | FILE_FLAGS_AND_ATTRIBUTES.FILE_FLAG_BACKUP_SEMANTICS,
				hTemplateFile: null);

			if (hFile.IsInvalid)
				return false;

			var bytesReturned = 0u;
			var compressionFormat = isCompressed
				? COMPRESSION_FORMAT.COMPRESSION_FORMAT_DEFAULT
				: COMPRESSION_FORMAT.COMPRESSION_FORMAT_NONE;

			var result = PInvoke.DeviceIoControl(
				new(hFile.DangerousGetHandle()),
				PInvoke.FSCTL_SET_COMPRESSION,
				&compressionFormat,
				sizeof(ushort),
				null,
				0u,