yuffie 0.0.1

A library for creating UEFI applications, libraries, and drivers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
// SPDX-License-Identifier: BSD-2-Clause-Patent
// SPDX-FileCopyrightText: 2024 System76, Inc.

//! Internal Forms Representation
//!
//! ## References
//!
//! - UEFI Specification, version 2.10: 33.3.8 Forms Package

use core::ops;

use crate::guid;

pub type QuestionId = u16;
pub type ImageId = u16;
pub type StringId = u16;
pub type FormId = u16;
pub type VarStoreId = u16;
pub type AnimationId = u16;
pub type DefaultId = u16;

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[repr(transparent)]
pub struct OpCode(u8);

impl OpCode {
    pub const FORM: Self = Self(0x01);
    pub const SUBTITLE: Self = Self(0x02);
    pub const TEXT: Self = Self(0x03);
    pub const IMAGE: Self = Self(0x04);
    pub const ONE_OF: Self = Self(0x05);
    pub const CHECKBOX: Self = Self(0x06);
    pub const NUMERIC: Self = Self(0x07);
    pub const PASSWORD: Self = Self(0x08);
    pub const ONE_OF_OPTION: Self = Self(0x09);
    pub const SUPPRESS_IF: Self = Self(0x0A);
    pub const LOCKED: Self = Self(0x0B);
    pub const ACTION: Self = Self(0x0C);
    pub const RESET_BUTTON: Self = Self(0x0D);
    pub const FORM_SET: Self = Self(0x0E);
    pub const REF: Self = Self(0x0F);
    pub const NO_SUBMIT_IF: Self = Self(0x10);
    pub const INCONSISTENT_IF: Self = Self(0x11);
    pub const EQ_ID_VAL: Self = Self(0x12);
    pub const EQ_ID_ID: Self = Self(0x13);
    pub const EQ_ID_VAL_LIST: Self = Self(0x14);
    pub const AND: Self = Self(0x15);
    pub const OR: Self = Self(0x16);
    pub const NOT: Self = Self(0x17);
    pub const RULE: Self = Self(0x18);
    pub const GRAY_OUT_IF: Self = Self(0x19);
    pub const DATE: Self = Self(0x1A);
    pub const TIME: Self = Self(0x1B);
    pub const STRING: Self = Self(0x1C);
    pub const REFRESH: Self = Self(0x1D);
    pub const DISABLE_IF: Self = Self(0x1E);
    pub const ANIMATION: Self = Self(0x1F);
    pub const TO_LOWER: Self = Self(0x20);
    pub const TO_UPPER: Self = Self(0x21);
    pub const MAP: Self = Self(0x22);
    pub const ORDERED_LIST: Self = Self(0x23);
    pub const VARSTORE: Self = Self(0x24);
    pub const VARSTORE_NAME_VALUE: Self = Self(0x25);
    pub const VARSTORE_EFI: Self = Self(0x26);
    pub const VARSTORE_DEVICE: Self = Self(0x27);
    pub const VERSION: Self = Self(0x28);
    pub const END: Self = Self(0x29);
    pub const MATCH: Self = Self(0x2A);
    pub const GET: Self = Self(0x2B);
    pub const SET: Self = Self(0x2C);
    pub const READ: Self = Self(0x2D);
    pub const WRITE: Self = Self(0x2E);
    pub const EQUAL: Self = Self(0x2F);
    pub const NOT_EQUAL: Self = Self(0x30);
    pub const GREATER_THAN: Self = Self(0x31);
    pub const GREATER_EQUAL: Self = Self(0x32);
    pub const LESS_THAN: Self = Self(0x33);
    pub const LESS_EQUAL: Self = Self(0x34);
    pub const BITWISE_AND: Self = Self(0x35);
    pub const BITWISE_OR: Self = Self(0x36);
    pub const BITWISE_NOT: Self = Self(0x37);
    pub const SHIFT_LEFT: Self = Self(0x38);
    pub const SHIFT_RIGHT: Self = Self(0x39);
    pub const ADD: Self = Self(0x3A);
    pub const SUBSTRACT: Self = Self(0x3B);
    pub const MULTIPLY: Self = Self(0x3C);
    pub const DIVIDE: Self = Self(0x3D);
    pub const MODULO: Self = Self(0x3E);
    pub const RULE_REF: Self = Self(0x3F);
    pub const QUESTION_REF1: Self = Self(0x40);
    pub const QUESTION_REF2: Self = Self(0x41);
    pub const UINT8: Self = Self(0x42);
    pub const UINT16: Self = Self(0x43);
    pub const UINT32: Self = Self(0x44);
    pub const UINT64: Self = Self(0x45);
    pub const TRUE: Self = Self(0x46);
    pub const FALSE: Self = Self(0x47);
    pub const TO_UINT: Self = Self(0x48);
    pub const TO_STRING: Self = Self(0x49);
    pub const TO_BOOLEAN: Self = Self(0x4A);
    pub const MID: Self = Self(0x4B);
    pub const FIND: Self = Self(0x4C);
    pub const TOKEN: Self = Self(0x4D);
    pub const STRING_REF1: Self = Self(0x4E);
    pub const STRING_REF2: Self = Self(0x4F);
    pub const CONDITIONAL: Self = Self(0x50);
    pub const QUESTION_REF3: Self = Self(0x51);
    pub const ZERO: Self = Self(0x52);
    pub const ONE: Self = Self(0x53);
    pub const ONES: Self = Self(0x54);
    pub const UNDEFINED: Self = Self(0x55);
    pub const LENGTH: Self = Self(0x56);
    pub const DUP: Self = Self(0x57);
    pub const THIS: Self = Self(0x58);
    pub const SPAN: Self = Self(0x59);
    pub const VALUE: Self = Self(0x5A);
    pub const DEFAULT: Self = Self(0x5B);
    pub const DEFAULTSTORE: Self = Self(0x5C);
    pub const FORM_MAP: Self = Self(0x5D);
    pub const CATENATE: Self = Self(0x5E);
    pub const GUID: Self = Self(0x5F);
    pub const SECURITY: Self = Self(0x60);
    pub const MODAL_TAG: Self = Self(0x61);
    pub const REFRESH_ID: Self = Self(0x62);
    pub const WARNING: Self = Self(0x63);
    pub const MATCH2: Self = Self(0x64);
}

