- 
                Notifications
    
You must be signed in to change notification settings  - Fork 583
 
          Add dedicated windows-enclaves crate
          #3788
        
          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
        
          
                crates/libs/windows/src/Windows/Win32/System/Environment/mod.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | 
           I have excluded all Enclave functions exported by  
 
 
 
 It seems these should all just be loaded from   | 
    
| 
           Not all those APIs are implemented in   | 
    
| 
           Sigh, it looks like various Enclave APIs intended to be called from outside of the Enclave are not exclusively exported from   | 
    
          
 It should only be that  Is the metadata not what the microsoft learn pages are generated from? Is there somewhere else I should just get the metadata updated so that the   | 
    
          
 Sadly not yet. Hopefully we get to the point of having canonical metadata in future. https://github.com/microsoft/windows-rs/tree/master/crates/libs/bindgen/default https://kennykerr.ca/rust-getting-started/how-are-crates-built.html  | 
    
| } | ||
| } | ||
| pub type HANDLE = *mut core::ffi::c_void; | ||
| pub type HEAP_FLAGS = u32; | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be nice if the constants for HEAP_FLAGS and other enum/integer + #define style types ended up in here as well, like how it works here
| 
           Closing for now. Happy to keep chatting about this and help you guys get an Enclaves crate published. It looks like you have a few repos like VbsEnclaveTooling and vbs-enclave-rs to potentially host this and own it outright, which probably makes the most sense since I don't know the first thing about how to test and support Enclaves.  | 
    
The Win32 metadata includes some support for Windows virtualization-based security enclaves but these APIs are a little tricky because you need to import the APIs from a different system library depending on whether you are inside or outside of the enclave. This update thus does the following:
kernel32.dllfor crates likewindowsandwindows-sys.windows-enclavescrate that provides dedicated bindings for use within an enclave where all of the functions provided by this crate are specifically imported fromvertdll.dll.I'm opening this PR for testing and validation as I am not too familiar with enclaves. Hopefully this will help make using enclaves easier from Rust.