Files
terminal/src/interactivity/onecore/ConsoleControl.cpp
Leonard Hecker eb5c26cc69 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.
2022-05-04 00:49:43 +00:00

42 lines
1.1 KiB
C++

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "precomp.h"
#include "ConsoleControl.hpp"
#include <ntcsrdll.h>
#include <csrmsg.h>
using namespace Microsoft::Console::Interactivity::OneCore;
#pragma region IConsoleControl Members
[[nodiscard]] NTSTATUS ConsoleControl::NotifyConsoleApplication(_In_ DWORD /*dwProcessId*/) noexcept
{
return STATUS_SUCCESS;
}
[[nodiscard]] NTSTATUS ConsoleControl::SetForeground(_In_ HANDLE /*hProcess*/, _In_ BOOL /*fForeground*/) noexcept
{
return STATUS_SUCCESS;
}
[[nodiscard]] NTSTATUS ConsoleControl::EndTask(_In_ HANDLE hProcessId, _In_ DWORD dwEventType, _In_ ULONG ulCtrlFlags)
{
USER_API_MSG m{};
const auto a = &m.u.EndTask;
RtlZeroMemory(a, sizeof(*a));
a->ProcessId = hProcessId;
a->ConsoleEventCode = dwEventType;
a->ConsoleFlags = ulCtrlFlags;
return CsrClientCallServer(reinterpret_cast<PCSR_API_MSG>(&m),
nullptr,
CSR_MAKE_API_NUMBER(USERSRV_SERVERDLL_INDEX, UserpEndTask),
sizeof(*a));
}
#pragma endregion