Skip to content
This repository was archived by the owner on May 16, 2022. It is now read-only.

Commit 77a4ab4

Browse files
committed
Shell: Console: Added missing Unicode charset to WinConsole methods.
1 parent ed354c2 commit 77a4ab4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/WinApiNet/Shell/Console/WinConsole.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public static uint FillConsoleOutputAttribute(
198198
/// If the function succeeds, the return value is <c>true</c>. If the function fails, the return value is
199199
/// <c>false</c>. To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
200200
/// </returns>
201-
[DllImport("kernel32.dll", SetLastError = true)]
201+
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
202202
[return: MarshalAs(UnmanagedType.Bool)]
203203
public static extern bool FillConsoleOutputCharacter(
204204
SafeConsoleHandle hConsoleOutput,
@@ -414,7 +414,7 @@ public static string GetConsoleAliasExes(uint exeNameBufferLength = 1024)
414414
/// The size of the buffer required to store the names of all executable files that have console aliases
415415
/// defined, in bytes.
416416
/// </returns>
417-
[DllImport("kernel32.dll")]
417+
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
418418
public static extern uint GetConsoleAliasExesLength();
419419

420420
/// <summary>
@@ -1021,7 +1021,7 @@ public static uint GetNumberOfConsoleMouseButtons()
10211021
/// If the function succeeds, the return value is <c>true</c>. If the function fails, the return value is
10221022
/// <c>false</c>. To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
10231023
/// </returns>
1024-
[DllImport("kernel32.dll", SetLastError = true)]
1024+
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
10251025
[return: MarshalAs(UnmanagedType.Bool)]
10261026
public static extern bool PeekConsoleInput(
10271027
SafeConsoleHandle hConsoleInput,
@@ -1202,7 +1202,7 @@ public static InputRecord[] ReadConsoleInput(
12021202
/// If the function succeeds, the return value is <c>true</c>. If the function fails, the return value is
12031203
/// <c>false</c>. To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
12041204
/// </returns>
1205-
[DllImport("kernel32.dll", SetLastError = true)]
1205+
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
12061206
[return: MarshalAs(UnmanagedType.Bool)]
12071207
public static extern bool ReadConsoleOutput(
12081208
SafeConsoleHandle hConsoleOutput,
@@ -1371,7 +1371,7 @@ public static string ReadConsoleOutputCharacter(
13711371
/// If the function succeeds, the return value is <c>true</c>. If the function fails, the return value is
13721372
/// <c>false</c>. To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
13731373
/// </returns>
1374-
[DllImport("kernel32.dll", SetLastError = true)]
1374+
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
13751375
[return: MarshalAs(UnmanagedType.Bool)]
13761376
public static extern bool ScrollConsoleScreenBuffer(
13771377
SafeConsoleHandle hConsoleOutput,

0 commit comments

Comments
 (0)