-
Notifications
You must be signed in to change notification settings - Fork 142
Correct close function for FwpmEngineOpen0 handle
#2185
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
Conversation
|
For handles that have domain-specific close functions, we generally follow this pattern to make sure that all projects can reliably generate proper safehandles. See https://github.com/microsoft/win32metadata/pull/2134/files for examples. CC @riverar |
|
Can you please elaborate where is the destinction line? I've come to my original solution by searching for Where can I find invalid values for a handle? In linked PR you declare a domain-specific handle for function, which clearly says in the docs that if function fails What does |
|
I don't think any of the current projections (C#, Rust) do anything with RAIIFree attributes on method parameters. Instead, we need to specialize the HANDLE (artificially) for this API. To do so, edit {
"Name": "FWPM_ENGINE_HANDLE_0",
"ValueType": "void*",
"CloseApi": "FwpmEngineClose0",
"InvalidHandleValues": [ -1, 0 ],
"NativeTypedef": false // This indicates whether this was a real typedef in headers
// or an artificial one we created for metadata purposes
},Then edit Be sure to pay close attention to _0 _1 and _2 APIs if you come across them. The APIs span multiple OS targets and must remain separate. |
|
@jevansaks @riverar PTAL |
|
Reviewing this with fresh eyes, I'm torn whether Looks good otherwise. |
|
Currently all functions accept the same handle since there is only on |
|
Agree with using the simpler name. |
Fixes: #2172