Skip to content

Instantly share code, notes, and snippets.

@kant2002
Created March 23, 2020 21:39
Show Gist options
  • Save kant2002/fc41e61d711eade16180e124ef73e3b6 to your computer and use it in GitHub Desktop.
Save kant2002/fc41e61d711eade16180e124ef73e3b6 to your computer and use it in GitHub Desktop.
How to wrap UEFI functions
[StructLayout(LayoutKind.Sequential)]
public unsafe readonly struct EFI_SIMPLE_TEXT_INPUT_PROTOCOL
{
private readonly IntPtr _reset;
private readonly IntPtr _readKeyStroke;
public readonly IntPtr WaitForKey;
public void Reset(void* handle, bool ExtendedVerification)
{
RawCalliHelper.StdCall(_reset, (byte*)handle, ExtendedVerification);
}
public ulong ReadKeyStroke(void* handle, EFI_INPUT_KEY* Key)
{
return RawCalliHelper.StdCall(_readKeyStroke, (byte*)handle, Key);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment