Open jonwis opened 3 months ago
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.
I am starting to work on this, understanding what enclave and will share udpates soon.
https://learn.microsoft.com/windows/win32/trusted-execution/enclaves support a restricted subset of the Win32 API surface. Methods like
FormatMessageW
andLoadLibraryW
andGetModuleHandle
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-purposewil::enclave
type that wraps the create/init/getmethods helpers with a.call(...)
method.