microsoft / microsoft/win32metadata

The friendly wrappers for `NtQueryInformationProcess()`/`NtQueryObject()`/`NtQuerySystemInformation()` should be `out uint ReturnLength`, not `ref`.

Open
#2,165 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
1.5k
Forks
149
Avg merge
5d 16h
Merged PRs (30d)
4

Description

## Actual behavior

These friendly overloads provide `ReturnLength` to the caller via a `ref uint` value, however the documentation clearly says its an out variable only.

## Expected behavior

Use `out` instead of `ref` to provide a nicer interface to the caller.

## Repro steps

1. `NativeMethods.txt` content:
```
NtQueryInformationProcess
NtQueryObject
NtQuerySystemInformation
```

2. `NativeMethods.json` content (if present): N/A

3. Any of your own code that should be shared? N/A

### Context

- CsWin32 version: 0.3.253
- Win32Metadata version (if explicitly set by project): N/A
- Target Framework: net472
- `LangVersion` (if explicitly set by project): N/A

Contributor guide

Open the contributing guide

Research direction

Start with the generated friendly overloads for NtQueryInformationProcess, NtQueryObject, and NtQuerySystemInformation, using the NativeMethods.txt entries as the reproduction input. Check the generated ReturnLength parameter declarations and verify that callers can supply an out uint value for all three APIs; done means the overloads use out consistently and generation still succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.