Add InteractivityOneCore/RendererWddmCon projects (#13007)

`InteractivityOneCore` and `RendererWddmCon` were the last two remaining
projects which are relevant for our internal console builds, but couldn't be
easily compiled publicly by users on GitHub. This commit adds all definitions
required to compile the two projects into dysfunctional libraries at least.
(Since the added definitions are deliberately incorrect.)

Additionally this commit fixes the AuditMode build for the two projects.

## Validation Steps Performed
The two new projects compile fine.
This commit is contained in:
Leonard Hecker
2022-05-04 02:49:43 +02:00
committed by GitHub
parent 223af3a54a
commit eb5c26cc69
50 changed files with 930 additions and 535 deletions

76
dep/Console/ConIoSrv.h Normal file
View File

@@ -0,0 +1,76 @@
/*++
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
--*/
#pragma once
#include <ntlpcapi.h>
#define CIS_ALPC_PORT_NAME L""
#define CIS_EVENT_TYPE_INPUT (0)
#define CIS_EVENT_TYPE_FOCUS (1)
#define CIS_EVENT_TYPE_FOCUS_ACK (2)
#define CIS_MSG_TYPE_GETDISPLAYSIZE (3)
#define CIS_MSG_TYPE_GETFONTSIZE (4)
#define CIS_MSG_TYPE_SETCURSOR (5)
#define CIS_MSG_TYPE_UPDATEDISPLAY (6)
#define CIS_MSG_ATTR_FLAGS (0)
#define CIS_MSG_ATTR_BUFFER_SIZE (1024)
#define CIS_DISPLAY_MODE_NONE (0)
#define CIS_DISPLAY_MODE_BGFX (1)
#define CIS_DISPLAY_MODE_DIRECTX (2)
typedef struct {
PORT_MESSAGE AlpcHeader;
UCHAR Type;
union {
struct {
CD_IO_DISPLAY_SIZE DisplaySize;
NTSTATUS ReturnValue;
} GetDisplaySizeParams;
struct {
CD_IO_FONT_SIZE FontSize;
NTSTATUS ReturnValue;
} GetFontSizeParams;
struct {
CD_IO_CURSOR_INFORMATION CursorInformation;
NTSTATUS ReturnValue;
} SetCursorParams;
struct {
SHORT RowIndex;
NTSTATUS ReturnValue;
} UpdateDisplayParams;
struct {
USHORT DisplayMode;
} GetDisplayModeParams;
};
} CIS_MSG, *PCIS_MSG;
typedef struct {
UCHAR Type;
union {
struct {
INPUT_RECORD Record;
} InputEvent;
struct {
BOOLEAN IsActive;
} FocusEvent;
};
} CIS_EVENT, *PCIS_EVENT;

View File

@@ -158,8 +158,8 @@ typedef struct _CD_IO_DISPLAY_SIZE {
} CD_IO_DISPLAY_SIZE, *PCD_IO_DISPLAY_SIZE;
typedef struct _CD_IO_CHARACTER {
WCHAR Character;
USHORT Atribute;
WCHAR Character;
USHORT Attribute;
} CD_IO_CHARACTER, *PCD_IO_CHARACTER;
typedef struct _CD_IO_ROW_INFORMATION {
@@ -175,6 +175,11 @@ typedef struct _CD_IO_CURSOR_INFORMATION {
BOOLEAN IsVisible;
} CD_IO_CURSOR_INFORMATION, *PCD_IO_CURSOR_INFORMATION;
typedef struct _CD_IO_FONT_SIZE {
ULONG Width;
ULONG Height;
} CD_IO_FONT_SIZE, *PCD_IO_FONT_SIZE;
#define IOCTL_CONDRV_READ_IO \
CTL_CODE(FILE_DEVICE_CONSOLE, 1, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
@@ -213,3 +218,6 @@ typedef struct _CD_IO_CURSOR_INFORMATION {
#define IOCTL_CONDRV_LAUNCH_SERVER \
CTL_CODE(FILE_DEVICE_CONSOLE, 13, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_CONDRV_GET_FONT_SIZE \
CTL_CODE(FILE_DEVICE_CONSOLE, 14, METHOD_NEITHER, FILE_ANY_ACCESS)

24
dep/Console/csrmsg.h Normal file
View File

@@ -0,0 +1,24 @@
/*++
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
--*/
#pragma once
#include <ntcsrmsg.h>
typedef enum _USER_API_NUMBER {
UserpEndTask,
} USER_API_NUMBER, *PUSER_API_NUMBER;
typedef struct _ENDTASKMSG {
HANDLE ProcessId;
ULONG ConsoleEventCode;
ULONG ConsoleFlags;
} ENDTASKMSG, *PENDTASKMSG;
typedef struct _USER_API_MSG {
union {
ENDTASKMSG EndTask;
} u;
} USER_API_MSG, *PUSER_API_MSG;

15
dep/Console/ntcsrdll.h Normal file
View File

@@ -0,0 +1,15 @@
/*++
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
--*/
#pragma once
#include <ntcsrmsg.h>
NTSTATUS CsrClientCallServer(
PCSR_API_MSG m,
PCSR_CAPTURE_HEADER CaptureBuffer OPTIONAL,
ULONG ApiNumber,
ULONG ArgLength
);

16
dep/Console/ntcsrmsg.h Normal file
View File

@@ -0,0 +1,16 @@
/*++
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
--*/
#pragma once
#include <ntlpcapi.h>
typedef struct _CSR_CAPTURE_HEADER {
} CSR_CAPTURE_HEADER, *PCSR_CAPTURE_HEADER;
typedef struct _CSR_API_MSG {
} CSR_API_MSG, *PCSR_API_MSG;
#define CSR_MAKE_API_NUMBER(DllIndex, ApiIndex) 0

126
dep/Console/ntlpcapi.h Normal file
View File

@@ -0,0 +1,126 @@
/*++
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
--*/
#pragma once
#define OB_FILE_OBJECT_TYPE 1
typedef struct _PORT_MESSAGE {
union {
struct {
SHORT DataLength;
SHORT TotalLength;
} s1;
} u1;
union {
ULONG ZeroInit;
} u2;
union {
CLIENT_ID ClientId;
};
ULONG MessageId;
} PORT_MESSAGE, *PPORT_MESSAGE;
#define ALPC_MSGFLG_SYNC_REQUEST 0
#define ALPC_PORFLG_ACCEPT_DUP_HANDLES 1
#define ALPC_PORFLG_ACCEPT_INDIRECT_HANDLES 2
typedef struct _ALPC_DATA_VIEW_ATTR {
PVOID ViewBase;
SIZE_T ViewSize;
} ALPC_DATA_VIEW_ATTR, *PALPC_DATA_VIEW_ATTR;
typedef struct _ALPC_CONTEXT_ATTR {
} ALPC_CONTEXT_ATTR, *PALPC_CONTEXT_ATTR;
#define ALPC_INDIRECT_HANDLE_MAX 512
typedef struct _ALPC_HANDLE_ATTR {
union {
ULONG HandleCount;
};
} ALPC_HANDLE_ATTR, *PALPC_HANDLE_ATTR;
#define ALPC_FLG_MSG_DATAVIEW_ATTR 1
#define ALPC_FLG_MSG_HANDLE_ATTR 2
typedef struct _ALPC_MESSAGE_ATTRIBUTES {
} ALPC_MESSAGE_ATTRIBUTES, *PALPC_MESSAGE_ATTRIBUTES;
typedef struct _ALPC_PORT_ATTRIBUTES {
ULONG Flags;
SECURITY_QUALITY_OF_SERVICE SecurityQos;
SIZE_T MaxMessageLength;
SIZE_T MemoryBandwidth;
SIZE_T MaxPoolUsage;
SIZE_T MaxSectionSize;
SIZE_T MaxViewSize;
SIZE_T MaxTotalSectionSize;
ULONG DupObjectTypes;
#ifdef _WIN64
ULONG Reserved;
#endif
} ALPC_PORT_ATTRIBUTES, *PALPC_PORT_ATTRIBUTES;
typedef enum _ALPC_MESSAGE_INFORMATION_CLASS {
AlpcMessageHandleInformation
} ALPC_MESSAGE_INFORMATION_CLASS;
typedef struct _ALPC_MESSAGE_HANDLE_INFORMATION {
ULONG Index;
ULONG Handle;
} ALPC_MESSAGE_HANDLE_INFORMATION, *PALPC_MESSAGE_HANDLE_INFORMATION;
NTSTATUS AlpcInitializeMessageAttribute(
ULONG AttributeFlags,
PALPC_MESSAGE_ATTRIBUTES Buffer,
SIZE_T BufferSize,
PSIZE_T RequiredBufferSize
);
PVOID AlpcGetMessageAttribute(
PALPC_MESSAGE_ATTRIBUTES Buffer,
ULONG AttributeFlag
);
#define ALPC_GET_DATAVIEW_ATTRIBUTES(MsgAttr) \
((PALPC_DATA_VIEW_ATTR)AlpcGetMessageAttribute(MsgAttr, ALPC_FLG_MSG_DATAVIEW_ATTR))
#define ALPC_GET_HANDLE_ATTRIBUTES(MsgAttr) \
((PALPC_HANDLE_ATTR)AlpcGetMessageAttribute(MsgAttr, ALPC_FLG_MSG_HANDLE_ATTR))
NTSTATUS NtAlpcConnectPort(
PHANDLE PortHandle,
PUNICODE_STRING PortName,
POBJECT_ATTRIBUTES ObjectAttributes,
PALPC_PORT_ATTRIBUTES PortAttributes,
ULONG Flags,
PSID RequiredServerSid,
PPORT_MESSAGE ConnectionMessage,
PSIZE_T BufferLength,
PALPC_MESSAGE_ATTRIBUTES OutMessageAttributes,
PALPC_MESSAGE_ATTRIBUTES InMessageAttributes,
PLARGE_INTEGER Timeout
);
NTSTATUS NtAlpcSendWaitReceivePort(
HANDLE PortHandle,
ULONG Flags,
PPORT_MESSAGE SendMessage,
PALPC_MESSAGE_ATTRIBUTES SendMessageAttributes,
PPORT_MESSAGE ReceiveMessage,
PSIZE_T BufferLength,
PALPC_MESSAGE_ATTRIBUTES ReceiveMessageAttributes,
PLARGE_INTEGER Timeout
);
NTSTATUS NtAlpcQueryInformationMessage(
HANDLE PortHandle,
PPORT_MESSAGE PortMessage,
ALPC_MESSAGE_INFORMATION_CLASS MessageInformationClass,
PVOID MessageInformation,
ULONG Length,
PULONG ReturnLength
);