mirror of
https://github.com/microsoft/terminal.git
synced 2026-05-07 06:03:21 -04:00
add clang-format conf to the project, format the c++ code (#1141)
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#include "ApiMessage.h"
|
||||
#include "DeviceComm.h"
|
||||
|
||||
_CONSOLE_API_MSG::_CONSOLE_API_MSG() :
|
||||
_CONSOLE_API_MSG::_CONSOLE_API_MSG() :
|
||||
_pDeviceComm(nullptr),
|
||||
_pApiRoutines(nullptr)
|
||||
{
|
||||
@@ -33,10 +33,9 @@ ConsoleHandleData* _CONSOLE_API_MSG::GetObjectHandle() const
|
||||
// - cbSize - Supplies the number of bytes to be read into the buffer.
|
||||
// Return Value:
|
||||
// - HRESULT indicating if the payload was successfully read.
|
||||
[[nodiscard]]
|
||||
HRESULT _CONSOLE_API_MSG::ReadMessageInput(const ULONG cbOffset,
|
||||
_Out_writes_bytes_(cbSize) PVOID pvBuffer,
|
||||
const ULONG cbSize)
|
||||
[[nodiscard]] HRESULT _CONSOLE_API_MSG::ReadMessageInput(const ULONG cbOffset,
|
||||
_Out_writes_bytes_(cbSize) PVOID pvBuffer,
|
||||
const ULONG cbSize)
|
||||
{
|
||||
CD_IO_OPERATION IoOperation;
|
||||
IoOperation.Identifier = Descriptor.Identifier;
|
||||
@@ -56,9 +55,8 @@ HRESULT _CONSOLE_API_MSG::ReadMessageInput(const ULONG cbOffset,
|
||||
// - Size - Receives the size, in bytes, of the input buffer.
|
||||
// Return Value:
|
||||
// - HRESULT indicating if the input buffer was successfully retrieved.
|
||||
[[nodiscard]]
|
||||
HRESULT _CONSOLE_API_MSG::GetInputBuffer(_Outptr_result_bytebuffer_(*pcbSize) void** const ppvBuffer,
|
||||
_Out_ ULONG* const pcbSize)
|
||||
[[nodiscard]] HRESULT _CONSOLE_API_MSG::GetInputBuffer(_Outptr_result_bytebuffer_(*pcbSize) void** const ppvBuffer,
|
||||
_Out_ ULONG* const pcbSize)
|
||||
{
|
||||
// Initialize the buffer if it hasn't been initialized yet.
|
||||
if (State.InputBuffer == nullptr)
|
||||
@@ -93,10 +91,9 @@ HRESULT _CONSOLE_API_MSG::GetInputBuffer(_Outptr_result_bytebuffer_(*pcbSize) vo
|
||||
// - Size - Receives the size, in bytes, of the output buffer.
|
||||
// Return Value:
|
||||
// - HRESULT indicating if the output buffer was successfully retrieved.
|
||||
[[nodiscard]]
|
||||
HRESULT _CONSOLE_API_MSG::GetAugmentedOutputBuffer(const ULONG cbFactor,
|
||||
_Outptr_result_bytebuffer_(*pcbSize) PVOID * const ppvBuffer,
|
||||
_Out_ PULONG pcbSize)
|
||||
[[nodiscard]] HRESULT _CONSOLE_API_MSG::GetAugmentedOutputBuffer(const ULONG cbFactor,
|
||||
_Outptr_result_bytebuffer_(*pcbSize) PVOID* const ppvBuffer,
|
||||
_Out_ PULONG pcbSize)
|
||||
{
|
||||
// Initialize the buffer if it hasn't been initialized yet.
|
||||
if (State.OutputBuffer == nullptr)
|
||||
@@ -106,7 +103,7 @@ HRESULT _CONSOLE_API_MSG::GetAugmentedOutputBuffer(const ULONG cbFactor,
|
||||
ULONG cbWriteSize = Descriptor.OutputSize - State.WriteOffset;
|
||||
RETURN_IF_FAILED(ULongMult(cbWriteSize, cbFactor, &cbWriteSize));
|
||||
|
||||
BYTE* pPayload = new(std::nothrow) BYTE[cbWriteSize];
|
||||
BYTE* pPayload = new (std::nothrow) BYTE[cbWriteSize];
|
||||
RETURN_IF_NULL_ALLOC(pPayload);
|
||||
ZeroMemory(pPayload, sizeof(BYTE) * cbWriteSize);
|
||||
|
||||
@@ -130,9 +127,8 @@ HRESULT _CONSOLE_API_MSG::GetAugmentedOutputBuffer(const ULONG cbFactor,
|
||||
// - Size - Receives the size, in bytes, of the output buffer.
|
||||
// Return Value:
|
||||
// - HRESULT indicating if the output buffer was successfully retrieved.
|
||||
[[nodiscard]]
|
||||
HRESULT _CONSOLE_API_MSG::GetOutputBuffer(_Outptr_result_bytebuffer_(*pcbSize) void** const ppvBuffer,
|
||||
_Out_ ULONG * const pcbSize)
|
||||
[[nodiscard]] HRESULT _CONSOLE_API_MSG::GetOutputBuffer(_Outptr_result_bytebuffer_(*pcbSize) void** const ppvBuffer,
|
||||
_Out_ ULONG* const pcbSize)
|
||||
{
|
||||
return GetAugmentedOutputBuffer(1, ppvBuffer, pcbSize);
|
||||
}
|
||||
@@ -146,8 +142,7 @@ HRESULT _CONSOLE_API_MSG::GetOutputBuffer(_Outptr_result_bytebuffer_(*pcbSize) v
|
||||
// - <none>
|
||||
// Return Value:
|
||||
// - HRESULT indicating if the payload was successfully written if applicable.
|
||||
[[nodiscard]]
|
||||
HRESULT _CONSOLE_API_MSG::ReleaseMessageBuffers()
|
||||
[[nodiscard]] HRESULT _CONSOLE_API_MSG::ReleaseMessageBuffers()
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user