[SDK] Big update
Signed-off-by: Quinn Stephens <quinn@osmora.org>
This commit is contained in:
parent
e3f81a4c08
commit
5c52adf492
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -33,7 +33,7 @@ print_hex (
|
||||
n = 0;
|
||||
shift = 28;
|
||||
while (n < maxlen && shift >= 0) {
|
||||
x = (num >> shift) & 0xf;
|
||||
x = (num >> shift) & 0xF;
|
||||
if (x >= 0xa) {
|
||||
*dest = 'a' + (x - 0xa);
|
||||
} else {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -64,7 +64,7 @@ memmove (
|
||||
|
||||
/* Check for overlap */
|
||||
if (src > dest || ((char *)src + count) < (char *)dest) {
|
||||
/* Low-to-high copy, use memcpy() */
|
||||
/* Low-to-high copy */
|
||||
return memcpy(dest, src, count);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -50,8 +50,8 @@ strnlen (
|
||||
|
||||
int
|
||||
strcmp (
|
||||
const char* s1,
|
||||
const char* s2
|
||||
const char *s1,
|
||||
const char *s2
|
||||
)
|
||||
|
||||
{
|
||||
@ -69,8 +69,8 @@ strcmp (
|
||||
|
||||
int
|
||||
strncmp (
|
||||
const char* s1,
|
||||
const char* s2,
|
||||
const char *s1,
|
||||
const char *s2,
|
||||
size_t n
|
||||
)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -61,7 +61,7 @@ wmemmove (
|
||||
|
||||
/* Check for overlap */
|
||||
if (src > dest || ((wchar_t *)src + count) < (wchar_t *)dest) {
|
||||
/* Low-to-high copy, use wmemcpy() */
|
||||
/* Low-to-high copy */
|
||||
return wmemcpy(dest, src, count);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -50,8 +50,8 @@ wcsnlen (
|
||||
|
||||
int
|
||||
wcscmp (
|
||||
const wchar_t* s1,
|
||||
const wchar_t* s2
|
||||
const wchar_t *s1,
|
||||
const wchar_t *s2
|
||||
)
|
||||
|
||||
{
|
||||
@ -69,8 +69,8 @@ wcscmp (
|
||||
|
||||
int
|
||||
wcsncmp (
|
||||
const wchar_t* s1,
|
||||
const wchar_t* s2,
|
||||
const wchar_t *s1,
|
||||
const wchar_t *s2,
|
||||
size_t n
|
||||
)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -9,14 +9,14 @@ Module Name:
|
||||
|
||||
Abstract:
|
||||
|
||||
Provides variable arguments definitions.
|
||||
Provides variable argument list definitions.
|
||||
|
||||
--*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef _STDARG_H
|
||||
#define _STDARG_H
|
||||
#define _STDARG_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -16,14 +16,16 @@ Abstract:
|
||||
#pragma once
|
||||
|
||||
#ifndef _STDDEF_H
|
||||
#define _STDDEF_H
|
||||
#define _STDDEF_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus
|
||||
#if defined(__cplusplus) && __cplusplus >= 201103L
|
||||
#define NULL nullptr
|
||||
#elif defined(__cplusplus)
|
||||
#define NULL 0
|
||||
#else
|
||||
#define NULL ((void*)0)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -16,7 +16,7 @@ Abstract:
|
||||
#pragma once
|
||||
|
||||
#ifndef _STRING_H
|
||||
#define _STRING_H
|
||||
#define _STRING_H 1
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@ -30,8 +30,8 @@ void *memmove(void *dest, const void *src, size_t count);
|
||||
|
||||
size_t strlen(const char *str);
|
||||
size_t strnlen(const char *str, size_t maxlen);
|
||||
int strcmp(const char* s1, const char* s2);
|
||||
int strncmp(const char* s1, const char* s2, size_t n);
|
||||
int strcmp(const char *s1, const char *s2);
|
||||
int strncmp(const char *s1, const char *s2, size_t n);
|
||||
char *strchr(const char *s, int c);
|
||||
char *strstr(const char *haystack, const char *needle);
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -16,7 +16,7 @@ Abstract:
|
||||
#pragma once
|
||||
|
||||
#ifndef _WCHAR_H
|
||||
#define _WCHAR_H
|
||||
#define _WCHAR_H 1
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
@ -31,8 +31,8 @@ wchar_t *wmemmove(wchar_t *dest, const wchar_t *src, size_t count);
|
||||
|
||||
size_t wcslen(const wchar_t *str);
|
||||
size_t wcsnlen(const wchar_t *str, size_t maxlen);
|
||||
int wcscmp(const wchar_t* s1, const wchar_t* s2);
|
||||
int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n);
|
||||
int wcscmp(const wchar_t *s1, const wchar_t *s2);
|
||||
int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n);
|
||||
wchar_t *wcschr(const wchar_t *wcs, wchar_t wc);
|
||||
wchar_t *wcsstr(const wchar_t *haystack, const wchar_t *needle);
|
||||
wchar_t *wcscpy_s(wchar_t *dest, size_t maxlen, const wchar_t *src);
|
||||
|
76
SDK/INC/EFI/X64/efibind.h
Normal file
76
SDK/INC/EFI/X64/efibind.h
Normal file
@ -0,0 +1,76 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
|
||||
efibind.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Provides processor/compiler-specific EFI definitions for x64 systems.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFIBIND_H
|
||||
#define _EFIBIND_H
|
||||
|
||||
//
|
||||
// Calling conventions.
|
||||
//
|
||||
#ifndef EFIAPI
|
||||
#if defined(_MSC_EXTENSIONS)
|
||||
#define EFIAPI __cdecl
|
||||
#elif defined(__clang__) || defined(__GNUC__)
|
||||
#define EFIAPI __attribute__((ms_abi))
|
||||
#else
|
||||
#define EFIAPI
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Error masks.
|
||||
//
|
||||
#define EFI_ERROR_MASK 0x8000000000000000
|
||||
#define EFI_ERROR_MASK_OEM 0xC000000000000000
|
||||
|
||||
//
|
||||
// Integer types.
|
||||
//
|
||||
#if defined(_MSC_EXTENSIONS)
|
||||
typedef unsigned __int8 uint8_t;
|
||||
typedef unsigned __int16 uint16_t;
|
||||
typedef unsigned __int32 uint32_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
typedef __int8 int8_t;
|
||||
typedef __int16 int16_t;
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
#elif defined(UNIX_LP64)
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned long uint64_t;
|
||||
typedef char int8_t;
|
||||
typedef short int16_t;
|
||||
typedef int int32_t;
|
||||
typedef long int64_t;
|
||||
#else
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned long long uint64_t;
|
||||
typedef char int8_t;
|
||||
typedef short int16_t;
|
||||
typedef int int32_t;
|
||||
typedef long long int64_t;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Word-sized integers.
|
||||
//
|
||||
typedef uint64_t UINTN;
|
||||
typedef int64_t INTN;
|
||||
|
||||
#endif /* !_EFIBIND_H */
|
32
SDK/INC/EFI/efi.h
Normal file
32
SDK/INC/EFI/efi.h
Normal file
@ -0,0 +1,32 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
|
||||
efi.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Provides EFI header files.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFI_H
|
||||
#define _EFI_H
|
||||
|
||||
#if defined(__x86_64__)
|
||||
#include "X64/efibind.h"
|
||||
#else
|
||||
#error Unsupported architecture
|
||||
#endif
|
||||
|
||||
#include "efidef.h"
|
||||
#include "efidevp.h"
|
||||
#include "eficon.h"
|
||||
#include "efiprot.h"
|
||||
#include "efiapi.h"
|
||||
#include "efierr.h"
|
||||
|
||||
#endif /* !_EFI_H */
|
1004
SDK/INC/EFI/efiapi.h
Normal file
1004
SDK/INC/EFI/efiapi.h
Normal file
File diff suppressed because it is too large
Load Diff
434
SDK/INC/EFI/eficon.h
Normal file
434
SDK/INC/EFI/eficon.h
Normal file
@ -0,0 +1,434 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
|
||||
eficon.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Provides EFI console protocol definitions.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFICON_H
|
||||
#define _EFICON_H
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
//
|
||||
// EFI Simple Text Output Protocol.
|
||||
//
|
||||
|
||||
#define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \
|
||||
{ 0x387477C2, 0x69C7, 0x11D2, {0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
|
||||
#define SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID
|
||||
|
||||
typedef struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
|
||||
typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SIMPLE_TEXT_OUTPUT_INTERFACE;
|
||||
|
||||
//
|
||||
// Text attributes.
|
||||
//
|
||||
|
||||
#define EFI_TEXT_ATTR(Foreground, Background) ((Foreground) | ((Background) << 4))
|
||||
|
||||
#define EFI_BLACK 0x00
|
||||
#define EFI_BLUE 0x01
|
||||
#define EFI_GREEN 0x02
|
||||
#define EFI_RED 0x04
|
||||
#define EFI_BRIGHT 0x08
|
||||
#define EFI_CYAN (EFI_BLUE | EFI_GREEN)
|
||||
#define EFI_MAGENTA (EFI_BLUE | EFI_RED)
|
||||
#define EFI_BROWN (EFI_GREEN | EFI_RED)
|
||||
#define EFI_LIGHTGRAY (EFI_BLUE | EFI_GREEN | EFI_RED)
|
||||
#define EFI_DARKGRAY (EFI_BRIGHT)
|
||||
#define EFI_LIGHTBLUE (EFI_BLUE | EFI_BRIGHT)
|
||||
#define EFI_LIGHTGREEN (EFI_GREEN | EFI_BRIGHT)
|
||||
#define EFI_LIGHTCYAN (EFI_CYAN | EFI_BRIGHT)
|
||||
#define EFI_LIGHTRED (EFI_RED | EFI_BRIGHT)
|
||||
#define EFI_LIGHTMAGENTA (EFI_MAGENTA | EFI_BRIGHT)
|
||||
#define EFI_YELLOW (EFI_BROWN | EFI_BRIGHT)
|
||||
#define EFI_WHITE (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT)
|
||||
|
||||
#define EFI_BACKGROUND_BLACK 0x00
|
||||
#define EFI_BACKGROUND_BLUE 0x10
|
||||
#define EFI_BACKGROUND_GREEN 0x20
|
||||
#define EFI_BACKGROUND_RED 0x40
|
||||
#define EFI_BACKGROUND_CYAN (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN)
|
||||
#define EFI_BACKGROUND_MAGENTA (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_RED)
|
||||
#define EFI_BACKGROUND_BROWN (EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)
|
||||
#define EFI_BACKGROUND_LIGHTGRAY (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)
|
||||
|
||||
//
|
||||
// Unicode Box Draw characters.
|
||||
//
|
||||
|
||||
#define BOXDRAW_HORIZONTAL 0x2500
|
||||
#define BOXDRAW_VERTICAL 0x2502
|
||||
#define BOXDRAW_DOWN_RIGHT 0x250C
|
||||
#define BOXDRAW_DOWN_LEFT 0x2510
|
||||
#define BOXDRAW_UP_RIGHT 0x2514
|
||||
#define BOXDRAW_UP_LEFT 0x2518
|
||||
#define BOXDRAW_VERTICAL_RIGHT 0x251C
|
||||
#define BOXDRAW_VERTICAL_LEFT 0x2524
|
||||
#define BOXDRAW_DOWN_HORIZONTAL 0x252C
|
||||
#define BOXDRAW_UP_HORIZONTAL 0x2534
|
||||
#define BOXDRAW_VERTICAL_HORIZONTAL 0x253C
|
||||
|
||||
#define BOXDRAW_DOUBLE_HORIZONTAL 0x2550
|
||||
#define BOXDRAW_DOUBLE_VERTICAL 0x2551
|
||||
#define BOXDRAW_DOWN_RIGHT_DOUBLE 0x2552
|
||||
#define BOXDRAW_DOWN_DOUBLE_RIGHT 0x2553
|
||||
#define BOXDRAW_DOUBLE_DOWN_RIGHT 0x2554
|
||||
|
||||
#define BOXDRAW_DOWN_LEFT_DOUBLE 0x2555
|
||||
#define BOXDRAW_DOWN_DOUBLE_LEFT 0x2556
|
||||
#define BOXDRAW_DOUBLE_DOWN_LEFT 0x2557
|
||||
|
||||
#define BOXDRAW_UP_RIGHT_DOUBLE 0x2558
|
||||
#define BOXDRAW_UP_DOUBLE_RIGHT 0x2559
|
||||
#define BOXDRAW_DOUBLE_UP_RIGHT 0x255A
|
||||
|
||||
#define BOXDRAW_UP_LEFT_DOUBLE 0x255B
|
||||
#define BOXDRAW_UP_DOUBLE_LEFT 0x255C
|
||||
#define BOXDRAW_DOUBLE_UP_LEFT 0x255D
|
||||
|
||||
#define BOXDRAW_VERTICAL_RIGHT_DOUBLE 0x255E
|
||||
#define BOXDRAW_VERTICAL_DOUBLE_RIGHT 0x255F
|
||||
#define BOXDRAW_DOUBLE_VERTICAL_RIGHT 0x2560
|
||||
|
||||
#define BOXDRAW_VERTICAL_LEFT_DOUBLE 0x2561
|
||||
#define BOXDRAW_VERTICAL_DOUBLE_LEFT 0x2562
|
||||
#define BOXDRAW_DOUBLE_VERTICAL_LEFT 0x2563
|
||||
|
||||
#define BOXDRAW_DOWN_HORIZONTAL_DOUBLE 0x2564
|
||||
#define BOXDRAW_DOWN_DOUBLE_HORIZONTAL 0x2565
|
||||
#define BOXDRAW_DOUBLE_DOWN_HORIZONTAL 0x2566
|
||||
|
||||
#define BOXDRAW_UP_HORIZONTAL_DOUBLE 0x2567
|
||||
#define BOXDRAW_UP_DOUBLE_HORIZONTAL 0x2568
|
||||
#define BOXDRAW_DOUBLE_UP_HORIZONTAL 0x2569
|
||||
|
||||
#define BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE 0x256A
|
||||
#define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL 0x256B
|
||||
#define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL 0x256C
|
||||
|
||||
//
|
||||
// Required Block Elements.
|
||||
//
|
||||
#define BLOCKELEMENT_FULL_BLOCK 0x2588
|
||||
#define BLOCKELEMENT_LIGHT_SHADE 0x2591
|
||||
|
||||
//
|
||||
// Required Geometric Shapes.
|
||||
//
|
||||
#define GEOMETRICSHAPE_UP_TRIANGLE 0x25B2
|
||||
#define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25BA
|
||||
#define GEOMETRICSHAPE_DOWN_TRIANGLE 0x25BC
|
||||
#define GEOMETRICSHAPE_LEFT_TRIANGLE 0x25C4
|
||||
|
||||
//
|
||||
// Required Arrow Shapes.
|
||||
//
|
||||
#define ARROW_LEFT 0x2190
|
||||
#define ARROW_UP 0x2191
|
||||
#define ARROW_RIGHT 0x2192
|
||||
#define ARROW_DOWN 0x2193
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_RESET) (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_OUTPUT_STRING) (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN CHAR16 *String
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_TEST_STRING) (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN CHAR16 *String
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_SET_ATTRIBUTE) (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN Attribute
|
||||
);
|
||||
|
||||
//
|
||||
// Mode/cursor.
|
||||
//
|
||||
|
||||
typedef struct {
|
||||
INT32 MaxMode;
|
||||
INT32 Mode;
|
||||
INT32 Attribute;
|
||||
INT32 CursorColumn;
|
||||
INT32 CursorRow;
|
||||
BOOLEAN CursorVisible;
|
||||
} SIMPLE_TEXT_OUTPUT_MODE;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_QUERY_MODE) (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN ModeNumber,
|
||||
OUT UINTN *Columns,
|
||||
OUT UINTN *Rows
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_SET_MODE) (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN ModeNumber
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_CLEAR_SCREEN) (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_SET_CURSOR_POSITION) (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN UINTN Column,
|
||||
IN UINTN Row
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_ENABLE_CURSOR) (
|
||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,
|
||||
IN BOOLEAN Visible
|
||||
);
|
||||
|
||||
struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {
|
||||
EFI_TEXT_RESET Reset;
|
||||
|
||||
EFI_TEXT_OUTPUT_STRING OutputString;
|
||||
EFI_TEXT_TEST_STRING TestString;
|
||||
|
||||
EFI_TEXT_QUERY_MODE QueryMode;
|
||||
EFI_TEXT_SET_MODE SetMode;
|
||||
EFI_TEXT_SET_ATTRIBUTE SetAttribute;
|
||||
|
||||
EFI_TEXT_CLEAR_SCREEN ClearScreen;
|
||||
EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition;
|
||||
EFI_TEXT_ENABLE_CURSOR EnableCursor;
|
||||
|
||||
SIMPLE_TEXT_OUTPUT_MODE *Mode;
|
||||
};
|
||||
|
||||
//
|
||||
// EFI Simple Text Input Protocol.
|
||||
//
|
||||
|
||||
#define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
|
||||
{ 0x387477C1, 0x69C7, 0x11D2, {0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
|
||||
#define SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID
|
||||
|
||||
typedef struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL;
|
||||
typedef EFI_SIMPLE_TEXT_INPUT_PROTOCOL SIMPLE_INPUT_INTERFACE;
|
||||
|
||||
//
|
||||
// Required Unicode control characters.
|
||||
//
|
||||
#define CHAR_NULL 0x0000
|
||||
#define CHAR_BACKSPACE 0x0008
|
||||
#define CHAR_TAB 0x0009
|
||||
#define CHAR_LINEFEED 0x000A
|
||||
#define CHAR_CARRIAGE_RETURN 0x000D
|
||||
|
||||
//
|
||||
// Scan codes.
|
||||
//
|
||||
#define SCAN_NULL 0x0000
|
||||
#define SCAN_UP 0x0001
|
||||
#define SCAN_DOWN 0x0002
|
||||
#define SCAN_RIGHT 0x0003
|
||||
#define SCAN_LEFT 0x0004
|
||||
#define SCAN_HOME 0x0005
|
||||
#define SCAN_END 0x0006
|
||||
#define SCAN_INSERT 0x0007
|
||||
#define SCAN_DELETE 0x0008
|
||||
#define SCAN_PAGE_UP 0x0009
|
||||
#define SCAN_PAGE_DOWN 0x000A
|
||||
#define SCAN_F1 0x000B
|
||||
#define SCAN_F2 0x000C
|
||||
#define SCAN_F3 0x000D
|
||||
#define SCAN_F4 0x000E
|
||||
#define SCAN_F5 0x000F
|
||||
#define SCAN_F6 0x0010
|
||||
#define SCAN_F7 0x0011
|
||||
#define SCAN_F8 0x0012
|
||||
#define SCAN_F9 0x0013
|
||||
#define SCAN_F10 0x0014
|
||||
#define SCAN_ESC 0x0017
|
||||
|
||||
typedef struct {
|
||||
UINT16 ScanCode;
|
||||
CHAR16 UnicodeChar;
|
||||
} EFI_INPUT_KEY;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_INPUT_RESET) (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_INPUT_READ_KEY) (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_PROTOCOL *This,
|
||||
OUT EFI_INPUT_KEY *Key
|
||||
);
|
||||
|
||||
struct _EFI_SIMPLE_TEXT_INPUT_PROTOCOL {
|
||||
EFI_INPUT_RESET Reset;
|
||||
EFI_INPUT_READ_KEY ReadKeyStroke;
|
||||
EFI_EVENT WaitForKey;
|
||||
};
|
||||
|
||||
//
|
||||
// EFI Extended Simple Text Input Protocol.
|
||||
//
|
||||
|
||||
#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \
|
||||
{ 0xDD9E7534, 0x7762, 0x4698, {0x8C, 0x14, 0xF5, 0x85, 0x17, 0xA6, 0x25, 0xAA} }
|
||||
#define SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID
|
||||
|
||||
typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL;
|
||||
|
||||
//
|
||||
// Shift state.
|
||||
//
|
||||
#define EFI_SHIFT_STATE_VALID 0x80000000
|
||||
#define EFI_RIGHT_SHIFT_PRESSED 0x00000001
|
||||
#define EFI_LEFT_SHIFT_PRESSED 0x00000002
|
||||
#define EFI_RIGHT_CONTROL_PRESSED 0x00000004
|
||||
#define EFI_LEFT_CONTROL_PRESSED 0x00000008
|
||||
#define EFI_RIGHT_ALT_PRESSED 0x00000010
|
||||
#define EFI_LEFT_ALT_PRESSED 0x00000020
|
||||
#define EFI_RIGHT_LOGO_PRESSED 0x00000040
|
||||
#define EFI_LEFT_LOGO_PRESSED 0x00000080
|
||||
#define EFI_MENU_KEY_PRESSED 0x00000100
|
||||
#define EFI_SYS_REQ_PRESSED 0x00000200
|
||||
|
||||
//
|
||||
// Toggle state.
|
||||
//
|
||||
#define EFI_SCROLL_LOCK_ACTIVE 0x01
|
||||
#define EFI_NUM_LOCK_ACTIVE 0x02
|
||||
#define EFI_CAPS_LOCK_ACTIVE 0x04
|
||||
#define EFI_KEY_STATE_EXPOSED 0x40
|
||||
#define EFI_TOGGLE_STATE_VALID 0x80
|
||||
|
||||
//
|
||||
// Additional scan codes.
|
||||
//
|
||||
#define SCAN_PAUSE 0x0048
|
||||
#define SCAN_F13 0x0068
|
||||
#define SCAN_F14 0x0069
|
||||
#define SCAN_F15 0x006A
|
||||
#define SCAN_F16 0x006B
|
||||
#define SCAN_F17 0x006C
|
||||
#define SCAN_F18 0x006D
|
||||
#define SCAN_F19 0x006E
|
||||
#define SCAN_F20 0x006F
|
||||
#define SCAN_F21 0x0070
|
||||
#define SCAN_F22 0x0071
|
||||
#define SCAN_F23 0x0072
|
||||
#define SCAN_F24 0x0073
|
||||
#define SCAN_MUTE 0x007F
|
||||
#define SCAN_VOLUME_UP 0x0080
|
||||
#define SCAN_VOLUME_DOWN 0x0081
|
||||
#define SCAN_BRIGHTNESS_UP 0x0100
|
||||
#define SCAN_BRIGHTNESS_DOWN 0x0101
|
||||
#define SCAN_SUSPEND 0x0102
|
||||
#define SCAN_HIBERNATE 0x0103
|
||||
#define SCAN_TOGGLE_DISPLAY 0x0104
|
||||
#define SCAN_RECOVERY 0x0105
|
||||
#define SCAN_EJECT 0x0106
|
||||
|
||||
typedef UINT8 EFI_KEY_TOGGLE_STATE;
|
||||
|
||||
typedef struct {
|
||||
UINT32 KeyShiftState;
|
||||
EFI_KEY_TOGGLE_STATE KeyToggleState;
|
||||
} EFI_KEY_STATE;
|
||||
|
||||
typedef struct {
|
||||
EFI_INPUT_KEY Key;
|
||||
EFI_KEY_STATE KeyState;
|
||||
} EFI_KEY_DATA;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_INPUT_RESET_EX) (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
IN BOOLEAN ExtendedVerification
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_INPUT_READ_KEY_EX) (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
OUT EFI_KEY_DATA *KeyData
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_SET_STATE) (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
IN EFI_KEY_TOGGLE_STATE *KeyToggleState
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_KEY_NOTIFY_FUNCTION) (
|
||||
IN EFI_KEY_DATA *KeyData
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY) (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
IN EFI_KEY_DATA *KeyData,
|
||||
IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,
|
||||
OUT VOID **NotifyHandle
|
||||
);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY) (
|
||||
IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,
|
||||
IN VOID *NotificationHandle
|
||||
);
|
||||
|
||||
struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL {
|
||||
EFI_INPUT_RESET_EX Reset;
|
||||
EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx;
|
||||
EFI_EVENT WaitForKeyEx;
|
||||
EFI_SET_STATE SetState;
|
||||
EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify;
|
||||
EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify;
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif /* !_EFICON_H */
|
375
SDK/INC/EFI/efidef.h
Normal file
375
SDK/INC/EFI/efidef.h
Normal file
@ -0,0 +1,375 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
|
||||
efidef.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Provides basic EFI type/structure definitions.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFIDEF_H
|
||||
#define _EFIDEF_H
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
#ifndef VOID
|
||||
#define VOID void
|
||||
#endif
|
||||
|
||||
#ifndef CONST
|
||||
#define CONST const
|
||||
#endif
|
||||
|
||||
#ifndef VOLATILE
|
||||
#define VOLATILE volatile
|
||||
#endif
|
||||
|
||||
//
|
||||
// Decorators to show parameter usage.
|
||||
// IN - Argument passed into routine.
|
||||
// OUT - Pointed-to value set by routine.
|
||||
// OPTIONAL - Argument is not required.
|
||||
//
|
||||
#ifndef IN
|
||||
#define IN
|
||||
#define OUT
|
||||
#define OPTIONAL
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#if defined(__cplusplus)
|
||||
#if __cplusplus >= 201103L
|
||||
#define NULL nullptr
|
||||
#else
|
||||
#define NULL 0
|
||||
#endif
|
||||
#else
|
||||
#define NULL ((VOID *) 0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || defined(__cplusplus)
|
||||
#define TRUE true
|
||||
#define FALSE false
|
||||
#else
|
||||
#define TRUE ((BOOLEAN) 1)
|
||||
#define FALSE ((BOOLEAN) 0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef FORCEINLINE
|
||||
#if defined(_MSC_EXTENSIONS)
|
||||
#define FORCEINLINE __forceinline
|
||||
#elif defined(__clang__) || defined(__GNUC__)
|
||||
#define FORCEINLINE __attribute__((always_inline))
|
||||
#else
|
||||
#define FORCEINLINE static inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//
|
||||
// Error code helpers.
|
||||
//
|
||||
#define EFIERR(e) (EFI_ERROR_MASK | e)
|
||||
#define EFIERR_OEM(e) (EFI_ERROR_MASK_OEM | e)
|
||||
|
||||
//
|
||||
// Unsigned integer types.
|
||||
//
|
||||
typedef uint8_t UINT8;
|
||||
typedef uint16_t UINT16;
|
||||
typedef uint32_t UINT32;
|
||||
typedef uint64_t UINT64;
|
||||
|
||||
//
|
||||
// Signed integer types.
|
||||
//
|
||||
typedef int8_t INT8;
|
||||
typedef int16_t INT16;
|
||||
typedef int32_t INT32;
|
||||
typedef int64_t INT64;
|
||||
|
||||
//
|
||||
// Boolean types.
|
||||
//
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || defined(__cplusplus)
|
||||
typedef bool BOOLEAN;
|
||||
#else
|
||||
typedef UINT8 BOOLEAN;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Character types.
|
||||
//
|
||||
typedef UINT8 CHAR8;
|
||||
typedef UINT16 CHAR16;
|
||||
|
||||
//
|
||||
// Miscellaneous types.
|
||||
//
|
||||
typedef UINTN EFI_STATUS;
|
||||
typedef UINT64 EFI_LBA;
|
||||
typedef UINTN EFI_TPL;
|
||||
typedef VOID *EFI_HANDLE;
|
||||
typedef VOID *EFI_EVENT;
|
||||
|
||||
//
|
||||
// Static assertion helper.
|
||||
//
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L) || (defined(__cplusplus) && __cplusplus >= 201103L)
|
||||
#define STATIC_ASSERT static_assert
|
||||
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||
#define STATIC_ASSERT _Static_assert
|
||||
#else
|
||||
#warning Static assertion not available. Compilation problems may not be detected!
|
||||
#define STATIC_ASSERT(expression, message)
|
||||
#endif
|
||||
|
||||
//
|
||||
// Ensure that types are of the correct size.
|
||||
//
|
||||
STATIC_ASSERT(sizeof(UINT8) == 1, "sizeof(UINT8) must equal 1");
|
||||
STATIC_ASSERT(sizeof(UINT16) == 2, "sizeof(UINT16) must equal 2");
|
||||
STATIC_ASSERT(sizeof(UINT32) == 4, "sizeof(UINT32) must equal 4");
|
||||
STATIC_ASSERT(sizeof(UINT64) == 8, "sizeof(UINT64) must equal 8");
|
||||
STATIC_ASSERT(sizeof(INT8) == 1, "sizeof(INT8) must equal 1");
|
||||
STATIC_ASSERT(sizeof(INT16) == 2, "sizeof(INT16) must equal 2");
|
||||
STATIC_ASSERT(sizeof(INT32) == 4, "sizeof(INT32) must equal 4");
|
||||
STATIC_ASSERT(sizeof(INT64) == 8, "sizeof(INT64) must equal 8");
|
||||
STATIC_ASSERT(sizeof(BOOLEAN) == 1, "sizeof(BOOLEAN) must equal 1");
|
||||
STATIC_ASSERT(sizeof(CHAR8) == 1, "sizeof(CHAR8) must equal 1");
|
||||
STATIC_ASSERT(sizeof(CHAR16) == 2, "sizeof(CHAR16) must equal 2");
|
||||
|
||||
//
|
||||
// GUID (Globally Unique IDentifier).
|
||||
//
|
||||
typedef struct {
|
||||
UINT32 Data1;
|
||||
UINT16 Data2;
|
||||
UINT16 Data3;
|
||||
UINT8 Data4[8];
|
||||
} EFI_GUID;
|
||||
|
||||
//
|
||||
// Time.
|
||||
//
|
||||
|
||||
typedef struct {
|
||||
UINT16 Year;
|
||||
UINT8 Month;
|
||||
UINT8 Day;
|
||||
UINT8 Hour;
|
||||
UINT8 Minute;
|
||||
UINT8 Second;
|
||||
UINT8 Pad1;
|
||||
UINT32 Nanosecond;
|
||||
INT16 Timezone;
|
||||
UINT8 Daylight;
|
||||
UINT8 Pad2;
|
||||
} EFI_TIME;
|
||||
|
||||
//
|
||||
// For EFI_TIME.Daylight.
|
||||
//
|
||||
#define EFI_TIME_ADJUST_DAYLIGHT 0x01
|
||||
#define EFI_TIME_IN_DAYLIGHT 0x02
|
||||
|
||||
//
|
||||
// For EFI_TIME.TimeZone.
|
||||
//
|
||||
#define EFI_UNSPECIFIED_TIMEZONE 0x07FF
|
||||
|
||||
//
|
||||
// Network addresses.
|
||||
//
|
||||
|
||||
typedef struct {
|
||||
UINT8 Addr[4];
|
||||
} EFI_IPv4_ADDRESS;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Addr[16];
|
||||
} EFI_IPv6_ADDRESS;
|
||||
|
||||
typedef union {
|
||||
UINT32 Addr[4];
|
||||
EFI_IPv4_ADDRESS v4;
|
||||
EFI_IPv6_ADDRESS v6;
|
||||
} EFI_IP_ADDRESS;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Addr[32];
|
||||
} EFI_MAC_ADDRESS;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Address[6];
|
||||
} BLUETOOTH_ADDRESS;
|
||||
|
||||
typedef struct {
|
||||
UINT8 Address[6];
|
||||
UINT8 Type;
|
||||
} BLUETOOTH_LE_ADDRESS;
|
||||
|
||||
//
|
||||
// Memory addresses.
|
||||
//
|
||||
typedef UINT64 EFI_PHYSICAL_ADDRESS;
|
||||
typedef UINT64 EFI_VIRTUAL_ADDRESS;
|
||||
|
||||
//
|
||||
// Memory allocation methods.
|
||||
//
|
||||
typedef enum {
|
||||
//
|
||||
// Allocate range at any address.
|
||||
//
|
||||
AllocateAnyPages,
|
||||
|
||||
//
|
||||
// Allocate range ending at a specific address.
|
||||
//
|
||||
AllocateMaxAddress,
|
||||
|
||||
//
|
||||
// Allocate range starting at a specific address.
|
||||
//
|
||||
AllocateAddress,
|
||||
|
||||
//
|
||||
// For bounds checking.
|
||||
//
|
||||
MaxAllocateType
|
||||
} EFI_ALLOCATE_TYPE;
|
||||
|
||||
//
|
||||
// Memory types.
|
||||
//
|
||||
typedef enum {
|
||||
EfiReservedMemoryType,
|
||||
EfiLoaderCode,
|
||||
EfiLoaderData,
|
||||
EfiBootServicesCode,
|
||||
EfiBootServicesData,
|
||||
EfiRuntimeServicesCode,
|
||||
EfiRuntimeServicesData,
|
||||
EfiConventionalMemory,
|
||||
EfiUnusableMemory,
|
||||
EfiACPIReclaimMemory,
|
||||
EfiACPIMemoryNVS,
|
||||
EfiMemoryMappedIO,
|
||||
EfiMemoryMappedIOPortSpace,
|
||||
EfiPalCode,
|
||||
EfiPersistentMemory,
|
||||
EfiUnacceptedMemoryType,
|
||||
EfiMaxMemoryType,
|
||||
|
||||
MEMORY_TYPE_OEM_RESERVED_MIN = 0x70000000,
|
||||
MEMORY_TYPE_OEM_RESERVED_MAX = 0x7FFFFFFF,
|
||||
MEMORY_TYPE_OS_RESERVED_MIN = 0x80000000,
|
||||
MEMORY_TYPE_OS_RESERVED_MAX = 0xFFFFFFFF
|
||||
} EFI_MEMORY_TYPE;
|
||||
|
||||
//
|
||||
// Memory caching attributes.
|
||||
//
|
||||
#define EFI_MEMORY_UC 0x0000000000000001
|
||||
#define EFI_MEMORY_WC 0x0000000000000002
|
||||
#define EFI_MEMORY_WT 0x0000000000000004
|
||||
#define EFI_MEMORY_WB 0x0000000000000008
|
||||
#define EFI_MEMORY_UCE 0x0000000000000010
|
||||
|
||||
//
|
||||
// Memory protection attributes.
|
||||
//
|
||||
#define EFI_MEMORY_WP 0x0000000000001000
|
||||
#define EFI_MEMORY_RP 0x0000000000002000
|
||||
#define EFI_MEMORY_XP 0x0000000000004000
|
||||
#define EFI_MEMORY_RO 0x0000000000020000
|
||||
|
||||
//
|
||||
// Miscellaneous memory attributes.
|
||||
//
|
||||
#define EFI_MEMORY_NV 0x0000000000008000
|
||||
#define EFI_MEMORY_MORE_RELIABLE 0x0000000000010000
|
||||
#define EFI_MEMORY_SP 0x0000000000040000
|
||||
#define EFI_MEMORY_CPU_CRYPTO 0x0000000000080000
|
||||
#define EFI_MEMORY_HOT_PLUGGABLE 0x0000000000100000
|
||||
#define EFI_MEMORY_ISA_VALID 0x4000000000000000
|
||||
#define EFI_MEMORY_RUNTIME 0x8000000000000000
|
||||
|
||||
//
|
||||
// Memory type/attribute masks.
|
||||
//
|
||||
#define EFI_MEMORY_ISA_MASK 0x0FFFF00000000000
|
||||
#define EFI_CACHE_ATTRIBUTE_MASK (EFI_MEMORY_UC | EFI_MEMORY_WC | EFI_MEMORY_WT | EFI_MEMORY_WB | EFI_MEMORY_UCE | EFI_MEMORY_WP)
|
||||
#define EFI_MEMORY_ACCESS_MASK (EFI_MEMORY_RP | EFI_MEMORY_XP | EFI_MEMORY_RO)
|
||||
#define EFI_MEMORY_ATTRIBUTE_MASK (EFI_MEMORY_ACCESS_MASK | EFI_MEMORY_SP | EFI_MEMORY_CPU_CRYPTO)
|
||||
|
||||
//
|
||||
// Memory descriptor.
|
||||
//
|
||||
|
||||
#define EFI_MEMORY_DESCRIPTOR_VERSION 1
|
||||
|
||||
typedef struct {
|
||||
//
|
||||
// Memory type (EFI_MEMORY_TYPE) of the region.
|
||||
//
|
||||
UINT32 Type;
|
||||
|
||||
UINT32 Pad;
|
||||
|
||||
//
|
||||
// Must be aligned on an EFI_PAGE_SIZE-byte boundary.
|
||||
// Must not be above 0xFFFFFFFFFFFFF000.
|
||||
//
|
||||
EFI_PHYSICAL_ADDRESS PhysicalStart;
|
||||
EFI_VIRTUAL_ADDRESS VirtualStart;
|
||||
|
||||
//
|
||||
// Number of EFI_PAGE_SIZE-byte pages.
|
||||
// Must not be zero.
|
||||
//
|
||||
UINT64 NumberOfPages;
|
||||
|
||||
//
|
||||
// Capabilities of the memory region.
|
||||
//
|
||||
UINT64 Attribute;
|
||||
} EFI_MEMORY_DESCRIPTOR;
|
||||
|
||||
//
|
||||
// International language.
|
||||
//
|
||||
typedef CHAR8 ISO_639_2;
|
||||
#define ISO_639_2_ENTRY_SIZE 3
|
||||
|
||||
//
|
||||
// Memory units & address helpers.
|
||||
//
|
||||
#define EFI_PAGE_SIZE 4096
|
||||
#define EFI_PAGE_MASK 0xFFF
|
||||
#define EFI_PAGE_SHIFT 12
|
||||
#define EFI_SIZE_TO_PAGES(s) (((s) >> EFI_PAGE_SHIFT) + ((s) & EFI_PAGE_MASK ? 1:0))
|
||||
|
||||
//
|
||||
// OS indications.
|
||||
//
|
||||
#define EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001
|
||||
#define EFI_OS_INDICATIONS_TIMESTAMP_REVOCATION 0x0000000000000002
|
||||
#define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED 0x0000000000000004
|
||||
#define EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED 0x0000000000000008
|
||||
#define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED 0x0000000000000010
|
||||
#define EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY 0x0000000000000040
|
||||
#define EFI_OS_INDICATIONS_JSON_CONFIG_DATA_REFRESH 0x0000000000000080
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif /* !_EFIDEF_H */
|
1056
SDK/INC/EFI/efidevp.h
Normal file
1056
SDK/INC/EFI/efidevp.h
Normal file
File diff suppressed because it is too large
Load Diff
86
SDK/INC/EFI/efierr.h
Normal file
86
SDK/INC/EFI/efierr.h
Normal file
@ -0,0 +1,86 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
|
||||
efierr.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Provides EFI error definitions.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFIERR_H
|
||||
#define _EFIERR_H
|
||||
|
||||
#define EFIWARN(a) (a)
|
||||
#define EFI_ERROR(a) (((INTN) (a)) < 0)
|
||||
|
||||
//
|
||||
// Standard errors.
|
||||
//
|
||||
#define EFI_SUCCESS 0
|
||||
#define EFI_LOAD_ERROR EFIERR(1)
|
||||
#define EFI_INVALID_PARAMETER EFIERR(2)
|
||||
#define EFI_UNSUPPORTED EFIERR(3)
|
||||
#define EFI_BAD_BUFFER_SIZE EFIERR(4)
|
||||
#define EFI_BUFFER_TOO_SMALL EFIERR(5)
|
||||
#define EFI_NOT_READY EFIERR(6)
|
||||
#define EFI_DEVICE_ERROR EFIERR(7)
|
||||
#define EFI_WRITE_PROTECTED EFIERR(8)
|
||||
#define EFI_OUT_OF_RESOURCES EFIERR(9)
|
||||
#define EFI_VOLUME_CORRUPTED EFIERR(10)
|
||||
#define EFI_VOLUME_FULL EFIERR(11)
|
||||
#define EFI_NO_MEDIA EFIERR(12)
|
||||
#define EFI_MEDIA_CHANGED EFIERR(13)
|
||||
#define EFI_NOT_FOUND EFIERR(14)
|
||||
#define EFI_ACCESS_DENIED EFIERR(15)
|
||||
#define EFI_NO_RESPONSE EFIERR(16)
|
||||
#define EFI_NO_MAPPING EFIERR(17)
|
||||
#define EFI_TIMEOUT EFIERR(18)
|
||||
#define EFI_NOT_STARTED EFIERR(19)
|
||||
#define EFI_ALREADY_STARTED EFIERR(20)
|
||||
#define EFI_ABORTED EFIERR(21)
|
||||
#define EFI_ICMP_ERROR EFIERR(22)
|
||||
#define EFI_TFTP_ERROR EFIERR(23)
|
||||
#define EFI_PROTOCOL_ERROR EFIERR(24)
|
||||
#define EFI_INCOMPATIBLE_VERSION EFIERR(25)
|
||||
#define EFI_SECURITY_VIOLATION EFIERR(26)
|
||||
#define EFI_CRC_ERROR EFIERR(27)
|
||||
#define EFI_END_OF_MEDIA EFIERR(28)
|
||||
#define EFI_END_OF_FILE EFIERR(31)
|
||||
#define EFI_INVALID_LANGUAGE EFIERR(32)
|
||||
#define EFI_COMPROMISED_DATA EFIERR(33)
|
||||
#define EFI_IP_ADDRESS_CONFLICT EFIERR(34)
|
||||
#define EFI_HTTP_ERROR EFIERR(35)
|
||||
|
||||
//
|
||||
// Standard warnings.
|
||||
//
|
||||
#define EFI_WARN_UNKOWN_GLYPH EFIWARN(1)
|
||||
#define EFI_WARN_DELETE_FAILURE EFIWARN(2)
|
||||
#define EFI_WARN_WRITE_FAILURE EFIWARN(3)
|
||||
#define EFI_WARN_BUFFER_TOO_SMALL EFIWARN(4)
|
||||
#define EFI_WARN_STALE_DATA EFIWARN(5)
|
||||
#define EFI_WARN_FILE_SYSTEM EFIWARN(6)
|
||||
#define EFI_WARN_RESET_REQUESTED EFIWARN(7)
|
||||
|
||||
//
|
||||
// ICMP errors.
|
||||
//
|
||||
#define EFI_NETWORK_UNREACHABLE EFIERR(100)
|
||||
#define EFI_HOST_UNREACHABLE EFIERR(101)
|
||||
#define EFI_PROTOCOL_UNREACHABLE EFIERR(102)
|
||||
#define EFI_PORT_UNREACHABLE EROERR(103)
|
||||
|
||||
//
|
||||
// TCP errors.
|
||||
//
|
||||
#define EFI_CONNECTION_FIN EFIERR(104)
|
||||
#define EFI_CONNECTION_RESET EFIERR(105)
|
||||
#define EFI_CONNECTION_REFUSED EFIERR(106)
|
||||
|
||||
#endif /* !_EFIERR_H */
|
70
SDK/INC/EFI/efiprot.h
Normal file
70
SDK/INC/EFI/efiprot.h
Normal file
@ -0,0 +1,70 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
|
||||
efiprot.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Provides EFI protocol definitions.
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _EFIPROT_H
|
||||
#define _EFIPROT_H
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
//
|
||||
// Device Path Protocol.
|
||||
//
|
||||
#define EFI_DEVICE_PATH_PROTOCOL_GUID \
|
||||
{ 0x9576E91, 0x6D3F, 0x11D2, {0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
|
||||
#define DEVICE_PATH_PROTOCOL EFI_DEVICE_PATH_PROTOCOL_GUID
|
||||
|
||||
//
|
||||
// Loaded Image Protocol.
|
||||
//
|
||||
|
||||
#define EFI_LOADED_IMAGE_PROTOCOL_GUID \
|
||||
{ 0x5B1B31A1, 0x9562, 0x11D2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
|
||||
#define LOADED_IMAGE_PROTOCOL EFI_LOADED_IMAGE_PROTOCOL_GUID
|
||||
|
||||
#define EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL_GUID \
|
||||
{ 0xBC62157E, 0x3E33, 0x4FEC, {0x99, 0x20, 0x2D, 0x3B, 0x36, 0xD7, 0x50, 0xDF} }
|
||||
|
||||
#define EFI_LOADED_IMAGE_PROTOCOL_REVISION 0x1000
|
||||
#define EFI_IMAGE_INFORMATION_REVISION EFI_LOADED_IMAGE_PROTOCOL_REVISION
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IMAGE_UNLOAD) (
|
||||
IN EFI_HANDLE ImageHandle
|
||||
);
|
||||
|
||||
typedef struct {
|
||||
UINT32 Revision;
|
||||
EFI_HANDLE ParentHandle;
|
||||
struct _EFI_SYSTEM_TABLE *SystemTable;
|
||||
|
||||
EFI_HANDLE DeviceHandle;
|
||||
EFI_DEVICE_PATH *FilePath;
|
||||
VOID *Reserved;
|
||||
|
||||
UINT32 LoadOptionsSize;
|
||||
VOID *LoadOptions;
|
||||
|
||||
VOID *ImageBase;
|
||||
UINT64 ImageSize;
|
||||
EFI_MEMORY_TYPE ImageCodeType;
|
||||
EFI_MEMORY_TYPE ImageDataType;
|
||||
|
||||
EFI_IMAGE_UNLOAD Unload;
|
||||
} EFI_LOADED_IMAGE_PROTOCOL, EFI_LOADED_IMAGE;
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif /* !_EFIPROT_H */
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -31,7 +31,7 @@ Abstract:
|
||||
#endif
|
||||
|
||||
#ifndef VOID
|
||||
#define VOID void
|
||||
#define VOID void
|
||||
#endif
|
||||
|
||||
#ifndef CONST
|
||||
@ -44,16 +44,23 @@ Abstract:
|
||||
|
||||
#ifndef NULL
|
||||
#if defined(__cplusplus)
|
||||
#define NULL 0
|
||||
#if __cplusplus >= 201103L
|
||||
#define NULL nullptr
|
||||
#else
|
||||
#define NULL ((VOID *)0)
|
||||
#define NULL 0
|
||||
#endif
|
||||
#else
|
||||
#define NULL ((VOID *) 0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef FORCEINLINE
|
||||
#if defined(_MSC_EXTENSIONS)
|
||||
#define FORCEINLINE __forceinline
|
||||
#elif defined(__clang__) || defined(__GNUC__)
|
||||
#define FORCEINLINE __attribute__((always_inline))
|
||||
#else
|
||||
#warning Unable to define FORCEINLINE
|
||||
#define FORCEINLINE static inline
|
||||
#endif
|
||||
#endif
|
||||
@ -61,14 +68,24 @@ Abstract:
|
||||
#ifndef FASTCALL
|
||||
#if defined(_M_IX86)
|
||||
#define FASTCALL __fastcall
|
||||
#elif defined(__clang__) || defined(__GNUC__)
|
||||
#define FASTCALL __attribute__((fastcall))
|
||||
#else
|
||||
#warning Unable to defined FASTCALL
|
||||
#define FASTCALL
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef NTAPI
|
||||
#if !defined(_M_AMD64)
|
||||
#if defined(_MSC_EXTENSIONS)
|
||||
#define NTAPI __stdcall
|
||||
#elif defined(__clang__) || defined(__GNUC__)
|
||||
#define NTAPI __attribute__((stdcall))
|
||||
#else
|
||||
#warning Unable to define NTAPI
|
||||
#define NTAPI
|
||||
#endif
|
||||
#else
|
||||
#define NTAPI
|
||||
#endif
|
||||
@ -77,48 +94,48 @@ Abstract:
|
||||
//
|
||||
// Basic types.
|
||||
//
|
||||
typedef char CHAR;
|
||||
typedef char CHAR;
|
||||
typedef short SHORT;
|
||||
typedef long LONG;
|
||||
typedef unsigned char UCHAR;
|
||||
typedef long LONG;
|
||||
typedef unsigned char UCHAR;
|
||||
typedef unsigned short USHORT;
|
||||
typedef unsigned long ULONG;
|
||||
typedef unsigned long ULONG;
|
||||
|
||||
//
|
||||
// Minimum/maximum values of basic types.
|
||||
//
|
||||
#define MINCHAR 0x80
|
||||
#define MAXCHAR 0x7f
|
||||
#define MAXCHAR 0x7F
|
||||
#define MINSHORT 0x8000
|
||||
#define MAXSHORT 0x7fff
|
||||
#define MAXSHORT 0x7FFF
|
||||
#define MINLONG 0x80000000
|
||||
#define MAXLONG 0x7fffffff
|
||||
#define MAXUCHAR 0xff
|
||||
#define MAXUSHORT 0xffff
|
||||
#define MAXULONG 0xffffffff
|
||||
#define MAXLONG 0x7FFFFFFF
|
||||
#define MAXUCHAR 0xFF
|
||||
#define MAXUSHORT 0xFFFF
|
||||
#define MAXULONG 0xFFFFFFFF
|
||||
|
||||
//
|
||||
// Long long types.
|
||||
//
|
||||
#if defined(_MSC_EXTENSIONS)
|
||||
typedef __int64 LONGLONG;
|
||||
typedef unsigned __int64 ULONGLONG;
|
||||
typedef __int64 LONGLONG;
|
||||
typedef unsigned __int64 ULONGLONG;
|
||||
#elif defined(UNIX_LP64)
|
||||
typedef long LONGLONG;
|
||||
typedef unsigned long ULONGLONG;
|
||||
typedef long LONGLONG;
|
||||
typedef unsigned long ULONGLONG;
|
||||
#else
|
||||
typedef long long LONGLONG;
|
||||
typedef long long LONGLONG;
|
||||
typedef unsigned long long ULONGLONG;
|
||||
#endif
|
||||
|
||||
#define MAXLONGLONG 0x7fffffffffffffff
|
||||
#define MAXULONGLONG 0xffffffffffffffff
|
||||
#define MAXLONGLONG 0x7FFFFFFFFFFFFFFF
|
||||
#define MAXULONGLONG 0xFFFFFFFFFFFFFFFF
|
||||
|
||||
//
|
||||
// Logical/boolean value types.
|
||||
//
|
||||
typedef ULONG LOGICAL;
|
||||
typedef int BOOL;
|
||||
typedef int BOOL;
|
||||
typedef UCHAR BOOLEAN;
|
||||
|
||||
#define TRUE 1
|
||||
@ -128,34 +145,34 @@ typedef UCHAR BOOLEAN;
|
||||
// Numeric pointer types.
|
||||
//
|
||||
#ifdef _WIN64
|
||||
typedef LONGLONG LONG_PTR;
|
||||
typedef LONGLONG LONG_PTR;
|
||||
typedef ULONGLONG ULONG_PTR;
|
||||
#else
|
||||
typedef LONG LONG_PTR;
|
||||
typedef ULONG ULONG_PTR;
|
||||
typedef LONG LONG_PTR;
|
||||
typedef ULONG ULONG_PTR;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Basic type pointers.
|
||||
//
|
||||
typedef VOID *PVOID;
|
||||
typedef CHAR *PCHAR;
|
||||
typedef SHORT *PSHORT;
|
||||
typedef UCHAR *PUCHAR;
|
||||
typedef VOID *PVOID;
|
||||
typedef CHAR *PCHAR;
|
||||
typedef SHORT *PSHORT;
|
||||
typedef UCHAR *PUCHAR;
|
||||
typedef USHORT *PUSHORT;
|
||||
typedef ULONG *PULONG;
|
||||
typedef ULONG *PULONG;
|
||||
|
||||
//
|
||||
// Long long type pointers.
|
||||
//
|
||||
typedef LONGLONG *PLONGLONG;
|
||||
typedef LONGLONG *PLONGLONG;
|
||||
typedef ULONGLONG *PULONGLONG;
|
||||
|
||||
//
|
||||
// Logical/boolean type pointers.
|
||||
//
|
||||
typedef ULONG *PLOGICAL;
|
||||
typedef BOOL *PBOOL;
|
||||
typedef ULONG *PLOGICAL;
|
||||
typedef BOOL *PBOOL;
|
||||
typedef BOOLEAN *PBOOLEAN;
|
||||
|
||||
//
|
||||
@ -174,15 +191,15 @@ typedef CONST WCHAR *PCWSTR, *LPCWSTR;
|
||||
//
|
||||
// Handle types.
|
||||
//
|
||||
typedef PVOID HANDLE;
|
||||
typedef PVOID HANDLE;
|
||||
typedef HANDLE *PHANDLE;
|
||||
|
||||
#define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR)-1)
|
||||
#define INVALID_HANDLE_VALUE ((HANDLE)(LONG_PTR) -1)
|
||||
|
||||
//
|
||||
// Status code types.
|
||||
//
|
||||
typedef LONG NTSTATUS;
|
||||
typedef LONG NTSTATUS;
|
||||
typedef NTSTATUS *PNTSTATUS;
|
||||
|
||||
//
|
||||
@ -213,10 +230,10 @@ typedef NTSTATUS *PNTSTATUS;
|
||||
//
|
||||
#define LODWORD(x) ((ULONG)(x))
|
||||
#define HIDWORD(x) ((ULONG)((x) >> 32))
|
||||
#define LOWORD(x) ((USHORT)(x))
|
||||
#define HIWORD(x) ((USHORT)((x) >> 16))
|
||||
#define LOBYTE(x) ((UCHAR)(x))
|
||||
#define HIBYTE(x) ((UCHAR)((x) >> 8))
|
||||
#define LOWORD(x) ((USHORT)(x))
|
||||
#define HIWORD(x) ((USHORT)((x) >> 16))
|
||||
#define LOBYTE(x) ((UCHAR)(x))
|
||||
#define HIBYTE(x) ((UCHAR)((x) >> 8))
|
||||
|
||||
//
|
||||
// Large (64-bit) integer value.
|
||||
@ -224,7 +241,7 @@ typedef NTSTATUS *PNTSTATUS;
|
||||
typedef union LARGE_INTEGER {
|
||||
struct {
|
||||
ULONG LowPart;
|
||||
LONG HighPart;
|
||||
LONG HighPart;
|
||||
};
|
||||
|
||||
LONGLONG QuadPart;
|
||||
@ -248,7 +265,7 @@ typedef union ULARGE_INTEGER {
|
||||
typedef struct _UNICODE_STRING {
|
||||
USHORT Length;
|
||||
USHORT MaximumLength;
|
||||
PWSTR Buffer;
|
||||
PWSTR Buffer;
|
||||
} UNICODE_STRING, *PUNICODE_STRING;
|
||||
typedef CONST UNICODE_STRING *PCUNICODE_STRING;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -17,10 +17,30 @@ Abstract:
|
||||
#define _NTIMAGE_H
|
||||
|
||||
//
|
||||
// Machine type values.
|
||||
// Machine types.
|
||||
//
|
||||
#define IMAGE_FILE_MACHINE_UNKNOWN 0x0000
|
||||
#define IMAGE_FILE_MACHINE_I386 0x014c
|
||||
#define IMAGE_FILE_MACHINE_I386 0x014C
|
||||
#define IMAGE_FILE_MACHINE_AMD64 0x8664
|
||||
|
||||
//
|
||||
// Subsystem types.
|
||||
//
|
||||
#define IMAGE_SUBSYSTEM_UNKNOWN 0
|
||||
#define IMAGE_SUBSYSTEM_NATIVE 1
|
||||
#define IMAGE_SUBSYSTEM_WINDOWS_GUI 2
|
||||
#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3
|
||||
#define IMAGE_SUBSYSTEM_WINDOWS_CE_OLD 4
|
||||
#define IMAGE_SUBSYSTEM_OS2_CUI 5
|
||||
#define IMAGE_SUBSYSTEM_POSIX_CUI 7
|
||||
#define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8
|
||||
#define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9
|
||||
#define IMAGE_SUBSYSTEM_EFI_APPLICATION 10
|
||||
#define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
|
||||
#define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
|
||||
#define IMAGE_SUBSYSTEM_EFI_ROM 13
|
||||
#define IMAGE_SUBSYSTEM_XBOX 14
|
||||
#define IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION 16
|
||||
#define IMAGE_SUBSYSTEM_XBOX_CODE_CATALOG 17
|
||||
|
||||
#endif /* !_NTIMAGE_H */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -149,13 +149,13 @@ Return Value:
|
||||
return (BOOLEAN)(Flink == Blink);
|
||||
}
|
||||
|
||||
#define ULONG_ERROR 0xffffffffUL
|
||||
#define ULONG_ERROR 0xFFFFFFFFUL
|
||||
|
||||
FORCEINLINE
|
||||
NTSTATUS
|
||||
RtlULongSub (
|
||||
IN ULONG ulMinuend,
|
||||
IN ULONG ulSubtrahend,
|
||||
IN ULONG ulMinuend,
|
||||
IN ULONG ulSubtrahend,
|
||||
IN OUT PULONG pulResult
|
||||
)
|
||||
|
||||
@ -194,14 +194,14 @@ VOID
|
||||
NTAPI
|
||||
RtlInitUnicodeString (
|
||||
OUT PUNICODE_STRING Destination,
|
||||
IN PCWSTR Source
|
||||
IN PCWSTR Source
|
||||
);
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlGUIDFromString (
|
||||
IN PUNICODE_STRING String,
|
||||
OUT GUID *Guid
|
||||
IN PUNICODE_STRING String,
|
||||
OUT GUID *Guid
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -16,11 +16,7 @@ Abstract:
|
||||
#ifndef _NTSTATUS_H
|
||||
#define _NTSTATUS_H
|
||||
|
||||
#define STATUS_SUCCESS ((NTSTATUS) 0x00000000L)
|
||||
|
||||
//
|
||||
// TODO: There are an insane amount of status values.
|
||||
//
|
||||
#define STATUS_SUCCESS ((NTSTATUS) 0x00000000L)
|
||||
#define STATUS_MEDIA_CHANGED ((NTSTATUS) 0x8000001CL)
|
||||
#define STATUS_UNSUCCESSFUL ((NTSTATUS) 0xC0000001L)
|
||||
#define STATUS_NOT_IMPLEMENTED ((NTSTATUS) 0xC0000002L)
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -19,7 +19,7 @@ Abstract:
|
||||
int
|
||||
ScanHexFormat (
|
||||
IN PCWSTR Buffer,
|
||||
IN ULONG MaximumLength,
|
||||
IN ULONG MaximumLength,
|
||||
IN PCWSTR Format,
|
||||
...
|
||||
)
|
||||
@ -28,13 +28,17 @@ ScanHexFormat (
|
||||
|
||||
Routine Description:
|
||||
|
||||
Turns a text representation of a GUID into the binary format.
|
||||
Parses a formatted hex string.
|
||||
|
||||
Arguments:
|
||||
|
||||
String - A GUID string in the format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.
|
||||
Buffer - The source string to parse.
|
||||
|
||||
Guid - The GUID structure which is to recieve the data.
|
||||
MaximumLength - The length of the source string.
|
||||
|
||||
Format - The format of the source string.
|
||||
|
||||
... - Pointers to data destinations.
|
||||
|
||||
Return Value:
|
||||
|
||||
@ -93,10 +97,10 @@ Return Value:
|
||||
|
||||
if (*Buffer >= '0' && *Buffer <= '9') {
|
||||
Number += *Buffer - '0';
|
||||
} else if (*Buffer >= 'a' && *Buffer <= 'f') {
|
||||
Number += *Buffer - 'a' + 0xa;
|
||||
} else if (*Buffer >= 'A' && *Buffer <= 'F') {
|
||||
Number += *Buffer - 'A' + 0xA;
|
||||
} else if (*Buffer >= 'a' && *Buffer <= 'f') {
|
||||
Number += *Buffer - 'a' + 0xa;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
@ -125,8 +129,8 @@ Return Value:
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
RtlGUIDFromString (
|
||||
IN PUNICODE_STRING String,
|
||||
OUT GUID *Guid
|
||||
IN PUNICODE_STRING String,
|
||||
OUT GUID *Guid
|
||||
)
|
||||
|
||||
/*++
|
||||
@ -155,9 +159,9 @@ Return Value:
|
||||
// Convert string to GUID data.
|
||||
//
|
||||
if (ScanHexFormat(
|
||||
String->Buffer, String->Length / sizeof(WCHAR),
|
||||
L"{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
|
||||
&Guid->Data1, &Guid->Data2, &Guid->Data3, &Data4[0], &Data4[1], &Data4[2], &Data4[3], &Data4[4], &Data4[5], &Data4[6], &Data4[7]
|
||||
String->Buffer, String->Length / sizeof(WCHAR),
|
||||
L"{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
|
||||
&Guid->Data1, &Guid->Data2, &Guid->Data3, &Data4[0], &Data4[1], &Data4[2], &Data4[3], &Data4[4], &Data4[5], &Data4[6], &Data4[7]
|
||||
) == -1) {
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*++
|
||||
|
||||
Copyright (c) 2024, Quinn Stephens.
|
||||
Copyright (c) 2024-2025, Quinn Stephens.
|
||||
Provided under the BSD 3-Clause license.
|
||||
|
||||
Module Name:
|
||||
@ -20,7 +20,7 @@ VOID
|
||||
NTAPI
|
||||
RtlInitUnicodeString (
|
||||
OUT PUNICODE_STRING Destination,
|
||||
IN PCWSTR Source
|
||||
IN PCWSTR Source
|
||||
)
|
||||
|
||||
/*++
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
--- Copyright (c) 2024, Quinn Stephens.
|
||||
--- Copyright (c) 2024-2025, Quinn Stephens.
|
||||
--- Provided under the BSD 3-Clause license.
|
||||
---
|
||||
|
||||
@ -46,7 +46,7 @@ project("BOOTMGR")
|
||||
location("BOOT/ENVIRON/APP/BOOTMGR")
|
||||
files({ "BOOT/ENVIRON/INC/**.h", "BOOT/ENVIRON/LIB/**.c", "BOOT/ENVIRON/LIB/**.S", "BOOT/ENVIRON/APP/BOOTMGR/**.c" })
|
||||
|
||||
includedirs({ "BOOT/ENVIRON/INC", "SDK/INC/CRT", "SDK/INC/NT" })
|
||||
includedirs({ "BOOT/ENVIRON/INC", "SDK/INC/CRT", "SDK/INC/NT", "SDK/INC/EFI" })
|
||||
libdirs({ "BUILD/SDK" })
|
||||
objdir("BUILD/BOOT")
|
||||
targetdir("BUILD/BOOT")
|
||||
|
Loading…
Reference in New Issue
Block a user