Minor cleanups after #14745 (#14748)

#14745 removed the only user of `GetAugmentedOutputBuffer`.
This commit is contained in:
Leonard Hecker
2023-03-30 17:27:04 +02:00
committed by GitHub
parent 9514c1191a
commit da3a33f3bc
2 changed files with 4 additions and 25 deletions

View File

@@ -131,17 +131,15 @@ CATCH_RETURN();
// Routine Description:
// - This routine retrieves the output buffer associated with this message. It will allocate one if needed.
// The allocated will be bigger than the actual output size by the requested factor.
// - Before completing the message, ReleaseMessageBuffers must be called to free any allocation performed by this routine.
// Arguments:
// - Factor - Supplies the factor to multiply the allocated buffer by.
// - Message - Supplies the message whose output buffer will be retrieved.
// - Buffer - Receives a pointer to the output buffer.
// - Size - Receives the size, in bytes, of the output buffer.
// Return Value:
// 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::GetOutputBuffer(_Outptr_result_bytebuffer_(*pcbSize) void** const ppvBuffer,
_Out_ ULONG* const pcbSize)
try
{
// Initialize the buffer if it hasn't been initialized yet.
@@ -150,7 +148,6 @@ try
RETURN_HR_IF(E_FAIL, State.WriteOffset > Descriptor.OutputSize);
auto cbWriteSize = Descriptor.OutputSize - State.WriteOffset;
RETURN_IF_FAILED(ULongMult(cbWriteSize, cbFactor, &cbWriteSize));
// If we were previously called with a huge buffer we have an equally large _outputBuffer.
// We shouldn't just keep this huge buffer around, if no one needs it anymore.
@@ -176,21 +173,6 @@ try
}
CATCH_RETURN();
// Routine Description:
// - This routine retrieves the output buffer associated with this message. It will allocate one if needed.
// - Before completing the message, ReleaseMessageBuffers must be called to free any allocation performed by this routine.
// Arguments:
// - Message - Supplies the message whose output buffer will be retrieved.
// - Buffer - Receives a pointer to the output buffer.
// - 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)
{
return GetAugmentedOutputBuffer(1, ppvBuffer, pcbSize);
}
// Routine Description:
// - This routine releases output or input buffers that might have been allocated
// during the processing of the given message. If the current completion status

View File

@@ -41,9 +41,6 @@ typedef struct _CONSOLE_API_MSG
ConsoleHandleData* GetObjectHandle() const;
[[nodiscard]] HRESULT ReadMessageInput(const ULONG cbOffset, _Out_writes_bytes_(cbSize) PVOID pvBuffer, const ULONG cbSize);
[[nodiscard]] HRESULT GetAugmentedOutputBuffer(const ULONG cbFactor,
_Outptr_result_bytebuffer_(*pcbSize) PVOID* ppvBuffer,
_Out_ PULONG pcbSize);
[[nodiscard]] HRESULT GetOutputBuffer(_Outptr_result_bytebuffer_(*pcbSize) void** const ppvBuffer, _Out_ ULONG* const pcbSize);
[[nodiscard]] HRESULT GetInputBuffer(_Outptr_result_bytebuffer_(*pcbSize) void** const ppvBuffer, _Out_ ULONG* const pcbSize);