Browse Source

Use bool instead of uint for better readability

pull/65/head
Meivyn 3 years ago
parent
commit
c16878b8ee
No known key found for this signature in database GPG Key ID: 8BDD3E48158B2F71
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      IPA.Loader/Logging/ConsoleWindow.cs

+ 4
- 4
IPA.Loader/Logging/ConsoleWindow.cs View File

@ -26,10 +26,10 @@ namespace IPA.Logging
{ {
bool consoleAttached = true; bool consoleAttached = true;
if (alwaysCreateNewConsole if (alwaysCreateNewConsole
|| (AttachConsole(pid) == 0
|| (!AttachConsole(pid)
&& Marshal.GetLastWin32Error() != ErrorAccessDenied)) && Marshal.GetLastWin32Error() != ErrorAccessDenied))
{ {
consoleAttached = AllocConsole() != 0;
consoleAttached = AllocConsole();
} }
if (consoleAttached) if (consoleAttached)
@ -112,14 +112,14 @@ namespace IPA.Logging
SetLastError = true, SetLastError = true,
CharSet = CharSet.Auto, CharSet = CharSet.Auto,
CallingConvention = CallingConvention.StdCall)] CallingConvention = CallingConvention.StdCall)]
private static extern int AllocConsole();
private static extern bool AllocConsole();
[DllImport("kernel32.dll", [DllImport("kernel32.dll",
EntryPoint = "AttachConsole", EntryPoint = "AttachConsole",
SetLastError = true, SetLastError = true,
CharSet = CharSet.Auto, CharSet = CharSet.Auto,
CallingConvention = CallingConvention.StdCall)] CallingConvention = CallingConvention.StdCall)]
private static extern uint AttachConsole(uint dwProcessId);
private static extern bool AttachConsole(uint dwProcessId);
[DllImport("kernel32.dll", [DllImport("kernel32.dll",
EntryPoint = "CreateFileW", EntryPoint = "CreateFileW",


Loading…
Cancel
Save