From 0621ef6007769a33a0022f9028327cca19aba735 Mon Sep 17 00:00:00 2001 From: Eduardo Baginski Costa Date: Sun, 23 Jun 2024 18:28:57 -0300 Subject: [PATCH] Update the file structure --- {NuGet => Package}/.nuspec | 12 +- {NuGet => Package}/README.md | 4 +- NuGet/NuGet.png => Package/icon.png | Bin README.md | 2 +- Source/Enumerations/AccessRights.cs | 9 + Source/Enumerations/CharacterAttributes.cs | 34 + Source/Enumerations/ConsoleDisplayMode.cs | 10 + Source/Enumerations/ConsoleMode.cs | 24 + Source/Enumerations/ConsoleReadingBehavior.cs | 9 + Source/Enumerations/ConsoleStandardDevice.cs | 10 + Source/Enumerations/ConsoleWindowEvent.cs | 14 + Source/Enumerations/ControlEvent.cs | 12 + Source/Enumerations/InputRecordEventType.cs | 11 + Source/Enumerations/ModifierKeyState.cs | 16 + Source/Enumerations/MouseButtonState.cs | 12 + Source/Enumerations/MouseEvent.cs | 11 + .../PseudoConsoleCreationOption.cs | 9 + Source/Enumerations/ResultHandle.cs | 18 + .../Enumerations/SecurityDescriptorControl.cs | 21 + Source/Enumerations/SelectionIndicator.cs | 12 + Source/Enumerations/ShareMode.cs | 9 + Source/Enumerations/SystemErrorCodes.cs | 251 ++ Source/Enumerations/VirtualKey.cs | 182 ++ Source/Kernel.cs | 1141 ++++++++ .../Properties/AssemblyInfo.cs | 6 +- .../Structures/CharacterInformation.cs | 20 - .../Structures/ConsoleCursorInformation.cs | 20 - .../Structures/ConsoleFontInformation.cs | 18 - .../ConsoleFontInformationExtended.cs | 33 - .../Structures/ConsoleHistoryInformation.cs | 23 - .../ConsoleScreenBufferInformation.cs | 36 - .../ConsoleScreenBufferInformationExtended.cs | 52 - .../Structures/ConsoleSelectionInformation.cs | 21 - .../Structures/Coordinate.cs | 21 - .../Structures/FocusEventRecord.cs | 13 - .../Structures/InputRecord.cs | 31 - .../Structures/KeyEventRecord.cs | 36 - .../Structures/MenuEventRecord.cs | 13 - .../Structures/MouseEventRecord.cs | 33 - .../Structures/ReadConsoleControl.cs | 29 - .../Structures/SecurityAttributes.cs | 28 - .../Structures/SecurityDescriptor.cs | 39 - .../Structures/SmallRectangle.cs | 28 - .../Structures/WindowBufferSizeRecord.cs | 19 +- .../ThirtyTwo.Kernel32.csproj | 6 +- {ThirtyTwo => Source}/ThirtyTwo.Kernel32.sln | 0 ThirtyTwo/Enumerations/AccessRights.cs | 21 - ThirtyTwo/Enumerations/CharacterAttributes.cs | 92 - ThirtyTwo/Enumerations/ConsoleDisplayMode.cs | 27 - ThirtyTwo/Enumerations/ConsoleMode.cs | 149 - .../Enumerations/ConsoleReadingBehavior.cs | 19 - .../Enumerations/ConsoleStandardDevice.cs | 24 - ThirtyTwo/Enumerations/ConsoleWindowEvent.cs | 57 - ThirtyTwo/Enumerations/ControlEvent.cs | 46 - .../Enumerations/InputRecordEventType.cs | 38 - ThirtyTwo/Enumerations/ModifierKeyState.cs | 54 - ThirtyTwo/Enumerations/MouseButtonState.cs | 34 - ThirtyTwo/Enumerations/MouseEvent.cs | 34 - .../PseudoConsoleCreationOption.cs | 20 - ThirtyTwo/Enumerations/ResultHandle.cs | 64 - .../Enumerations/SecurityDescriptorControl.cs | 86 - ThirtyTwo/Enumerations/SelectionIndicator.cs | 39 - ThirtyTwo/Enumerations/ShareMode.cs | 19 - ThirtyTwo/Enumerations/SystemErrorCodes.cs | 1259 -------- ThirtyTwo/Enumerations/VirtualKey.cs | 885 ------ ThirtyTwo/Kernel.cs | 2575 ----------------- pack.bat | 18 +- 67 files changed, 1840 insertions(+), 6078 deletions(-) rename {NuGet => Package}/.nuspec (67%) rename {NuGet => Package}/README.md (65%) rename NuGet/NuGet.png => Package/icon.png (100%) create mode 100644 Source/Enumerations/AccessRights.cs create mode 100644 Source/Enumerations/CharacterAttributes.cs create mode 100644 Source/Enumerations/ConsoleDisplayMode.cs create mode 100644 Source/Enumerations/ConsoleMode.cs create mode 100644 Source/Enumerations/ConsoleReadingBehavior.cs create mode 100644 Source/Enumerations/ConsoleStandardDevice.cs create mode 100644 Source/Enumerations/ConsoleWindowEvent.cs create mode 100644 Source/Enumerations/ControlEvent.cs create mode 100644 Source/Enumerations/InputRecordEventType.cs create mode 100644 Source/Enumerations/ModifierKeyState.cs create mode 100644 Source/Enumerations/MouseButtonState.cs create mode 100644 Source/Enumerations/MouseEvent.cs create mode 100644 Source/Enumerations/PseudoConsoleCreationOption.cs create mode 100644 Source/Enumerations/ResultHandle.cs create mode 100644 Source/Enumerations/SecurityDescriptorControl.cs create mode 100644 Source/Enumerations/SelectionIndicator.cs create mode 100644 Source/Enumerations/ShareMode.cs create mode 100644 Source/Enumerations/SystemErrorCodes.cs create mode 100644 Source/Enumerations/VirtualKey.cs create mode 100644 Source/Kernel.cs rename {ThirtyTwo => Source}/Properties/AssemblyInfo.cs (81%) rename {ThirtyTwo => Source}/Structures/CharacterInformation.cs (74%) rename {ThirtyTwo => Source}/Structures/ConsoleCursorInformation.cs (72%) rename {ThirtyTwo => Source}/Structures/ConsoleFontInformation.cs (74%) rename {ThirtyTwo => Source}/Structures/ConsoleFontInformationExtended.cs (71%) rename {ThirtyTwo => Source}/Structures/ConsoleHistoryInformation.cs (76%) rename {ThirtyTwo => Source}/Structures/ConsoleScreenBufferInformation.cs (66%) rename {ThirtyTwo => Source}/Structures/ConsoleScreenBufferInformationExtended.cs (66%) rename {ThirtyTwo => Source}/Structures/ConsoleSelectionInformation.cs (76%) rename {ThirtyTwo => Source}/Structures/Coordinate.cs (83%) rename {ThirtyTwo => Source}/Structures/FocusEventRecord.cs (78%) rename {ThirtyTwo => Source}/Structures/InputRecord.cs (72%) rename {ThirtyTwo => Source}/Structures/KeyEventRecord.cs (69%) rename {ThirtyTwo => Source}/Structures/MenuEventRecord.cs (78%) rename {ThirtyTwo => Source}/Structures/MouseEventRecord.cs (63%) rename {ThirtyTwo => Source}/Structures/ReadConsoleControl.cs (66%) rename {ThirtyTwo => Source}/Structures/SecurityAttributes.cs (60%) rename {ThirtyTwo => Source}/Structures/SecurityDescriptor.cs (69%) rename {ThirtyTwo => Source}/Structures/SmallRectangle.cs (86%) rename {ThirtyTwo => Source}/Structures/WindowBufferSizeRecord.cs (85%) rename {ThirtyTwo => Source}/ThirtyTwo.Kernel32.csproj (94%) rename {ThirtyTwo => Source}/ThirtyTwo.Kernel32.sln (100%) delete mode 100644 ThirtyTwo/Enumerations/AccessRights.cs delete mode 100644 ThirtyTwo/Enumerations/CharacterAttributes.cs delete mode 100644 ThirtyTwo/Enumerations/ConsoleDisplayMode.cs delete mode 100644 ThirtyTwo/Enumerations/ConsoleMode.cs delete mode 100644 ThirtyTwo/Enumerations/ConsoleReadingBehavior.cs delete mode 100644 ThirtyTwo/Enumerations/ConsoleStandardDevice.cs delete mode 100644 ThirtyTwo/Enumerations/ConsoleWindowEvent.cs delete mode 100644 ThirtyTwo/Enumerations/ControlEvent.cs delete mode 100644 ThirtyTwo/Enumerations/InputRecordEventType.cs delete mode 100644 ThirtyTwo/Enumerations/ModifierKeyState.cs delete mode 100644 ThirtyTwo/Enumerations/MouseButtonState.cs delete mode 100644 ThirtyTwo/Enumerations/MouseEvent.cs delete mode 100644 ThirtyTwo/Enumerations/PseudoConsoleCreationOption.cs delete mode 100644 ThirtyTwo/Enumerations/ResultHandle.cs delete mode 100644 ThirtyTwo/Enumerations/SecurityDescriptorControl.cs delete mode 100644 ThirtyTwo/Enumerations/SelectionIndicator.cs delete mode 100644 ThirtyTwo/Enumerations/ShareMode.cs delete mode 100644 ThirtyTwo/Enumerations/SystemErrorCodes.cs delete mode 100644 ThirtyTwo/Enumerations/VirtualKey.cs delete mode 100644 ThirtyTwo/Kernel.cs diff --git a/NuGet/.nuspec b/Package/.nuspec similarity index 67% rename from NuGet/.nuspec rename to Package/.nuspec index 9ea130d..1bbf19c 100644 --- a/NuGet/.nuspec +++ b/Package/.nuspec @@ -3,7 +3,7 @@ ThirtyTwo.Kernel32 ThirtyTwo.Kernel32 - 1.0.0.2 + 1.0.0.3 Windows API Kernel32 interop library for the .NET Framework. Eduardo Baginski Costa, ThirtyTwo Interops eduardobcosta @@ -11,10 +11,10 @@ win32 win32api kernel32 kernel32dll thirtytwo interoperability interop - .\NuGet.png + .\icon.png https://github.com/thirtytwointerops/kernel32 - Copyright © 2024 ThirtyTwo Interops + Copyright © 2024 ThirtyTwo Interops and Novus Inspire true MIT @@ -25,11 +25,9 @@ - + - - - + \ No newline at end of file diff --git a/NuGet/README.md b/Package/README.md similarity index 65% rename from NuGet/README.md rename to Package/README.md index 8351c9d..5a5ef18 100644 --- a/NuGet/README.md +++ b/Package/README.md @@ -4,6 +4,6 @@ We interoperate all Kernel32 methods, structures, and enumerations from the Wind

- Maintained by @eduardobaginskicosta - . + Maintained by Eduardo Baginski Costa and Novus Inspire. +

diff --git a/NuGet/NuGet.png b/Package/icon.png similarity index 100% rename from NuGet/NuGet.png rename to Package/icon.png diff --git a/README.md b/README.md index 3177f48..961aaed 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ -

ThirtyTwo Interops • Kernel32

+

Kernel32

## 📘 Get Started diff --git a/Source/Enumerations/AccessRights.cs b/Source/Enumerations/AccessRights.cs new file mode 100644 index 0000000..eb74e49 --- /dev/null +++ b/Source/Enumerations/AccessRights.cs @@ -0,0 +1,9 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum AccessRights : long + { + GenericRead = 0x80000000L, + GenericWrite = 0x40000000L, + } +} diff --git a/Source/Enumerations/CharacterAttributes.cs b/Source/Enumerations/CharacterAttributes.cs new file mode 100644 index 0000000..b8866cc --- /dev/null +++ b/Source/Enumerations/CharacterAttributes.cs @@ -0,0 +1,34 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum CharacterAttributes : ushort + { + ForegroundBlue = 0x0001, + ForegroundGreen = 0x0002, + ForegroundRed = 0x0004, + ForegroundIntensity = 0x0008, + + // @ + + BackgroundBlue = 0x0010, + BackgroundGreen = 0x0020, + BackgroundRed = 0x0040, + BackgroundIntensity = 0x0080, + + // @ + + CommonLVBLeadingByte = 0x0100, + CommonLVBTrailingByte = 0x0200, + + // @ + + CommonGridHorizontal = 0x0400, + CommonGridLeftVertical = 0x0800, + CommonGridRightVertical = 0x1000, + + // @ + + CommonLVBReverseVideo = 0x4000, + CommonLVBUnderscore = 0x8000, + } +} diff --git a/Source/Enumerations/ConsoleDisplayMode.cs b/Source/Enumerations/ConsoleDisplayMode.cs new file mode 100644 index 0000000..d0d2f0d --- /dev/null +++ b/Source/Enumerations/ConsoleDisplayMode.cs @@ -0,0 +1,10 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum ConsoleDisplayMode : uint + { + FullScreen = 1, + FullScreenHardware = 2, + Windowed = 2, + } +} diff --git a/Source/Enumerations/ConsoleMode.cs b/Source/Enumerations/ConsoleMode.cs new file mode 100644 index 0000000..ad33170 --- /dev/null +++ b/Source/Enumerations/ConsoleMode.cs @@ -0,0 +1,24 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum ConsoleMode : uint + { + EnableEchoInput = 0x0004, + EnableInsertMode = 0x0020, + EnableLineInput = 0x0002, + EnableMouseInput = 0x0010, + EnableProcessedInput = 0x0001, + EnableQuickEditMode = 0x0040, + EnableExtendedFlags = 0x0080, + EnableWindowInput = 0x0008, + EnableVirtualTerminalInput = 0x0200, + + // @ + + EnableProcessedOutput = 0x0001, + EnableWrapAtEOLOutput = 0x0002, + EnableVirtualTerminalProcessing = 0x0004, + DisableNewLineAutoReturn = 0x0008, + EnableLVBGridWorldWide = 0x0010, + } +} diff --git a/Source/Enumerations/ConsoleReadingBehavior.cs b/Source/Enumerations/ConsoleReadingBehavior.cs new file mode 100644 index 0000000..e993813 --- /dev/null +++ b/Source/Enumerations/ConsoleReadingBehavior.cs @@ -0,0 +1,9 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum ConsoleReadingBehavior : ushort + { + NoRemove = 0x0001, + NoWait = 0x0002, + } +} diff --git a/Source/Enumerations/ConsoleStandardDevice.cs b/Source/Enumerations/ConsoleStandardDevice.cs new file mode 100644 index 0000000..1bd0579 --- /dev/null +++ b/Source/Enumerations/ConsoleStandardDevice.cs @@ -0,0 +1,10 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum ConsoleStandardDevice : int + { + InputHandle = -10, + OutputHandle = -11, + ErrorHandle = -12, + } +} diff --git a/Source/Enumerations/ConsoleWindowEvent.cs b/Source/Enumerations/ConsoleWindowEvent.cs new file mode 100644 index 0000000..9d43716 --- /dev/null +++ b/Source/Enumerations/ConsoleWindowEvent.cs @@ -0,0 +1,14 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum ConsoleWindowEvent : int + { + Caret = 0x4001, + EndApplication = 0x4007, + Layout = 0x4005, + StartApplication = 0x4006, + UpdateRegion = 0x4002, + UpdateScroll = 0x4004, + UpdateSimple = 0x4003, + } +} diff --git a/Source/Enumerations/ControlEvent.cs b/Source/Enumerations/ControlEvent.cs new file mode 100644 index 0000000..aee4ee1 --- /dev/null +++ b/Source/Enumerations/ControlEvent.cs @@ -0,0 +1,12 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum ControlEvent : uint + { + CtrlC = 0, + CtrlBreak = 1, + CtrlClose = 2, + CtrlLogoff = 5, + CtrlShutdown = 6, + } +} diff --git a/Source/Enumerations/InputRecordEventType.cs b/Source/Enumerations/InputRecordEventType.cs new file mode 100644 index 0000000..bbb08a7 --- /dev/null +++ b/Source/Enumerations/InputRecordEventType.cs @@ -0,0 +1,11 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + public enum InputRecordEventType : ushort + { + Focus = 0x0010, + Key = 0x0001, + Menu = 0x0008, + Mouse = 0x0002, + WindowBufferSize = 0x0004, + } +} diff --git a/Source/Enumerations/ModifierKeyState.cs b/Source/Enumerations/ModifierKeyState.cs new file mode 100644 index 0000000..cc1d842 --- /dev/null +++ b/Source/Enumerations/ModifierKeyState.cs @@ -0,0 +1,16 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum ModifierKeyState : uint + { + CapsLockOn = 0x0080, + EnhancedKey = 0x0100, + LeftAltPressed = 0x0002, + LeftCtrlPressed = 0x0008, + NumLockOn = 0x0020, + RightAltPressed = 0x0001, + RightCtrlPressed = 0x0004, + ScrollLockOn = 0x0040, + ShiftPressed = 0x0010, + } +} diff --git a/Source/Enumerations/MouseButtonState.cs b/Source/Enumerations/MouseButtonState.cs new file mode 100644 index 0000000..42c399c --- /dev/null +++ b/Source/Enumerations/MouseButtonState.cs @@ -0,0 +1,12 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum MouseButtonState : uint + { + FromLeft1stButtonPressed = 0x0001, + FromLeft2ndButtonPressed = 0x0004, + FromLeft3rdButtonPressed = 0x0008, + FromLeft4thButtonPressed = 0x0010, + RightmostButtonPressed = 0x0002, + } +} diff --git a/Source/Enumerations/MouseEvent.cs b/Source/Enumerations/MouseEvent.cs new file mode 100644 index 0000000..f146279 --- /dev/null +++ b/Source/Enumerations/MouseEvent.cs @@ -0,0 +1,11 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum MouseEvent : uint + { + DoubleClick = 0x0002, + HorizontalWheeled = 0x0008, + Moved = 0x0001, + VerticalWheeled = 0x0004, + } +} diff --git a/Source/Enumerations/PseudoConsoleCreationOption.cs b/Source/Enumerations/PseudoConsoleCreationOption.cs new file mode 100644 index 0000000..caaadaf --- /dev/null +++ b/Source/Enumerations/PseudoConsoleCreationOption.cs @@ -0,0 +1,9 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum PseudoConsoleCreationOption : uint + { + Standard = 0, + InheritCursor = 1, + } +} diff --git a/Source/Enumerations/ResultHandle.cs b/Source/Enumerations/ResultHandle.cs new file mode 100644 index 0000000..b4adc17 --- /dev/null +++ b/Source/Enumerations/ResultHandle.cs @@ -0,0 +1,18 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum ResultHandle : uint + { + Ok = 0x00000000, + Abort = 0x80004004, + AccessDenied = 0x80070005, + Fail = 0x80004005, + Handle = 0x80070006, + InvalidArgument = 0x80070057, + NoInterface = 0x80004002, + NotImplemented = 0x80004001, + OutOfMemory = 0x8007000E, + Pointer = 0x80004003, + Unexpected = 0x8000FFFF, + } +} diff --git a/Source/Enumerations/SecurityDescriptorControl.cs b/Source/Enumerations/SecurityDescriptorControl.cs new file mode 100644 index 0000000..e2e19c3 --- /dev/null +++ b/Source/Enumerations/SecurityDescriptorControl.cs @@ -0,0 +1,21 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum SecurityDescriptorControl : uint + { + OwnerDefaulted = 0x0001, + GroupDefaulted = 0x0002, + DACLPresent = 0x0004, + DACLDefaulted = 0x0008, + SACLPresent = 0x0010, + SACLDefaulted = 0x0020, + DACLAutoInheritRequired = 0x0100, + SACLAutoInheritRequired = 0x0200, + DACLAutoInherit = 0x0400, + SACLAutoInherit = 0x0800, + DACLProtected = 0x1000, + SACLProtected = 0x2000, + ResourceManagerControlValid = 0x4000, + SelfRelative = 0x8000, + } +} diff --git a/Source/Enumerations/SelectionIndicator.cs b/Source/Enumerations/SelectionIndicator.cs new file mode 100644 index 0000000..ae0635b --- /dev/null +++ b/Source/Enumerations/SelectionIndicator.cs @@ -0,0 +1,12 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum SelectionIndicator : uint + { + MouseDown = 0x0008, + MouseSelection = 0x0004, + NoSelection = 0x0000, + SelectionInProgress = 0x0001, + SelectionNotEmpty = 0x0002, + } +} diff --git a/Source/Enumerations/ShareMode.cs b/Source/Enumerations/ShareMode.cs new file mode 100644 index 0000000..d99dce3 --- /dev/null +++ b/Source/Enumerations/ShareMode.cs @@ -0,0 +1,9 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum ShareMode : long + { + Read = 0x00000001, + Write = 0x00000002, + } +} diff --git a/Source/Enumerations/SystemErrorCodes.cs b/Source/Enumerations/SystemErrorCodes.cs new file mode 100644 index 0000000..c820da9 --- /dev/null +++ b/Source/Enumerations/SystemErrorCodes.cs @@ -0,0 +1,251 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum SystemErrorCodes : uint + { + Success = 0x0, + InvalidFunction = 0x1, + FileNotFound = 0x2, + PathNotFound = 0x3, + TooManyOpenFiles = 0x4, + AccessDenied = 0x5, + InvalidHandle = 0x6, + ArenaTrashed = 0x7, + NotEnoughMemory = 0x8, + InvalidBlock = 0x9, + BadEnvironment = 0xa, + BadFormat = 0xb, + InvalidAccess = 0xc, + InvalidData = 0xd, + OutOfMemory = 0xe, + InvalidDrive = 0xf, + CurrentDirectory = 0x10, + NotSameDevice = 0x11, + NoMoreFiles = 0x12, + WriteProtect = 0x13, + BadUnit = 0x14, + NotReady = 0x15, + BadCommand = 0x16, + CyclicRedundancyCheck = 0x17, + BadLength = 0x18, + Seek = 0x19, + NotDosDisk = 0x1a, + SectorNotFound = 0x1b, + OutOfPaper = 0x1c, + WriteFault = 0x1d, + ReadFault = 0x1e, + GenFailure = 0x1f, + SharingViolation = 0x20, + LockViolation = 0x21, + WrongDisk = 0x22, + SharingBufferExceeded = 0x24, + HandleEOF = 0x26, + HandleDiskFull = 0x27, + NotSupported = 0x32, + RemoteNotList = 0x33, + DuplicateName = 0x34, + BadNetPath = 0x35, + NetworkBusy = 0x36, + DevNotExist = 0x37, + TooManyCommands = 0x38, + AdapterHardwareError = 0x39, + BadNetworkResponse = 0x3a, + UnexpectedNetworkError = 0x3b, + BadRemoteAdapter = 0x3c, + PrinterQueueFull = 0x3d, + NoSpoolSpace = 0x3e, + PrintCancelled = 0x3f, + NetworkNameDeleted = 0x40, + NetworkAccessDenied = 0x41, + BadDevType = 0x42, + BadNetworkName = 0x43, + TooManyNames = 0x44, + TooManySession = 0x45, + SharingPaused = 0x46, + RequestNotAccepted = 0x47, + RedirectPaused = 0x48, + FileExists = 0x50, + CannotMake = 0x52, + FailInt24 = 0x53, + OutOfStructures = 0x54, + AlreadyAssigned = 0x55, + InvalidPassword = 0x56, + InvalidParameter = 0x57, + NetworkWriteFault = 0x58, + NoProcSlots = 0x59, + TooManySemaphores = 0x64, + ExclusiveSemAlreadyOwned = 0x65, + SemIsSet = 0x66, + TooManySemRequests = 0x67, + InvalidAtInterruptTime = 0x68, + SemOwnerDied = 0x69, + SemUserLimit = 0x6a, + DiskChange = 0x6b, + DriveLocked = 0x6c, + BrokenPipe = 0x6d, + OpenFailed = 0x6e, + BufferOverflow = 0x6f, + DiskFull = 0x70, + NoMoreSearchHandles = 0x71, + InvalidTargetHandle = 0x72, + InvalidCategory = 0x75, + InvalidVerifySwitch = 0x76, + BadDriverLevel = 0x77, + callNotImplemented = 0x78, + SemTimeout = 0x79, + InsufficientBuffer = 0x7a, + InvalidName = 0x7b, + InvalidLevel = 0x7c, + NoVolumeLabel = 0x7d, + ModuleNotFound = 0x7e, + ProcedureNotFound = 0x7f, + WaitNoChildren = 0x80, + ChildNotComplete = 0x81, + DirectAccessHandle = 0x82, + NegativeSeek = 0x83, + SeekOnDevice = 0x84, + IsJoinTarget = 0x85, + IsJoined = 0x86, + IsSubsted = 0x87, + NotJoined = 0x88, + NotSubsted = 0x89, + JoinToJoin = 0x8a, + SubstToSubst = 0x8b, + JoinToSubst = 0x8c, + SubstToJoin = 0x8d, + BusyDrive = 0x8e, + SameDrive = 0x8f, + DirectoryNotRoot = 0x90, + DirectoryNotEmpty = 0x91, + IsSubstPath = 0x92, + IsJoinPath = 0x93, + PathBusy = 0x94, + IsSubstTarget = 0x95, + SystemTrace = 0x96, + InvalidEventCount = 0x97, + TooManyMuxWaiters = 0x98, + InvalidListFormat = 0x99, + labelTooLong = 0x9a, + TooManyTcbs = 0x9b, + SignalRefused = 0x9c, + Discarded = 0x9d, + NotLocked = 0x9e, + BadThreadidAddr = 0x9f, + BadArguments = 0xa0, + BadPathname = 0xa1, + SignalPending = 0xa2, + MaxThrdsReached = 0xa4, + LockFailed = 0xa7, + Busy = 0xaa, + DeviceSupportInProgress = 0xab, + CancelViolation = 0xad, + AtomicLocksNotSupported = 0xae, + InvalidSegmentNumber = 0xb4, + InvalidOrdinal = 0xb6, + AlreadyExists = 0xb7, + InvalidFlagNumber = 0xba, + SemNotFound = 0xbb, + InvalidStartingCodeseg = 0xbc, + InvalidStackseg = 0xbd, + InvalidModuletype = 0xbe, + InvalidExeSignature = 0xbf, + ExeMarkedInvalid = 0xc0, + BadExeFormat = 0xc1, + IteratedDataExceeds_64k = 0xc2, + InvalidMinallocsize = 0xc3, + DynlinkFromInvalidRing = 0xc4, + IoplNotEnabled = 0xc5, + InvalidSegmentDPL = 0xc6, + AutoDataSegmentExceeds64k = 0xc7, + Ring2SegmentMustBeMovable = 0xc8, + RelocChainXeedsSegmentLimit = 0xc9, + InFloopInRelocChain = 0xca, + EnvironmentVariableNotFound = 0xcb, + NoSignalSent = 0xcd, + FilenameExcedRange = 0xce, + Ring2StackInUse = 0xcf, + MetaExpansionTooLong = 0xd0, + InvalidSignalNumber = 0xd1, + Thread1Inactive = 0xd2, + Locked = 0xd4, + TooManyModules = 0xd6, + NestingNotAllowed = 0xd7, + ExeMachineTypeMismatch = 0xd8, + ExeCannotModifySignedBinary = 0xd9, + ExeCannotModifyStrongSignedBinary = 0xda, + FileCheckedOut = 0xdc, + checkoutRequired = 0xdd, + BadFileType = 0xde, + FileTooLarge = 0xdf, + FormsAuthRequired = 0xe0, + VirusInfected = 0xe1, + VirusDeleted = 0xe2, + PipeLocal = 0xe5, + BadPipe = 0xe6, + PipeBusy = 0xe7, + NoData = 0xe8, + PipeNotConnected = 0xe9, + MoreData = 0xea, + SessionDisconnected = 0xf0, + InvalidExtendedAttributeName = 0xfe, + ExtendedAttributeListInconsistent = 0xff, + WaitTimeout = 0x102, + NoMoreItems = 0x103, + CannotCopy = 0x10a, + Directory = 0x10b, + ExtendedAttributesDidntFit = 0x113, + ExtendedAttributeFileCorrupt = 0x114, + ExtendedAttributeTableFull = 0x115, + InvalidExtendedAttributeHandle = 0x116, + ExtendedAttributesNotSupported = 0x11a, + NotOwner = 0x120, + TooManyPosts = 0x12a, + PartialCopy = 0x12b, + OpLockNotGranted = 0x12c, + InvalidOpLockProtocol = 0x12d, + DiskTooFragmented = 0x12e, + DeletePending = 0x12f, + IncompatibleWithGlobalShortNameRegistrySetting = 0x130, + ShortNamesNotEnabledOnVolume = 0x131, + SecurityStreamIsInconsistent = 0x132, + InvalidLockRange = 0x133, + ImageSubsystemNotPresent = 0x134, + NotificationGuidAlreadyDefined = 0x135, + InvalidExceptionHandler = 0x136, + DuplicatePrivileges = 0x137, + NoRangesProcessed = 0x138, + NotAllowedOnSystemFile = 0x139, + DiskResourcesExhausted = 0x13a, + InvalidToken = 0x13b, + DeviceFeatureNotSupported = 0x13c, + MemoryMidNotFound = 0x13d, + ScopeNotFound = 0x13e, + UndefinedScope = 0x13f, + InvalidCentralAccessPolicy = 0x140, + DeviceUnreachable = 0x141, + DeviceNoResources = 0x142, + DataChecksumError = 0x143, + IntermixedKernelExtendedAttributeOperation = 0x144, + FileLevelTrimNotSupported = 0x146, + OffsetAlignmentViolation = 0x147, + InvalidFieldInParameterList = 0x148, + OperationInProgress = 0x149, + BadDevicePath = 0x14a, + TooManyDescriptors = 0x14b, + scrubDataDisabled = 0x14c, + NotRedundantStorage = 0x14d, + ResidentFileNotSupported = 0x14e, + CompressedFileNotSupported = 0x14f, + DirectoryNotSupported = 0x150, + NotReadFromCopy = 0x151, + FailNoactionReboot = 0x15e, + FailShutdown = 0x15f, + FailRestart = 0x160, + MaxSessionsReached = 0x161, + ThreadModeAlreadyBackground = 0x190, + ThreadModeNotBackground = 0x191, + ProcessModeAlreadyBackground = 0x192, + ProcessModeNotBackground = 0x193, + InvalidAddress = 0x1e7, + } +} diff --git a/Source/Enumerations/VirtualKey.cs b/Source/Enumerations/VirtualKey.cs new file mode 100644 index 0000000..84b204c --- /dev/null +++ b/Source/Enumerations/VirtualKey.cs @@ -0,0 +1,182 @@ +namespace ThirtyTwo.Kernel32.Enumerations +{ + [System.Flags] + public enum VirtualKey : ushort + { + LeftMouseButton = 0x01, + RightMouseButton = 0x02, + Cancel = 0x03, + MiddleMouseButton = 0x04, + XButton1 = 0x05, + XButton2 = 0x06, + Backspace = 0x08, + Tab = 0x09, + Clear = 0x0C, + Return = 0x0D, + Shift = 0x10, + Control = 0x11, + Menu = 0x12, + Pause = 0x13, + Capital = 0x14, + ImeKana = 0x15, + ImeHangul = 0x15, + ImeOn = 0x16, + ImeJunja = 0x17, + ImeFinal = 0x18, + ImeHanja = 0x19, + ImeKanji = 0x19, + ImeOff = 0x1A, + Escape = 0x1B, + ImeConvert = 0x1C, + ImeNonConvert = 0x1D, + ImeAccept = 0x1E, + ImeModeChange = 0x1F, + Space = 0x20, + Prior = 0x21, + Next = 0x22, + End = 0x23, + Home = 0x24, + Left = 0x25, + Up = 0x26, + Right = 0x27, + Down = 0x28, + Select = 0x29, + Print = 0x2A, + Execute = 0x2B, + Snapshot = 0x2C, + Insert = 0x2D, + Delete = 0x2E, + Help = 0x2F, + LeftWindows = 0x5B, + RightWindows = 0x5C, + Apps = 0x5D, + Sleep = 0x5F, + Numpad0 = 0x60, + Numpad1 = 0x61, + Numpad2 = 0x62, + Numpad3 = 0x63, + Numpad4 = 0x64, + Numpad5 = 0x65, + Numpad6 = 0x66, + Numpad7 = 0x67, + Numpad8 = 0x68, + Numpad9 = 0x69, + Multiply = 0x6A, + Add = 0x6B, + Separator = 0x6C, + Subtract = 0x6D, + Decimal = 0x6E, + Divide = 0x6F, + F1 = 0x70, + F2 = 0x71, + F3 = 0x72, + F4 = 0x73, + F5 = 0x74, + F6 = 0x75, + F7 = 0x76, + F8 = 0x77, + F9 = 0x78, + F10 = 0x79, + F11 = 0x7A, + F12 = 0x7B, + F13 = 0x7C, + F14 = 0x7D, + F15 = 0x7E, + F16 = 0x7F, + F17 = 0x80, + F18 = 0x81, + F19 = 0x82, + F20 = 0x83, + F21 = 0x84, + F22 = 0x85, + F23 = 0x86, + F24 = 0x87, + NumLock = 0x90, + Scroll = 0x91, + LeftShift = 0xA0, + RightShift = 0xA1, + LeftControl = 0xA2, + RightControl = 0xA3, + LeftMenu = 0xA4, + RightMenu = 0xA5, + BrowserBack = 0xA6, + BrowserForward = 0xA7, + BrowserRefresh = 0xA8, + BrowserStop = 0xA9, + BrowserSearch = 0xAA, + BrowserFavorites = 0xAB, + BrowserHome = 0xAC, + VolumeMute = 0xAD, + VolumeDown = 0xAE, + VolumeUp = 0xAF, + MediaNextTrack = 0xB0, + MediaPrevTrack = 0xB1, + MediaStop = 0xB2, + MediaPlayPause = 0xB3, + LaunchMail = 0xB4, + LaunchMediaSelect = 0xB5, + LaunchApp1 = 0xB6, + LaunchApp2 = 0xB7, + Oem1 = 0xBA, + OemPlus = 0xBB, + OemComma = 0xBC, + OemMinus = 0xBD, + OemPeriod = 0xBE, + Oem2 = 0xBF, + Oem3 = 0xC0, + Oem4 = 0xDB, + Oem5 = 0xDC, + Oem6 = 0xDD, + Oem7 = 0xDE, + Oem8 = 0xDF, + Oem102 = 0xE2, + ImeProcess = 0xE5, + Packet = 0xE7, + Attn = 0xF6, + CrSel = 0xF7, + ExSel = 0xF8, + EraseEOF = 0xF9, + Play = 0xFA, + Zoom = 0xFB, + Pa1 = 0xFD, + OemClear = 0xFE, + + // @ + Number0 = 0x30, + Number1 = 0x31, + Number2 = 0x32, + Number3 = 0x33, + Number4 = 0x34, + Number5 = 0x35, + Number6 = 0x36, + Number7 = 0x37, + Number8 = 0x38, + Number9 = 0x39, + A = 0x41, + B = 0x42, + C = 0x43, + D = 0x44, + E = 0x45, + F = 0x46, + G = 0x47, + H = 0x48, + I = 0x49, + J = 0x4A, + K = 0x4B, + L = 0x4C, + M = 0x4D, + N = 0x4E, + O = 0x4F, + P = 0x50, + Q = 0x51, + R = 0x52, + S = 0x53, + T = 0x54, + U = 0x55, + V = 0x56, + W = 0x57, + X = 0x58, + Y = 0x59, + Z = 0x5A, + } +} diff --git a/Source/Kernel.cs b/Source/Kernel.cs new file mode 100644 index 0000000..26b39d6 --- /dev/null +++ b/Source/Kernel.cs @@ -0,0 +1,1141 @@ +using System.Runtime.InteropServices; +using System.Text; +using System; + +using Microsoft.Win32.SafeHandles; + +using ThirtyTwo.Kernel32.Enumerations; +using ThirtyTwo.Kernel32.Structures; + +namespace ThirtyTwo.Kernel32 +{ + public static class Kernel + { + #region Public Constants + + public const string DLL_NAME = @"kernel32.dll"; + + #endregion + + // @ + + #region GetLastError => SystemErrorCodes + + [DllImport( + DLL_NAME, + EntryPoint = "GetLastError" + )] + public static extern SystemErrorCodes GetLastError(); + + #endregion + + // @ + + #region GetLastErrorCode => uint + + [DllImport( + DLL_NAME, + EntryPoint = "GetLastError" + )] + public static extern uint GetLastErrorCode(); + + #endregion + + // @ + + #region AddConsoleAlias (Unicode - LPWStr) => bool + + [DllImport( + DLL_NAME, + EntryPoint = "AddConsoleAlias", + CharSet = CharSet.Unicode, + SetLastError = true + )] + public static extern bool AddConsoleAlias( + [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder Source, + [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder Target, + [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder ExeName + ); + + #endregion + + // @ + + #region AllocConsole => bool + + [DllImport( + DLL_NAME, + EntryPoint = "AllocConsole", + SetLastError = true + )] + public static extern bool AllocConsole(); + + #endregion + + // @ + + #region AttachConsole => bool + + [DllImport( + DLL_NAME, + EntryPoint = "AttachConsole", + SetLastError = true + )] + public static extern bool AttachConsole( + [In] uint dwProcessId + ); + + #endregion + + // @ + + #region ClosePseudoConsole => void + + [DllImport( + DLL_NAME, + EntryPoint = "ClosePseudoConsole", + SetLastError = true + )] + public static extern void ClosePseudoConsole( + [In] IntPtr hPC + ); + + #endregion + + // @ + + #region CreatePseudoConsole => ResultHandle + + [DllImport( + DLL_NAME, + EntryPoint = "CreatePseudoConsole", + SetLastError = true + )] + public static extern ResultHandle CreatePseudoConsole( + [In] Coordinate size, + [In] IntPtr hInput, + [In] IntPtr hOutput, + [In] PseudoConsoleCreationOption dwFlags, + [Out] out IntPtr phPC + ); + + #endregion + + // @ + + #region CreateConsoleScreenBuffer => SafeFileHandle + + [DllImport( + DLL_NAME, + EntryPoint = "CreateConsoleScreenBuffer", + SetLastError = true + )] + public static extern SafeFileHandle CreateConsoleScreenBuffer( + [In] AccessRights dwDesiredAccess, + [In] ShareMode dwShareMode, + [In] ref SecurityAttributes lpSecurityAttributes, + [In] uint dwFlags, + [In] IntPtr lpScreenBufferData = default + ); + + #endregion + + // @ + + #region FillConsoleOutputAttribute => bool + + [DllImport(DLL_NAME, EntryPoint = "FillConsoleOutputAttribute", SetLastError = true)] + public static extern bool FillConsoleOutputAttribute( + [In] IntPtr hConsoleOutput, + [In] CharacterAttributes wAttribute, + [In] uint nLength, + [In] Coordinate dwWriteCoord, + [Out] out uint lpNumberOfAttrsWritten + ); + + #endregion + + // @ + + #region FillConsoleOutputCharacter (Unicode - LPWStr) => bool + + [DllImport( + DLL_NAME, + EntryPoint = "FillConsoleOutputCharacter", + CharSet = CharSet.Unicode, + SetLastError = true + )] + public static extern bool FillConsoleOutputCharacter( + [In] IntPtr hConsoleOutput, + [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder cCharacter, + [In] uint nLength, + [In] Coordinate dwWriteCoord, + [Out] out uint lpNumberOfCharsWritten + ); + + #endregion + + // @ + + #region FlushConsoleInputBuffer => bool + + [DllImport( + DLL_NAME, + EntryPoint = "FlushConsoleInputBuffer", + SetLastError = true + )] + public static extern bool FlushConsoleInputBuffer( + [In] IntPtr hConsoleInput + ); + + #endregion + + // @ + + #region FreeConsole => void + + [DllImport( + DLL_NAME, + EntryPoint = "FreeConsole", + SetLastError = true + )] + public static extern void FreeConsole(); + + #endregion + + // @ + + #region GenerateConsoleCtrlEvent => bool + + [DllImport( + DLL_NAME, + EntryPoint = "GenerateConsoleCtrlEvent", + SetLastError = true + )] + public static extern bool GenerateConsoleCtrlEvent( + [In] ControlEvent dwCtrlEvent, + [In] uint dwProcessGroupId + ); + + #endregion + + // @ + + #region GetConsoleAlias (Unicode - LPWStr) => uint + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleAlias", + CharSet = CharSet.Unicode, + SetLastError = true + )] + public static extern uint GetConsoleAlias( + [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpSource, + [Out] out StringBuilder lpTargetBuffer, + [In, MarshalAs(UnmanagedType.LPWStr)] uint TargetBufferLength, + [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpExeName + ); + + #endregion + + // @ + + #region GetConsoleAliases (Unicode - LPWStr) => uint + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleAliases", + CharSet = CharSet.Unicode, + SetLastError = true + )] + public static extern uint GetConsoleAliases( + [Out, MarshalAs(UnmanagedType.LPWStr)] out StringBuilder lpAliasBuffer, + [In] uint AliasBufferLength, + [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpExeName + ); + + #endregion + + // @ + + #region GetConsoleAliasesLength (Unicode - LPWStr) => uint + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleAliasesLength", + CharSet = CharSet.Unicode, + SetLastError = true + )] + public static extern uint GetConsoleAliasesLength( + [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpExeName + ); + + #endregion + + // @ + + #region GetConsoleAliasExes (Unicode - LPWStr) => uint + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleAliasExes", + CharSet = CharSet.Unicode, + SetLastError = true + )] + public static extern uint GetConsoleAliasExes( + [Out, MarshalAs(UnmanagedType.LPWStr)] out StringBuilder lpExeNameBuffer, + [In] uint ExeNameBufferLength + ); + + #endregion + + // @ + + #region GetConsoleAliasExesLength => uint + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleAliasExesLength", + SetLastError = true + )] + public static extern uint GetConsoleAliasExesLength(); + + #endregion + + // @ + + #region GetConsoleCP => uint + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleCP", + SetLastError = true + )] + public static extern uint GetConsoleCP(); + + #endregion + + // @ + + #region GetConsoleCursorInfo => bool + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleCursorInfo", + SetLastError = true + )] + public static extern bool GetConsoleCursorInfo( + [In] IntPtr hConsoleOutput, + [Out] out ConsoleCursorInformation lpConsoleCursorInfo + ); + + #endregion + + // @ + + #region GetConsoleDisplayMode => bool + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleDisplayMode", + SetLastError = true + )] + public static extern bool GetConsoleDisplayMode( + [Out] out ConsoleDisplayMode lpModeFlags + ); + + #endregion + + // @ + + #region GetConsoleFontSize => Coordinate + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleFontSize", + SetLastError = true + )] + public static extern Coordinate GetConsoleFontSize( + [In] IntPtr hConsoleOutput, + [In] uint nFont + ); + + #endregion + + // @ + + #region GetConsoleHistoryInfo => bool + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleHistoryInfo", + SetLastError = true + )] + public static extern bool GetConsoleHistoryInfo( + [Out] out ConsoleHistoryInformation lpConsoleHistoryInfo + ); + + #endregion + + // @ + + #region GetConsoleMode => bool + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleMode", + SetLastError = true + )] + public static extern bool GetConsoleMode( + [In] IntPtr hConsoleHandle, + [Out] out ConsoleMode lpMode + ); + + #endregion + + // @ + + #region GetConsoleOriginalTitle (Unicode - LPWStr) => uint + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleOriginalTitle", + CharSet = CharSet.Unicode, + SetLastError = true + )] + public static extern uint GetConsoleOriginalTitle( + [Out, MarshalAs(UnmanagedType.LPWStr)] out StringBuilder lpConsoleTitle, + [In] uint nSize + ); + + #endregion + + // @ + + #region GetConsoleOutputCP => uint + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleOutputCP", + SetLastError = true + )] + public static extern uint GetConsoleOutputCP(); + + #endregion + + // @ + + #region GetConsoleProcessList => uint + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleProcessList", + SetLastError = true + )] + public static extern uint GetConsoleProcessList( + [Out] out IntPtr[] lpdwProcessList, + [In] uint dwProcessCount + ); + + #endregion + + // @ + + #region GetConsoleScreenBufferInfo => bool + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleScreenBufferInfo", + SetLastError = true + )] + public static extern bool GetConsoleScreenBufferInfo( + [In] IntPtr hConsoleOutput, + [Out] out ConsoleScreenBufferInformation lpConsoleScreenBufferInfo + ); + + #endregion + + // @ + + #region GetConsoleScreenBufferInfoEx => bool + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleScreenBufferInfoEx", + SetLastError = true + )] + public static extern bool GetConsoleScreenBufferInfoEx( + [In] IntPtr hConsoleOutput, + [Out] out ConsoleScreenBufferInformationExtended lpConsoleScreenBufferInfoEx + ); + + #endregion + + // @ + + #region GetConsoleSelectionInfo => bool + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleSelectionInfo", + SetLastError = true + )] + public static extern bool GetConsoleSelectionInfo( + [Out] out ConsoleSelectionInformation lpConsoleSelectionInfo + ); + + #endregion + + // @ + + #region GetConsoleTitle (Unicode - LPWStr) => bool + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleTitle", + SetLastError = true + )] + public static extern bool GetConsoleTitle( + [Out, MarshalAs(UnmanagedType.LPWStr)] out StringBuilder lpConsoleTitle, + [In] uint nSize + ); + + #endregion + + // @ + + #region GetConsoleWindow => IntPtr + + [DllImport( + DLL_NAME, + EntryPoint = "GetConsoleWindow", + SetLastError = true + )] + public static extern IntPtr GetConsoleWindow(); + + #endregion + + // @ + + #region GetCurrentConsoleFont => bool + + [DllImport( + DLL_NAME, + EntryPoint = "GetCurrentConsoleFont", + SetLastError = true + )] + public static extern bool GetCurrentConsoleFont( + [In] IntPtr hConsoleOutput, + [In] bool bMaximumWindow, + [Out] out ConsoleFontInformation lpConsoleCurrentFont + ); + + #endregion + + // @ + + #region GetCurrentConsoleFontEx => bool + + [DllImport( + DLL_NAME, + EntryPoint = "GetCurrentConsoleFontEx", + SetLastError = true + )] + public static extern bool GetCurrentConsoleFontEx( + [In] IntPtr hConsoleOutput, + [In] bool bMaximumWindow, + [Out] out ConsoleFontInformationExtended lpConsoleCurrentFontEx + ); + + #endregion + + // @ + + #region GetLargestConsoleWindowSize => Coordinate + + [DllImport( + DLL_NAME, + EntryPoint = "GetLargestConsoleWindowSize", + SetLastError = true + )] + public static extern Coordinate GetLargestConsoleWindowSize( + [In] IntPtr hConsoleOutput + ); + + #endregion + + // @ + + #region GetNumberOfConsoleInputEvents => bool + + [DllImport( + DLL_NAME, + EntryPoint = "GetNumberOfConsoleInputEvents", + SetLastError = true + )] + public static extern bool GetNumberOfConsoleInputEvents( + [In] IntPtr hConsoleInput, + [Out] out uint lpcNumberOfEvents + ); + + #endregion + + // @ + + #region GetNumberOfConsoleMouseButtons => bool + + [DllImport( + DLL_NAME, + EntryPoint = "GetNumberOfConsoleMouseButtons", + SetLastError = true + )] + public static extern bool GetNumberOfConsoleMouseButtons( + [Out] out uint lpNumberOfMouseButtons + ); + + #endregion + + // @ + + #region GetStdHandle => IntPtr + + [DllImport( + DLL_NAME, + EntryPoint = "GetStdHandle", + SetLastError = true + )] + public static extern IntPtr GetStdHandle( + [In] ConsoleStandardDevice nStdHandle + ); + + #endregion + + // @ + + #region HandlerRoutine (delegate) => bool + + public delegate bool HandlerRoutine( + [In] ControlEvent dwCtrlType + ); + + #endregion + + // @ + + #region PeekConsoleInput => bool + + [DllImport( + DLL_NAME, + EntryPoint = "PeekConsoleInput", + SetLastError = true + )] + public static extern bool PeekConsoleInput( + [In] IntPtr hConsoleInput, + [Out] out InputRecord lpBuffer, + [In] uint nLength, + [Out] out uint lpNumberOfEventsRead + ); + + #endregion + + // @ + + #region ReadConsole => bool + + [DllImport( + DLL_NAME, + EntryPoint = "ReadConsole", + SetLastError = true + )] + public static extern bool ReadConsole( + [In] IntPtr hConsoleInput, + [Out] out byte[] lpBuffer, + [In] uint nNumberOfCharsToRead, + [Out] out uint lpNumberOfCharsRead, + [In] ref ReadConsoleControl pInputControl + ); + + #endregion + + // @ + + #region ReadConsoleInput => bool + + [DllImport( + DLL_NAME, + EntryPoint = "ReadConsoleInput", + SetLastError = true + )] + public static extern bool ReadConsoleInput( + [In] IntPtr hConsoleInput, + [Out] out InputRecord lpBuffer, + [In] uint nLength, + [Out] out uint lpNumberOfEventsRead + ); + + #endregion + + // @ + + #region ReadConsoleInputEx => bool + + [DllImport( + DLL_NAME, + EntryPoint = "ReadConsoleInputEx", + SetLastError = true + )] + public static extern bool ReadConsoleInputEx( + [In] IntPtr hConsoleInput, + [Out] out InputRecord lpBuffer, + [In] uint nLength, + [Out] out uint lpNumberOfEventsRead, + [In] ConsoleReadingBehavior wFlags + ); + + #endregion + + // @ + + #region ReadConsoleOutput => bool + + [DllImport( + DLL_NAME, + EntryPoint = "ReadConsoleOutput", + SetLastError = true + )] + public static extern bool ReadConsoleOutput( + [In] IntPtr hConsoleOutput, + [Out] out CharacterInformation lpBuffer, + [In] Coordinate dwBufferSize, + [In] Coordinate dwBufferCoord, + [In, Out] ref SmallRectangle lpReadRegion + ); + + #endregion + + // @ + + #region ReadConsoleOutputAttribute => bool + + [DllImport( + DLL_NAME, + EntryPoint = "ReadConsoleOutputAttribute", + SetLastError = true + )] + public static extern bool ReadConsoleOutputAttribute( + [In] IntPtr hConsoleOutput, + [Out] out CharacterAttributes lpAttribute, + [In] uint nLength, + [In] Coordinate dwReadCoord, + [Out] out uint lpNumberOfAttrsRead + ); + + #endregion + + // @ + + #region ReadConsoleOutputCharacter (Unicode or ANSI - LPTStr) => bool + + [DllImport( + DLL_NAME, + EntryPoint = "ReadConsoleOutputCharacter", + CharSet = CharSet.Auto, + SetLastError = true + )] + public static extern bool ReadConsoleOutputCharacter( + [In] IntPtr hConsoleOutput, + [Out, MarshalAs(UnmanagedType.LPTStr)] out StringBuilder lpCharacter, + [In] uint nLength, + [In] Coordinate dwReadCoord, + [Out] out uint lpNumberOfCharsRead + ); + + #endregion + + // @ + + #region ResizePseudoConsole => ResultHandle + + [DllImport( + DLL_NAME, + EntryPoint = "ResizePseudoConsole", + SetLastError = true + )] + public static extern ResultHandle ResizePseudoConsole( + [In] IntPtr hPC, + [In] Coordinate size + ); + + #endregion + + // @ + + #region ScrollConsoleScreenBuffer => bool + + [DllImport( + DLL_NAME, + EntryPoint = "ScrollConsoleScreenBuffer", + SetLastError = true + )] + public static extern bool ScrollConsoleScreenBuffer( + [In] IntPtr hConsoleOutput, + [In] ref SmallRectangle lpScrollRectangle, + [In] ref SmallRectangle lpClipRectangle, + [In] Coordinate dwDestinationOrigin, + [In] ref CharacterInformation lpFill + ); + + #endregion + + // @ + + #region SetConsoleActiveScreenBuffer => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleActiveScreenBuffer", + SetLastError = true + )] + public static extern bool SetConsoleActiveScreenBuffer( + [In] IntPtr hConsoleOutput + ); + + #endregion + + // @ + + #region SetConsoleCP => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleCP", + SetLastError = true + )] + public static extern bool SetConsoleCP( + [In] uint wCodePageID + ); + + #endregion + + // @ + + #region SetConsoleCtrlHandler => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleCtrlHandler", + SetLastError = true + )] + public static extern bool SetConsoleCtrlHandler( + [In] HandlerRoutine HandlerRoutine, + [In] bool Add + ); + + #endregion + + // @ + + #region SetConsoleCursorInfo => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleCursorInfo", + SetLastError = true + )] + public static extern bool SetConsoleCursorInfo( + [In] IntPtr hConsoleOutput, + [In] ref ConsoleCursorInformation lpConsoleCursorInfo + ); + + #endregion + + // @ + + #region SetConsoleCursorPosition => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleCursorPosition", + SetLastError = true + )] + public static extern bool SetConsoleCursorPosition( + [In] IntPtr hConsoleOutput, + [In] Coordinate dwCursorPosition + ); + + #endregion + + // @ + + #region SetConsoleDisplayMode => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleDisplayMode", + SetLastError = true + )] + public static extern bool SetConsoleDisplayMode( + [In] IntPtr hConsoleOutput, + [In] ConsoleDisplayMode dwFlags, + [Out] out Coordinate lpNewScreenBufferDimensions + ); + + #endregion + + // @ + + #region SetConsoleHistoryInfo => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleHistoryInfo", + SetLastError = true + )] + public static extern bool SetConsoleHistoryInfo( + [In] ConsoleHistoryInformation lpConsoleHistoryInfo + ); + + #endregion + + // @ + + #region SetConsoleMode => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleMode", + SetLastError = true + )] + public static extern bool SetConsoleMode( + [In] IntPtr hConsoleHandle, + [In] ConsoleMode dwMode + ); + + #endregion + + // @ + + #region SetConsoleOutputCP => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleOutputCP", + SetLastError = true + )] + public static extern bool SetConsoleOutputCP( + [In] uint wCodePageID + ); + + #endregion + + // @ + + #region SetConsoleScreenBufferInfoEx => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleScreenBufferInfoEx", + SetLastError = true + )] + public static extern bool SetConsoleScreenBufferInfoEx( + [In] IntPtr hConsoleOutput, + [In] ConsoleScreenBufferInformationExtended lpConsoleScreenBufferInfoEx + ); + + #endregion + + // @ + + #region SetConsoleScreenBufferSize => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleScreenBufferSize", + SetLastError = true + )] + public static extern bool SetConsoleScreenBufferSize( + [In] IntPtr hConsoleOutput, + [In] Coordinate dwSize + ); + + #endregion + + // @ + + #region SetConsoleTextAttribute => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleTextAttribute", + SetLastError = true + )] + public static extern bool SetConsoleTextAttribute( + [In] IntPtr hConsoleOutput, + [In] CharacterAttributes wAttributes + ); + + #endregion + + // @ + + #region SetConsoleTitle (Unicode - LPWStr) => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleTitle", + CharSet = CharSet.Unicode, + SetLastError = true + )] + public static extern bool SetConsoleTitle( + [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpConsoleTitle + ); + + #endregion + + // @ + + #region SetConsoleWindowInfo => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetConsoleWindowInfo", + SetLastError = true + )] + public static extern bool SetConsoleWindowInfo( + [In] IntPtr hConsoleOutput, + [In] bool bAbsolute, + [In] ref SmallRectangle lpConsoleWindow + ); + + #endregion + + // @ + + #region SetCurrentConsoleFontEx => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetCurrentConsoleFontEx", + SetLastError = true + )] + public static extern bool SetCurrentConsoleFontEx( + [In] IntPtr hConsoleOutput, + [In] bool bMaximumWindow, + [In] ref ConsoleFontInformationExtended lpConsoleCurrentFontEx + ); + + #endregion + + // @ + + #region SetStdHandle => bool + + [DllImport( + DLL_NAME, + EntryPoint = "SetStdHandle", + SetLastError = true + )] + public static extern bool SetStdHandle( + [In] ConsoleStandardDevice nStdHandle, + [In] IntPtr hHandle + ); + + #endregion + + // @ + + #region WriteConsole (Unicode or ANSI - LPTStr) => bool + + [DllImport( + DLL_NAME, + EntryPoint = "WriteConsole", + CharSet = CharSet.Auto, + SetLastError = true + )] + public static extern bool WriteConsole( + [In] IntPtr hConsoleOutput, + [In, MarshalAs(UnmanagedType.LPTStr)] ref StringBuilder lpBuffer, + [In] uint nNumberOfCharsToWrite, + [Out] out uint lpNumberOfCharsWritten, + [In] IntPtr lpReserved = default + ); + + #endregion + + // @ + + #region WriteConsoleInput => bool + + [DllImport( + DLL_NAME, + EntryPoint = "WriteConsoleInput", + SetLastError = true + )] + public static extern bool WriteConsoleInput( + [In] IntPtr hConsoleInput, + [In] ref InputRecord lpBuffer, + [In] uint nLength, + [Out] out uint lpNumberOfEventsWritten + ); + + #endregion + + // @ + + #region WriteConsoleOutput => bool + + [DllImport( + DLL_NAME, + EntryPoint = "WriteConsoleOutput", + SetLastError = true + )] + public static extern bool WriteConsoleOutput( + [In] IntPtr hConsoleOutput, + [In] ref CharacterInformation[] lpBuffer, + [In] Coordinate dwBufferSize, + [In] Coordinate dwBufferCoord, + [In, Out] ref SmallRectangle lpWriteRegion + ); + + #endregion + + // @ + + #region WriteConsoleOutputAttribute => bool + + [DllImport( + DLL_NAME, + EntryPoint = "WriteConsoleOutputAttribute", + SetLastError = true + )] + public static extern bool WriteConsoleOutputAttribute( + [In] IntPtr hConsoleOutput, + [In] ref CharacterAttributes lpAttribute, + [In] uint Length, + [In] Coordinate dwWriteCoord, + [Out] out uint lpNumberOfAttrsWritten + ); + + #endregion + + // @ + + #region WriteConsoleOutputCharacter => bool + + [DllImport( + DLL_NAME, + EntryPoint = "WriteConsoleOutputCharacter", + CharSet = CharSet.Auto, + SetLastError = true + )] + public static extern bool WriteConsoleOutputCharacter( + [In] IntPtr hConsoleOutput, + [In, MarshalAs(UnmanagedType.LPTStr)] StringBuilder lpCharacter, + [In] uint nLength, + [In] Coordinate dwWriteCoord, + [Out] out uint lpNumberOfCharsWritten + ); + + #endregion + } +} diff --git a/ThirtyTwo/Properties/AssemblyInfo.cs b/Source/Properties/AssemblyInfo.cs similarity index 81% rename from ThirtyTwo/Properties/AssemblyInfo.cs rename to Source/Properties/AssemblyInfo.cs index 9925b00..979de4a 100644 --- a/ThirtyTwo/Properties/AssemblyInfo.cs +++ b/Source/Properties/AssemblyInfo.cs @@ -6,11 +6,11 @@ [assembly: AssemblyConfiguration("retail")] [assembly: AssemblyCompany("ThirtyTwo Interops")] [assembly: AssemblyProduct("ThirtyTwo.Kernel32")] -[assembly: AssemblyCopyright("Copyright © 2024 ThirtyTwo Interops")] +[assembly: AssemblyCopyright("Copyright © 2024 ThirtyTwo Interops and Novus Inspire")] [assembly: AssemblyTrademark("ThirtyTwo")] [assembly: Guid("d7ba9bd7-2edf-4e74-bd15-b32c8d432afb")] [assembly: ComVisible(false)] -[assembly: AssemblyFileVersion("1.0.0.2")] -[assembly: AssemblyVersion("1.0.0.2")] +[assembly: AssemblyFileVersion("1.0.0.3")] +[assembly: AssemblyVersion("1.0.0.3")] diff --git a/ThirtyTwo/Structures/CharacterInformation.cs b/Source/Structures/CharacterInformation.cs similarity index 74% rename from ThirtyTwo/Structures/CharacterInformation.cs rename to Source/Structures/CharacterInformation.cs index 4922e48..21b059f 100644 --- a/ThirtyTwo/Structures/CharacterInformation.cs +++ b/Source/Structures/CharacterInformation.cs @@ -5,32 +5,18 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Specifies a Unicode or ANSI character and its attributes. This structure is - /// used by console functions to read from and write to a console screen buffer. - /// [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode)] public struct CharacterInformation : IEquatable { #region Public Members - /// - /// Unicode character of a screen buffer character cell. - /// [FieldOffset(0)] public char UnicodeChar; - /// - /// ANSI character of a screen buffer character cell. - /// [FieldOffset(0)] public char AsciiChar; - /// - /// The character's attributes. This member can be zero or a combination of - /// values ​​from the "CharacterAttributes" enumeration. - /// [FieldOffset(2)] public CharacterAttributes Attributes; @@ -40,7 +26,6 @@ public struct CharacterInformation : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( CharacterInformation firstStructure, CharacterInformation secondStructure @@ -64,7 +49,6 @@ CharacterInformation secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( CharacterInformation firstStructure, CharacterInformation secondStructure @@ -88,13 +72,11 @@ CharacterInformation secondStructure #region Equals => bool - /// public bool Equals(CharacterInformation other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is CharacterInformation charInfo) @@ -111,7 +93,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -129,7 +110,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/ConsoleCursorInformation.cs b/Source/Structures/ConsoleCursorInformation.cs similarity index 72% rename from ThirtyTwo/Structures/ConsoleCursorInformation.cs rename to Source/Structures/ConsoleCursorInformation.cs index 9bb1b24..4b164e7 100644 --- a/ThirtyTwo/Structures/ConsoleCursorInformation.cs +++ b/Source/Structures/ConsoleCursorInformation.cs @@ -3,27 +3,13 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Contains information about the console cursor. - /// [StructLayout(LayoutKind.Sequential)] public struct ConsoleCursorInformation : IEquatable { #region Public Members - /// - /// The percentage of the character cell that is filled by the cursor. This - /// value is between 1 and 100. The cursor appearance variates, ranging from - /// completely filling the cell to showing up as a horizontal line at the - /// bottom of the cell. - /// public uint dwSize; - - /// - /// The visibility of the cursor. If true cursor is visible, this member - /// is TRUE. - /// public bool bVisible; #endregion @@ -32,7 +18,6 @@ public struct ConsoleCursorInformation : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( ConsoleCursorInformation firstStructure, ConsoleCursorInformation secondStructure @@ -55,7 +40,6 @@ ConsoleCursorInformation secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( ConsoleCursorInformation firstStructure, ConsoleCursorInformation secondStructure @@ -78,13 +62,11 @@ ConsoleCursorInformation secondStructure #region Equals => bool - /// public bool Equals(ConsoleCursorInformation other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is ConsoleCursorInformation consoleCursorInfo) @@ -101,7 +83,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -118,7 +99,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/ConsoleFontInformation.cs b/Source/Structures/ConsoleFontInformation.cs similarity index 74% rename from ThirtyTwo/Structures/ConsoleFontInformation.cs rename to Source/Structures/ConsoleFontInformation.cs index 8daa53d..c82d633 100644 --- a/ThirtyTwo/Structures/ConsoleFontInformation.cs +++ b/Source/Structures/ConsoleFontInformation.cs @@ -3,25 +3,13 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Contains information for a console font. - /// [StructLayout(LayoutKind.Sequential)] public struct ConsoleFontInformation : IEquatable { #region Public Members - /// - /// The index of the font int the system's console font table. - /// public uint wFont; - - /// - /// A "Coordinate" structure that contains the width and height of each character - /// in the font, in logical units. The X member contains the width, while - /// the Y member contains the height. - /// public Coordinate dwFontSize; #endregion @@ -30,7 +18,6 @@ public struct ConsoleFontInformation : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( ConsoleFontInformation firstStructure, ConsoleFontInformation secondStructure @@ -53,7 +40,6 @@ ConsoleFontInformation secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( ConsoleFontInformation firstStructure, ConsoleFontInformation secondStructure @@ -76,13 +62,11 @@ ConsoleFontInformation secondStructure #region Equals => bool - /// public bool Equals(ConsoleFontInformation other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is ConsoleFontInformation consoleFontInfo) @@ -99,7 +83,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -116,7 +99,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/ConsoleFontInformationExtended.cs b/Source/Structures/ConsoleFontInformationExtended.cs similarity index 71% rename from ThirtyTwo/Structures/ConsoleFontInformationExtended.cs rename to Source/Structures/ConsoleFontInformationExtended.cs index a6ea80f..9c022fc 100644 --- a/ThirtyTwo/Structures/ConsoleFontInformationExtended.cs +++ b/Source/Structures/ConsoleFontInformationExtended.cs @@ -3,48 +3,21 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Contains extended information for a console font. - /// [StructLayout(LayoutKind.Sequential)] public struct ConsoleFontInformationExtended : IEquatable { #region Public Members - /// - /// The size of this structure, in bytes. - /// public static uint cbSize = (uint)Marshal.SizeOf( typeof(ConsoleFontInformationExtended) ); - /// - /// The index of the font in the system's console font table. - /// public uint nFont; - - /// - /// A "Coordinate" structure that contains the width and height of each character - /// in the font, in logical units. The X member contains the width, while - /// the Y member contains the height. - /// public Coordinate dwFontSize; - - /// - /// The font pitch and family. - /// public uint FontFamily; - - /// - /// The font weight. The weight can range from 100 to 1000, in multiples of - /// 100. For example, the normal weight is 400, while 700 is bold. - /// public uint FontWeight; - /// - /// The name of the typeface (such as Courier or Arial). - /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] public string FaceName; @@ -54,7 +27,6 @@ public struct ConsoleFontInformationExtended : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( ConsoleFontInformationExtended firstStructure, ConsoleFontInformationExtended secondStructure @@ -80,7 +52,6 @@ ConsoleFontInformationExtended secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( ConsoleFontInformationExtended firstStructure, ConsoleFontInformationExtended secondStructure @@ -106,13 +77,11 @@ ConsoleFontInformationExtended secondStructure #region Equals => bool - /// public bool Equals(ConsoleFontInformationExtended other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is ConsoleFontInformationExtended consoleFontInfoEx) @@ -129,7 +98,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -150,7 +118,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/ConsoleHistoryInformation.cs b/Source/Structures/ConsoleHistoryInformation.cs similarity index 76% rename from ThirtyTwo/Structures/ConsoleHistoryInformation.cs rename to Source/Structures/ConsoleHistoryInformation.cs index 2c87d0e..a6b57ea 100644 --- a/ThirtyTwo/Structures/ConsoleHistoryInformation.cs +++ b/Source/Structures/ConsoleHistoryInformation.cs @@ -3,35 +3,18 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Contains information about the console history. - /// [StructLayout(LayoutKind.Sequential)] public struct ConsoleHistoryInformation : IEquatable { #region Public Members - /// - /// The size of the structure, in bytes. - /// public static uint cbSize = (uint)Marshal.SizeOf( typeof(ConsoleHistoryInformation) ); - /// - /// The number of commands kept in each history buffer. - /// public uint HistoryBufferSize; - - /// - /// The number of history buffers kept for this console process. - /// public uint NumberOfHistoryBuffers; - - /// - /// Duplicates entries will not be stored in the history buffer. - /// public static uint dwFlags = 0x1; #endregion @@ -40,7 +23,6 @@ public struct ConsoleHistoryInformation : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( ConsoleHistoryInformation firstStructure, ConsoleHistoryInformation secondStructure @@ -63,7 +45,6 @@ ConsoleHistoryInformation secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( ConsoleHistoryInformation firstStructure, ConsoleHistoryInformation secondStructure @@ -86,13 +67,11 @@ ConsoleHistoryInformation secondStructure #region Equals => bool - /// public bool Equals(ConsoleHistoryInformation other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is ConsoleHistoryInformation consoleHistoryInfo) @@ -109,7 +88,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -128,7 +106,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/ConsoleScreenBufferInformation.cs b/Source/Structures/ConsoleScreenBufferInformation.cs similarity index 66% rename from ThirtyTwo/Structures/ConsoleScreenBufferInformation.cs rename to Source/Structures/ConsoleScreenBufferInformation.cs index b77b068..38b4afe 100644 --- a/ThirtyTwo/Structures/ConsoleScreenBufferInformation.cs +++ b/Source/Structures/ConsoleScreenBufferInformation.cs @@ -5,46 +5,16 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Contains information about a console screen buffer. - /// [StructLayout(LayoutKind.Sequential)] public struct ConsoleScreenBufferInformation : IEquatable { #region Public Members - /// - /// A "Coordinate" structure that contains the size of the console screen buffer, in - /// character columns and rows. - /// public Coordinate dwSize; - - /// - /// A "Coordinate" structure that contains the column and row coordinates of the cursor - /// in the console screen buffer. - /// public Coordinate dwCursorPosition; - - /// - /// The attributes of the characters written to a screen buffer by the "WriteFile" - /// and "WriteConsole" functions, or echoed to a screen buffer by the "ReadFile" and - /// "ReadConsole" functions. This member can be zero or a combination of values ​​from - /// the "CharacterAttributes" enumeration. - /// public CharacterAttributes wAttributes; - - /// - /// A "SmallRectangle" structure that contains the console screen buffer coordinates of - /// the upper-left and lower-right corners of the display window. - /// public SmallRectangle srWindow; - - /// - /// A "Coordinate" structure that contains the maximum size of the console window, in - /// character columns and rows, given the current screen buffer size and font and - /// the screen size. - /// public Coordinate dwMaximumWindowSize; #endregion @@ -53,7 +23,6 @@ public struct ConsoleScreenBufferInformation : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( ConsoleScreenBufferInformation firstStructure, ConsoleScreenBufferInformation secondStructure @@ -79,7 +48,6 @@ ConsoleScreenBufferInformation secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( ConsoleScreenBufferInformation firstStructure, ConsoleScreenBufferInformation secondStructure @@ -105,13 +73,11 @@ ConsoleScreenBufferInformation secondStructure #region Equals => bool - /// public bool Equals(ConsoleScreenBufferInformation other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is ConsoleScreenBufferInformation consoleScreenBufferInfo) @@ -128,7 +94,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -148,7 +113,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/ConsoleScreenBufferInformationExtended.cs b/Source/Structures/ConsoleScreenBufferInformationExtended.cs similarity index 66% rename from ThirtyTwo/Structures/ConsoleScreenBufferInformationExtended.cs rename to Source/Structures/ConsoleScreenBufferInformationExtended.cs index 623b577..e83817b 100644 --- a/ThirtyTwo/Structures/ConsoleScreenBufferInformationExtended.cs +++ b/Source/Structures/ConsoleScreenBufferInformationExtended.cs @@ -5,70 +5,24 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Contains extended information about a console screen buffer. - /// [StructLayout(LayoutKind.Sequential)] public struct ConsoleScreenBufferInformationExtended : IEquatable { #region Public Members - /// - /// The size of this structure, in bytes. - /// public static uint cbSize = (uint)Marshal.SizeOf( typeof(ConsoleScreenBufferInformationExtended) ); - /// - /// A "Coordinate" structure that contains the size of the console screen buffer, in - /// character columns and rows. - /// public Coordinate dwSize; - - /// - /// A "Coordinate" structure that contains the column and row coordinates of the cursor - /// in the console screen buffer. - /// public Coordinate dwCursorPosition; - - /// - /// The attributes of the characters written to a screen buffer by the "WriteFile" - /// and "WriteConsole" functions, or echoed to a screen buffer by the "ReadFile" and - /// "ReadConsole" functions. This member can be zero or a combination of values ​​from - /// the "CharacterAttributes" enumeration. - /// public CharacterAttributes wAttributes; - - /// - /// A "SmallRectangle" structure that contains the console screen buffer coordinates of - /// the upper-left and lower-right corners of the display window. - /// public SmallRectangle srWindow; - - /// - /// A "Coordinate" structure that contains the maximum size of the console window, in - /// character columns and rows, given the current screen buffer size and font and - /// the screen size. - /// public Coordinate dwMaximumWindowSize; - - /// - /// The fill attribute for console pop-ups. - /// public ushort wPopupAttributes; - - /// - /// If this member is "TRUE", full-screen mode is supported; otherwise, it is not. - /// This will always be "FALSE" for systems after Windows Vista with the WDDM driver - /// model as true direct VGA access to the monitor is no longer available. - /// public bool bFullscreenSupported; - /// - /// An array of "COLORREF (DWORD)" values that describe the console's color settings. - /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public uint[] ColorTable; @@ -78,7 +32,6 @@ public struct ConsoleScreenBufferInformationExtended : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( ConsoleScreenBufferInformationExtended firstStructure, ConsoleScreenBufferInformationExtended secondStructure @@ -107,7 +60,6 @@ ConsoleScreenBufferInformationExtended secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( ConsoleScreenBufferInformationExtended firstStructure, ConsoleScreenBufferInformationExtended secondStructure @@ -136,13 +88,11 @@ ConsoleScreenBufferInformationExtended secondStructure #region Equals => bool - /// public bool Equals(ConsoleScreenBufferInformationExtended other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is ConsoleScreenBufferInformationExtended consoleScreenBufferInfoEx) @@ -159,7 +109,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -182,7 +131,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/ConsoleSelectionInformation.cs b/Source/Structures/ConsoleSelectionInformation.cs similarity index 76% rename from ThirtyTwo/Structures/ConsoleSelectionInformation.cs rename to Source/Structures/ConsoleSelectionInformation.cs index b20b0ee..6a25d9e 100644 --- a/ThirtyTwo/Structures/ConsoleSelectionInformation.cs +++ b/Source/Structures/ConsoleSelectionInformation.cs @@ -5,29 +5,14 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Contains information for a console selection. - /// [StructLayout(LayoutKind.Sequential)] public struct ConsoleSelectionInformation : IEquatable { #region Public Members - /// - /// The selection indicator. This member can contain one or a combination of values - /// from the "SelectionIndicator" enumeration. - /// public SelectionIndicator dwFlags; - - /// - /// A "Coordinate" structure that specifies the selection anchor, in characters. - /// public Coordinate dwSelectionAnchor; - - /// - /// A "SmallRectangle" structure that specifies the selection rectangle. - /// public SmallRectangle srSelection; #endregion @@ -36,7 +21,6 @@ public struct ConsoleSelectionInformation : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( ConsoleSelectionInformation firstStructure, ConsoleSelectionInformation secondStructure @@ -60,7 +44,6 @@ ConsoleSelectionInformation secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( ConsoleSelectionInformation firstStructure, ConsoleSelectionInformation secondStructure @@ -84,13 +67,11 @@ ConsoleSelectionInformation secondStructure #region Equals => bool - /// public bool Equals(ConsoleSelectionInformation other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is ConsoleSelectionInformation consoleSelectionInfo) @@ -107,7 +88,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -125,7 +105,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/Coordinate.cs b/Source/Structures/Coordinate.cs similarity index 83% rename from ThirtyTwo/Structures/Coordinate.cs rename to Source/Structures/Coordinate.cs index 27cebab..d797f37 100644 --- a/ThirtyTwo/Structures/Coordinate.cs +++ b/Source/Structures/Coordinate.cs @@ -3,24 +3,13 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Defines the coordinates of a character cell in a console screen buffer. The - /// origin of the coordinate system (0, 0) is at the top, left cell of the buffer. - /// [StructLayout(LayoutKind.Sequential)] public struct Coordinate : IEquatable { #region Public Members - /// - /// The horizontal coordinate or column value. The units depend on the function call. - /// public short X; - - /// - /// The vertical coordinate or row value. The units depend on the function call. - /// public short Y; #endregion @@ -29,7 +18,6 @@ public struct Coordinate : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( Coordinate firstStructure, Coordinate secondStructure @@ -52,7 +40,6 @@ Coordinate secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( Coordinate firstStructure, Coordinate secondStructure @@ -75,7 +62,6 @@ Coordinate secondStructure #region Logical Operator: Arithmetic (Sum) => Coordinate - /// public static Coordinate operator +( Coordinate firstStructure, Coordinate secondStructure @@ -106,7 +92,6 @@ Coordinate secondStructure #region Logical Operator: Arithmetic (Subtract) => Coordinate - /// public static Coordinate operator -( Coordinate firstStructure, Coordinate secondStructure @@ -137,7 +122,6 @@ Coordinate secondStructure #region Logical Operator: Arithmetic (Multiply) => Coordinate - /// public static Coordinate operator *( Coordinate firstStructure, Coordinate secondStructure @@ -168,7 +152,6 @@ Coordinate secondStructure #region Logical Operator: Arithmetic (Divide) => Coordinate - /// public static Coordinate operator /( Coordinate firstStructure, Coordinate secondStructure @@ -199,13 +182,11 @@ Coordinate secondStructure #region Equals => bool - /// public bool Equals(Coordinate other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is Coordinate coord) @@ -222,7 +203,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -239,7 +219,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/FocusEventRecord.cs b/Source/Structures/FocusEventRecord.cs similarity index 78% rename from ThirtyTwo/Structures/FocusEventRecord.cs rename to Source/Structures/FocusEventRecord.cs index da62b78..868df27 100644 --- a/ThirtyTwo/Structures/FocusEventRecord.cs +++ b/Source/Structures/FocusEventRecord.cs @@ -3,19 +3,12 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Describes a focus event in a console "INPUT_RECORD" structure. These events are - /// used internally and should be ignored. - /// [StructLayout(LayoutKind.Sequential)] public struct FocusEventRecord : IEquatable { #region Public Members - /// - /// Reserved. - /// public bool bSetFocus; #endregion @@ -24,7 +17,6 @@ public struct FocusEventRecord : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( FocusEventRecord firstStructure, FocusEventRecord secondStructure @@ -44,7 +36,6 @@ FocusEventRecord secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( FocusEventRecord firstStructure, FocusEventRecord secondStructure @@ -64,13 +55,11 @@ FocusEventRecord secondStructure #region Equals => bool - /// public bool Equals(FocusEventRecord other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is FocusEventRecord focusEventRecord) @@ -87,7 +76,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -103,7 +91,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return bSetFocus.GetHashCode(); diff --git a/ThirtyTwo/Structures/InputRecord.cs b/Source/Structures/InputRecord.cs similarity index 72% rename from ThirtyTwo/Structures/InputRecord.cs rename to Source/Structures/InputRecord.cs index fe8c649..825b14b 100644 --- a/ThirtyTwo/Structures/InputRecord.cs +++ b/Source/Structures/InputRecord.cs @@ -5,52 +5,27 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Describes an input event in the console input buffer. These records can be read from - /// the input buffer by using the "ReadConsoleInput" or "PeekConsoleInput" function, or - /// written to the input buffer by using the "WriteConsoleInput" function. - /// [StructLayout(LayoutKind.Explicit)] public struct InputRecord : IEquatable { #region Public Members - /// - /// A handle to the type of input event and the event record stored in the "Event" - /// member. This member can be defined by one of the values ​​of the - /// "InputRecordEventType" enumeration. - /// [FieldOffset(0)] public InputRecordEventType EventType; - /// - /// Describes a keyboard input event. - /// [FieldOffset(2)] public KeyEventRecord KeyEvent; - /// - /// Describes a mouse input event. - /// [FieldOffset(2)] public MouseEventRecord MouseEvent; - /// - /// Describes a change in the size of the console screen buffer. - /// [FieldOffset(2)] public WindowBufferSizeRecord WindowBufferSizeEvent; - /// - /// Describes a menu event; - /// [FieldOffset(2)] public MenuEventRecord MenuEvent; - /// - /// Describes a focus event. - /// [FieldOffset(2)] public FocusEventRecord FocusEvent; @@ -60,7 +35,6 @@ public struct InputRecord : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( InputRecord firstStructure, InputRecord secondStructure @@ -87,7 +61,6 @@ InputRecord secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( InputRecord firstStructure, InputRecord secondStructure @@ -114,13 +87,11 @@ InputRecord secondStructure #region Equals => bool - /// public bool Equals(InputRecord other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is InputRecord inputRecord) @@ -137,7 +108,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -158,7 +128,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/KeyEventRecord.cs b/Source/Structures/KeyEventRecord.cs similarity index 69% rename from ThirtyTwo/Structures/KeyEventRecord.cs rename to Source/Structures/KeyEventRecord.cs index 3838f43..566ea3a 100644 --- a/ThirtyTwo/Structures/KeyEventRecord.cs +++ b/Source/Structures/KeyEventRecord.cs @@ -5,60 +5,30 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Describes a keyboard input event in a console "INPUT_RECORD" structure. - /// [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Auto)] public struct KeyEventRecord : IEquatable { #region Public Members - /// - /// If the key is pressed, this member is "TRUE". Otherwise, this member is "FALSE" - /// (the key is released). - /// [FieldOffset(0)] public bool bKeyDown; - /// - /// The repeat count, which indicates that a key is being held down. For example, when - /// a key is held down, you might get five events with this member equal to "1", one - /// event with this member equal to "5", or multiple events with this member greater - /// than or equal to "1". - /// [FieldOffset(1)] public ushort wRepeatCount; - /// - /// A virtual-key code that identifies the given key in a device-independent manner. - /// [FieldOffset(3)] public VirtualKey wVirtualKeyCode; - /// - /// The virtual scan code of the given key that represents the device-dependent value - /// generated by the keyboard hardware. - /// [FieldOffset(5)] public ushort wVirtualScanCode; - /// - /// Translated Unicode character. - /// [FieldOffset(7)] public char UnicodeChar; - /// - /// Translated ASCII character. - /// [FieldOffset(7)] public char AsciiChar; - /// - /// The state of the control keys. This member can contain one or a combination of - /// values ​​from the "CTRL_KEY_STATE" enumeration. - /// [FieldOffset(9)] public ModifierKeyState dwControlKeyState; @@ -68,7 +38,6 @@ public struct KeyEventRecord : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( KeyEventRecord firstStructure, KeyEventRecord secondStructure @@ -96,7 +65,6 @@ KeyEventRecord secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( KeyEventRecord firstStructure, KeyEventRecord secondStructure @@ -124,13 +92,11 @@ KeyEventRecord secondStructure #region Equals => bool - /// public bool Equals(KeyEventRecord other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is KeyEventRecord keyEventRecord) @@ -147,7 +113,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -169,7 +134,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/MenuEventRecord.cs b/Source/Structures/MenuEventRecord.cs similarity index 78% rename from ThirtyTwo/Structures/MenuEventRecord.cs rename to Source/Structures/MenuEventRecord.cs index 4bc7ad1..4f5bf1e 100644 --- a/ThirtyTwo/Structures/MenuEventRecord.cs +++ b/Source/Structures/MenuEventRecord.cs @@ -3,19 +3,12 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Describes a menu event in a console "InputRecord" structure. These events are used - /// internally and should be ignored. - /// [StructLayout(LayoutKind.Sequential)] public struct MenuEventRecord : IEquatable { #region Public Members - /// - /// Reserved. - /// public uint dwCommandId; #endregion @@ -24,7 +17,6 @@ public struct MenuEventRecord : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( MenuEventRecord firstStructure, MenuEventRecord secondStructure @@ -44,7 +36,6 @@ MenuEventRecord secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( MenuEventRecord firstStructure, MenuEventRecord secondStructure @@ -64,13 +55,11 @@ MenuEventRecord secondStructure #region Equals => bool - /// public bool Equals(MenuEventRecord other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is MenuEventRecord menuEventRecord) @@ -87,7 +76,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -103,7 +91,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return dwCommandId.GetHashCode(); diff --git a/ThirtyTwo/Structures/MouseEventRecord.cs b/Source/Structures/MouseEventRecord.cs similarity index 63% rename from ThirtyTwo/Structures/MouseEventRecord.cs rename to Source/Structures/MouseEventRecord.cs index d986526..a27f92e 100644 --- a/ThirtyTwo/Structures/MouseEventRecord.cs +++ b/Source/Structures/MouseEventRecord.cs @@ -5,42 +5,15 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Describes a mouse input event in a console "InputRecord" structure. - /// [StructLayout(LayoutKind.Sequential)] public struct MouseEventRecord : IEquatable { #region Public Members - /// - /// A "Coordinate" structure that contains the location of the cursor, in terms of the - /// console screen buffer's character-cell coordinates. - /// public Coordinate dwMousePosition; - - /// - /// The status of the mouse buttons. The least significant bit corresponds to the - /// leftmost mouse button. The next least significant bit corresponds to the - /// rightmost mouse button. The next bit indicates the next-to-leftmost mouse button. - /// The bits then correspond left to right to the mouse buttons. A bit is 1 if the - /// button was pressed. This member can be defined by one of the values ​​in the - /// "MouseButtonState" enumeration. - /// public MouseButtonState dwButtonState; - - /// - /// The state of the control keys. This member can contain one or a combination of - /// values ​​from the "CTRL_KEY_STATE" enumeration. - /// public ModifierKeyState dwControlKeyState; - - /// - /// The type of mouse event. If this value is zero, it indicates a mouse button being - /// pressed or released. Otherwise, this member can be defined by one of the values ​​in - /// the "MouseEvent" enumeration. - /// public MouseEvent dwEventFlags; #endregion @@ -49,7 +22,6 @@ public struct MouseEventRecord : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( MouseEventRecord firstStructure, MouseEventRecord secondStructure @@ -74,7 +46,6 @@ MouseEventRecord secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( MouseEventRecord firstStructure, MouseEventRecord secondStructure @@ -99,13 +70,11 @@ MouseEventRecord secondStructure #region Equals => bool - /// public bool Equals(MouseEventRecord other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is MouseEventRecord mouseEventRecord) @@ -122,7 +91,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -141,7 +109,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/ReadConsoleControl.cs b/Source/Structures/ReadConsoleControl.cs similarity index 66% rename from ThirtyTwo/Structures/ReadConsoleControl.cs rename to Source/Structures/ReadConsoleControl.cs index abbcb75..2580112 100644 --- a/ThirtyTwo/Structures/ReadConsoleControl.cs +++ b/Source/Structures/ReadConsoleControl.cs @@ -5,41 +5,18 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Contains information for a console read operation. - /// [StructLayout(LayoutKind.Sequential)] public struct ReadConsoleControl : IEquatable { #region Public Members - /// - /// The size of the structure. - /// public static uint nLength = (uint)Marshal.SizeOf( typeof(ReadConsoleControl) ); - /// - /// The number of characters to skip (and thus preserve) before writing newly read - /// input in the buffer passed to the "ReadConsole" function. This value must be less - /// than the "nNumberOfCharsToRead" parameter of the ReadConsole function. - /// public uint nInitialChars; - - /// - /// A mask specifying which control characters between "0x00" and "0x1F" should be used - /// to signal that the read is complete. Each bit corresponds to a character with the - /// least significant bit corresponding to "0x00" or "NULL" and the most significant bit - /// corresponding to "0x1F" or "US". Multiple bits (control characters) can be specified. - /// public uint dwCtrlWakeupMask; - - /// - /// The state of the control keys. This member can contain one or a combination of - /// values ​​from the "CTRL_KEY_STATE" enumeration. - /// public ModifierKeyState dwCtrlKeyState; #endregion @@ -48,7 +25,6 @@ public struct ReadConsoleControl : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( ReadConsoleControl firstStructure, ReadConsoleControl secondStructure @@ -72,7 +48,6 @@ ReadConsoleControl secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( ReadConsoleControl firstStructure, ReadConsoleControl secondStructure @@ -96,13 +71,11 @@ ReadConsoleControl secondStructure #region Equals => bool - /// public bool Equals(ReadConsoleControl other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is ReadConsoleControl consoleReadConsoleControl) @@ -119,7 +92,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -138,7 +110,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/SecurityAttributes.cs b/Source/Structures/SecurityAttributes.cs similarity index 60% rename from ThirtyTwo/Structures/SecurityAttributes.cs rename to Source/Structures/SecurityAttributes.cs index 22665a3..6fc4e17 100644 --- a/ThirtyTwo/Structures/SecurityAttributes.cs +++ b/Source/Structures/SecurityAttributes.cs @@ -3,39 +3,17 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// The "SecurityAttributes" structure contains the security descriptor for an object - /// and specifies whether the handle retrieved by specifying this structure is inheritable. - /// This structure provides security settings for objects created by various functions, - /// such as "CreateFile", "CreatePipe", "CreateProcess", "RegCreateKeyEx", or "RegSaveKeyEx". - /// [StructLayout(LayoutKind.Sequential)] public struct SecurityAttributes : IEquatable { #region Public Members - /// - /// The size, in bytes, of this structure. - /// public static uint nLength = (uint)Marshal.SizeOf( typeof(SecurityAttributes) ); - /// - /// A pointer to a "SecurityDescriptor" structure that controls access to the object. - /// If the value of this member is "NULL", the object is assigned the default security - /// descriptor associated with the access token of the calling process. This is not - /// the same as granting access to everyone by assigning a "NULL" discretionary access - /// control list (DACL). By default, the default DACL in the access token of a process - /// allows access only to the user represented by the access token. - /// public SecurityDescriptor lpSecurityDescriptor; - - /// - /// A Boolean value that specifies whether the returned handle is inherited when a new - /// process is created. If this member is "TRUE", the new process inherits the handle. - /// public bool bInheritHandle; #endregion @@ -44,7 +22,6 @@ public struct SecurityAttributes : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( SecurityAttributes firstStructure, SecurityAttributes secondStructure @@ -67,7 +44,6 @@ SecurityAttributes secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( SecurityAttributes firstStructure, SecurityAttributes secondStructure @@ -90,13 +66,11 @@ SecurityAttributes secondStructure #region Equals => bool - /// public bool Equals(SecurityAttributes other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is SecurityAttributes securityAttributes) @@ -113,7 +87,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -130,7 +103,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/SecurityDescriptor.cs b/Source/Structures/SecurityDescriptor.cs similarity index 69% rename from ThirtyTwo/Structures/SecurityDescriptor.cs rename to Source/Structures/SecurityDescriptor.cs index 7bda174..3165a29 100644 --- a/ThirtyTwo/Structures/SecurityDescriptor.cs +++ b/Source/Structures/SecurityDescriptor.cs @@ -5,51 +5,18 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// The "SecurityDescriptor" structure contains the security information associated - /// with an object. Applications use this structure to set and query an object's - /// security status. - /// [StructLayout(LayoutKind.Sequential)] public struct SecurityDescriptor : IEquatable { #region Public Members - /// - /// The revision level of the security descriptor structure. - /// public byte Revision; - - /// - /// Reserved. Must be zero. - /// public byte Sbz1; - - /// - /// A set of bit flags that qualify the meaning of the security descriptor or its - /// individual members. - /// public SecurityDescriptorControl Control; - - /// - /// A pointer to a security identifier (SID) structure representing an object’s owner. - /// public IntPtr Owner; - - /// - /// A pointer to a SID structure representing an object’s primary group. - /// public IntPtr Group; - - /// - /// A pointer to a system access control list (SACL) structure. - /// public IntPtr Sacl; - - /// - /// A pointer to a discretionary access control list (DACL) structure. - /// public IntPtr Dacl; #endregion @@ -58,7 +25,6 @@ public struct SecurityDescriptor : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( SecurityDescriptor firstStructure, SecurityDescriptor secondStructure @@ -86,7 +52,6 @@ SecurityDescriptor secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( SecurityDescriptor firstStructure, SecurityDescriptor secondStructure @@ -114,13 +79,11 @@ SecurityDescriptor secondStructure #region Equals => bool - /// public bool Equals(SecurityDescriptor other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is SecurityDescriptor securityDescriptor) @@ -137,7 +100,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -159,7 +121,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/SmallRectangle.cs b/Source/Structures/SmallRectangle.cs similarity index 86% rename from ThirtyTwo/Structures/SmallRectangle.cs rename to Source/Structures/SmallRectangle.cs index 141f682..95f3121 100644 --- a/ThirtyTwo/Structures/SmallRectangle.cs +++ b/Source/Structures/SmallRectangle.cs @@ -3,33 +3,15 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Defines the coordinates of the upper left and lower right corners of a rectangle. - /// [StructLayout(LayoutKind.Sequential)] public struct SmallRectangle : IEquatable { #region Public Members - /// - /// The x-coordinate of the upper left corner of the rectangle. - /// public short Left; - - /// - /// The y-coordinate of the upper left corner of the rectangle. - /// public short Top; - - /// - /// The x-coordinate of the lower right corner of the rectangle. - /// public short Right; - - /// - /// The y-coordinate of the lower right corner of the rectangle. - /// public short Bottom; #endregion @@ -38,7 +20,6 @@ public struct SmallRectangle : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( SmallRectangle firstStructure, SmallRectangle secondStructure @@ -63,7 +44,6 @@ SmallRectangle secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( SmallRectangle firstStructure, SmallRectangle secondStructure @@ -88,7 +68,6 @@ SmallRectangle secondStructure #region Logical Operator: Arithmetic (Sum) => SmallRectangle - /// public static SmallRectangle operator +( SmallRectangle firstStructure, SmallRectangle secondStructure @@ -127,7 +106,6 @@ SmallRectangle secondStructure #region Logical Operator: Arithmetic (Subtract) => SmallRectangle - /// public static SmallRectangle operator -( SmallRectangle firstStructure, SmallRectangle secondStructure @@ -166,7 +144,6 @@ SmallRectangle secondStructure #region Logical Operator: Arithmetic (Multiply) => SmallRectangle - /// public static SmallRectangle operator *( SmallRectangle firstStructure, SmallRectangle secondStructure @@ -205,7 +182,6 @@ SmallRectangle secondStructure #region Logical Operator: Arithmetic (Divide) => SmallRectangle - /// public static SmallRectangle operator /( SmallRectangle firstStructure, SmallRectangle secondStructure @@ -244,13 +220,11 @@ SmallRectangle secondStructure #region Equals => bool - /// public bool Equals(SmallRectangle other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is SmallRectangle smallRect) @@ -267,7 +241,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -286,7 +259,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return diff --git a/ThirtyTwo/Structures/WindowBufferSizeRecord.cs b/Source/Structures/WindowBufferSizeRecord.cs similarity index 85% rename from ThirtyTwo/Structures/WindowBufferSizeRecord.cs rename to Source/Structures/WindowBufferSizeRecord.cs index 43e8b04..4fc0918 100644 --- a/ThirtyTwo/Structures/WindowBufferSizeRecord.cs +++ b/Source/Structures/WindowBufferSizeRecord.cs @@ -3,19 +3,12 @@ namespace ThirtyTwo.Kernel32.Structures { - /// - /// Describes a change in the size of the console screen buffer. - /// [StructLayout(LayoutKind.Sequential)] public struct WindowBufferSizeRecord : - IEquatable + IEquatable { #region Public Members - /// - /// A "Coordinate" structure that contains the size of the console screen buffer, in - /// character cell columns and rows. - /// public Coordinate dwSize; #endregion @@ -24,7 +17,6 @@ public struct WindowBufferSizeRecord : #region Logical Operator: Comparison (Equals) => bool - /// public static bool operator ==( WindowBufferSizeRecord firstStructure, WindowBufferSizeRecord secondStructure @@ -44,7 +36,6 @@ WindowBufferSizeRecord secondStructure #region Logical Operator: Comparison (Different) => bool - /// public static bool operator !=( WindowBufferSizeRecord firstStructure, WindowBufferSizeRecord secondStructure @@ -64,7 +55,6 @@ WindowBufferSizeRecord secondStructure #region Logical Operator: Arithmetic (Sum) => WindowBufferSizeRecord - /// public static WindowBufferSizeRecord operator +( WindowBufferSizeRecord firstStructure, WindowBufferSizeRecord secondStructure @@ -94,7 +84,6 @@ WindowBufferSizeRecord secondStructure #region Logical Operator: Arithmetic (Subtract) => WindowBufferSizeRecord - /// public static WindowBufferSizeRecord operator -( WindowBufferSizeRecord firstStructure, WindowBufferSizeRecord secondStructure @@ -124,7 +113,6 @@ WindowBufferSizeRecord secondStructure #region Logical Operator: Arithmetic (Multiply) => WindowBufferSizeRecord - /// public static WindowBufferSizeRecord operator *( WindowBufferSizeRecord firstStructure, WindowBufferSizeRecord secondStructure @@ -154,7 +142,6 @@ WindowBufferSizeRecord secondStructure #region Logical Operator: Arithmetic (Divide) => WindowBufferSizeRecord - /// public static WindowBufferSizeRecord operator /( WindowBufferSizeRecord firstStructure, WindowBufferSizeRecord secondStructure @@ -184,13 +171,11 @@ WindowBufferSizeRecord secondStructure #region Equals => bool - /// public bool Equals(WindowBufferSizeRecord other) { return this == other; } - /// public override bool Equals(object obj) { if (obj is WindowBufferSizeRecord windowBufferSizeRecord) @@ -207,7 +192,6 @@ public override bool Equals(object obj) #region To String => string - /// public override string ToString() { return @@ -223,7 +207,6 @@ public override string ToString() #region GetHashCode => int - /// public override int GetHashCode() { return dwSize.GetHashCode(); diff --git a/ThirtyTwo/ThirtyTwo.Kernel32.csproj b/Source/ThirtyTwo.Kernel32.csproj similarity index 94% rename from ThirtyTwo/ThirtyTwo.Kernel32.csproj rename to Source/ThirtyTwo.Kernel32.csproj index 0d74f2d..72d8221 100644 --- a/ThirtyTwo/ThirtyTwo.Kernel32.csproj +++ b/Source/ThirtyTwo.Kernel32.csproj @@ -21,7 +21,8 @@ DEBUG;TRACE prompt 4 - bin\Debug\ThirtyTwo.Kernel32.xml + + pdbonly @@ -30,7 +31,8 @@ TRACE prompt 4 - bin\Release\ThirtyTwo.Kernel32.xml + + diff --git a/ThirtyTwo/ThirtyTwo.Kernel32.sln b/Source/ThirtyTwo.Kernel32.sln similarity index 100% rename from ThirtyTwo/ThirtyTwo.Kernel32.sln rename to Source/ThirtyTwo.Kernel32.sln diff --git a/ThirtyTwo/Enumerations/AccessRights.cs b/ThirtyTwo/Enumerations/AccessRights.cs deleted file mode 100644 index 5cfd32d..0000000 --- a/ThirtyTwo/Enumerations/AccessRights.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies the access rights for a security descriptor. - /// - [System.Flags] - public enum AccessRights : long - { - /// - /// Requests read access to the console screen buffer, enabling the process to read - /// data from the buffer. - /// - GenericRead = 0x80000000L, - - /// - /// Requests write access to the console screen buffer, enabling the process to write - /// data to the buffer. - /// - GenericWrite = 0x40000000L, - } -} diff --git a/ThirtyTwo/Enumerations/CharacterAttributes.cs b/ThirtyTwo/Enumerations/CharacterAttributes.cs deleted file mode 100644 index 7b5ca82..0000000 --- a/ThirtyTwo/Enumerations/CharacterAttributes.cs +++ /dev/null @@ -1,92 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies the attributes of a given character. - /// - [System.Flags] - public enum CharacterAttributes : ushort - { - /// - /// Text color contains blue. - /// - ForegroundBlue = 0x0001, - - /// - /// Text color contains green. - /// - ForegroundGreen = 0x0002, - - /// - /// Text color contains red. - /// - ForegroundRed = 0x0004, - - /// - /// Text color is intensified. - /// - ForegroundIntensity = 0x0008, - - // * - - /// - /// Background color contains blue. - /// - BackgroundBlue = 0x0010, - - /// - /// Background color contains green. - /// - BackgroundGreen = 0x0020, - - /// - /// Background color contains red. - /// - BackgroundRed = 0x0040, - - /// - /// Background color is intensified. - /// - BackgroundIntensity = 0x0080, - - // * - - /// - /// Leading byte. - /// - CommonLVBLeadingByte = 0x0100, - - /// - /// Trailing byte. - /// - CommonLVBTrailingByte = 0x0200, - - // * - - /// - /// Top horizontal. - /// - CommonGridHorizontal = 0x0400, - - /// - /// Left vertical. - /// - CommonGridLeftVertical = 0x0800, - - /// - /// Right vertical. - /// - CommonGridRightVertical = 0x1000, - - // * - - /// - /// Reverse foreground an background attribute. - /// - CommonLVBReverseVideo = 0x4000, - - /// - /// Underscore. - /// - CommonLVBUnderscore = 0x8000, - } -} diff --git a/ThirtyTwo/Enumerations/ConsoleDisplayMode.cs b/ThirtyTwo/Enumerations/ConsoleDisplayMode.cs deleted file mode 100644 index b295755..0000000 --- a/ThirtyTwo/Enumerations/ConsoleDisplayMode.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies the console display mode. - /// - [System.Flags] - public enum ConsoleDisplayMode : uint - { - /// - /// Full-screen console. The console is in this mode as soon as the window is maximized. - /// At this point, the transition to full-screen mode can still fail. - /// - FullScreen = 1, - - /// - /// Full-screen console communicating directly with the video hardware. This mode is set - /// after the console is in "FullScreen" mode to indicate that the transition to - /// full-screen mode has completed - /// - FullScreenHardware = 2, - - /// - /// Text is displayed in a console window. - /// - Windowed = 2, - } -} diff --git a/ThirtyTwo/Enumerations/ConsoleMode.cs b/ThirtyTwo/Enumerations/ConsoleMode.cs deleted file mode 100644 index 2250456..0000000 --- a/ThirtyTwo/Enumerations/ConsoleMode.cs +++ /dev/null @@ -1,149 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies the modes supported by the console input and output buffers. - /// - [System.Flags] - public enum ConsoleMode : uint - { - /// - /// Characters read by the "ReadFile" or "ReadConsole" function are written to the - /// active screen buffer as they are typed into the console. This mode can be used - /// only if the "EnableLineInput" mode is also enabled. - /// - EnableEchoInput = 0x0004, - - /// - /// When enabled, text entered in a console window will be inserted at the current - /// cursor location and all text following that location will not be overwritten. When - /// disabled, all following text will be overwritten. - /// - EnableInsertMode = 0x0020, - - /// - /// The "ReadFile" or "ReadConsole" function returns only when a carriage return - /// character is read. If this mode is disabled, the functions return when one or - /// more characters are available. - /// - EnableLineInput = 0x0002, - - /// - /// If the mouse pointer is within the borders of the console window and the window has - /// the keyboard focus, mouse events generated by mouse movement and button presses are - /// placed in the input buffer. These events are discarded by "ReadFile" or - /// "ReadConsole", even when this mode is enabled. The "ReadConsole" Input function can - /// be used to read "MouseEvent" input records from the input buffer. - /// - EnableMouseInput = 0x0010, - - /// - /// "CTRL + C" is processed by the system and is not placed in the input buffer. If the - /// input buffer is being read by "ReadFile" or "ReadConsole", other control keys are - /// processed by the system and are not returned in the "ReadFile" or "ReadConsole" - /// buffer. If the "EnableLineInput" mode is also enabled, backspace, carriage return, - /// and line feed characters are handled by the system. - /// - EnableProcessedInput = 0x0001, - - /// - /// This flag enables the user to use the mouse to select and edit text. To enable this - /// mode, use "EnableQuickEditMode | EnableExtendedFlags". To disable this mode, - /// use "EnableExtendedFlags" without this flag. - /// - EnableQuickEditMode = 0x0040, - - /// - /// No official description or value. - /// - EnableExtendedFlags = 0x0080, - - /// - /// User interactions that change the size of the console screen buffer are reported in - /// the console's input buffer. Information about these events can be read from the - /// input buffer by applications using the "ReadConsole"Input function, but not by - /// those using "ReadFile" or "ReadConsole". - /// - EnableWindowInput = 0x0008, - - /// - /// Setting this flag directs the Virtual Terminal processing engine to convert user - /// input received by the console window into Console Virtual Terminal Sequences that - /// can be retrieved by a supporting application through "ReadFile" or "ReadConsole" - /// functions. The typical usage of this flag is intended in conjunction with - /// "EnableVirtualTerminalProcessing" on the output handle to connect to an - /// application that communicates exclusively via virtual terminal sequences. - /// - EnableVirtualTerminalInput = 0x0200, - - // @ - - /// - /// Characters written by the "WriteFile" or "WriteConsole" function or echoed by the - /// "ReadFile" or "ReadConsole" function are parsed for ASCII control sequences, and - /// the correct action is performed. Backspace, tab, bell, carriage return, and line - /// feed characters are processed. It should be enabled when using control sequences - /// or when "EnableVirtualTerminalProcessing" is set. - /// - EnableProcessedOutput = 0x0001, - - /// - /// When writing with "WriteFile" or "WriteConsole" or echoing with "ReadFile" or - /// "ReadConsole", the cursor moves to the beginning of the next row when it reaches - /// the end of the current row.This causes the rows displayed in the console window to - /// scroll up automatically when the cursor advances beyond the last row in the window. - /// It also causes the contents of the console screen buffer to scroll up - /// (../discarding the top row of the console screen buffer) when the cursor advances - /// beyond the last row in the console screen buffer.If this mode is disabled, the last - /// character in the row is overwritten with any subsequent characters. - /// - EnableWrapAtEOLOutput = 0x0002, - - /// - /// When writing with "WriteFile" or "WriteConsole", characters are parsed for VT100 - /// and similar control character sequences that control cursor movement, color/font - /// mode, and other operations that can also be performed via the existing Console APIs. - /// Ensure "ENABLE_PROCESSED_OUTPUT" is set when using this flag. - /// - EnableVirtualTerminalProcessing = 0x0004, - - /// - /// When writing with "WriteFile" or "WriteConsole", this adds an additional state to - /// end-of-line wrapping that can delay the cursor move and buffer scroll operations. - /// Normally when "EnableWrapAtEOLOutput" is set and text reaches the end of the - /// line, the cursor will immediately move to the next line and the contents of the - /// buffer will scroll up by one line.In contrast with this flag set, the cursor does - /// not move to the next line, and the scroll operation is not performed. The written - /// character will be printed in the final position on the line and the cursor will - /// remain above this character as if "EnableWrapAtEOLOutput" was off, but the next - /// printable character will be printed as if "EnableWrapAtEOLOutput" is on. No - /// overwrite will occur. Specifically, the cursor quickly advances down to the - /// following line, a scroll is performed if necessary, the character is printed, and - /// the cursor advances one more position. The typical usage of this flag is intended - /// in conjunction with setting "EnableVirtualTerminalProcessing" to better emulate - /// a terminal emulator where writing the final character on the screen - /// (../in the bottom right corner) without triggering an immediate scroll is the - /// desired behavior. - /// - DisableNewLineAutoReturn = 0x0008, - - /// - /// The APIs for writing character attributes including "WriteConsoleOutput" and - /// "WriteConsoleOutputAttribute" allow the usage of flags from character attributes to - /// adjust the color of the foreground and background of text. Additionally, a range of - /// DBCS flags was specified with the "COMMON_LVB" prefix. Historically, these flags - /// only functioned in DBCS code pages for Chinese, Japanese, and Korean languages. - /// With exception of the leading byte and trailing byte flags, the remaining flags - /// describing line drawing and reverse video (../swap foreground and background colors) - /// can be useful for other languages to emphasize portions of output. Setting this - /// console mode flag will allow these attributes to be used in every code page on every - /// language. It is off by default to maintain compatibility with known applications - /// that have historically taken advantage of the console ignoring these flags on - /// non-CJK machines to store bits in these fields for their own purposes or by - /// accident. Note that using the "EnableVirtualTerminalProcessing" mode can result - /// in LVB grid and reverse video flags being set while this flag is still off if the - /// attached application requests underlining or inverse video via Console Virtual - /// Terminal Sequences. - /// - EnableLVBGridWorldWide = 0x0010, - } -} diff --git a/ThirtyTwo/Enumerations/ConsoleReadingBehavior.cs b/ThirtyTwo/Enumerations/ConsoleReadingBehavior.cs deleted file mode 100644 index f5d8f48..0000000 --- a/ThirtyTwo/Enumerations/ConsoleReadingBehavior.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies the console reading behavior. - /// - [System.Flags] - public enum ConsoleReadingBehavior : ushort - { - /// - /// Leave the events in the input buffer (as in "PeekConsoleInput"). - /// - NoRemove = 0x0001, - - /// - /// Return immediately, even if there are no events in the input buffer. - /// - NoWait = 0x0002, - } -} diff --git a/ThirtyTwo/Enumerations/ConsoleStandardDevice.cs b/ThirtyTwo/Enumerations/ConsoleStandardDevice.cs deleted file mode 100644 index 34a6146..0000000 --- a/ThirtyTwo/Enumerations/ConsoleStandardDevice.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies the default console device. - /// - [System.Flags] - public enum ConsoleStandardDevice : int - { - /// - /// The standard input device. Initially, this is the console input buffer. - /// - InputHandle = -10, - - /// - /// The standard output device. Initially, this is the active console screen buffer. - /// - OutputHandle = -11, - - /// - /// The standard error device. Initially, this is the active console screen buffer. - /// - ErrorHandle = -12, - } -} diff --git a/ThirtyTwo/Enumerations/ConsoleWindowEvent.cs b/ThirtyTwo/Enumerations/ConsoleWindowEvent.cs deleted file mode 100644 index d68f49a..0000000 --- a/ThirtyTwo/Enumerations/ConsoleWindowEvent.cs +++ /dev/null @@ -1,57 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies the window event messages emitted by the console. - /// - [System.Flags] - public enum ConsoleWindowEvent : int - { - /// - /// The console caret has moved. The "idObject" parameter is one or more of the - /// following values: "CONSOLE_CARET_SELECTION" or "CONSOLE_CARET_VISIBLE". The - /// "idChild" parameter is a "Coordinate" structure that specifies the cursor's - /// current position. - /// - Caret = 0x4001, - - /// - /// A console process has exited. The "idObject" parameter contains the process - /// identifier of the terminated process. - /// - EndApplication = 0x4007, - - /// - /// The console layout has changed. - /// - Layout = 0x4005, - - /// - /// A new console process has started.The "idObject" parameter contains the process - /// identifier of the newly created process. If the application is a 16-bit application, - /// the "idChild" parameter is "CONSOLE_APPLICATION_16BIT" and "idObject" is the - /// process identifier of the NTVDM session associated with the console. - /// - StartApplication = 0x4006, - - /// - /// More than one character has changed. The "idObject" parameter is a "Coordinate" - /// structure that specifies the start of the changed region.The "idChild" parameter - /// is a "Coordinate" structure that specifies the end of the changed region. - /// - UpdateRegion = 0x4002, - - /// - /// The console has scrolled. The "idObject" parameter is the horizontal distance the - /// console has scrolled. The "idChild" parameter is the vertical distance the console - /// has scrolled. - /// - UpdateScroll = 0x4004, - - /// - /// A single character has changed. The "idObject" parameter is a "Coordinate" - /// structure that specifies the character that has changed. The "idChild" parameter - /// specifies the character in the low word and the character attributes in the high word. - /// - UpdateSimple = 0x4003, - } -} diff --git a/ThirtyTwo/Enumerations/ControlEvent.cs b/ThirtyTwo/Enumerations/ControlEvent.cs deleted file mode 100644 index 628f592..0000000 --- a/ThirtyTwo/Enumerations/ControlEvent.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies the control signals that can be output from the console. - /// - [System.Flags] - public enum ControlEvent : uint - { - /// - /// Generates a "CTRL + C" signal. This signal cannot be limited to a specific process - /// group. If "dwProcessGroupId" is nonzero, this function will succeed, but the - /// "CTRL + C" signal will not be received by processes within the specified process group. - /// - CtrlC = 0, - - /// - /// Generates a "CTRL + BREAK" signal. - /// - CtrlBreak = 1, - - /// - /// A signal that the system sends to all processes attached to a console when the user - /// closes the console (either by clicking Close on the console window's window menu, - /// or by clicking the End Task button command from Task Manager). - /// - CtrlClose = 2, - - /// - /// A signal that the system sends to all console processes when a user is logging off. - /// This signal does not indicate which user is logging off, so no assumptions can - /// be made. Note that this signal is received only by services. Interactive - /// applications are terminated at log off, so they are not present when the system - /// sends this signal. - /// - CtrlLogoff = 5, - - /// - /// A signal that the system sends when the system is shutting down. Interactive - /// applications are not present by the time the system sends this signal, therefore - /// it can be received only be services in this situation. Services also have their - /// own notification mechanism for shutdown events. This signal can also be generated - /// by an application using "GenerateConsoleCtrlEvent". - /// - CtrlShutdown = 6, - } -} diff --git a/ThirtyTwo/Enumerations/InputRecordEventType.cs b/ThirtyTwo/Enumerations/InputRecordEventType.cs deleted file mode 100644 index 1c8a991..0000000 --- a/ThirtyTwo/Enumerations/InputRecordEventType.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies the event type of the console input record. - /// - public enum InputRecordEventType : ushort - { - /// - /// The Event member contains a "FOCUS_EVENT_RECORD" structure. These events are used - /// internally and should be ignored. - /// - FOCUS_EVENT = 0x0010, - - /// - /// The Event member contains a "KEY_EVENT_RECORD" structure with information about a - /// keyboard event. - /// - KEY_EVENT = 0x0001, - - /// - /// The Event member contains a "MENU_EVENT_RECORD" structure. These events are used - /// internally and should be ignored. - /// - MENU_EVENT = 0x0008, - - /// - /// The Event member contains a "MOUSE_EVENT_RECORD" structure with information about a - /// mouse movement or button press event. - /// - MOUSE_EVENT = 0x0002, - - /// - /// The Event member contains a "WINDOW_BUFFER_SIZE_RECORD" structure with information - /// about the new size of the console screen buffer. - /// - WINDOW_BUFFER_SIZE_EVENT = 0x0004, - } -} diff --git a/ThirtyTwo/Enumerations/ModifierKeyState.cs b/ThirtyTwo/Enumerations/ModifierKeyState.cs deleted file mode 100644 index d7bce67..0000000 --- a/ThirtyTwo/Enumerations/ModifierKeyState.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies the states of modifier keys. - /// - [System.Flags] - public enum ModifierKeyState : uint - { - /// - /// The CAPS LOCK light is on. - /// - CapsLockOn = 0x0080, - - /// - /// The key is enhanced. - /// - EnhancedKey = 0x0100, - - /// - /// The left "ALT" key is pressed. - /// - LeftAltPressed = 0x0002, - - /// - /// The left "CTRL" key is pressed. - /// - LeftCtrlPressed = 0x0008, - - /// - /// The "NUM LOCK" light is on. - /// - NumLockOn = 0x0020, - - /// - /// The right "ALT" key is pressed. - /// - RightAltPressed = 0x0001, - - /// - /// The right "CTRL" key is pressed. - /// - RightCtrlPressed = 0x0004, - - /// - /// The "SCROLL LOCK" light is on. - /// - ScrollLockOn = 0x0040, - - /// - /// The "SHIFT" key is pressed. - /// - ShiftPressed = 0x0010, - } -} diff --git a/ThirtyTwo/Enumerations/MouseButtonState.cs b/ThirtyTwo/Enumerations/MouseButtonState.cs deleted file mode 100644 index 9ac5ce4..0000000 --- a/ThirtyTwo/Enumerations/MouseButtonState.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies mouse button states. - /// - [System.Flags] - public enum MouseButtonState : uint - { - /// - /// The leftmost mouse button. - /// - FromLeft1stButtonPressed = 0x0001, - - /// - /// The second button from the left. - /// - FromLeft2ndButtonPressed = 0x0004, - - /// - /// The third button from the left. - /// - FromLeft3rdButtonPressed = 0x0008, - - /// - /// The fourth button from the left. - /// - FromLeft4thButtonPressed = 0x0010, - - /// - /// The rightmost mouse button. - /// - RightmostButtonPressed = 0x0002, - } -} diff --git a/ThirtyTwo/Enumerations/MouseEvent.cs b/ThirtyTwo/Enumerations/MouseEvent.cs deleted file mode 100644 index a1d83f7..0000000 --- a/ThirtyTwo/Enumerations/MouseEvent.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies mouse events. - /// - [System.Flags] - public enum MouseEvent : uint - { - /// - /// The second click (button press) of a double-click occurred. The first click is - /// returned as a regular button-press event. - /// - DoubleClick = 0x0002, - - /// - /// The horizontal mouse wheel was moved. If the high word of the dwButtonState member - /// contains a positive value, the wheel was rotated to the right. Otherwise, the - /// wheel was rotated to the left. - /// - HorizontalWheeled = 0x0008, - - /// - /// A change in mouse position occurred. - /// - Moved = 0x0001, - - /// - /// The vertical mouse wheel was moved. If the high word of the "dwButtonState" member - /// contains a positive value, the wheel was rotated forward, away from the user. - /// Otherwise, the wheel was rotated backward, toward the user. - /// - VerticalWheeled = 0x0004, - } -} diff --git a/ThirtyTwo/Enumerations/PseudoConsoleCreationOption.cs b/ThirtyTwo/Enumerations/PseudoConsoleCreationOption.cs deleted file mode 100644 index 14e89fe..0000000 --- a/ThirtyTwo/Enumerations/PseudoConsoleCreationOption.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies options for creating a pseudo console. - /// - [System.Flags] - public enum PseudoConsoleCreationOption : uint - { - /// - /// Perform a standard pseudo console creation. - /// - Standard = 0, - - /// - /// The created pseudo console session will attempt to inherit the cursor position - /// of the parent console. - /// - InheritCursor = 1, - } -} diff --git a/ThirtyTwo/Enumerations/ResultHandle.cs b/ThirtyTwo/Enumerations/ResultHandle.cs deleted file mode 100644 index b36672d..0000000 --- a/ThirtyTwo/Enumerations/ResultHandle.cs +++ /dev/null @@ -1,64 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// A 32-bit value that is used to describe an error or warning. - /// - [System.Flags] - public enum ResultHandle : uint - { - /// - /// Operation successful. - /// - Ok = 0x00000000, - - /// - /// Operation aborted. - /// - Abort = 0x80004004, - - /// - /// General access denied error. - /// - AccessDenied = 0x80070005, - - /// - /// Unspecified failure. - /// - Fail = 0x80004005, - - /// - /// Handle that is not valid. - /// - Handle = 0x80070006, - - /// - /// One or more arguments are not valid. - /// - InvalidArgument = 0x80070057, - - /// - /// No such interface supported. - /// - NoInterface = 0x80004002, - - /// - /// Not implemented. - /// - NotImplemented = 0x80004001, - - /// - /// Failed to allocate necessary memory. - /// - OutOfMemory = 0x8007000E, - - /// - /// Pointer that is not valid. - /// - Pointer = 0x80004003, - - /// - /// Unexpected failure. - /// - Unexpected = 0x8000FFFF, - } -} diff --git a/ThirtyTwo/Enumerations/SecurityDescriptorControl.cs b/ThirtyTwo/Enumerations/SecurityDescriptorControl.cs deleted file mode 100644 index b93c3c2..0000000 --- a/ThirtyTwo/Enumerations/SecurityDescriptorControl.cs +++ /dev/null @@ -1,86 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// The "SecurityDescriptorControl" enumeration is a set of bit flags that qualify the - /// meaning of a security descriptor or its components. - /// - [System.Flags] - public enum SecurityDescriptorControl : uint - { - /// - /// The owner security identifier (SID) is not present in the security descriptor, - /// and a default owner SID is substituted. - /// - OwnerDefaulted = 0x0001, - - /// - /// The group SID is not present in the security descriptor, and a default group SID - /// is substituted. - /// - GroupDefaulted = 0x0002, - - /// - /// The discretionary access control list (DACL) is present in the security descriptor. - /// - DACLPresent = 0x0004, - - /// - /// The DACL is not present in the security descriptor, and a default DACL is substituted. - /// - DACLDefaulted = 0x0008, - - /// - /// The system access control list (SACL) is present in the security descriptor. - /// - SACLPresent = 0x0010, - - /// - /// The SACL is not present in the security descriptor, and a default SACL is substituted. - /// - SACLDefaulted = 0x0020, - - /// - /// The DACL is set up to support automatic propagation of inheritable access control - /// entries (ACEs) to existing child objects. - /// - DACLAutoInheritRequired = 0x0100, - - /// - /// The SACL is set up to support automatic propagation of inheritable ACEs to existing - /// child objects. - /// - SACLAutoInheritRequired = 0x0200, - - /// - /// The DACL is set up to support automatic propagation of inheritable ACEs to existing - /// child objects. - /// - DACLAutoInherit = 0x0400, - - /// - /// The SACL is set up to support automatic propagation of inheritable ACEs to existing - /// child objects. - /// - SACLAutoInherit = 0x0800, - - /// - /// The DACL cannot be modified by inheritable ACEs. - /// - DACLProtected = 0x1000, - - /// - /// The SACL cannot be modified by inheritable ACEs. - /// - SACLProtected = 0x2000, - - /// - /// Indicates that the resource manager control is valid. - /// - ResourceManagerControlValid = 0x4000, - - /// - /// The security descriptor is in self-relative format. - /// - SelfRelative = 0x8000, - } -} diff --git a/ThirtyTwo/Enumerations/SelectionIndicator.cs b/ThirtyTwo/Enumerations/SelectionIndicator.cs deleted file mode 100644 index b8217e0..0000000 --- a/ThirtyTwo/Enumerations/SelectionIndicator.cs +++ /dev/null @@ -1,39 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies console selection indicators. - /// - [System.Flags] - public enum SelectionIndicator : uint - { - /// - /// Mouse is down. The user is actively adjusting the selection rectangle with a mouse. - /// - MouseDown = 0x0008, - - /// - /// Selecting with the mouse. If off, the user is operating conhost.exe mark mode - /// selection with the keyboard. - /// - MouseSelection = 0x0004, - - /// - /// No selection. - /// - NoSelection = 0x0000, - - /// - /// Selection has begun. If a mouse selection, this will typically not occur without - /// the "CONSOLE_SELECTION_NOT_EMPTY" flag. If a keyboard selection, this may occur - /// when mark mode has been entered but the user is still navigating to the initial - /// position. - /// - SelectionInProgress = 0x0001, - - /// - /// Selection rectangle not empty. The payload of "dwSelectionAnchor" and - /// "srSelection" are valid. - /// - SelectionNotEmpty = 0x0002, - } -} diff --git a/ThirtyTwo/Enumerations/ShareMode.cs b/ThirtyTwo/Enumerations/ShareMode.cs deleted file mode 100644 index 004b40d..0000000 --- a/ThirtyTwo/Enumerations/ShareMode.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies the sharing modes for a security descriptor. - /// - [System.Flags] - public enum ShareMode : long - { - /// - /// Other open operations can be performed on the console screen buffer for read access. - /// - Read = 0x00000001, - - /// - /// Other open operations can be performed on the console screen buffer for write access. - /// - Write = 0x00000002, - } -} diff --git a/ThirtyTwo/Enumerations/SystemErrorCodes.cs b/ThirtyTwo/Enumerations/SystemErrorCodes.cs deleted file mode 100644 index 3a05ac6..0000000 --- a/ThirtyTwo/Enumerations/SystemErrorCodes.cs +++ /dev/null @@ -1,1259 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies the system error codes returned by the "GetLastError" method. - /// - [System.Flags] - public enum SystemErrorCodes : uint - { - /// - /// The operation completed successfully. - /// - Success = 0x0, - - /// - /// Incorrect function. - /// - InvalidFunction = 0x1, - - /// - /// The system cannot find the file specified. - /// - FileNotFound = 0x2, - - /// - /// The system cannot find the path specified. - /// - PathNotFound = 0x3, - - /// - /// The system cannot open the file. - /// - TooManyOpenFiles = 0x4, - - /// - /// Access is denied. - /// - AccessDenied = 0x5, - - /// - /// The handle is invalid. - /// - InvalidHandle = 0x6, - - /// - /// The storage control blocks were destroyed. - /// - ArenaTrashed = 0x7, - - /// - /// Not enough memory resources are available to process this command. - /// - NotEnoughMemory = 0x8, - - /// - /// The storage control block address is invalid. - /// - InvalidBlock = 0x9, - - /// - /// The environment is incorrect. - /// - BadEnvironment = 0xa, - - /// - /// An attempt was made to load a program with an incorrect format. - /// - BadFormat = 0xb, - - /// - /// The access code is invalid. - /// - InvalidAccess = 0xc, - - /// - /// The data is invalid. - /// - InvalidData = 0xd, - - /// - /// Not enough storage is available to complete this operation. - /// - OutOfMemory = 0xe, - - /// - /// The system cannot find the drive specified. - /// - InvalidDrive = 0xf, - - /// - /// The directory cannot be removed. - /// - CurrentDirectory = 0x10, - - /// - /// The system cannot move the file to a different disk drive. - /// - NotSameDevice = 0x11, - - /// - /// There are no more files. - /// - NoMoreFiles = 0x12, - - /// - /// The media is write protected. - /// - WriteProtect = 0x13, - - /// - /// The system cannot find the device specified. - /// - BadUnit = 0x14, - - /// - /// The device is not ready. - /// - NotReady = 0x15, - - /// - /// The device does not recognize the command. - /// - BadCommand = 0x16, - - /// - /// Data error (cyclic redundancy check). - /// - CyclicRedundancyCheck = 0x17, - - /// - /// The program issued a command but the command length is incorrect. - /// - BadLength = 0x18, - - /// - /// The drive cannot locate a specific area or track on the disk. - /// - Seek = 0x19, - - /// - /// The specified disk or diskette cannot be accessed. - /// - NotDosDisk = 0x1a, - - /// - /// The drive cannot find the sector requested. - /// - SectorNotFound = 0x1b, - - /// - /// The printer is out of paper. - /// - OutOfPaper = 0x1c, - - /// - /// The system cannot write to the specified device. - /// - WriteFault = 0x1d, - - /// - /// The system cannot read from the specified device. - /// - ReadFault = 0x1e, - - /// - /// A device attached to the system is not functioning. - /// - GenFailure = 0x1f, - - /// - /// The process cannot access the file because it is being used by another process. - /// - SharingViolation = 0x20, - - /// - /// The process cannot access the file because another process has locked a portion of - /// the file. - /// - LockViolation = 0x21, - - /// - /// The wrong diskette is in the drive. Insert %2 (Volume Serial Number: %3) into - /// drive %1. - /// - WrongDisk = 0x22, - - /// - /// Too many files opened for sharing. - /// - SharingBufferExceeded = 0x24, - - /// - /// Reached the end of the file. - /// - HandleEOF = 0x26, - - /// - /// The disk is full. - /// - HandleDiskFull = 0x27, - - /// - /// The request is not supported. - /// - NotSupported = 0x32, - - /// - /// Windows cannot find the network path. Verify that the network path is correct and - /// the destination computer is not busy or turned off. If Windows still cannot find - /// the network path, contact your network administrator. - /// - RemoteNotList = 0x33, - - /// - /// You were not connected because a duplicate name exists on the network. If joining a - /// domain, go to System in Control Panel to change the computer name and try again. If - /// joining a work group, choose another work group name. - /// - DuplicateName = 0x34, - - /// - /// The network path was not found. - /// - BadNetPath = 0x35, - - /// - /// The network is busy. - /// - NetworkBusy = 0x36, - - /// - /// The specified network resource or device is no longer available. - /// - DevNotExist = 0x37, - - /// - /// The network BIOS command limit has been reached. - /// - TooManyCommands = 0x38, - - /// - /// A network adapter hardware error occurred. - /// - AdapterHardwareError = 0x39, - - /// - /// The specified server cannot perform the requested operation. - /// - BadNetworkResponse = 0x3a, - - /// - /// An unexpected network error occurred. - /// - UnexpectedNetworkError = 0x3b, - - /// - /// The remote adapter is not compatible. - /// - BadRemoteAdapter = 0x3c, - - /// - /// The printer queue is full. - /// - PrinterQueueFull = 0x3d, - - /// - /// Space to store the file waiting to e printed is not available on the server. - /// - NoSpoolSpace = 0x3e, - - /// - /// Your file waiting to be printed was deleted. - /// - PrintCancelled = 0x3f, - - /// - /// The specified network name is no longer available. - /// - NetworkNameDeleted = 0x40, - - /// - /// Network access is denied. - /// - NetworkAccessDenied = 0x41, - - /// - /// The network resource type is not correct. - /// - BadDevType = 0x42, - - /// - /// The network name cannot be found. - /// - BadNetworkName = 0x43, - - /// - /// The name limit for the local computer network adapter card was exceeded. - /// - TooManyNames = 0x44, - - /// - /// The network BIOS session limit was exceeded. - /// - TooManySession = 0x45, - - /// - /// The remote server has been paused o is in the process of being started. - /// - SharingPaused = 0x46, - - /// - /// No more connections can be made to this remote computer at this time because there - /// are already as many connections as the computer can accept. - /// - RequestNotAccepted = 0x47, - - /// - /// The specified printer or disk device has been paused. - /// - RedirectPaused = 0x48, - - /// - /// The file exists. - /// - FileExists = 0x50, - - /// - /// The directory or file cannot be related. - /// - CannotMake = 0x52, - - /// - /// Fail on INT 24 - /// - FailInt24 = 0x53, - - /// - /// Storage to process this request is not available. - /// - OutOfStructures = 0x54, - - /// - /// The local device name is already in use. - /// - AlreadyAssigned = 0x55, - - /// - /// The specified network password is not correct. - /// - InvalidPassword = 0x56, - - /// - /// The parameter is incorrect. - /// - InvalidParameter = 0x57, - - /// - /// A write fault occurred on the network. - /// - NetworkWriteFault = 0x58, - - /// - /// The system cannot start another process at this time. - /// - NoProcSlots = 0x59, - - /// - /// Cannot create another system semaphore. - /// - TooManySemaphores = 0x64, - - /// - /// The exclusive semaphore is owned by another process. - /// - ExclusiveSemAlreadyOwned = 0x65, - - /// - /// The semaphore is set and cannot be closed. - /// - SemIsSet = 0x66, - - /// - /// The semaphore cannot be set again. - /// - TooManySemRequests = 0x67, - - /// - /// Cannot request exclusive semaphores at interrupt time. - /// - InvalidAtInterruptTime = 0x68, - - /// - /// The previous ownership of this semaphore has ended. - /// - SemOwnerDied = 0x69, - - /// - /// Insert the diskette for drive %1. - /// - SemUserLimit = 0x6a, - - /// - /// The program stopped because an alternate diskette was not inserted. - /// - DiskChange = 0x6b, - - /// - /// The disk is in use or locked by another process. - /// - DriveLocked = 0x6c, - - /// - /// The pipe has been ended. - /// - BrokenPipe = 0x6d, - - /// - /// The system cannot open the device or file specified. - /// - OpenFailed = 0x6e, - - /// - /// The file name is too long. - /// - BufferOverflow = 0x6f, - - /// - /// There is not enough space on the disk. - /// - DiskFull = 0x70, - - /// - /// No more internal file identifiers available. - /// - NoMoreSearchHandles = 0x71, - - /// - /// The target internal file identifier is incorrect. - /// - InvalidTargetHandle = 0x72, - - /// - /// The IOCTL call made by the application program is not correct. - /// - InvalidCategory = 0x75, - - /// - /// The verify-on-write switch parameter value is not correct. - /// - InvalidVerifySwitch = 0x76, - - /// - /// The system does not support the command requested. - /// - BadDriverLevel = 0x77, - - /// - /// This function is not supported on this system. - /// - callNotImplemented = 0x78, - - /// - /// The semaphore timeout period has expired. - /// - SemTimeout = 0x79, - - /// - /// The data area passed to a system call is too small. - /// - InsufficientBuffer = 0x7a, - - /// - /// The filename, directory name, or volume label syntax is incorrect. - /// - InvalidName = 0x7b, - - /// - /// The system call level is not correct. - /// - InvalidLevel = 0x7c, - - /// - /// The disk has no volume label. - /// - NoVolumeLabel = 0x7d, - - /// - /// The specified module could not be found. - /// - ModuleNotFound = 0x7e, - - /// - /// The specified procedure could not be found. - /// - ProcedureNotFound = 0x7f, - - /// - /// There are no child processes to wait or. - /// - WaitNoChildren = 0x80, - - /// - /// The %1 application cannot be run in Win32 mode. - /// - ChildNotComplete = 0x81, - - /// - /// Attempt to use a file handle to an open disk partition for an operation other than - /// raw disk I/O. - /// - DirectAccessHandle = 0x82, - - /// - /// An attempt was made to move the fie pointer before the beginning of the file. - /// - NegativeSeek = 0x83, - - /// - /// The file pointer cannot be set on the specified device or file. - /// - SeekOnDevice = 0x84, - - /// - /// A JOIN or SUBST command cannot be used for a drive that contains previously - /// joined drives. - /// - IsJoinTarget = 0x85, - - /// - /// An attempt was made to use a JIN or SUBST command on a drive that has already - /// been joined. - /// - IsJoined = 0x86, - - /// - /// An attempt was made to use a JON or SUBST command on a drive that has already - /// been substituted. - /// - IsSubsted = 0x87, - - /// - /// The system tried to delete the OIN of a drive that is not joined. - /// - NotJoined = 0x88, - - /// - /// The system tried to delete the substitution of a drive that is not substituted. - /// - NotSubsted = 0x89, - - /// - /// The system tried to join a drive to a directory on a joined drive. - /// - JoinToJoin = 0x8a, - - /// - /// The system tried to substitute a drive to a directory on a substituted drive. - /// - SubstToSubst = 0x8b, - - /// - /// The system tried to join a drive to a directory on a substituted drive. - /// - JoinToSubst = 0x8c, - - /// - /// The system tried to SUBST a drive to a directory on a joined drive. - /// - SubstToJoin = 0x8d, - - /// - /// The system cannot perform a JOIN or SUBST at this time. - /// - BusyDrive = 0x8e, - - /// - /// The system cannot join or substitute a drive to or for a directory on the - /// same drive. - /// - SameDrive = 0x8f, - - /// - /// The directory is not a subdirectory of the root directory. - /// - DirectoryNotRoot = 0x90, - - /// - /// The directory is not empty. - /// - DirectoryNotEmpty = 0x91, - - /// - /// The path specified is being used in a substitute. - /// - IsSubstPath = 0x92, - - /// - /// Not enough resources are available to process this command. - /// - IsJoinPath = 0x93, - - /// - /// The path specified cannot be used at this time. - /// - PathBusy = 0x94, - - /// - /// An attempt was made to join or substitute a drive for which a directory on the - /// drive is the target of a previous substitute. - /// - IsSubstTarget = 0x95, - - /// - /// System trace information was not specified in your "CONFIG.SYS" file, or tracing - /// is disallowed. - /// - SystemTrace = 0x96, - - /// - /// The number of specified semaphore events for DosMuxSemWait is not correct. - /// - InvalidEventCount = 0x97, - - /// - /// DosMuxSemWait did not execute; too many semaphores are already set. - /// - TooManyMuxWaiters = 0x98, - - /// - /// The DosMuxSemWait list is not correct. - /// - InvalidListFormat = 0x99, - - /// - /// The volume label you entered exceeds the label character limit of the target - /// file system. - /// - labelTooLong = 0x9a, - - /// - /// Cannot create another thread. - /// - TooManyTcbs = 0x9b, - - /// - /// The recipient process has refused the signal. - /// - SignalRefused = 0x9c, - - /// - /// The segment is already discard and cannot be locked. - /// - Discarded = 0x9d, - - /// - /// The segment is already unlocked. - /// - NotLocked = 0x9e, - - /// - /// The address for the thread ID is not correct. - /// - BadThreadidAddr = 0x9f, - - /// - /// One or more arguments are not correct. - /// - BadArguments = 0xa0, - - /// - /// The specified path is invalid. - /// - BadPathname = 0xa1, - - /// - /// A signal is already pending. - /// - SignalPending = 0xa2, - - /// - /// No more threads can be created in the system. - /// - MaxThrdsReached = 0xa4, - - /// - /// Unable to lock a region of a file. - /// - LockFailed = 0xa7, - - /// - /// The requested resource is in use. - /// - Busy = 0xaa, - - /// - /// Device's command support detection is in progress. - /// - DeviceSupportInProgress = 0xab, - - /// - /// A lock request was not outstanding for the supplied cancel region. - /// - CancelViolation = 0xad, - - /// - /// The file system does not support atomic changes to the lock type. - /// - AtomicLocksNotSupported = 0xae, - - /// - /// The system detected a segment number that was not correct. - /// - InvalidSegmentNumber = 0xb4, - - /// - /// The operating system cannot run %1. - /// - InvalidOrdinal = 0xb6, - - /// - /// Cannot create a file when that file already exists. - /// - AlreadyExists = 0xb7, - - /// - /// The flag passed is not correct. - /// - InvalidFlagNumber = 0xba, - - /// - /// The specified system semaphore name was not found. - /// - SemNotFound = 0xbb, - - /// - /// The operating system cannot run %1. - /// - InvalidStartingCodeseg = 0xbc, - - /// - /// The operating system cannot run %1. - /// - InvalidStackseg = 0xbd, - - /// - /// The operating system cannot run %1. - /// - InvalidModuletype = 0xbe, - - /// - /// Cannot run %1 in Win32 mode. - /// - InvalidExeSignature = 0xbf, - - /// - /// The operating system cannot run %1. - /// - ExeMarkedInvalid = 0xc0, - - /// - /// %1 is not a valid Win32 application. - /// - BadExeFormat = 0xc1, - - /// - /// The operating system cannot run %1 - /// - IteratedDataExceeds_64k = 0xc2, - - /// - /// The operating system cannot run %1. - /// - InvalidMinallocsize = 0xc3, - - /// - /// The operating system cannot run this application program. - /// - DynlinkFromInvalidRing = 0xc4, - - /// - /// The operating system is not presently configured to run this application. - /// - IoplNotEnabled = 0xc5, - - /// - /// The operating system cannot run %1. - /// - InvalidSegmentDPL = 0xc6, - - /// - /// The operating system cannot run this application program. - /// - AutoDataSegmentExceeds64k = 0xc7, - - /// - /// The code segment cannot be greater than or equal to 64K. - /// - Ring2SegmentMustBeMovable = 0xc8, - - /// - /// The operating system cannot run %1. - /// - RelocChainXeedsSegmentLimit = 0xc9, - - /// - /// The operating system cannot run %1. - /// - InFloopInRelocChain = 0xca, - - /// - /// The system could not find the environment option that was entered. - /// - EnvironmentVariableNotFound = 0xcb, - - /// - /// No process in the command subtree has a signal handler. - /// - NoSignalSent = 0xcd, - - /// - /// The filename or extension is too long. - /// - FilenameExcedRange = 0xce, - - /// - /// The ring 2 stack is in use. - /// - Ring2StackInUse = 0xcf, - - /// - /// The global filename characters, "*" or "?", are entered incorrectly or too many - /// global filename characters are specified. - /// - MetaExpansionTooLong = 0xd0, - - /// - /// The signal being posted is not correct. - /// - InvalidSignalNumber = 0xd1, - - /// - /// The signal handler cannot be set. - /// - Thread1Inactive = 0xd2, - - /// - /// The segment is locked and cannot be reallocated. - /// - Locked = 0xd4, - - /// - /// Too many dynamic - link modules are attached to this program or dynamic - - /// link module. - /// - TooManyModules = 0xd6, - - /// - /// Cannot nest calls to LoadModule. - /// - NestingNotAllowed = 0xd7, - - /// - /// This version of %1 is not compatible with the version of Windows you're running. - /// Check your computer's system information and then contact the software publisher. - /// - ExeMachineTypeMismatch = 0xd8, - - /// - /// The image file %1 is signed, unable to modify. - /// - ExeCannotModifySignedBinary = 0xd9, - - /// - /// The image file %1 is strong signed, unable to modify. - /// - ExeCannotModifyStrongSignedBinary = 0xda, - - /// - /// This file is checked out or locked for editing by another user. - /// - FileCheckedOut = 0xdc, - - /// - /// The file must be checked out before saving changes. - /// - checkoutRequired = 0xdd, - - /// - /// The file type being saved or retrieved has been blocked. - /// - BadFileType = 0xde, - - /// - /// The file size exceeds the limit allowed and cannot be saved. - /// - FileTooLarge = 0xdf, - - /// - /// Access Denied. Before opening files in this location, you must first add the web - /// site to your trusted sites list, browse to the web site, and select the option to - /// login automatically. - /// - FormsAuthRequired = 0xe0, - - /// - /// Operation did not complete successfully because the file contains a virus or - /// potentially unwanted software. - /// - VirusInfected = 0xe1, - - /// - /// This file contains a virus or potentially unwanted software and cannot be opened. - /// Due to the nature of this virus or potentially unwanted software, the file has been - /// removed from this location. - /// - VirusDeleted = 0xe2, - - /// - /// The pipe is local. - /// - PipeLocal = 0xe5, - - /// - /// The pipe state is invalid. - /// - BadPipe = 0xe6, - - /// - /// All pipe instances are busy. - /// - PipeBusy = 0xe7, - - /// - /// The pipe is being closed. - /// - NoData = 0xe8, - - /// - /// No process is on the other end of the pipe. - /// - PipeNotConnected = 0xe9, - - /// - /// More data is available. - /// - MoreData = 0xea, - - /// - /// The session was canceled. - /// - SessionDisconnected = 0xf0, - - /// - /// The specified extended attribute name was invalid. - /// - InvalidExtendedAttributeName = 0xfe, - - /// - /// The extended attributes are inconsistent. - /// - ExtendedAttributeListInconsistent = 0xff, - - /// - /// The wait operation timed out. - /// - WaitTimeout = 0x102, - - /// - /// No more data is available. - /// - NoMoreItems = 0x103, - - /// - /// The copy functions cannot be used. - /// - CannotCopy = 0x10a, - - /// - /// The directory name is invalid. - /// - Directory = 0x10b, - - /// - /// The extended attributes did not fit in the buffer. - /// - ExtendedAttributesDidntFit = 0x113, - - /// - /// The extended attribute file on the mounted file system is corrupt. - /// - ExtendedAttributeFileCorrupt = 0x114, - - /// - /// The extended attribute table file i full. - /// - ExtendedAttributeTableFull = 0x115, - - /// - /// The specified extended attribute handle is invalid. - /// - InvalidExtendedAttributeHandle = 0x116, - - /// - /// The mounted file system does not support extended attributes. - /// - ExtendedAttributesNotSupported = 0x11a, - - /// - /// Attempt to release mutex not owned by caller. - /// - NotOwner = 0x120, - - /// - /// Too many posts were made to a semaphore. - /// - TooManyPosts = 0x12a, - - /// - /// Only part of a ReadProcessMemory or WriteProcessMemory request was completed. - /// - PartialCopy = 0x12b, - - /// - /// The oplock request is denied. - /// - OpLockNotGranted = 0x12c, - - /// - /// An invalid oplock acknowledgment was received by the system. - /// - InvalidOpLockProtocol = 0x12d, - - /// - /// The volume is too fragmented to complete his operation. - /// - DiskTooFragmented = 0x12e, - - /// - /// The file cannot be opened because itis in the process of being deleted. - /// - DeletePending = 0x12f, - - /// - /// Short name settings may not be changed on this volume due to the global - /// registry setting. - /// - IncompatibleWithGlobalShortNameRegistrySetting = 0x130, - - /// - /// Short names are not enabled on this volume. - /// - ShortNamesNotEnabledOnVolume = 0x131, - - /// - /// The security stream for the given volume is in an inconsistent state. Please run - /// CHKDSK on the volume. - /// - SecurityStreamIsInconsistent = 0x132, - - /// - /// A requested file lock operation cannot be processed due to an invalid byte range. - /// - InvalidLockRange = 0x133, - - /// - /// The subsystem needed to support the image type is not present. - /// - ImageSubsystemNotPresent = 0x134, - - /// - /// The specified file already has a notification GUID associated with it. - /// - NotificationGuidAlreadyDefined = 0x135, - - /// - /// An invalid exception handler routine has been detected. - /// - InvalidExceptionHandler = 0x136, - - /// - /// Duplicate privileges were specified for the token. - /// - DuplicatePrivileges = 0x137, - - /// - /// No ranges for the specified operation were able to be processed. - /// - NoRangesProcessed = 0x138, - - /// - /// Operation is not allowed on a file system internal file. - /// - NotAllowedOnSystemFile = 0x139, - - /// - /// The physical resources of this disk have been exhausted. - /// - DiskResourcesExhausted = 0x13a, - - /// - /// The token representing the data is invalid. - /// - InvalidToken = 0x13b, - - /// - /// The device does not support the command feature. - /// - DeviceFeatureNotSupported = 0x13c, - - /// - /// The system cannot find message text for message number 0x%1 in the message - /// file for %2. - /// - MemoryMidNotFound = 0x13d, - - /// - /// The scope specified was not found. - /// - ScopeNotFound = 0x13e, - - /// - /// The Central Access Policy specified is not defined on the target machine. - /// - UndefinedScope = 0x13f, - - /// - /// The Central Access Policy obtained from Active Directory is invalid. - /// - InvalidCentralAccessPolicy = 0x140, - - /// - /// The device is unreachable. - /// - DeviceUnreachable = 0x141, - - /// - /// The target device has insufficient resources to complete the operation. - /// - DeviceNoResources = 0x142, - - /// - /// A data integrity checksum error occurred. Data in the file stream is corrupt. - /// - DataChecksumError = 0x143, - - /// - /// An attempt was made to modify both a KERNEL and normal Extended Attribute (EA) in - /// the same operation. - /// - IntermixedKernelExtendedAttributeOperation = 0x144, - - /// - /// Device does not support file-level TRIM. - /// - FileLevelTrimNotSupported = 0x146, - - /// - /// The command specified a data offset that does not align to the device's - /// granularity/alignment. - /// - OffsetAlignmentViolation = 0x147, - - /// - /// The command specified an invalid field in its parameter list. - /// - InvalidFieldInParameterList = 0x148, - - /// - /// An operation is currently in progress with he device. - /// - OperationInProgress = 0x149, - - /// - /// An attempt was made to send down the command via an invalid path to the - /// target device. - /// - BadDevicePath = 0x14a, - - /// - /// The command specified a number of descriptors that exceeded the maximum supported - /// by the device. - /// - TooManyDescriptors = 0x14b, - - /// - /// Scrub is disabled on the specified file. - /// - scrubDataDisabled = 0x14c, - - /// - /// The storage device does not provide redundancy. - /// - NotRedundantStorage = 0x14d, - - /// - /// An operation is not supported on a resident file. - /// - ResidentFileNotSupported = 0x14e, - - /// - /// An operation is not supported on a compressed file. - /// - CompressedFileNotSupported = 0x14f, - - /// - /// An operation is not supported on a directory. - /// - DirectoryNotSupported = 0x150, - - /// - /// The specified copy of the requested data could not be read. - /// - NotReadFromCopy = 0x151, - - /// - /// No action was taken as a system reboot is required. - /// - FailNoactionReboot = 0x15e, - - /// - /// The shutdown operation failed. - /// - FailShutdown = 0x15f, - - /// - /// The restart operation failed. - /// - FailRestart = 0x160, - - /// - /// The maximum number of sessions has been reached. - /// - MaxSessionsReached = 0x161, - - /// - /// The thread is already in background processing mode. - /// - ThreadModeAlreadyBackground = 0x190, - - /// - /// The thread is not in background processing mode. - /// - ThreadModeNotBackground = 0x191, - - /// - /// The process is already in background processing mode. - /// - ProcessModeAlreadyBackground = 0x192, - - /// - /// The process is not in background processing mode. - /// - ProcessModeNotBackground = 0x193, - - /// - /// Attempt to access invalid address. - /// - InvalidAddress = 0x1e7, - } -} diff --git a/ThirtyTwo/Enumerations/VirtualKey.cs b/ThirtyTwo/Enumerations/VirtualKey.cs deleted file mode 100644 index 5972641..0000000 --- a/ThirtyTwo/Enumerations/VirtualKey.cs +++ /dev/null @@ -1,885 +0,0 @@ -namespace ThirtyTwo.Kernel32.Enumerations -{ - /// - /// Specifies the virtual key codes. - /// - [System.Flags] - public enum VirtualKey : ushort - { - /// - /// Left mouse button. - /// - LeftMouseButton = 0x01, - - /// - /// Right mouse button. - /// - RightMouseButton = 0x02, - - /// - /// Control-break processing. - /// - Cancel = 0x03, - - /// - /// Middle mouse button. - /// - MiddleMouseButton = 0x04, - - /// - /// X1 mouse button. - /// - XButton1 = 0x05, - - /// - /// X2 mouse button. - /// - XButton2 = 0x06, - - /// - /// BACKSPACE key. - /// - Backspace = 0x08, - - /// - /// TAB key. - /// - Tab = 0x09, - - /// - /// CLEAR key. - /// - Clear = 0x0C, - - /// - /// ENTER key. - /// - Return = 0x0D, - - /// - /// SHIFT key. - /// - Shift = 0x10, - - /// - /// CTRL key. - /// - Control = 0x11, - - /// - /// ALT key. - /// - Menu = 0x12, - - /// - /// PAUSE key. - /// - Pause = 0x13, - - /// - /// CAPS LOCK key. - /// - Capital = 0x14, - - /// - /// IME Kana mode. - /// - ImeKana = 0x15, - - /// - /// IME Hangul mode. - /// - ImeHangul = 0x15, - - /// - /// IME On. - /// - ImeOn = 0x16, - - /// - /// IME Junja mode. - /// - ImeJunja = 0x17, - - /// - /// IME final mode. - /// - ImeFinal = 0x18, - - /// - /// IME Hanja mode. - /// - ImeHanja = 0x19, - - /// - /// IME Kanji mode. - /// - ImeKanji = 0x19, - - /// - /// IME Off. - /// - ImeOff = 0x1A, - - /// - /// ESC key. - /// - Escape = 0x1B, - - /// - /// IME convert. - /// - ImeConvert = 0x1C, - - /// - /// IME non convert. - /// - ImeNonConvert = 0x1D, - - /// - /// IME accept. - /// - ImeAccept = 0x1E, - - /// - /// IME mode change request. - /// - ImeModeChange = 0x1F, - - /// - /// SPACEBAR. - /// - Space = 0x20, - - /// - /// PAGE UP key. - /// - Prior = 0x21, - - /// - /// PAGE DOWN key. - /// - Next = 0x22, - - /// - /// END key. - /// - End = 0x23, - - /// - /// HOME key. - /// - Home = 0x24, - - /// - /// LEFT ARROW key. - /// - Left = 0x25, - - /// - /// UP ARROW key. - /// - Up = 0x26, - - /// - /// RIGHT ARROW key. - /// - Right = 0x27, - - /// - /// DOWN ARROW key. - /// - Down = 0x28, - - /// - /// SELECT key. - /// - Select = 0x29, - - /// - /// PRINT key. - /// - Print = 0x2A, - - /// - /// EXECUTE key. - /// - Execute = 0x2B, - - /// - /// PRINT SCREEN key. - /// - Snapshot = 0x2C, - - /// - /// INS key. - /// - Insert = 0x2D, - - /// - /// DEL key. - /// - Delete = 0x2E, - - /// - /// HELP key. - /// - Help = 0x2F, - - /// - /// Left Windows key. - /// - LeftWindows = 0x5B, - - /// - /// Right Windows key - /// - RightWindows = 0x5C, - - /// - /// Applications key. - /// - Apps = 0x5D, - - /// - /// Computer Sleep key. - /// - Sleep = 0x5F, - - /// - /// Numeric keypad 0 key. - /// - Numpad0 = 0x60, - - /// - /// Numeric keypad 1 key - /// - Numpad1 = 0x61, - - /// - /// Numeric keypad 2 key. - /// - Numpad2 = 0x62, - - /// - /// Numeric keypad 3 key. - /// - Numpad3 = 0x63, - - /// - /// Numeric keypad 4 key. - /// - Numpad4 = 0x64, - - /// - /// Numeric keypad 5 key. - /// - Numpad5 = 0x65, - - /// - /// Numeric keypad 6 key. - /// - Numpad6 = 0x66, - - /// - /// Numeric keypad 7 key. - /// - Numpad7 = 0x67, - - /// - /// Numeric keypad 8 key. - /// - Numpad8 = 0x68, - - /// - /// Numeric keypad 9 key. - /// - Numpad9 = 0x69, - - /// - /// Multiply key. - /// - Multiply = 0x6A, - - /// - /// Add key. - /// - Add = 0x6B, - - /// - /// Separator key. - /// - Separator = 0x6C, - - /// - /// Subtract key. - /// - Subtract = 0x6D, - - /// - /// Decimal key. - /// - Decimal = 0x6E, - - /// - /// Divide key. - /// - Divide = 0x6F, - - /// - /// F1 key. - /// - F1 = 0x70, - - /// - /// F2 key. - /// - F2 = 0x71, - - /// - /// F3 key. - /// - F3 = 0x72, - - /// - /// F4 key. - /// - F4 = 0x73, - - /// - /// F5 key. - /// - F5 = 0x74, - - /// - /// F6 key. - /// - F6 = 0x75, - - /// - /// F7 key. - /// - F7 = 0x76, - - /// - /// F8 key. - /// - F8 = 0x77, - - /// - /// F9 key. - /// - F9 = 0x78, - - /// - /// F10 key. - /// - F10 = 0x79, - - /// - /// F11 key. - /// - F11 = 0x7A, - - /// - /// F12 key. - /// - F12 = 0x7B, - - /// - /// F13 key. - /// - F13 = 0x7C, - - /// - /// F14 key. - /// - F14 = 0x7D, - - /// - /// F15 key. - /// - F15 = 0x7E, - - /// - /// F16 key. - /// - F16 = 0x7F, - - /// - /// F17 key. - /// - F17 = 0x80, - - /// - /// F18 key. - /// - F18 = 0x81, - - /// - /// F19 key. - /// - F19 = 0x82, - - /// - /// F20 key. - /// - F20 = 0x83, - - /// - /// F21 key. - /// - F21 = 0x84, - - /// - /// F22 key. - /// - F22 = 0x85, - - /// - /// F23 key. - /// - F23 = 0x86, - - /// - /// F24 key. - /// - F24 = 0x87, - - /// - /// NUM LOCK key. - /// - NumLock = 0x90, - - /// - /// SCROLL LOCK key. - /// - Scroll = 0x91, - - /// - /// Left SHIFT key. - /// - LeftShift = 0xA0, - - /// - /// Right SHIFT key. - /// - RightShift = 0xA1, - - /// - /// Left CONTROL key. - /// - LeftControl = 0xA2, - - /// - /// Right CONTROL key. - /// - RightControl = 0xA3, - - /// - /// Left ALT key. - /// - LeftMenu = 0xA4, - - /// - /// Right ALT key. - /// - RightMenu = 0xA5, - - /// - /// Browser Back key. - /// - BrowserBack = 0xA6, - - /// - /// Browser Forward key. - /// - BrowserForward = 0xA7, - - /// - /// Browser Refresh key. - /// - BrowserRefresh = 0xA8, - - /// - /// Browser Stop key. - /// - BrowserStop = 0xA9, - - /// - /// Browser Search key. - /// - BrowserSearch = 0xAA, - - /// - /// Browser Favorites key. - /// - BrowserFavorites = 0xAB, - - /// - /// Browser Start and Home key. - /// - BrowserHome = 0xAC, - - /// - /// Volume Mute key. - /// - VolumeMute = 0xAD, - - /// - /// Volume Down key. - /// - VolumeDown = 0xAE, - - /// - /// Volume Up key. - /// - VolumeUp = 0xAF, - - /// - /// Next Track key. - /// - MediaNextTrack = 0xB0, - - /// - /// Previous Track key. - /// - MediaPrevTrack = 0xB1, - - /// - /// Stop Media key. - /// - MediaStop = 0xB2, - - /// - /// Play/Pause Media key. - /// - MediaPlayPause = 0xB3, - - /// - /// Start Mail key. - /// - LaunchMail = 0xB4, - - /// - /// Select Media key. - /// - LaunchMediaSelect = 0xB5, - - /// - /// Start Application 1 key. - /// - LaunchApp1 = 0xB6, - - /// - /// Start Application 2 key. - /// - LaunchApp2 = 0xB7, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. For the US standard - /// keyboard, the ";:" key - /// - Oem1 = 0xBA, - - /// - /// For any country/region, the "+" key. - /// - OemPlus = 0xBB, - - /// - /// For any country/region, the "," key - /// - OemComma = 0xBC, - - /// - /// For any country/region, the "-" key. - /// - OemMinus = 0xBD, - - /// - /// For any country/region, the "." key. - /// - OemPeriod = 0xBE, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. For the US standard - /// keyboard, the "/?" key. - /// - Oem2 = 0xBF, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. For the US standard - /// keyboard, the "`~" key. - /// - Oem3 = 0xC0, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. For the US standard - /// keyboard, the "[{" key. - /// - Oem4 = 0xDB, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. For the US standard - /// keyboard, the "\|" key. - /// - Oem5 = 0xDC, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. For the US standard - /// keyboard, the "]}" key. - /// - Oem6 = 0xDD, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. For the US standard - /// keyboard, the "'\"" key - /// - Oem7 = 0xDE, - - /// - /// Used for miscellaneous characters; it can vary by keyboard. - /// - Oem8 = 0xDF, - - /// - /// The "<>" keys on the US standard keyboard, or the "\|" key on the non-US - /// 102-key keyboard. - /// - Oem102 = 0xE2, - - /// - /// IME PROCESS key. - /// - ImeProcess = 0xE5, - - /// - /// Used to pass Unicode characters as if they were keystrokes. The "Packet" key is - /// the low word of a 32-bit Virtual Key value used for non-keyboard input methods. - /// - Packet = 0xE7, - - /// - /// Attn key. - /// - Attn = 0xF6, - - /// - /// CrSel key. - /// - CrSel = 0xF7, - - /// - /// ExSel key. - /// - ExSel = 0xF8, - - /// - /// Erase EOF key. - /// - EraseEOF = 0xF9, - - /// - /// Play key. - /// - Play = 0xFA, - - /// - /// Zoom key. - /// - Zoom = 0xFB, - - /// - /// PA1 key. - /// - Pa1 = 0xFD, - - /// - /// Clear key. - /// - OemClear = 0xFE, - - // @ - - /// - /// 0 key. - /// - Number0 = 0x30, - - /// - /// 1 key. - /// - Number1 = 0x31, - - /// - /// 2 key. - /// - Number2 = 0x32, - - /// - /// 3 key. - /// - Number3 = 0x33, - - /// - /// 4 key. - /// - Number4 = 0x34, - - /// - /// 5 key. - /// - Number5 = 0x35, - - /// - /// 6 key. - /// - Number6 = 0x36, - - /// - /// 7 key. - /// - Number7 = 0x37, - - /// - /// 8 key. - /// - Number8 = 0x38, - - /// - /// 9 key. - /// - Number9 = 0x39, - - /// - /// A key. - /// - A = 0x41, - - /// - /// B key. - /// - B = 0x42, - - /// - /// C key. - /// - C = 0x43, - - /// - /// D key. - /// - D = 0x44, - - /// - /// E key. - /// - E = 0x45, - - /// - /// F key. - /// - F = 0x46, - - /// - /// G key. - /// - G = 0x47, - - /// - /// H key. - /// - H = 0x48, - - /// - /// I key. - /// - I = 0x49, - - /// - /// J key. - /// - J = 0x4A, - - /// - /// K key. - /// - K = 0x4B, - - /// - /// L key. - /// - L = 0x4C, - - /// - /// M key. - /// - M = 0x4D, - - /// - /// N key. - /// - N = 0x4E, - - /// - /// O key. - /// - O = 0x4F, - - /// - /// P key. - /// - P = 0x50, - - /// - /// Q key. - /// - Q = 0x51, - - /// - /// R key. - /// - R = 0x52, - - /// - /// S key. - /// - S = 0x53, - - /// - /// T key. - /// - T = 0x54, - - /// - /// U key. - /// - U = 0x55, - - /// - /// V key. - /// - V = 0x56, - - /// - /// W key. - /// - W = 0x57, - - /// - /// X key. - /// - X = 0x58, - - /// - /// Y key. - /// - Y = 0x59, - - /// - /// Z key. - /// - Z = 0x5A, - } -} diff --git a/ThirtyTwo/Kernel.cs b/ThirtyTwo/Kernel.cs deleted file mode 100644 index dd07d5d..0000000 --- a/ThirtyTwo/Kernel.cs +++ /dev/null @@ -1,2575 +0,0 @@ -using System.Runtime.InteropServices; -using System.Text; -using System; - -using Microsoft.Win32.SafeHandles; - -using ThirtyTwo.Kernel32.Enumerations; -using ThirtyTwo.Kernel32.Structures; - -namespace ThirtyTwo.Kernel32 -{ - /// - /// Provides public, static methods for communicating with the Kernel32 API. - /// - public static class Kernel - { - #region Public Constants - - /// - /// Specifies the name of the DLL where the methods will be imported. - /// - public const string DLL_NAME = @"kernel32.dll"; - - #endregion - - // @ - - #region GetLastError => SystemErrorCodes - - /// - /// Retrieves the calling thread's last-error code value. The last-error code is - /// maintained on a per-thread basis. Multiple threads do not overwrite each other's - /// last-error code. - /// - /// - /// - /// The return value is the calling thread's last-error code. - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetLastError" - )] - public static extern SystemErrorCodes GetLastError(); - - #endregion - - // @ - - #region GetLastErrorCode => uint - - /// - /// Retrieves the calling thread's last-error code value. The last-error code is - /// maintained on a per-thread basis. Multiple threads do not overwrite each other's - /// last-error code. - /// - /// - /// - /// The return value is the calling thread's last-error code. - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetLastError" - )] - public static extern uint GetLastErrorCode(); - - #endregion - - // @ - - #region AddConsoleAlias (Unicode - LPWStr) => bool - - /// - /// Defines a console alias for the specified executable. - /// - /// - /// - /// The console alias to be mapped to the text specified by "Target". - /// - /// - /// - /// The text to be substituted for "Source". If this parameter is "NULL", then the - /// console alias is removed. - /// - /// - /// - /// The name of the executable file for which the console alias is to be defined. - /// - /// - /// - /// If the function succeeds, the return value is "TRUE". If the function fails, the - /// return value is "FALSE". To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "AddConsoleAlias", - CharSet = CharSet.Unicode, - SetLastError = true - )] - public static extern bool AddConsoleAlias( - [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder Source, - [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder Target, - [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder ExeName - ); - - #endregion - - // @ - - #region AllocConsole => bool - - /// - /// Allocates a new console for the calling process. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "AllocConsole", - SetLastError = true - )] - public static extern bool AllocConsole(); - - #endregion - - // @ - - #region AttachConsole => bool - - /// - /// Attaches the calling process to the console of the specified process as a client - /// application. - /// - /// - /// - /// The identifier of the process whose console is to be used. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "AttachConsole", - SetLastError = true - )] - public static extern bool AttachConsole( - [In] uint dwProcessId - ); - - #endregion - - // @ - - #region ClosePseudoConsole => void - - /// - /// Closes a pseudo console from the given handle. - /// - /// - /// - /// A handle to an active pseudo console as opened by "CreatePseudoConsole". - /// - [DllImport( - DLL_NAME, - EntryPoint = "ClosePseudoConsole", - SetLastError = true - )] - public static extern void ClosePseudoConsole( - [In] IntPtr hPC - ); - - #endregion - - // @ - - #region CreatePseudoConsole => ResultHandle - - /// - /// Creates a new pseudo console object for the calling process. - /// - /// - /// - /// The dimensions of the window/buffer in count of characters that will be used - /// on initial creation of the pseudo console. This can be adjusted later with - /// "ResizePseudoConsole". - /// - /// - /// - /// An open handle to a stream of data that represents user input to the device. - /// This is currently restricted to synchronous I/O. - /// - /// - /// - /// An open handle to a stream of data that represents application output from the - /// device. This is currently restricted to synchronous I/O. - /// - /// - /// - /// The creation option. This parameter can be defined by one of the values ​​of the - /// "PseudoConsoleCreationOption" enumeration. - /// - /// - /// - /// Pointer to a location that will receive a handle to the new pseudo console device. - /// - /// - /// - /// If this method succeeds, it returns "Ok". Otherwise, it returns an "ResultHandle" - /// error code. - /// - [DllImport( - DLL_NAME, - EntryPoint = "CreatePseudoConsole", - SetLastError = true - )] - public static extern ResultHandle CreatePseudoConsole( - [In] Coordinate size, - [In] IntPtr hInput, - [In] IntPtr hOutput, - [In] PseudoConsoleCreationOption dwFlags, - [Out] out IntPtr phPC - ); - - #endregion - - // @ - - #region CreateConsoleScreenBuffer => SafeFileHandle - - /// - /// Creates a console screen buffer. - /// - /// - /// - /// The access to the console screen buffer. This parameter can be defined by one of - /// the values ​​of the "AccessRights" enumeration. - /// - /// - /// - /// This parameter can be zero, indicating that the buffer cannot be shared, or it can - /// be one or more values ​​from the "ShareMode" enumeration. - /// - /// - /// - /// A pointer to a "SecurityAttributes" structure that determines whether the returned - /// handle can be inherited by child processes. If "lpSecurityAttributes" is "NULL", - /// the handle cannot be inherited. The "lpSecurityDescriptor" member of the structure - /// specifies a security descriptor for the new console screen buffer. If - /// "lpSecurityAttributes" is "NULL", the console screen buffer gets a default security - /// descriptor. The ACLs in the default security descriptor for a console screen buffer - /// come from the primary or impersonation token of the creator. - /// - /// - /// - /// The type of console screen buffer to create. The only supported screen buffer type - /// is "CONSOLE_TEXTMODE_BUFFER (1)". - /// - /// - /// - /// Reserved. Should be "NULL". - /// - /// - /// - /// If the function succeeds, the return value is a handle to the new console screen - /// buffer. If the function fails, the return value is "INVALID_HANDLE_VALUE". To get - /// extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "CreateConsoleScreenBuffer", - SetLastError = true - )] - public static extern SafeFileHandle CreateConsoleScreenBuffer( - [In] AccessRights dwDesiredAccess, - [In] ShareMode dwShareMode, - [In] ref SecurityAttributes lpSecurityAttributes, - [In] uint dwFlags, - [In] IntPtr lpScreenBufferData = default - ); - - #endregion - - // @ - - #region FillConsoleOutputAttribute => bool - - /// - /// Sets the character attributes for a specified number of character cells, beginning - /// at the specified coordinates in a screen buffer. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericWrite" - /// access right. - /// - /// - /// - /// The attributes to use when writing to the console screen buffer. This parameter can - /// be zero or a combination of values ​​from the "CharacterAttributes" enumeration. - /// - /// - /// - /// The number of character cells to be set to the specified color attributes. - /// - /// - /// - /// A "Coordinate" structure that specifies the character coordinates of the first cell - /// whose attributes are to be set. - /// - /// - /// - /// A pointer to a variable that receives the number of character cells whose - /// attributes were actually set. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport(DLL_NAME, EntryPoint = "FillConsoleOutputAttribute", SetLastError = true)] - public static extern bool FillConsoleOutputAttribute( - [In] IntPtr hConsoleOutput, - [In] CharacterAttributes wAttribute, - [In] uint nLength, - [In] Coordinate dwWriteCoord, - [Out] out uint lpNumberOfAttrsWritten - ); - - #endregion - - // @ - - #region FillConsoleOutputCharacter (Unicode - LPWStr) => bool - - /// - /// Writes a character to the console screen buffer a specified number of times, - /// beginning at the specified coordinates. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericWrite" - /// access right. - /// - /// - /// - /// The character to be written to the console screen buffer. - /// - /// - /// - /// The number of character cells to which the character should be written. - /// - /// - /// - /// A "Coordinate" structure that specifies the character coordinates of the first cell - /// to which the character is to be written. - /// - /// - /// - /// A pointer to a variable that receives the number of characters actually written to - /// the console screen buffer. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "FillConsoleOutputCharacter", - CharSet = CharSet.Unicode, - SetLastError = true - )] - public static extern bool FillConsoleOutputCharacter( - [In] IntPtr hConsoleOutput, - [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder cCharacter, - [In] uint nLength, - [In] Coordinate dwWriteCoord, - [Out] out uint lpNumberOfCharsWritten - ); - - #endregion - - // @ - - #region FlushConsoleInputBuffer => bool - - /// - /// Flushes the console input buffer. All input records currently in the input buffer - /// are discarded. - /// - /// - /// - /// A handle to the console input buffer. The handle must have the "GenericWrite" - /// access right. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "FlushConsoleInputBuffer", - SetLastError = true - )] - public static extern bool FlushConsoleInputBuffer( - [In] IntPtr hConsoleInput - ); - - #endregion - - // @ - - #region FreeConsole => void - - /// - /// Detaches the calling process from its console. - /// - [DllImport( - DLL_NAME, - EntryPoint = "FreeConsole", - SetLastError = true - )] - public static extern void FreeConsole(); - - #endregion - - // @ - - #region GenerateConsoleCtrlEvent => bool - - /// - /// Sends a specified signal to a console process group that shares the console - /// associated with the calling process. - /// - /// - /// - /// The type of signal to be generated. This parameter can be defined by one of the - /// values ​​in the "ControlEvent" enumeration. - /// - /// - /// - /// The identifier of the process group to receive the signal. A process group is - /// created when the "CREATE_NEW_PROCESS_GROUP" flag is specified in a call to the - /// "CreateProcess" function. The process identifier of the new process is also the - /// process group identifier of a new process group. The process group includes all - /// processes that are descendants of the root process. Only those processes in the - /// group that share the same console as the calling process receive the signal. In - /// other words, if a process in the group creates a new console, that process does - /// not receive the signal, nor do its descendants. If this parameter is zero, the - /// signal is generated in all processes that share the console of the calling process. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GenerateConsoleCtrlEvent", - SetLastError = true - )] - public static extern bool GenerateConsoleCtrlEvent( - [In] ControlEvent dwCtrlEvent, - [In] uint dwProcessGroupId - ); - - #endregion - - // @ - - #region GetConsoleAlias (Unicode - LPWStr) => uint - - /// - /// Retrieves the text for the specified console alias and executable. - /// - /// - /// - /// The console alias whose text is to be retrieved. - /// - /// - /// - /// A pointer to a buffer that receives the text associated with the console alias. - /// - /// - /// - /// The size of the buffer pointed to by "lpTargetBuffer", in bytes. - /// - /// - /// - /// The name of the executable file. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleAlias", - CharSet = CharSet.Unicode, - SetLastError = true - )] - public static extern uint GetConsoleAlias( - [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpSource, - [Out] out StringBuilder lpTargetBuffer, - [In, MarshalAs(UnmanagedType.LPWStr)] uint TargetBufferLength, - [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpExeName - ); - - #endregion - - // @ - - #region GetConsoleAliases (Unicode - LPWStr) => uint - - /// - /// Retrieves all defined console aliases for the specified executable. - /// - /// - /// - /// A pointer to a buffer that receives the aliases. The format of the data is as - /// follows: "Source1=Target1\0Source2=Target2\0... SourceN=TargetN\0", where "N" is - /// the number of console aliases defined. - /// - /// - /// - /// The size of the buffer pointed to by "lpAliasBuffer", in bytes. - /// - /// - /// - /// The executable file whose aliases are to be retrieved. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleAliases", - CharSet = CharSet.Unicode, - SetLastError = true - )] - public static extern uint GetConsoleAliases( - [Out, MarshalAs(UnmanagedType.LPWStr)] out StringBuilder lpAliasBuffer, - [In] uint AliasBufferLength, - [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpExeName - ); - - #endregion - - // @ - - #region GetConsoleAliasesLength (Unicode - LPWStr) => uint - - /// - /// Retrieves the required size for the buffer used by the "GetConsoleAliases" function. - /// - /// - /// - /// The name of the executable file whose console aliases are to be retrieved. - /// - /// - /// - /// The size of the buffer required to store all console aliases defined for this - /// executable file, in bytes. - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleAliasesLength", - CharSet = CharSet.Unicode, - SetLastError = true - )] - public static extern uint GetConsoleAliasesLength( - [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpExeName - ); - - #endregion - - // @ - - #region GetConsoleAliasExes (Unicode - LPWStr) => uint - - /// - /// Retrieves the names of all executable files with console aliases defined. - /// - /// - /// - /// A pointer to a buffer that receives the names of the executable files. - /// - /// - /// - /// The size of the buffer pointed to by "lpExeNameBuffer", in bytes. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleAliasExes", - CharSet = CharSet.Unicode, - SetLastError = true - )] - public static extern uint GetConsoleAliasExes( - [Out, MarshalAs(UnmanagedType.LPWStr)] out StringBuilder lpExeNameBuffer, - [In] uint ExeNameBufferLength - ); - - #endregion - - // @ - - #region GetConsoleAliasExesLength => uint - - /// - /// Retrieves the required size for the buffer used by the "GetConsoleAliasExes" function. - /// - /// - /// - /// The size of the buffer required to store the names of all executable files that - /// have console aliases defined, in bytes. - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleAliasExesLength", - SetLastError = true - )] - public static extern uint GetConsoleAliasExesLength(); - - #endregion - - // @ - - #region GetConsoleCP => uint - - /// - /// Retrieves the input code page used by the console associated with the calling - /// process. A console uses its input code page to translate keyboard input into the - /// corresponding character value. - /// - /// - /// - /// The return value is a code that identifies the code page. If the return value is - /// zero, the function has failed. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleCP", - SetLastError = true - )] - public static extern uint GetConsoleCP(); - - #endregion - - // @ - - #region GetConsoleCursorInfo => bool - - /// - /// Retrieves information about the size and visibility of the cursor for the specified - /// console screen buffer. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A pointer to a "ConsoleCursorInformation" structure that receives information about the - /// console's cursor. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleCursorInfo", - SetLastError = true - )] - public static extern bool GetConsoleCursorInfo( - [In] IntPtr hConsoleOutput, - [Out] out ConsoleCursorInformation lpConsoleCursorInfo - ); - - #endregion - - // @ - - #region GetConsoleDisplayMode => bool - - /// - /// Retrieves the display mode of the current console. - /// - /// - /// - /// The display mode of the console. This parameter can be set by one of the values ​​in - /// the "ConsoleDisplayMode" enumeration. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleDisplayMode", - SetLastError = true - )] - public static extern bool GetConsoleDisplayMode( - [Out] out ConsoleDisplayMode lpModeFlags - ); - - #endregion - - // @ - - #region GetConsoleFontSize => Coordinate - - /// - /// Retrieves the size of the font used by the specified console screen buffer. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// The index of the font whose size is to be retrieved. This index is obtained by - /// calling the "GetCurrentConsoleFont" function. - /// - /// - /// - /// If the function succeeds, the return value is a "Coordinate" structure that contains the - /// width and height of each character in the font, in logical units. The "X" member - /// contains the width, while the "Y" member contains the height. If the function fails, - /// the width and the height are zero.To get extended error information, call - /// "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleFontSize", - SetLastError = true - )] - public static extern Coordinate GetConsoleFontSize( - [In] IntPtr hConsoleOutput, - [In] uint nFont - ); - - #endregion - - // @ - - #region GetConsoleHistoryInfo => bool - - /// - /// Retrieves the history settings for the calling process's console. - /// - /// - /// - /// A pointer to a "ConsoleHistoryInformation" structure that receives the history settings - /// for the calling process's console. - /// - /// - /// - /// If the function succeeds the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleHistoryInfo", - SetLastError = true - )] - public static extern bool GetConsoleHistoryInfo( - [Out] out ConsoleHistoryInformation lpConsoleHistoryInfo - ); - - #endregion - - // @ - - #region GetConsoleMode => bool - - /// - /// Retrieves the current input mode of a console's input buffer or the current output - /// mode of a console screen buffer. - /// - /// - /// - /// A handle to the console input buffer or the console screen buffer. The handle must - /// have the "GenericRead" access right. - /// - /// - /// - /// A pointer to a variable that receives the current mode of the specified buffer. If - /// the "hConsoleHandle" parameter is an input handle, the mode can be one or more - /// values ​​from the "ConsoleMode" enumeration. When a console is created, all input - /// modes except "EnableWindowInput" and "EnableVirtualTerminalInput" are enabled - /// by default. If the "hConsoleHandle" parameter is a screen buffer handle, the mode - /// can be one or more values ​​from the "ConsoleMode" enumeration. When a screen buffer - /// is created, both output modes are enabled by default. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleMode", - SetLastError = true - )] - public static extern bool GetConsoleMode( - [In] IntPtr hConsoleHandle, - [Out] out ConsoleMode lpMode - ); - - #endregion - - // @ - - #region GetConsoleOriginalTitle (Unicode - LPWStr) => uint - - /// - /// Retrieves the original title for the current console window. - /// - /// - /// - /// A pointer to a buffer that receives a null-terminated string containing the - /// original title. - /// - /// - /// - /// The size of the "lpConsoleTitle" buffer, in characters. - /// - /// - /// - /// If "nSize" is zero, the return value is zero. If the function succeeds, the return - /// value is the length of the original console title, in characters. If the function - /// fails, the return value is zero and "GetLastError" returns the error code. - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleOriginalTitle", - CharSet = CharSet.Unicode, - SetLastError = true - )] - public static extern uint GetConsoleOriginalTitle( - [Out, MarshalAs(UnmanagedType.LPWStr)] out StringBuilder lpConsoleTitle, - [In] uint nSize - ); - - #endregion - - // @ - - #region GetConsoleOutputCP => uint - - /// - /// Retrieves the output code page used by the console associated with the calling - /// process. A console uses its output code page to translate the character values - /// written by the various output functions into the images displayed in the - /// console window. - /// - /// - /// - /// The return value is a code that identifies the code page. If the return value is - /// zero, the function has failed. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleOutputCP", - SetLastError = true - )] - public static extern uint GetConsoleOutputCP(); - - #endregion - - // @ - - #region GetConsoleProcessList => uint - - /// - /// Retrieves a list of the processes attached to the current console. - /// - /// - /// - /// A pointer to a buffer that receives an array of process identifiers upon success. - /// This must be a valid buffer and cannot be "NULL". The buffer must have space to - /// receive at least "1" returned process id. - /// - /// - /// - /// The maximum number of process identifiers that can be stored in the "lpdwProcessList" - /// buffer. This must be greater than "0". - /// - /// - /// - /// If the function succeeds, the return value is less than or equal to "dwProcessCount" - /// and represents the number of process identifiers stored in the "lpdwProcessList" - /// buffer. If the buffer is too small to hold all the valid process identifiers, the - /// return value is the required number of array elements. The function will have stored - /// no identifiers in the buffer. In this situation, use the return value to allocate a - /// buffer that is large enough to store the entire list and call the function again. If - /// the return value is zero, the function has failed, because every console has at least - /// one process associated with it.To get extended error information, call - /// "GetLastError". If a "NULL" process list was provided or the process count was "0", - /// the call will return "0" and "GetLastError" will return - /// "ERROR_INVALID_PARAMETER (87)". Please provide a buffer of at least one element to - /// call this function. Allocate a larger buffer and call again if the return code is - /// larger than the length of the provided buffer. - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleProcessList", - SetLastError = true - )] - public static extern uint GetConsoleProcessList( - [Out] out IntPtr[] lpdwProcessList, - [In] uint dwProcessCount - ); - - #endregion - - // @ - - #region GetConsoleScreenBufferInfo => bool - - /// - /// Retrieves information about the specified console screen buffer. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A pointer to a "ConsoleScreenBufferInformation" structure that receives the console - /// screen buffer information. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleScreenBufferInfo", - SetLastError = true - )] - public static extern bool GetConsoleScreenBufferInfo( - [In] IntPtr hConsoleOutput, - [Out] out ConsoleScreenBufferInformation lpConsoleScreenBufferInfo - ); - - #endregion - - // @ - - #region GetConsoleScreenBufferInfoEx => bool - - /// - /// Retrieves extended information about the specified console screen buffer. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A "ConsoleScreenBufferInformationExtended" structure that receives the requested - /// console screen buffer information. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleScreenBufferInfoEx", - SetLastError = true - )] - public static extern bool GetConsoleScreenBufferInfoEx( - [In] IntPtr hConsoleOutput, - [Out] out ConsoleScreenBufferInformationExtended lpConsoleScreenBufferInfoEx - ); - - #endregion - - // @ - - #region GetConsoleSelectionInfo => bool - - /// - /// Retrieves information about the current console selection. - /// - /// - /// - /// A pointer to a "ConsoleSelectionInformation" structure that receives the - /// selection information. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleSelectionInfo", - SetLastError = true - )] - public static extern bool GetConsoleSelectionInfo( - [Out] out ConsoleSelectionInformation lpConsoleSelectionInfo - ); - - #endregion - - // @ - - #region GetConsoleTitle (Unicode - LPWStr) => bool - - /// - /// Retrieves the title for the current console window. - /// - /// - /// - /// A pointer to a buffer that receives a null-terminated string containing the title. - /// If the buffer is too small to store the title, the function stores as many - /// characters of the title as will fit in the buffer, ending with a null terminator. - /// - /// - /// - /// The size of the buffer pointed to by the "lpConsoleTitle" parameter, in characters. - /// - /// - /// - /// If the function succeeds, the return value is the length of the console window's - /// title, in characters. If the function fails, the return value is zero and - /// "GetLastError" returns the error code. - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleTitle", - SetLastError = true - )] - public static extern bool GetConsoleTitle( - [Out, MarshalAs(UnmanagedType.LPWStr)] out StringBuilder lpConsoleTitle, - [In] uint nSize - ); - - #endregion - - // @ - - #region GetConsoleWindow => IntPtr - - /// - /// Retrieves the window handle used by the console associated with the calling process. - /// - /// - /// - /// The return value is a handle to the window used by the console associated with the - /// calling process or "NULL" if there is no such associated console. - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetConsoleWindow", - SetLastError = true - )] - public static extern IntPtr GetConsoleWindow(); - - #endregion - - // @ - - #region GetCurrentConsoleFont => bool - - /// - /// Retrieves information about the current console font. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// If this parameter is "TRUE", font information is retrieved for the maximum window - /// size. If this parameter is "FALSE", font information is retrieved for the current - /// window size. - /// - /// - /// - /// A pointer to a "ConsoleFontInformation" structure that receives the requested font - /// information. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetCurrentConsoleFont", - SetLastError = true - )] - public static extern bool GetCurrentConsoleFont( - [In] IntPtr hConsoleOutput, - [In] bool bMaximumWindow, - [Out] out ConsoleFontInformation lpConsoleCurrentFont - ); - - #endregion - - // @ - - #region GetCurrentConsoleFontEx => bool - - /// - /// Retrieves extended information about the current console font. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// If this parameter is "TRUE", font information is retrieved for the maximum window - /// size. If this parameter is "FALSE", font information is retrieved for the current - /// window size. - /// - /// - /// - /// A pointer to a "ConsoleFontInformationExtended" structure that receives the requested - /// font information. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetCurrentConsoleFontEx", - SetLastError = true - )] - public static extern bool GetCurrentConsoleFontEx( - [In] IntPtr hConsoleOutput, - [In] bool bMaximumWindow, - [Out] out ConsoleFontInformationExtended lpConsoleCurrentFontEx - ); - - #endregion - - // @ - - #region GetLargestConsoleWindowSize => Coordinate - - /// - /// Retrieves the size of the largest possible console window, based on the current font - /// and the size of the display. - /// - /// - /// - /// A handle to the console screen buffer. - /// - /// - /// - /// If the function succeeds, the return value is a "Coordinate" structure that specifies - /// the number of character cell columns ("X" member) and rows ("Y" member) in the largest - /// possible console window. Otherwise, the members of the structure are zero. To get - /// extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetLargestConsoleWindowSize", - SetLastError = true - )] - public static extern Coordinate GetLargestConsoleWindowSize( - [In] IntPtr hConsoleOutput - ); - - #endregion - - // @ - - #region GetNumberOfConsoleInputEvents => bool - - /// - /// Retrieves the number of unread input records in the console's input buffer. - /// - /// - /// - /// A handle to the console input buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A pointer to a variable that receives the number of unread input records in the - /// console's input buffer. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetNumberOfConsoleInputEvents", - SetLastError = true - )] - public static extern bool GetNumberOfConsoleInputEvents( - [In] IntPtr hConsoleInput, - [Out] out uint lpcNumberOfEvents - ); - - #endregion - - // @ - - #region GetNumberOfConsoleMouseButtons => bool - - /// - /// Retrieves the number of buttons on the mouse used by the current console. - /// - /// - /// - /// A pointer to a variable that receives the number of mouse buttons. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetNumberOfConsoleMouseButtons", - SetLastError = true - )] - public static extern bool GetNumberOfConsoleMouseButtons( - [Out] out uint lpNumberOfMouseButtons - ); - - #endregion - - // @ - - #region GetStdHandle => IntPtr - - /// - /// Retrieves a handle to the specified standard device (standard input, standard - /// output, or standard error). - /// - /// - /// - /// The standard device. This parameter can be set by one of the values ​​in the - /// "ConsoleStandardDevice" enumeration. - /// - /// - /// - /// If the function succeeds, the return value is a handle to the specified device, or - /// a redirected handle set by a previous call to SetStdHandle. The handle has - /// "GenericRead" and "GenericWrite" access rights, unless the application has used - /// "SetStdHandle" to set a standard handle with lesser access. - /// - [DllImport( - DLL_NAME, - EntryPoint = "GetStdHandle", - SetLastError = true - )] - public static extern IntPtr GetStdHandle( - [In] ConsoleStandardDevice nStdHandle - ); - - #endregion - - // @ - - #region HandlerRoutine (delegate) => bool - - /// - /// An application-defined function used with the "SetConsoleCtrlHandler" function. - /// A console process uses this function to handle control signals received by the - /// process. When the signal is received, the system creates a new thread in the - /// process to execute the function. The "PHANDLER_ROUTINE" type defines a pointer to - /// this callback function. "HandlerRoutine" is a placeholder for the - /// application-defined function name. - /// - /// - /// - /// The type of control signal received by the handler. This parameter can be defined - /// by one of the values ​​in the "ControlEvent" enumeration. - /// - /// - /// - /// If the function handles the control signal, it should return "TRUE". If it returns - /// "FALSE", the next handler function in the list of handlers for this process is used. - /// - public delegate bool HandlerRoutine( - [In] ControlEvent dwCtrlType - ); - - #endregion - - // @ - - #region PeekConsoleInput => bool - - /// - /// Reads data from the specified console input buffer without removing it from - /// the buffer. - /// - /// - /// - /// A handle to the console input buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A pointer to an array of "InputRecord" structures that receives the input - /// buffer data. - /// - /// - /// - /// The size of the array pointed to by the "lpBuffer" parameter, in array elements. - /// - /// - /// - /// A pointer to a variable that receives the number of input records read. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "PeekConsoleInput", - SetLastError = true - )] - public static extern bool PeekConsoleInput( - [In] IntPtr hConsoleInput, - [Out] out InputRecord lpBuffer, - [In] uint nLength, - [Out] out uint lpNumberOfEventsRead - ); - - #endregion - - // @ - - #region ReadConsole => bool - - /// - /// Reads character input from the console input buffer and removes it from the buffer. - /// - /// - /// - /// A handle to the console input buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A pointer to a buffer that receives the data read from the console input buffer. - /// - /// - /// - /// The number of characters to be read. The size of the buffer pointed to by the - /// "lpBuffer" parameter should be at least "nNumberOfCharsToRead * sizeof(char)" bytes. - /// - /// - /// - /// A pointer to a variable that receives the number of characters actually read. - /// - /// - /// - /// A pointer to a "ReadConsoleControl" structure that specifies a control - /// character to signal the end of the read operation. This parameter can be "NULL". - /// This parameter requires Unicode input by default. For ANSI mode, set this parameter - /// to "NULL". - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "ReadConsole", - SetLastError = true - )] - public static extern bool ReadConsole( - [In] IntPtr hConsoleInput, - [Out] out byte[] lpBuffer, - [In] uint nNumberOfCharsToRead, - [Out] out uint lpNumberOfCharsRead, - [In] ref ReadConsoleControl pInputControl - ); - - #endregion - - // @ - - #region ReadConsoleInput => bool - - /// - /// Reads data from a console input buffer and removes it from the buffer. - /// - /// - /// - /// A handle to the console input buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A pointer to an array of "InputRecord" structures that receives the input - /// buffer data. - /// - /// - /// - /// The size of the array pointed to by the "lpBuffer" parameter, in array elements. - /// - /// - /// - /// A pointer to a variable that receives the number of input records read. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "ReadConsoleInput", - SetLastError = true - )] - public static extern bool ReadConsoleInput( - [In] IntPtr hConsoleInput, - [Out] out InputRecord lpBuffer, - [In] uint nLength, - [Out] out uint lpNumberOfEventsRead - ); - - #endregion - - // @ - - #region ReadConsoleInputEx => bool - - /// - /// Reads data from a console input buffer and removes it from the buffer, with - /// configurable behavior. - /// - /// - /// - /// A handle to the console input buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A pointer to an array of "InputRecord" structures that receives the input - /// buffer data. - /// - /// - /// - /// The size of the array pointed to by the "lpBuffer" parameter, in array elements. - /// - /// - /// - /// A pointer to a variable that receives the number of input records read. - /// - /// - /// - /// A set of flags (ORed together) that specify the console's reading behavior. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "ReadConsoleInputEx", - SetLastError = true - )] - public static extern bool ReadConsoleInputEx( - [In] IntPtr hConsoleInput, - [Out] out InputRecord lpBuffer, - [In] uint nLength, - [Out] out uint lpNumberOfEventsRead, - [In] ConsoleReadingBehavior wFlags - ); - - #endregion - - // @ - - #region ReadConsoleOutput => bool - - /// - /// Reads character and color attribute data from a rectangular block of character - /// cells in a console screen buffer, and the function writes the data to a rectangular - /// block at a specified location in the destination buffer. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A pointer to a destination buffer that receives the data read from the console - /// screen buffer. This pointer is treated as the origin of a two-dimensional array of - /// "CharacterInformation" structures whose size is specified by the "dwBufferSize" - /// parameter. - /// - /// - /// - /// The size of the "lpBuffer" parameter, in character cells. The "X" member of the - /// "Coordinate" structure is the number of columns; the "Y" member is the number of rows. - /// - /// - /// - /// The coordinates of the upper-left cell in the lpBuffer parameter that receives the - /// data read from the console screen buffer. The "X" member of the "Coordinate" structure - /// is the column, and the "Y" member is the row. - /// - /// - /// - /// A pointer to a "SmallRectangle" structure. On input, the structure members specify the - /// upper-left and lower-right coordinates of the console screen buffer rectangle from - /// which the function is to read. On output, the structure members specify the actual - /// rectangle that was used. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "ReadConsoleOutput", - SetLastError = true - )] - public static extern bool ReadConsoleOutput( - [In] IntPtr hConsoleOutput, - [Out] out CharacterInformation lpBuffer, - [In] Coordinate dwBufferSize, - [In] Coordinate dwBufferCoord, - [In, Out] ref SmallRectangle lpReadRegion - ); - - #endregion - - // @ - - #region ReadConsoleOutputAttribute => bool - - /// - /// Copies a specified number of character attributes from consecutive cells of a - /// console screen buffer, beginning at a specified location. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A pointer to a buffer that receives the attributes being used by the console screen buffer. - /// - /// - /// - /// The number of screen buffer character cells from which to read. The size of the - /// buffer pointed to by the "lpAttribute" parameter should be "nLength * sizeof(ushort)". - /// - /// - /// - /// The coordinates of the first cell in the console screen buffer from which to read, - /// in characters. The "X" member of the "Coordinate" structure is the column, and the "Y" - /// member is the row. - /// - /// - /// - /// A pointer to a variable that receives the number of attributes actually read. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "ReadConsoleOutputAttribute", - SetLastError = true - )] - public static extern bool ReadConsoleOutputAttribute( - [In] IntPtr hConsoleOutput, - [Out] out CharacterAttributes lpAttribute, - [In] uint nLength, - [In] Coordinate dwReadCoord, - [Out] out uint lpNumberOfAttrsRead - ); - - #endregion - - // @ - - #region ReadConsoleOutputCharacter (Unicode or ANSI - LPTStr) => bool - - /// - /// Copies a number of characters from consecutive cells of a console screen buffer, - /// beginning at a specified location. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A pointer to a buffer that receives the characters read from the console - /// screen buffer. - /// - /// - /// - /// The number of screen buffer character cells from which to read. The size of the - /// buffer pointed to by the "lpCharacter" parameter should be "nLength * sizeof(char)". - /// - /// - /// - /// The coordinates of the first cell in the console screen buffer from which to read, - /// in characters. The "X" member of the "Coordinate" structure is the column, and the "Y" - /// member is the row. - /// - /// - /// - /// A pointer to a variable that receives the number of characters actually read. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "ReadConsoleOutputCharacter", - CharSet = CharSet.Auto, - SetLastError = true - )] - public static extern bool ReadConsoleOutputCharacter( - [In] IntPtr hConsoleOutput, - [Out, MarshalAs(UnmanagedType.LPTStr)] out StringBuilder lpCharacter, - [In] uint nLength, - [In] Coordinate dwReadCoord, - [Out] out uint lpNumberOfCharsRead - ); - - #endregion - - // @ - - #region ResizePseudoConsole => ResultHandle - - /// - /// Resizes the internal buffers for a pseudo console to the given size. - /// - /// - /// - /// A handle to an active pseudo console as opened by "CreatePseudoConsole". - /// - /// - /// - /// The dimensions of the window/buffer in count of characters that will be used for - /// the internal buffer of this pseudo console. - /// - /// - /// - /// If this method succeeds, it returns "Ok". Otherwise, it returns an "ResultHandle" - /// error code. - /// - [DllImport( - DLL_NAME, - EntryPoint = "ResizePseudoConsole", - SetLastError = true - )] - public static extern ResultHandle ResizePseudoConsole( - [In] IntPtr hPC, - [In] Coordinate size - ); - - #endregion - - // @ - - #region ScrollConsoleScreenBuffer => bool - - /// - /// Moves a block of data in a screen buffer. The effects of the move can be limited by - /// specifying a clipping rectangle, so the contents of the console screen buffer - /// outside the clipping rectangle are unchanged. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A pointer to a "SmallRectangle" structure whose members specify the upper-left and - /// lower-right coordinates of the console screen buffer rectangle to be moved. - /// - /// - /// - /// A pointer to a "SmallRectangle" structure whose members specify the upper-left and - /// lower-right coordinates of the console screen buffer rectangle that is affected by - /// the scrolling. This pointer can be "NULL". - /// - /// - /// - /// A "Coordinate" structure that specifies the upper-left corner of the new location of - /// the "lpScrollRectangle" contents, in characters. - /// - /// - /// - /// A pointer to a "CharacterInformation" structure that specifies the character and color - /// attributes to be used in filling the cells within the intersection of - /// "lpScrollRectangle" and "lpClipRectangle" that were left empty as a result of the move. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "ScrollConsoleScreenBuffer", - SetLastError = true - )] - public static extern bool ScrollConsoleScreenBuffer( - [In] IntPtr hConsoleOutput, - [In] ref SmallRectangle lpScrollRectangle, - [In] ref SmallRectangle lpClipRectangle, - [In] Coordinate dwDestinationOrigin, - [In] ref CharacterInformation lpFill - ); - - #endregion - - // @ - - #region SetConsoleActiveScreenBuffer => bool - - /// - /// Sets the specified screen buffer to be the currently displayed console screen buffer. - /// - /// - /// - /// A handle to the console screen buffer. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleActiveScreenBuffer", - SetLastError = true - )] - public static extern bool SetConsoleActiveScreenBuffer( - [In] IntPtr hConsoleOutput - ); - - #endregion - - // @ - - #region SetConsoleCP => bool - - /// - /// Sets the input code page used by the console associated with the calling process. A - /// console uses its input code page to translate keyboard input into the corresponding - /// character value. - /// - /// - /// - /// The identifier of the code page to be set. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleCP", - SetLastError = true - )] - public static extern bool SetConsoleCP( - [In] uint wCodePageID - ); - - #endregion - - // @ - - #region SetConsoleCtrlHandler => bool - - /// - /// Adds or removes an application-defined "HandlerRoutine" function from the list of - /// handler functions for the calling process. If no handler function is specified, the - /// function sets an inheritable attribute that determines whether the calling process - /// ignores "CTRL + C" signals. - /// - /// - /// - /// A pointer to the application-defined "HandlerRoutine" function to be added or - /// removed. This parameter can be "NULL". - /// - /// - /// - /// If this parameter is "TRUE", the handler is added; if it is "FALSE", the handler is - /// removed. If the "HandlerRoutine" parameter is "NULL", a "TRUE" value causes the - /// calling process to ignore "CTRL + C" input, and a "FALSE" value restores normal - /// processing of "CTRL + C" input. This attribute of ignoring or processing "CTRL + C" - /// is inherited by child processes. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleCtrlHandler", - SetLastError = true - )] - public static extern bool SetConsoleCtrlHandler( - [In] HandlerRoutine HandlerRoutine, - [In] bool Add - ); - - #endregion - - // @ - - #region SetConsoleCursorInfo => bool - - /// - /// Sets the size and visibility of the cursor for the specified console screen buffer. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A pointer to a "ConsoleCursorInformation" structure that provides the new specifications - /// for the console screen buffer's cursor. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleCursorInfo", - SetLastError = true - )] - public static extern bool SetConsoleCursorInfo( - [In] IntPtr hConsoleOutput, - [In] ref ConsoleCursorInformation lpConsoleCursorInfo - ); - - #endregion - - // @ - - #region SetConsoleCursorPosition => bool - - /// - /// Sets the cursor position in the specified console screen buffer. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A "Coordinate" structure that specifies the new cursor position, in characters. The - /// coordinates are the column and row of a screen buffer character cell. The - /// coordinates must be within the boundaries of the console screen buffer. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleCursorPosition", - SetLastError = true - )] - public static extern bool SetConsoleCursorPosition( - [In] IntPtr hConsoleOutput, - [In] Coordinate dwCursorPosition - ); - - #endregion - - // @ - - #region SetConsoleDisplayMode => bool - - /// - /// Sets the display mode of the specified console screen buffer. - /// - /// - /// - /// A handle to the console screen buffer. - /// - /// - /// - /// The display mode of the console. This parameter can be defined by one or more - /// values ​​from the "ConsoleDisplayMode" enumeration. - /// - /// - /// - /// A pointer to a "Coordinate" structure that receives the new dimensions of the screen - /// buffer, in characters. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleDisplayMode", - SetLastError = true - )] - public static extern bool SetConsoleDisplayMode( - [In] IntPtr hConsoleOutput, - [In] ConsoleDisplayMode dwFlags, - [Out] out Coordinate lpNewScreenBufferDimensions - ); - - #endregion - - // @ - - #region SetConsoleHistoryInfo => bool - - /// - /// Sets the history settings for the calling process's console. - /// - /// - /// - /// A pointer to a "ConsoleHistoryInformation" structure that contains the history settings - /// for the process's console. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleHistoryInfo", - SetLastError = true - )] - public static extern bool SetConsoleHistoryInfo( - [In] ConsoleHistoryInformation lpConsoleHistoryInfo - ); - - #endregion - - // @ - - #region SetConsoleMode => bool - - /// - /// Sets the input mode of a console's input buffer or the output mode of a console - /// screen buffer. - /// - /// - /// - /// A handle to the console input buffer or a console screen buffer. The handle must - /// have the "GenericRead" access right. - /// - /// - /// - /// The input or output mode to be set. If the "hConsoleHandle" parameter is an input - /// handle, the mode can be one or more of the values ​​in the "ConsoleMode" enumeration. - /// When a console is created, all input modes except "EnableWindowInput" and - /// "EnableVirtualTerminalInput" are enabled by default. If the "hConsoleHandle" - /// parameter is a screen buffer handle, the mode can be one or more of the values ​​in - /// the "ConsoleMode" enumeration. When a screen buffer is created, both output modes - /// are enabled by default. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleMode", - SetLastError = true - )] - public static extern bool SetConsoleMode( - [In] IntPtr hConsoleHandle, - [In] ConsoleMode dwMode - ); - - #endregion - - // @ - - #region SetConsoleOutputCP => bool - - /// - /// Sets the output code page used by the console associated with the calling process. - /// A console uses its output code page to translate the character values written by - /// the various output functions into the images displayed in the console window. - /// - /// - /// - /// The identifier of the code page to set. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleOutputCP", - SetLastError = true - )] - public static extern bool SetConsoleOutputCP( - [In] uint wCodePageID - ); - - #endregion - - // @ - - #region SetConsoleScreenBufferInfoEx => bool - - /// - /// Sets extended information about the specified console screen buffer. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericWrite" - /// access right. - /// - /// - /// - /// A "ConsoleScreenBufferInformationExtended" structure that contains the console screen - /// buffer information. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleScreenBufferInfoEx", - SetLastError = true - )] - public static extern bool SetConsoleScreenBufferInfoEx( - [In] IntPtr hConsoleOutput, - [In] ConsoleScreenBufferInformationExtended lpConsoleScreenBufferInfoEx - ); - - #endregion - - // @ - - #region SetConsoleScreenBufferSize => bool - - /// - /// Changes the size of the specified console screen buffer. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// A "Coordinate" structure that specifies the new size of the console screen buffer, in - /// character rows and columns. The specified width and height cannot be less than the - /// width and height of the console screen buffer's window. The specified dimensions - /// also cannot be less than the minimum size allowed by the system. This minimum - /// depends on the current font size for the console (selected by the user) and the - /// "SM_CXMIN" and "SM_CYMIN" values returned by the "GetSystemMetrics" function. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleScreenBufferSize", - SetLastError = true - )] - public static extern bool SetConsoleScreenBufferSize( - [In] IntPtr hConsoleOutput, - [In] Coordinate dwSize - ); - - #endregion - - // @ - - #region SetConsoleTextAttribute => bool - - /// - /// Sets the attributes of characters written to the console screen buffer by the - /// "WriteFile" or "WriteConsole" function, or echoed by the "ReadFile" or "ReadConsole" - /// function. This function affects text written after the function call. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// The character attributes. This member can be zero or a combination of - /// values ​​from the "CharacterAttributes" enumeration. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleTextAttribute", - SetLastError = true - )] - public static extern bool SetConsoleTextAttribute( - [In] IntPtr hConsoleOutput, - [In] CharacterAttributes wAttributes - ); - - #endregion - - // @ - - #region SetConsoleTitle (Unicode - LPWStr) => bool - - /// - /// Sets the title for the current console window. - /// - /// - /// - /// The string to be displayed in the title bar of the console window. The total size - /// must be less than 64K. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleTitle", - CharSet = CharSet.Unicode, - SetLastError = true - )] - public static extern bool SetConsoleTitle( - [In, MarshalAs(UnmanagedType.LPWStr)] StringBuilder lpConsoleTitle - ); - - #endregion - - // @ - - #region SetConsoleWindowInfo => bool - - /// - /// Sets the current size and position of a console screen buffer's window. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericRead" - /// access right. - /// - /// - /// - /// If this parameter is "TRUE", the coordinates specify the new upper-left and - /// lower-right corners of the window. If it is "FALSE", the coordinates are relative - /// to the current window-corner coordinates. - /// - /// - /// - /// A pointer to a "SmallRectangle" structure that specifies the new upper-left and - /// lower-right corners of the window. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetConsoleWindowInfo", - SetLastError = true - )] - public static extern bool SetConsoleWindowInfo( - [In] IntPtr hConsoleOutput, - [In] bool bAbsolute, - [In] ref SmallRectangle lpConsoleWindow - ); - - #endregion - - // @ - - #region SetCurrentConsoleFontEx => bool - - /// - /// Sets extended information about the current console font. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericWrite" - /// access right. - /// - /// - /// - /// If this parameter is "TRUE", font information is set for the maximum window size. - /// If this parameter is "FALSE", font information is set for the current window size. - /// - /// - /// - /// A pointer to a "ConsoleFontInformationExtended" structure that contains the font - /// information. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetCurrentConsoleFontEx", - SetLastError = true - )] - public static extern bool SetCurrentConsoleFontEx( - [In] IntPtr hConsoleOutput, - [In] bool bMaximumWindow, - [In] ref ConsoleFontInformationExtended lpConsoleCurrentFontEx - ); - - #endregion - - // @ - - #region SetStdHandle => bool - - /// - /// Sets the handle for the specified standard device (standard input, standard output, - /// or standard error). - /// - /// - /// - /// The standard device for which the handle is to be set. This parameter can be set by - /// one of the values ​​in the "ConsoleStandardDevice" enumeration. - /// - /// - /// - /// The handle for the standard device. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "SetStdHandle", - SetLastError = true - )] - public static extern bool SetStdHandle( - [In] ConsoleStandardDevice nStdHandle, - [In] IntPtr hHandle - ); - - #endregion - - // @ - - #region WriteConsole (Unicode or ANSI - LPTStr) => bool - - /// - /// Writes a character string to a console screen buffer beginning at the current - /// cursor location. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericWrite" - /// access right. - /// - /// - /// - /// A pointer to a buffer that contains characters to be written to the console - /// screen buffer. - /// - /// - /// - /// The number of characters to be written. If the total size of the specified number - /// of characters exceeds the available heap, the function fails with - /// "ERROR_NOT_ENOUGH_MEMORY (8)". - /// - /// - /// - /// A pointer to a variable that receives the number of characters actually written. - /// - /// - /// - /// Reserved. Must be "NULL". - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "WriteConsole", - CharSet = CharSet.Auto, - SetLastError = true - )] - public static extern bool WriteConsole( - [In] IntPtr hConsoleOutput, - [In, MarshalAs(UnmanagedType.LPTStr)] ref StringBuilder lpBuffer, - [In] uint nNumberOfCharsToWrite, - [Out] out uint lpNumberOfCharsWritten, - [In] IntPtr lpReserved = default - ); - - #endregion - - // @ - - #region WriteConsoleInput => bool - - /// - /// Writes data directly to the console input buffer. - /// - /// - /// - /// A handle to the console input buffer. The handle must have the "GenericWrite" - /// access right. - /// - /// - /// - /// A pointer to an array of "InputRecord" structures that contain data to be written - /// to the input buffer. - /// - /// - /// - /// The number of input records to be written. - /// - /// - /// - /// A pointer to a variable that receives the number of input records actually written. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "WriteConsoleInput", - SetLastError = true - )] - public static extern bool WriteConsoleInput( - [In] IntPtr hConsoleInput, - [In] ref InputRecord lpBuffer, - [In] uint nLength, - [Out] out uint lpNumberOfEventsWritten - ); - - #endregion - - // @ - - #region WriteConsoleOutput => bool - - /// - /// Writes character and color attribute data to a specified rectangular block of - /// character cells in a console screen buffer. The data to be written is taken from a - /// correspondingly sized rectangular block at a specified location in the source buffer. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericWrite" - /// access right. - /// - /// - /// - /// The data to be written to the console screen buffer. This pointer is treated as the - /// origin of a two-dimensional array of "CharacterInformation" structures whose size is specified - /// by the "dwBufferSize" parameter. - /// - /// - /// - /// The size of the buffer pointed to by the "lpBuffer" parameter, in character cells. - /// The "X" member of the "Coordinate" structure is the number of columns; the "Y" member - /// is the number of rows. - /// - /// - /// - /// The coordinates of the upper-left cell in the buffer pointed to by the "lpBuffer" - /// parameter. The "X" member of the "Coordinate" structure is the column, and the "Y" - /// member is the row. - /// - /// - /// - /// A pointer to a "SmallRectangle" structure. On input, the structure members specify the - /// upper-left and lower-right coordinates of the console screen buffer rectangle to - /// write to. On output, the structure members specify the actual rectangle that was used. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "WriteConsoleOutput", - SetLastError = true - )] - public static extern bool WriteConsoleOutput( - [In] IntPtr hConsoleOutput, - [In] ref CharacterInformation[] lpBuffer, - [In] Coordinate dwBufferSize, - [In] Coordinate dwBufferCoord, - [In, Out] ref SmallRectangle lpWriteRegion - ); - - #endregion - - // @ - - #region WriteConsoleOutputAttribute => bool - - /// - /// Copies a number of character attributes to consecutive cells of a console screen - /// buffer, beginning at a specified location. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericWrite" - /// access right. - /// - /// - /// - /// The attributes to be used when writing to the console screen buffer. This member - /// can be zero or a combination of values ​​from the "CharacterAttributes" enumeration. - /// - /// - /// - /// The number of screen buffer character cells to which the attributes will be copied. - /// - /// - /// - /// A "Coordinate" structure that specifies the character coordinates of the first cell in - /// the console screen buffer to which the attributes will be written. - /// - /// - /// - /// A pointer to a variable that receives the number of attributes actually written to - /// the console screen buffer. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "WriteConsoleOutputAttribute", - SetLastError = true - )] - public static extern bool WriteConsoleOutputAttribute( - [In] IntPtr hConsoleOutput, - [In] ref CharacterAttributes lpAttribute, - [In] uint Length, - [In] Coordinate dwWriteCoord, - [Out] out uint lpNumberOfAttrsWritten - ); - - #endregion - - // @ - - #region WriteConsoleOutputCharacter => bool - - /// - /// Copies a number of characters to consecutive cells of a console screen buffer, - /// beginning at a specified location. - /// - /// - /// - /// A handle to the console screen buffer. The handle must have the "GenericWrite" - /// access right. - /// - /// - /// - /// The characters to be written to the console screen buffer. - /// - /// - /// - /// The number of characters to be written. - /// - /// - /// - /// A "Coordinate" structure that specifies the character coordinates of the first cell in - /// the console screen buffer to which characters will be written. - /// - /// - /// - /// A pointer to a variable that receives the number of characters actually written. - /// - /// - /// - /// If the function succeeds, the return value is nonzero. If the function fails, the - /// return value is zero. To get extended error information, call "GetLastError". - /// - [DllImport( - DLL_NAME, - EntryPoint = "WriteConsoleOutputCharacter", - CharSet = CharSet.Auto, - SetLastError = true - )] - public static extern bool WriteConsoleOutputCharacter( - [In] IntPtr hConsoleOutput, - [In, MarshalAs(UnmanagedType.LPTStr)] StringBuilder lpCharacter, - [In] uint nLength, - [In] Coordinate dwWriteCoord, - [Out] out uint lpNumberOfCharsWritten - ); - - #endregion - } -} diff --git a/pack.bat b/pack.bat index 0af915c..7610f83 100644 --- a/pack.bat +++ b/pack.bat @@ -6,8 +6,8 @@ where /q dotnet if %errorlevel% neq 0 ( echo Error: The "dotnet" tool was not detected! - echo Recommendation: Download online at https://dotnet.microsoft.com/pt-br/download/dotnet-framework - echo Alternative: Install with Winget using 'winget install Microsoft.DotNet.SDK.8' + echo Recommendation: Download it online at https://dotnet.microsoft.com/pt-br/download/dotnet-framework + echo Alternative: Install it with Winget using 'winget install Microsoft.DotNet.SDK.8' exit ) else ( echo Success: The "dotnet" tool has been detected! @@ -18,8 +18,8 @@ where /q curl if %errorlevel% neq 0 ( echo Error: The "curl" tool was not detected! - echo Recommendation: Download online at https://curl.se/download.html - echo Alternative: Install with Winget using 'winget install --id=cURL.cURL -e' + echo Recommendation: Download it online at https://curl.se/download.html + echo Alternative: Install it with Winget using 'winget install --id=cURL.cURL -e' exit ) else ( echo Success: The "curl" tool has been detected! @@ -28,16 +28,16 @@ if %errorlevel% neq 0 ( rem Compile the project cls echo Commencing compilation... -dotnet build "ThirtyTwo" -c Release +dotnet build "Source" -c Release rem Download NuGet.exe cls echo Initiating the NuGet CLI download... -if not exist ".\NuGet\nuget.exe" ( - curl -o "NuGet\nuget.exe" "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" +if not exist ".\Package\nuget.exe" ( + curl -o "Package\nuget.exe" "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" ) -cd .\NuGet +cd .\Package .\nuget.exe pack rem Cleaning @@ -51,4 +51,4 @@ if exist .\nuget.exe ( rem Completion cls echo The library has been packaged successfully! -cd ..\ \ No newline at end of file +cd ..