This repository has been archived by the owner on May 25, 2022. It is now read-only.
Fix for Windows Event Log operator in Windows Server 2022 #283
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a port of this fix from Stanza: observIQ/stanza#456
TL;DR of the issue:
The API for EvtFormatMessage returns number of characters written to the buffer, and each character is the Windows WCHAR type, which is 2 bytes. It seems like previous versions of Windows returned a much larger size back (greater than 2x) for how many characters it had written to the provided buffer, but with Windows Server 2022 we are seeing it return the correct value, leading to try to only parse half of the returned XML.
Resolves #284