Skip to content

Conversation

@jevansaks
Copy link
Member

To make it easier to transition to Span overloads, this PR adds the option to opt in to pointer overloads. With this option things like DeviceIoControl will generate Span versions as well as pointer versions. And APIs like NtQueryObject which also have optional parameters will have 4 overloads (ones with and without optional parameters), e.g.:

NTSTATUS NtQueryObject(HANDLE Handle, OBJECT_INFORMATION_CLASS ObjectInformationClass, Span<byte> ObjectInformation, out uint ReturnLength)

NTSTATUS NtQueryObject(HANDLE Handle, OBJECT_INFORMATION_CLASS ObjectInformationClass, Span<byte> ObjectInformation)

NTSTATUS NtQueryObject(HANDLE Handle, OBJECT_INFORMATION_CLASS ObjectInformationClass, void* ObjectInformation, uint ObjectInformationLength, out uint ReturnLength)

NTSTATUS NtQueryObject(HANDLE Handle, OBJECT_INFORMATION_CLASS ObjectInformationClass, void* ObjectInformation, uint ObjectInformationLength)

Fixes #1519

@jevansaks jevansaks requested a review from manodasanW November 4, 2025 00:27
@jevansaks jevansaks changed the title Add an option to FriendlyOverloads to request PointerOverloadsToo Add an option to FriendlyOverloads to request previous pointer overloads Nov 4, 2025
@jevansaks jevansaks merged commit 6450f6b into main Nov 4, 2025
7 checks passed
@jevansaks jevansaks deleted the user/jevansaks/pointeroverloadstoo branch November 4, 2025 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generate SafeHandle overloads for non-Span methods

3 participants