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

Support for using WIL from inside an Enclave #460

Open
jonwis opened this issue Aug 8, 2024 · 2 comments
Open

Support for using WIL from inside an Enclave #460

jonwis opened this issue Aug 8, 2024 · 2 comments
Assignees
Labels
feature-request New feature or request

Comments

@jonwis
Copy link
Member

jonwis commented Aug 8, 2024

https://learn.microsoft.com/windows/win32/trusted-execution/enclaves support a restricted subset of the Win32 API surface. Methods like FormatMessageW and LoadLibraryW and GetModuleHandle are not directly supported. These are used by WIL for various purposes including error reporting.

Provide a control flag to either set "WIL for enclaves" mode (similar to the existing kernel mode flag) or provide configurability for the uses of those unsupported methods.

Consider adding helpers for things like more strongly typed CallEnclave operations as well, and a general-purpose wil::enclave type that wraps the create/init/getmethods helpers with a .call(...) method.

@jonwis jonwis added the feature-request New feature or request label Aug 8, 2024
@jonwis jonwis self-assigned this Aug 8, 2024
@jonwis
Copy link
Member Author

jonwis commented Aug 12, 2024

We've found that many WIL linker errors can be resolved by turning off static initializers:

#ifndef RESULT_SUPPRESS_STATIC_INITIALIZERS
#define RESULT_SUPPRESS_STATIC_INITIALIZERS
#endif

FormatMessageW is another to fix - THROW_IF_FAILED pulls in wil::ResultException whose ::what() uses FormatMessageW which is ... not in the Enclave API surface.

IsDebuggerPresent is another to fix. Probably used in the exception processing/logging path for a "break on error" experience.

@tusharchitti
Copy link
Contributor

I am starting to work on this, understanding what enclave and will share udpates soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants