|
// <auto-generated/>
internal static unsafe partial class Interop
{
internal static unsafe partial class Kernel32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
internal static partial bool GetConsoleMode(nint handle, out int mode)
{
int __lastError;
mode = default;
bool __retVal;
int __retVal_native;
// Pin - Pin data in preparation for calling the P/Invoke.
fixed (int* __mode_native = &mode)
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal_native = __PInvoke(handle, __mode_native);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
// Unmarshal - Convert native data to managed data.
__retVal = __retVal_native != 0;
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetConsoleMode", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __handle_native, int* __mode_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Kernel32
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Interop.LibraryImportGenerator", "42.42.42.42")]
[global::System.Runtime.CompilerServices.SkipLocalsInitAttribute]
internal static partial bool SetConsoleMode(nint handle, int mode)
{
int __lastError;
bool __retVal;
int __retVal_native;
{
global::System.Runtime.InteropServices.Marshal.SetLastSystemError(0);
__retVal_native = __PInvoke(handle, mode);
__lastError = global::System.Runtime.InteropServices.Marshal.GetLastSystemError();
}
// Unmarshal - Convert native data to managed data.
__retVal = __retVal_native != 0;
global::System.Runtime.InteropServices.Marshal.SetLastPInvokeError(__lastError);
return __retVal;
// Local P/Invoke
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "SetConsoleMode", ExactSpelling = true)]
static extern unsafe int __PInvoke(nint __handle_native, int __mode_native);
}
}
}
internal static unsafe partial class Interop
{
internal static unsafe partial class Kernel32
{
[global::System.Runtime.InteropServices.DllImportAttribute("kernel32.dll", EntryPoint = "GetStdHandle", ExactSpelling = true)]
internal static extern partial nint GetStdHandle(int nStdHandle);
}
}
|