diff --git a/src/buffer/out/textBuffer.cpp b/src/buffer/out/textBuffer.cpp index afcda2c9261..fe305fd9394 100644 --- a/src/buffer/out/textBuffer.cpp +++ b/src/buffer/out/textBuffer.cpp @@ -281,9 +281,9 @@ bool TextBuffer::_AssertValidDoubleByteSequence(const DbcsAttribute dbcsAttribut // - false otherwise (out of memory) bool TextBuffer::_PrepareForDoubleByteSequence(const DbcsAttribute dbcsAttribute) { - // Assert the buffer state is ready for this character - // This function corrects most errors. If this is false, we had an uncorrectable one. - FAIL_FAST_IF(!(_AssertValidDoubleByteSequence(dbcsAttribute))); // Shouldn't be uncorrectable sequences unless something is very wrong. + // This function corrects most errors. If this is false, we had an uncorrectable one which + // older versions of conhost simply let pass by unflinching. + LOG_HR_IF(E_NOT_VALID_STATE, !(_AssertValidDoubleByteSequence(dbcsAttribute))); // Shouldn't be uncorrectable sequences unless something is very wrong. bool fSuccess = true; // Now compensate if we don't have enough space for the upcoming double byte sequence diff --git a/src/server/WaitBlock.cpp b/src/server/WaitBlock.cpp index 2aab0352ff9..a23cb52c055 100644 --- a/src/server/WaitBlock.cpp +++ b/src/server/WaitBlock.cpp @@ -15,8 +15,8 @@ // Routine Description: // - Initializes a ConsoleWaitBlock -// - ConsoleWaitBlocks will self-manage their position in their two queues. -// - They will push themselves into the tail and store the iterator for constant deletion time later. +// - ConsoleWaitBlocks will mostly self-manage their position in their two queues. +// - They will be pushed into the tail and the resulting iterator stored for constant deletion time later. // Arguments: // - pProcessQueue - The queue attached to the client process ID that requested this action // - pObjectQueue - The queue attached to the console object that will service the action when data arrives @@ -30,9 +30,6 @@ ConsoleWaitBlock::ConsoleWaitBlock(_In_ ConsoleWaitQueue* const pProcessQueue, _pObjectQueue(THROW_HR_IF_NULL(E_INVALIDARG, pObjectQueue)), _pWaiter(THROW_HR_IF_NULL(E_INVALIDARG, pWaiter)) { - _itProcessQueue = _pProcessQueue->_blocks.insert(_pProcessQueue->_blocks.end(), this); - _itObjectQueue = _pObjectQueue->_blocks.insert(_pObjectQueue->_blocks.end(), this); - _WaitReplyMessage = *pWaitReplyMessage; // We will write the original message back (with updated out parameters/payload) when the request is finally serviced. @@ -87,6 +84,10 @@ ConsoleWaitBlock::~ConsoleWaitBlock() pObjectQueue, pWaitReplyMessage, pWaiter); + + // Set the iterators on the wait block so that it can remove itself later. + pWaitBlock->_itProcessQueue = pProcessQueue->_blocks.insert(pProcessQueue->_blocks.end(), pWaitBlock); + pWaitBlock->_itObjectQueue = pObjectQueue->_blocks.insert(pObjectQueue->_blocks.end(), pWaitBlock); } catch (...) {