#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef unsigned char UINT8;
typedef struct {
UINT8 Type; ///< 0x01 Hardware Device Path.
///< 0x02 ACPI Device Path.
///< 0x03 Messaging Device Path.
///< 0x04 Media Device Path.
///< 0x05 BIOS Boot Specification Device Path.
///< 0x7F End of Hardware Device Path.
UINT8 SubType; ///< Varies by Type
///< 0xFF End Entire Device Path, or
///< 0x01 End This Instance of a Device Path and start a new
///< Device Path.
UINT8 Length[2]; ///< Specific Device Path data. Type and Sub-Type define
///< type of data. Size of data is included in Length.
//Length[0]: low 8 bytes, Length[1]: high 8 bytes
} EFI_DEVICE_PATH_PROTOCOL;
int main()
{
int aaa = 2;
int bbb = 3;
unsigned char s[30];
memset(s, 0, 30);
EFI_DEVICE_PATH_PROTOCOL *p = (EFI_DEVICE_PATH_PROTOCOL *)s;
p->Type = 1;
p->SubType = 2;
p->Length[0] = 3;
p->Length[1] = 4;
p = (EFI_DEVICE_PATH_PROTOCOL *)(s + 15);
p->Type = 1;
p->SubType = 2;
p->Length[0] = 3;
p->Length[1] = 4;
for(int i=0;i<30;i++)
{
printf("%d: %c %u\n", i+1, s[i], s[i]);
//TODO
}
}