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.
Finished a project where I needed to decode NDR data with x64 bit pointer sizes. Most of the alignment issues could be fixed by consuming irrelevant data from the stream, however, peeking at the data makes things much more efficient and reliable, which explains the PeekBuffer method. This method reads the given length from the stream and puts the position back to where it was.
Another issue was when reading and aligning 64bit data, the size of a property within a struct was put on the _conformancevalues array, but was never read and removed from the stack afterwards. This caused issues when putting new items on the stack, since it performs a check if the stack is empty or not, skipping adding routine if the stack is not empty.
Added two methods: