-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optional out params should (sometimes?) get an out
modifier on friendly overloads
#107
Comments
The reason no I'm not sure though how to distinguish between the cases where it really should be optional and where it really should be mandatory even though the docs indicate it is optional. I'll leave this issue open to track. |
out uint
overloadout
modifier on friendly overloads
What is the reason not to provide both the friendly overload and the optional pointer overload? |
We may do just that. The reason I hesitate is because today the friendly overload (when there is one) applies even when the out parameter should be NULL. If we change it to use an |
Just clocked this. The return value is the thread ID, so I can envision not caring about the |
Oh, I hadn't noticed that. Well... interesting then. |
If I knew the HWND is my own I'd only be interested in the thread ID and pass NULL for the process id argument in a C++ program. Not sure if its worth the distinction for this particular API (i.e. if it has any observable gain, in C++ it saves you from allocating a stack variable). Most optional outputs are optional for a reason though, so I'm not sure if there is any point teaching the mappings to override that. If its important to your own coude you probably could easily make an extension method and I'd assume it to be inlined by the JIT in most cases? |
At the moment, @weltkante, I'm mostly interested in exploring the broad codegen policies to make most APIs work well. After that, we may consider touch-ups to individual APIs if they are popular and high value enough to do the work in the generator. I learned more about how to do optional |
Add support for TargetFrameworks of the form netXX
Expected:
uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowthreadprocessid
The text was updated successfully, but these errors were encountered: