Skip to content
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

Handle release methods take HANDLE instead of their own typedef #275

Closed
AArnott opened this issue Feb 23, 2021 · 0 comments
Closed

Handle release methods take HANDLE instead of their own typedef #275

AArnott opened this issue Feb 23, 2021 · 0 comments
Labels
broken api An API is inaccurate and could lead to runtime failure

Comments

@AArnott
Copy link
Member

AArnott commented Feb 23, 2021

From the metadata:

[DllImport("ADVAPI32", ExactSpelling = true, SetLastError = true)]
public static extern BOOL CloseEventLog([In] HANDLE hEventLog);

[RAIIFree("CloseHandle")]
[NativeTypedef]
public struct HANDLE
{
	public IntPtr Value;
}

[RAIIFree("CloseEventLog")]
[NativeTypedef]
public struct EventLogHandle
{
	public IntPtr Value;
}

HANDLE is appropriately tagged as being closed via CloseHandle.
EventLogHandle should be closed with CloseEventLog.
So why does CloseEventLog take a HANDLE instead of an EventLogHandle?

Issue also appears:

  • LsaDeregisterLogonProcess similarly takes HANDLE instead of LsaHandle.
@AArnott AArnott added the broken api An API is inaccurate and could lead to runtime failure label Feb 23, 2021
@AArnott AArnott changed the title CloseEventLog takes HANDLE parameter instead of EventLogHandle Handle release methods take HANDLE instead of their own typedef Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broken api An API is inaccurate and could lead to runtime failure
Projects
None yet
Development

No branches or pull requests

1 participant