impl From<u8> for OpCode {
    fn from(value: u8) -> Self {
        Self(value)
    }
}

#[derive(Debug)]
#[repr(C)]
pub struct OpHeader {
    /// Type of operation this header describes
    pub OpCode: OpCode,
    pub ScopeAndLength: u8,
}

impl OpHeader {
    /// The opcode begins a new scope
    pub fn scope(&self) -> u8 {
        (self.ScopeAndLength >> 7) & 0x1
    }

    /// The number of bytes in the opcode, including this header
    pub fn length(&self) -> u8 {
        self.ScopeAndLength & 0x7F
    }
}

#[derive(Debug)]
#[repr(C)]
pub struct StatementHeader {
    pub Prompt: StringId,
    pub Help: StringId,
}

#[repr(transparent)]
pub struct QuestionFlags(u8);
impl QuestionFlags {
    pub const READ_ONLY: Self = Self(1 << 0);
    pub const CALLBACK: Self = Self(1 << 2);
    pub const RESET_REQUIRED: Self = Self(1 << 4);
    pub const REST_STYLE: Self = Self(1 << 5);
    pub const RECONNECT_REQUIRED: Self = Self(1 << 6);
    pub const OPTIONS_ONLY: Self = Self(1 << 7);
}

impl ops::BitOr for QuestionFlags {
    type Output = Self;

    fn bitor(self, rhs: Self) -> Self::Output {
        Self(self.0 | rhs.0)
    }
}

