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

Enable ProcessStrictHandleCheckPolicy on Windows #3

Open
nakst opened this issue Aug 11, 2022 · 2 comments
Open

Enable ProcessStrictHandleCheckPolicy on Windows #3

nakst opened this issue Aug 11, 2022 · 2 comments

Comments

@nakst
Copy link

nakst commented Aug 11, 2022

On Windows, ProcessStrictHandleCheckPolicy can be enabled with SetProcessMitigationPolicy to check that the plugin does not misuse HANDLEs in the Win32 API. This is not specific to CLAP, but I think it is a nice-to-have in a plugin validator nonetheless.

@robbert-vdh
Copy link
Member

What does this do exactly? Microsoft's documentation doesn't specify what 'manipulating a handle that is not valid' entails. Does that mean that calling, say, CloseHandle on a handle that has already been closed or a null pointer would SIGABRT instead of returning false? I've never seen other applications (or other validators) use this, so I'm not quite sure what the use case is.

@nakst
Copy link
Author

nakst commented Aug 18, 2022

Does that mean that calling, say, CloseHandle on a handle that has already been closed or a null pointer would SIGABRT instead of returning false?

Yes, this is the general idea.

In the context of a multithreaded DAW with plugins, I think it is important to ensure that plugins do not have bugs of this form, since misuse of a handle by a plugin could affect the host itself as well as other plugins, resulting in e.g. file data corruption.

I've never seen other applications use this

I believe Windows enables it by default for all UWP applications.

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

No branches or pull requests

2 participants