Closed syjzwjj closed 1 week ago
Hi,
Thank you for the Pull request. Unfortunately, I will not merge your PR as-is. My choice of using P
(or 0x50) as the padding value is a deliberate and considered choice from me. Indeed, this allows me to easily make the difference between chose NULL values & parameters VS bytes which are exclusively here for automatic padding. These bytes being padding, they are ignored and the choice of 0x50 should not have any impact on the receiving end. Thus I would not consider it a bug.
If you want, I would be open to a PR that allow choosing/setting the padding bytes used by ndr.py
. as a parameter.
NdrWriteStream object use to marshall data to the memory, however, there's a problem when do alignment. Let' see the rpc interface idl below:
The code we reach the interface:
We observed the server side argument memory:
Althougth the data successful passed to the serverside with no unmarshall error, the padding data
P
cause confusion for me when I do rpc research, especially when it these simple type stored into structure. Hope this patch can fix this problem, thanks!