73 if (GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biHeight > 0)
74 GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biHeight = -GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biHeight;
77 if (GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biCompression !=
BI_RGB)
79 DPRINT1(
"biCompression == %d != BI_RGB, fix that!\n",
80 GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biCompression);
81 GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biCompression =
BI_RGB;
85 GraphicsInfo->Info.lpBitMapInfo,
86 GraphicsInfo->Info.dwBitMapInfoLength);
88 NewBuffer->
BitMapUsage = GraphicsInfo->Info.dwUsage;
91 if ( GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biWidth <= 0xFFFF &&
92 -GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biHeight <= 0xFFFF )
95 NewBuffer->ScreenBufferSize.X = (
SHORT)GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biWidth ;
96 NewBuffer->ScreenBufferSize.Y = (
SHORT)-GraphicsInfo->Info.lpBitMapInfo->bmiHeader.biHeight;
98 NewBuffer->OldViewSize = NewBuffer->ViewSize =
99 NewBuffer->OldScreenBufferSize = NewBuffer->ScreenBufferSize;
153 DPRINT1(
"Error: Impossible to create a shared section, Status = 0x%08lx\n",
Status);
179 DPRINT1(
"Error: Impossible to map the shared section, Status = 0x%08lx\n",
Status);
207 DPRINT1(
"Error: Impossible to map the shared section, Status = 0x%08lx\n",
Status);
218 NewBuffer->ViewOrigin.X = NewBuffer->ViewOrigin.Y = 0;
220 NewBuffer->CursorBlinkOn =
FALSE;
221 NewBuffer->ForceCursorOff =
TRUE;
222 NewBuffer->CursorInfo.bVisible =
FALSE;
223 NewBuffer->CursorInfo.dwSize = 0;
224 NewBuffer->CursorPosition.X = NewBuffer->CursorPosition.Y = 0;
NTSTATUS NTAPI NtUnmapViewOfSection(IN HANDLE ProcessHandle, IN PVOID BaseAddress)
NTSTATUS NTAPI NtCreateSection(OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN PLARGE_INTEGER MaximumSize OPTIONAL, IN ULONG SectionPageProtection OPTIONAL, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL)
NTSTATUS NTAPI NtMapViewOfSection(IN HANDLE SectionHandle, IN HANDLE ProcessHandle, IN OUT PVOID *BaseAddress, IN ULONG_PTR ZeroBits, IN SIZE_T CommitSize, IN OUT PLARGE_INTEGER SectionOffset OPTIONAL, IN OUT PSIZE_T ViewSize, IN SECTION_INHERIT InheritDisposition, IN ULONG AllocationType, IN ULONG Protect)
#define NT_SUCCESS(StatCode)
NTSTATUS NTAPI NtCreateMutant(OUT PHANDLE MutantHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN BOOLEAN InitialOwner)
#define MUTANT_ALL_ACCESS
_In_ HANDLE ProcessHandle
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T _Inout_opt_ PLARGE_INTEGER _Inout_ PSIZE_T ViewSize
#define SECTION_ALL_ACCESS
#define NtCurrentProcess()
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
NTSTATUS NTAPI NtDuplicateObject(IN HANDLE SourceProcessHandle, IN HANDLE SourceHandle, IN HANDLE TargetProcessHandle OPTIONAL, OUT PHANDLE TargetHandle OPTIONAL, IN ACCESS_MASK DesiredAccess, IN ULONG HandleAttributes, IN ULONG Options)
BITMAPINFOHEADER bmiHeader
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
VOID GRAPHICS_BUFFER_Destroy(IN OUT PCONSOLE_SCREEN_BUFFER Buffer)
NTSTATUS GRAPHICS_BUFFER_Initialize(OUT PCONSOLE_SCREEN_BUFFER *Buffer, IN PCONSOLE Console, IN HANDLE ProcessHandle, IN PGRAPHICS_BUFFER_INFO GraphicsInfo)
VOID CONSOLE_SCREEN_BUFFER_Destroy(IN OUT PCONSOLE_SCREEN_BUFFER Buffer)
NTSTATUS CONSOLE_SCREEN_BUFFER_Initialize(OUT PCONSOLE_SCREEN_BUFFER *Buffer, IN PCONSOLE Console, IN CONSOLE_IO_OBJECT_TYPE Type, IN SIZE_T Size)
#define ConsoleAllocHeap(Flags, Size)
#define ConsoleFreeHeap(HeapBase)
enum _CONSOLE_IO_OBJECT_TYPE CONSOLE_IO_OBJECT_TYPE
struct _CONSOLE_SCREEN_BUFFER * PCONSOLE_SCREEN_BUFFER
struct _GRAPHICS_SCREEN_BUFFER * PGRAPHICS_SCREEN_BUFFER
#define DUPLICATE_SAME_ACCESS
#define DUPLICATE_CLOSE_SOURCE