diff --git a/DepotDownloader/PlatformUtilities.cs b/DepotDownloader/PlatformUtilities.cs index 31d26e9e..d3d184f5 100644 --- a/DepotDownloader/PlatformUtilities.cs +++ b/DepotDownloader/PlatformUtilities.cs @@ -147,11 +147,13 @@ namespace DepotDownloader } #region WIN32_CONSOLE_STUFF - [DllImport("kernel32.dll", SetLastError = true)] + [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)] + [DefaultDllImportSearchPaths(DllImportSearchPath.System32)] static extern uint GetConsoleProcessList(uint[] processList, uint processCount); - [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] - static extern int MessageBox(IntPtr hWnd, string text, string caption, uint type); + [DllImport("user32.dll", SetLastError = true, ExactSpelling = true, CharSet = CharSet.Unicode)] + [DefaultDllImportSearchPaths(DllImportSearchPath.System32)] + static extern int MessageBoxW(IntPtr hWnd, string text, string caption, uint type); const uint MB_OK = 0x0; const uint MB_ICONWARNING = 0x30; @@ -167,7 +169,7 @@ namespace DepotDownloader return; } - _ = MessageBox( + _ = MessageBoxW( IntPtr.Zero, "Depot Downloader is a console application; there is no GUI.\n\nIf you do not pass any command line parameters, it prints usage info and exits.\n\nYou must use this from a terminal/console.", "DepotDownloader",