impl From<u8> for QuestionFlags {
    fn from(value: u8) -> Self {
        Self(value)
    }
}

#[repr(C)]
pub union VarStoreInfo {
    VarName: StringId,
    VarOffset: u16,
}

#[repr(C, packed)]
pub struct QuestionHeader {
    pub Header: StatementHeader,
    pub QuestionId: QuestionId,
    pub VarStoreId: VarStoreId,
    pub VarStoreInfo: VarStoreInfo,
    pub Flags: QuestionFlags,
}

#[repr(C, packed)]
pub struct Action {
    pub Header: OpHeader,
    pub Question: QuestionHeader,
    pub QuestionConfig: StringId,
}

#[repr(C, packed)]
pub struct Action1 {
    pub Header: OpHeader,
    pub Question: QuestionHeader,
}

#[repr(C)]
pub struct Animation {
    pub Header: OpHeader,
    pub Id: AnimationId,
}

#[repr(C)]
pub struct Add {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct And {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct BitwiseAnd {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct BitwiseNot {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct BitwiseOr {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Catenate {
    pub Header: OpHeader,
}

#[repr(C, packed)]
pub struct Checkbox {
    pub Header: OpHeader,
    pub Question: QuestionHeader,
    pub Flags: u8,
}

#[repr(C)]
pub struct Conditional {
    pub Header: OpHeader,
}

#[repr(C, packed)]
pub struct Date {
    pub Header: OpHeader,
    pub Question: QuestionHeader,
    pub Flags: u8,
}

// TODO
//#[repr(C)]
//pub struct Default {
//    pub Header: OpHeader,
//    pub DefaultId: u16,
//    pub Type: u8,
//    pub Value: TypeValue,
//}

#[repr(C)]
pub struct DefaultStore {
    pub Header: OpHeader,
    pub DefaultName: StringId,
    pub DefaultId: u16,
}

#[repr(C)]
pub struct DisableIf {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Divide {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Dup {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct End {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Equal {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct EqIdId {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct EqIdVal {
    pub Header: OpHeader,
    pub QuestionId: QuestionId,
    pub Value: u16,
}

// TODO
//#[repr(C)]
//pub struct EqIdValList {
//    pub Header: OpHeader,
//    pub QuestionId: QuestionId,
//    pub ListLength: u16,
//    pub ValueList: [u16; 1],
//}

#[repr(C)]
pub struct False {
    pub Header: OpHeader,
}

#[repr(C, packed)]
pub struct Find {
    pub Header: OpHeader,
    pub Format: u8,
}

#[repr(C)]
pub struct Form {
    pub Header: OpHeader,
    pub FormId: FormId,
    pub FormTitle: StringId,
}

// TODO
//#[repr(C)]
//pub struct FormMap {
//    pub Header: OpHeader,
//    pub FormId: FormId,
//}

// TODO
//#[repr(C)]
//pub struct FormSet {
//    pub Header: OpHeader,
//    pub Guid: guid::Guid,
//    pub FormSetTitle: StringId,
//    pub Help: StringId,
//    pub Flags: u8,
//}

#[repr(C, packed)]
pub struct Get {
    pub Header: OpHeader,
    pub VarStoreId: VarStoreId,
    pub VarStoreInfo: VarStoreInfo,
    pub VarStoreType: u8,
}

#[repr(C)]
pub struct GrayOutIf {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct GreaterEqual {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct GreaterThan {
    // NOTE: UEFI 2.10 incorrectly uses `EFI_IFR_OP_HEADER*`.
    pub Header: OpHeader,
}

#[repr(C, packed)]
pub struct Guid {
    pub Header: OpHeader,
    pub Guid: guid::Guid,
}

#[repr(C)]
pub struct Image {
    // NOTE: UEFI 2.10 incorrectly missing `Header`.
    pub Header: OpHeader,
    pub Id: ImageId,
}

#[repr(C)]
pub struct InconsistentIf {
    pub Header: OpHeader,
    pub Error: StringId,
}

#[repr(C)]
pub struct Length {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct LessEqual {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct LessThan {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Locked {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Map {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Match {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Mid {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Modal {
    // NOTE: UEFI 2.10 incorrectly uses `EFI_IFR_OP_HEADER*`.
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Modulo {
    // NOTE: UEFI 2.10 incorrectly uses `EFI_IFR_OP_HEADER*`.
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Multiply {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Not {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct NotEqual {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct NoSubmitIf {
    pub Header: OpHeader,
    pub Error: StringId,
}

// TODO
//#[repr(C)]
//pub struct Numeric {
//    pub Header: OpHeader,
//    pub Question: QuestionHeader,
//    pub Flags: u8,
//    pub Data: ,
//}

#[repr(C)]
pub struct One {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Ones {
    pub Header: OpHeader,
}

// TODO
//#[repr(C)]
//pub struct OneOf {
//    pub Header: OpHeader,
//    // NOTE: UEFI 2.10 incorrectly uses `EFI_IFR_QUESTION_HEADER*`.
//    pub Question: QuestionHeader,
//    pub Flags: u8,
//    pub Data: ,
//}

// TODO
//#[repr(C)]
//pub struct OneOfOption {
//    pub Header: OpHeader,
//    pub Option: StringId,
//    pub Flags: u8,
//    pub Type: u8,
//    pub Value: TypeValue,
//}

#[repr(C)]
pub struct Or {
    pub Header: OpHeader,
}

#[repr(C, packed)]
pub struct OrderedList {
    pub Header: OpHeader,
    pub Question: QuestionHeader,
    pub MaxContainers: u8,
    pub Flags: u8,
}

#[repr(C, packed)]
pub struct Password {
    pub Header: OpHeader,
    pub Question: QuestionHeader,
    pub MinSize: u16,
    pub MaxSize: u16,
}

#[repr(C)]
pub struct QuestionRef1 {
    pub Header: OpHeader,
    pub QuestionId: QuestionId,
}

#[repr(C)]
pub struct QuestionRef2 {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct QuestionRef3 {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct QuestionRef3_2 {
    pub Header: OpHeader,
    pub DevicePath: StringId,
}

#[repr(C)]
pub struct QuestionRef3_3 {
    pub Header: OpHeader,
    pub DevicePath: StringId,
    pub Guid: guid::Guid,
}

#[repr(C)]
pub struct Read {
    pub Header: OpHeader,
}

#[repr(C, packed)]
pub struct Ref {
    pub Header: OpHeader,
    pub Question: QuestionHeader,
    pub FormId: FormId,
}

#[repr(C, packed)]
pub struct Ref2 {
    pub Header: OpHeader,
    pub Question: QuestionHeader,
    pub FormId: FormId,
    pub QuestionId: QuestionId,
}

#[repr(C, packed)]
pub struct Ref3 {
    pub Header: OpHeader,
    pub Question: QuestionHeader,
    pub FormId: FormId,
    pub QuestionId: QuestionId,
    pub FormSetId: guid::Guid,
}

#[repr(C, packed)]
pub struct Ref4 {
    pub Header: OpHeader,
    pub Question: QuestionHeader,
    pub FormId: FormId,
    pub QuestionId: QuestionId,
    pub FormSetId: guid::Guid,
    pub DevicePath: StringId,
}

#[repr(C, packed)]
pub struct Ref5 {
    pub Header: OpHeader,
    pub Question: QuestionHeader,
}

#[repr(C)]
pub struct Refresh {
    pub Header: OpHeader,
    pub RefreshInterval: u8,
}

#[repr(C, packed)]
pub struct RefreshId {
    pub Header: OpHeader,
    pub RefreshEventGroupId: guid::Guid,
}

#[repr(C)]
pub struct ResetButton {
    pub Header: OpHeader,
    pub Statement: StatementHeader,
    pub DefaultId: DefaultId,
}

#[repr(C)]
pub struct Rule {
    pub Header: OpHeader,
    pub RuleId: u8,
}

#[repr(C)]
pub struct RuleRef {
    pub Header: OpHeader,
    pub RuleId: u8,
}

#[repr(C, packed)]
pub struct Security {
    pub Header: OpHeader,
    pub Permissions: guid::Guid,
}

#[repr(C, packed)]
pub struct Set {
    pub Header: OpHeader,
    pub VarStoreId: VarStoreId,
    pub VarStoreInfo: VarStoreInfo,
    pub VarStoreType: u8,
}

#[repr(C)]
pub struct ShiftLeft {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct ShiftRight {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Span {
    pub Header: OpHeader,
    pub Flags: u8,
}

#[repr(C, packed)]
pub struct String {
    pub Header: OpHeader,
    pub Question: QuestionHeader,
    pub MinSize: u8,
    pub MaxSize: u8,
    pub Flags: u8,
}

#[repr(C)]
pub struct StringRef1 {
    pub Header: OpHeader,
    pub StringId: StringId,
}

#[repr(C)]
pub struct StringRef2 {
    pub Header: OpHeader,
}

#[repr(C, packed)]
pub struct Subtitle {
    pub Header: OpHeader,
    pub Statement: StatementHeader,
    pub Flags: u8,
}

#[repr(C)]
pub struct Subtract {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct SuprressIf {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Text {
    pub Header: OpHeader,
    pub Statement: StatementHeader,
    pub TextTwo: StringId,
}

#[repr(C)]
pub struct This {
    pub Header: OpHeader,
}

#[repr(C, packed)]
pub struct Time {
    pub Header: OpHeader,
    pub Question: QuestionHeader,
    pub Flags: u8,
}

#[repr(C)]
pub struct Token {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct ToBoolean {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct ToLower {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct ToString {
    pub Header: OpHeader,
    pub Format: u8,
}

#[repr(C)]
pub struct ToUint {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct ToUpper {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct True {
    pub Header: OpHeader,
}

#[repr(C, packed)]
pub struct Uint8 {
    pub Header: OpHeader,
    pub Value: u8,
}

#[repr(C)]
pub struct Uint16 {
    pub Header: OpHeader,
    pub Value: u16,
}

#[repr(C, packed)]
pub struct Uint32 {
    pub Header: OpHeader,
    pub Value: u32,
}

#[repr(C, packed)]
pub struct Uint64 {
    pub Header: OpHeader,
    pub Value: u64,
}

#[repr(C)]
pub struct Undefined {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Value {
    pub Header: OpHeader,
}

// TODO
//#[repr(C)]
//pub struct VarStore {
//    pub Header: OpHeader,
//    pub Guid: guid::Guid,
//    pub VarStoreId: VarStoreId,
//    pub Size: u16,
//    //pub Name: *mut u8,
//}

#[repr(C, packed)]
pub struct VarStoreNameValue {
    pub Header: OpHeader,
    pub VarStoreId: VarStoreId,
    pub Guid: guid::Guid,
}

// TODO
//#[repr(C)]
//pub struct VarStoreEfi {
//    pub Header: OpHeader,
//    pub VarStoreId: VarStoreId,
//    pub Guid: guid::Guid,
//    pub Attributes: u32,
//    pub Size: u16,
//    //pub Name: *mut u8,
//}

#[repr(C)]
pub struct VarStoreDevice {
    pub Header: OpHeader,
    pub DevicePath: StringId,
}

#[repr(C)]
pub struct Version {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Write {
    pub Header: OpHeader,
}

#[repr(C)]
pub struct Zero {
    pub Header: OpHeader,
}

#[repr(C, packed)]
pub struct WarningIf {
    pub Header: OpHeader,
    pub Warning: StringId,
    pub TimeOut: u8,
}

#[repr(C, packed)]
pub struct Match2 {
    pub Header: OpHeader,
    pub SyntaxType: guid::Guid,
}