On Fri Sep 15 11:30:54 2023 +0000, Dmitry Timoshkov wrote:
I don't insist on anything, but only pointing at potential improvements.
I don't see how to avoid the checks in both A and W versions. If you have an idea how to do that please share it.
I was thinking something like that:
``` if (flags & FLAG_1) size = max(size, FIELDOFFSET(..) + ...); if (flags & FLAG_2) size = max(size, ...);
if (cbSize < size) { SetLastError(...); return; } ```
To make it easier to read you can use just FIELDOFFSET() of the next field.
I think it's fine to duplicate that for A and W functions, and avoid changing Rtl* one at all, as long as we don't provide compatible interface for it, nothing is going to call it successfully anyway.