summaryrefslogtreecommitdiff
path: root/EDK/MiniSetup/uefi2.0/uefi20Wapper.c
blob: 8b4bf06135ec8474f5c8f74e5833de86ec26ac08 (plain)
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
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
//**                                                             **//
//**         (C)Copyright 2013, American Megatrends, Inc.        **//
//**                                                             **//
//**                     All Rights Reserved.                    **//
//**                                                             **//
//**   5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093  **//
//**                                                             **//
//**                     Phone (770)-246-8600                    **//
//**                                                             **//
//*****************************************************************//
//*****************************************************************//
//*****************************************************************//
// $Archive: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/uefi2.0/uefi20Wapper.c $
//
// $Author: Arunsb $
//
// $Revision: 34 $
//
// $Date: 5/02/14 10:38p $
//
//*****************************************************************//
//*****************************************************************//
// Revision History
// ----------------
// $Log: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/uefi2.0/uefi20Wapper.c $
// 
// 34    5/02/14 10:38p Arunsb
// gEnableProcessPack variable added to avoid build error
// 
// 33    6/10/13 2:15p Arunsb
// EvaluateControlDefault function added to avoid build error in 2.0
// 
// 32    3/25/13 8:34a Premkumara
// [TAG]  		EIP116315
// [Category]  	Improvement
// [Description]  	Display control prompt string for password control.
// (for String on CHAP secret popup)
// [Files]  		- AMITSE.sdl
// - CommonHelper.c
// - FakeToken.c
// - AmiTSEStr.uni
// - TseLite\PopupPassword.c
// - uefi2.1\UefiWapper21.c
// - uefi2.0\HiiCallback.c
// - uefi2.0\hii.h
// - uefi2.0\hii.c 
// 
// 31    10/18/12 6:00a Arunsb
// Updated for 2.16.1235 QA submission
// 
// 18    10/10/12 12:39p Arunsb
// Synched the source for v2.16.1232, backup with Aptio
// 
// 28    9/25/12 1:45p Premkumara
// EIP - 99059 - Updated for UEFI2.0
// Files - Hii.c, Uefi20Wapper.c
// 
// 27    2/02/12 2:56a Premkumara
// [TAG]  		EIP75066 
// [Category]  	Improvement
// [Description]  	Support loading defaults for Ordelist controls
// [Files]  		Ordlistbox.c, Uefi21Wapper.c, CtrlCond.c, HiiCallback.c,
// Parse.c, Uefi20Wapper.c, TseUefihiil.h
// 
// 26    12/08/11 9:37a Rajashakerg
// [TAG]  		EIP75588
// [Category]  	Improvement
// [Description]  	Updated the file to aviod build errors when build for
// UEFI 20 by providing the dummy functions.
// 
// 25    12/02/11 1:52a Premkumara
// [TAG]  		EIP73226
// [Category]  	New Feature
// [Description]  	Extended support for password prompt
// [Files]  	FakeToken.c, Uefi21Wapper.c, AmiTSEStr.uni, PopupPassword.c,
// HiiCallBack.c, Uefi20Wapper.c
// 
// 24    12/01/11 7:16p Blaines
// Fix build errors in Uefi2.0
// 
// 23    11/28/11 5:06a Rajashakerg
// [TAG]  		EIP73231
// [Category]  	Improvement
// [Description]  	Callback handling :For interactive controls updating
// the currnet vaule in cache even when hii callback returns error status.
// [Files]  		Date.c, SubMenu.c, ordlistbox.c, time.c, UefiAction.c,
// hii.h, uefi20Wapper.c, HiiCallback.c, TseUefiHii.h, Uefi21Wapper.c  
// 
// 22    11/23/11 5:24a Rajashakerg
// [TAG]  		EIP75473 
// [Category]  	Improvement
// [Description]  	System Time is not updated every second
// [Files]  		variable.h, variable.c, FormBrowser2.c, TseUefiHii.h,
// Uefi21Wapper.c, hii.h, uefi20Wapper.c
// 
// 21    10/18/11 1:50p Blaines
// [TAG] - EIP 66860
// [Category]- Function Request
// [Synopsis]- AmiPostManager interface for text entry.
// [Files] - LogoLib.h, AMIPostMgr.h, protocol.c, protocol.h,
// TseAdvanced.c, TseLitehelper.c, TseUefiHii.h, Uefi21Wapper.c,
// uefi20Wapper.c
// 
// 20    6/30/11 4:15a Arunsb
// [TAG]           EIP57661
// [Category]      New Feature
// [Description]   Boot manager algorithm for interaction with Driver
// Health protocol.
//                 Wrapper functions added.
// [Files]         amitse.cif, amitse.sdl, faketokens.c, amitsestr.uni,
//                 commonhelper.c, uefisetup.ini, tsedrvhealth.h,
// amivfr.h, minisetupbin.mak,
//                 hiistring21.c, hiistring20.c, tseadvanced.c, special.c,
// special.h, boot.h, minisetup.h,
//                 uefi20wapper.c, formbrowser2.c, hii.c, parse.c and
// uefi21wapper.c.
// 
// 19    6/28/11 3:44p Arunsb
// [TAG]  		EIP55762
// [Description]  	Dummy  UpdateDestiantionQuestion function added
// 
// 18    4/29/11 4:39p Arunsb
// For 2.13 public patch release IFR RefX feature is omitted
// 
// 16    3/28/11 5:03p Rajashakerg
// [TAG]  		EIP56413 
// [Category]  	Improvement
// [Description]  	TSE: Support for EFI_IFR_RESET_BUTTON opcode
// [Files]  		ezport.c, minisetupext.h, ResetButton.c, ResetButton.h,
// Hii.c, TseUefiHii.h, Uefi21Wapper.c, hii.h, Uefi20Wapper.c 
// 
// 15    3/09/11 7:25p Madhans
// [TAG]  		EIPEIP48615 
// [Category]  	Improvement
// [Description]  	To support UEFI 2.1 RefreshOp. Based in Refersh Rate
// Controls are refershed periodically.
// [Files]  		minisetupext.h
// SubMenu.h
// SubMenu.c
// Memo.c
// Memo.h
// numeric.c
// numeric.h
// time.c
// Date.c
// PopupSel.c
// PopupSel.h
// PopupString.c
// PopupString.h
// ordlistbox.c
// minisetupext.c
// UefiAction.c
// hii.h
// Uefi20wapper.c
// hiicallback.c
// Parse.c
// tseuefihii.h
// Uefi21wapper.c
// 
// 14    2/01/11 7:41p Madhans
// [TAG] - EIP 52032 
// [Category]- Defect
// [Severity]- Mordarate
// [Symptom] - In UEFI2.0 Updating the Interactive One of Control may not
// work correctly.
// [RootCause] - The UefiGetControlKey for Interactive one of control is
// not returned properly.
// [Solution]- fix in UefiGetControlKey control.
// [Files] - uefi20wapper.c
// 
// 13    2/01/11 7:37p Madhans
// [TAG] - EIP 50737 
// [Category]- Defect
// [Severity]- Mordarate
// [Symptom] - Suppressing the Interactive control does not work
// correctly.
// [RootCause] - The control conditional pointer if not set correctly.
// [Solution]- To fix the Control condition pointer. And identify the
// suppress if related to UEFI action control
// [Files] - UefiAction.c TseLiteHelper.c hii.h uefi20wapper.c
// uefi21wapper.c
// 
// 12    12/02/10 6:09p Madhans
// [TAG] - EIP49562    
// [Category]- Improvment.
// [Severity]- Mordarate
// [Symptom]- Need to support UEFI 2.2 requirements related to Calling
// Formcallback with 
// EFI_BROWSER_ACTION_CHANGING and EFI_BROWSER_ACTION_CHANGED action.
// [Solution]- Implemented the support.
// [Files] - submenu.c, numeric.c, popupsel.c, popupString.c,
// uefi20\hii.h, uefi20\uefi20wrapper.c
// uefi21\hiicalback.c, uefi21\tseuefihii.h
// 
// 11    9/16/10 8:38p Madhans
// Update for TSE 2.10. Refer Changelog.log for more details.
// 
// 10    6/15/10 12:16p Blaines
// Update functon prototype for UefiSetTime and UefiGetTime
// 
// 9     6/04/10 12:53p Blaines
// Add support for UEFI 2.1 date and time controls
// 
// 8     2/19/10 1:04p Madhans
// Updated for TSE 2.01. Refer Changelog.log for File change history.
// 
// 11    2/19/10 8:20a Mallikarjunanv
// updated year in copyright message
// 
// 10    1/29/10 4:34p Madhans
// To avoid compiler warnings.
// 
// 9     1/27/10 12:59p Madhans
// // EIP 33804 : Issue iSCSI initiator name is not saved..
// 
// 8     1/09/10 7:30a Mallikarjunanv
// Updated TSE2.01 Release sources with coding standards
// 
// 7     10/19/09 10:52a Blaines
// EIP #26029 Fix: UefiCreateOneOfWithOptionsTemplate() does not always
// return NULL when EfiLibAllocateZeroPool() returns NULL
// 
// 6     7/09/09 12:30p Mallikarjunanv
// updated the password encoding fix
// 
// 4     6/24/09 6:11p Madhans
// Made TSE_USE_EDK_LIBRARY=OFF to not to refer EDK module.
// 
// 3     6/23/09 6:51p Blaines
// Coding standard update, 
// Remove spaces from file header to allow proper chm function list
// creation.
// 
// 2     6/12/09 7:44p Presannar
// Initial implementation of coding standards for AMITSE2.0
// 
// 1     6/04/09 8:05p Madhans
// 
// 1     4/28/09 11:09p Madhans
// Tse 2.0 Code complete Checkin.
// 
// 4     4/28/09 9:40p Madhans
// Tse 2.0 Code complete Checkin.
// 
// 3     3/31/09 4:14p Madhans
// UEFI Wrapper improvments.
// 
// 2     1/30/09 6:06p Madhans
// Function headers added. 
// 
// 1     12/18/08 7:59p Madhans
// Intial version of TSE Lite sources
// 
// 
//*****************************************************************//
//*****************************************************************//

//<AMI_FHDR_START>
//----------------------------------------------------------------------------
//
// Name:		uefi20wraper.c
//
// Description:	This file contains code for UEFI2.0 wrapper
//
//----------------------------------------------------------------------------
//<AMI_FHDR_END>

#include "minisetup.h"
#include EFI_PROTOCOL_DEFINITION(Hii)
#include EFI_PROTOCOL_DEFINITION(FormCallback)
extern EFI_HII_PROTOCOL	*gHiiProtocol;
BOOLEAN gPackUpdatePending = FALSE;
BOOLEAN gEnableProcessPack = FALSE; //Added to avoid build error

static EFI_IFR_SUBTITLE	_Title = { { EFI_IFR_SUBTITLE_OP, sizeof(EFI_IFR_SUBTITLE) }, 0 };
static EFI_IFR_SUBTITLE	_Help = { { EFI_IFR_SUBTITLE_OP, sizeof(EFI_IFR_SUBTITLE) }, 0 };
static EFI_IFR_SUBTITLE	_SubTitle = { { EFI_IFR_SUBTITLE_OP, sizeof(EFI_IFR_SUBTITLE) }, 0 };
static EFI_IFR_SUBTITLE	_HelpTitle = { { EFI_IFR_SUBTITLE_OP, sizeof(EFI_IFR_SUBTITLE) }, STRING_TOKEN(STR_HELP_TITLE) };
static EFI_IFR_SUBTITLE	_NavStrings = { { EFI_IFR_SUBTITLE_OP, sizeof(EFI_IFR_SUBTITLE) }, 0 };

UINTN	gTitle = (UINTN)&_Title;
UINTN	gHelp = (UINTN)&_Help;
UINTN	gSubTitle = (UINTN)&_SubTitle;
UINTN	gHelpTitle = (UINTN)&_HelpTitle;
UINTN	gNavStrings = (UINTN)&_NavStrings;

EFI_IFR_FORM_SET *HiiGetFormSetFromHandle( /*EFI_HII_HANDLE*/VOID* handle );
EFI_IFR_FORM_SET *HiiGetFormSet( UINTN index );
VOID *UefiCreateStringTemplate(UINT16 Token);

UINT32 FindVarFromITKQuestionId(UINT16 QuestionId);
UINT32 GetVarNumFromVarID(UINT32 ID);
VOID UefiSetHelpField(VOID *IfrPtr,UINT16 Token);
////For avoiding build error EIP101564
UINT32 gRefreshIdCount = 0; //No. of controls with Refresh Id set	
REFRESH_ID_INFO *gRefreshIdInfo = NULL;

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetHelpField
//
// Description:	To get the specific help field
//
// Input:		VOID *IfrPtr
//
// Output:		Help Field
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiGetHelpField(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_REF_OP:
		return ((EFI_IFR_REF*)OpHeader)->Help;
		break;
	case EFI_IFR_TEXT_OP:
		return ((EFI_IFR_TEXT*)OpHeader)->Help;
		break;
	case EFI_IFR_ONE_OF_OP:
		return ((EFI_IFR_ONE_OF*)OpHeader)->Help;
		break;
	case EFI_IFR_TIME_OP:
	case EFI_IFR_DATE_OP:
	case EFI_IFR_NUMERIC_OP:
		return ((EFI_IFR_NUMERIC*)OpHeader)->Help; 
		break;
	case EFI_IFR_PASSWORD_OP:
		return ((EFI_IFR_PASSWORD*)OpHeader)->Help; 
		break;
	case EFI_IFR_STRING_OP:
		return ((EFI_IFR_STRING*)OpHeader)->Help; 
		break;
	default:
		break;
	}

	return 0;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiSetHelpField
//
// Description:	To Set the specific help field
//
// Input:	VOID *IfrPtr,	UINT16 Token
//
// Output:	VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiSetHelpField(VOID *IfrPtr, UINT16 Token)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_REF_OP:
		((EFI_IFR_REF*)OpHeader)->Help = Token ;
		break;
	case EFI_IFR_TEXT_OP:
		((EFI_IFR_TEXT*)OpHeader)->Help = Token ;
		break;
	case EFI_IFR_ONE_OF_OP:
		((EFI_IFR_ONE_OF*)OpHeader)->Help = Token ;
		break;
	case EFI_IFR_TIME_OP:
	case EFI_IFR_DATE_OP:
	case EFI_IFR_NUMERIC_OP:
		((EFI_IFR_NUMERIC*)OpHeader)->Help = Token ;
		break;
	case EFI_IFR_PASSWORD_OP:
		((EFI_IFR_PASSWORD*)OpHeader)->Help = Token ;
		break;
	case EFI_IFR_STRING_OP:
		((EFI_IFR_STRING*)OpHeader)->Help = Token ;
		break;
	default:
		break;
	}
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetPromptField
//
// Description:	To get the prompt field from ifr
//
// Input:		VOID *IfrPtr
//
// Output:		Prompt Field
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiGetPromptField(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_REF_OP:
		return ((EFI_IFR_REF*)OpHeader)->Prompt;
		break;
	case EFI_IFR_NUMERIC_OP:
	case EFI_IFR_TIME_OP:
	case EFI_IFR_DATE_OP:
		return ((EFI_IFR_NUMERIC*)OpHeader)->Prompt;
		break;
	case EFI_IFR_ONE_OF_OP:
		return ((EFI_IFR_ONE_OF*)OpHeader)->Prompt;
		break;
	case EFI_IFR_ORDERED_LIST_OP:
		return ((EFI_IFR_ORDERED_LIST*)OpHeader)->Prompt;
		break;
	case EFI_IFR_CHECKBOX_OP:
		return ((EFI_IFR_CHECK_BOX*)OpHeader)->Prompt;
		break;
	case EFI_IFR_PASSWORD_OP:
		return ((EFI_IFR_PASSWORD*)OpHeader)->Prompt;
		break;
	case EFI_IFR_STRING_OP:
		return ((EFI_IFR_STRING*)OpHeader)->Prompt;
		break;
	default:
		break;
	}

	return 0;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetKeyField
//
// Description:	To get the Key field from ifr
//
// Input:		VOID *IfrPtr
//
// Output:		Key Field
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiGetKeyField(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_REF_OP:
		return ((EFI_IFR_REF*)OpHeader)->Key;
		break;
	case EFI_IFR_NUMERIC_OP:
		return ((EFI_IFR_NUMERIC*)OpHeader)->Key;
		break;
	case EFI_IFR_PASSWORD_OP:
		return ((EFI_IFR_PASSWORD*)OpHeader)->Key;
		break;
	case EFI_IFR_TEXT_OP:
		return ((EFI_IFR_TEXT*)OpHeader)->Key;
		break;
	case EFI_IFR_CHECKBOX_OP:
		return ((EFI_IFR_CHECK_BOX*)OpHeader)->Key;
		break;
	case EFI_IFR_ONE_OF_OP:
    case EFI_IFR_ORDERED_LIST_OP:
    	if(OpHeader->OpCode == EFI_IFR_ORDERED_LIST_OP)
    		OpHeader = (EFI_IFR_OP_HEADER *)(((UINT8 *)OpHeader) +sizeof(EFI_IFR_ORDERED_LIST) );
    	else
    		OpHeader = (EFI_IFR_OP_HEADER *)(((UINT8 *)OpHeader) +sizeof(EFI_IFR_ONE_OF) );
		return ((EFI_IFR_ONE_OF_OPTION*)OpHeader)->Key;
		break;
	case EFI_IFR_ONE_OF_OPTION_OP:
		return ((EFI_IFR_ONE_OF_OPTION*)OpHeader)->Key;
		break;
	case EFI_IFR_STRING_OP:
		return ((EFI_IFR_STRING*)OpHeader)->Key;
		break;
	default:
		break;
	}

	return 0;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetTitleField
//
// Description:	To get the Title field from ifr
//
// Input:		VOID *IfrPtr
//
// Output:		Title Field
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiGetTitleField(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_SUBTITLE_OP:
		return ((EFI_IFR_SUBTITLE*)OpHeader)->SubTitle;
		break;
	case EFI_IFR_FORM_OP:
		return ((EFI_IFR_FORM*)OpHeader)->FormTitle;
		break;
	default:
		break;
	}

	return 0;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetFlagsField
//
// Description:	to get the Flags field from ifr
//
// Input:		VOID *IfrPtr
//
// Output:		Flags Field
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT8 UefiGetFlagsField(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_REF_OP:
		return ((EFI_IFR_REF*)OpHeader)->Flags;
		break;
	default:
		break;
	}

	return 0;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiIsInteractive
//
// Description: To get Uefi Interactive
//
// Input:		CONTROL_INFO *ControlData
//
// Output:		TRUE/FALSE
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
BOOLEAN UefiIsInteractive(CONTROL_INFO *ControlData)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)ControlData->ControlPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_REF_OP:
		return ((((EFI_IFR_REF*)OpHeader)->Flags & EFI_IFR_FLAG_INTERACTIVE)?TRUE:FALSE);
		break;
	case EFI_IFR_NUMERIC_OP:
		return ((((EFI_IFR_NUMERIC*)OpHeader)->Flags & EFI_IFR_FLAG_INTERACTIVE)?TRUE:FALSE);
		break;
	case EFI_IFR_STRING_OP:
		return ((((EFI_IFR_STRING*)OpHeader)->Flags & EFI_IFR_FLAG_INTERACTIVE)?TRUE:FALSE);
		break;
	case EFI_IFR_PASSWORD_OP:
		return ((((EFI_IFR_PASSWORD*)OpHeader)->Flags & EFI_IFR_FLAG_INTERACTIVE)?TRUE:FALSE);
		break;
	default:
		break;
	}

	return FALSE;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetControlKey
//
// Description:	Helper function in obtaining Control Key
//
// Input:		CONTROL_INFO *ControlData
//
// Output:		Key Field
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiGetControlKey(CONTROL_INFO *ControlData)
{
	return UefiGetKeyField((VOID*)ControlData->ControlPtr);
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetTextField
//
// Description:	Function to get the Text Field.
//
// Input:		VOID *IfrPtr
//
// Output:		Text Field
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiGetTextField(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_TEXT_OP:
		return ((EFI_IFR_TEXT*)OpHeader)->Text;
		break;
	default:
		break;
	}

	return 0;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetTextTwoField
//
// Description:	Function to get the Text Field.
//
// Input:		VOID *IfrPtr
//
// Output:		Text Field
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiGetTextTwoField(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_TEXT_OP:
		return ((EFI_IFR_TEXT*)OpHeader)->TextTwo;
		break;
	default:
		break;
	}

	return 0;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiSetSubTitleField
//
// Description:	Function to Set the Sub-Title Field.
//
// Input:		VOID *IfrPtr,	UINT16 Token
//
// Output:	VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiSetSubTitleField(VOID *IfrPtr,UINT16 Token)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_SUBTITLE_OP:
		((EFI_IFR_SUBTITLE*)OpHeader)->SubTitle = Token;
		break;
	default:
		break;
	}
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiSetPromptField
//
// Description:	Function to set the prompt Field.
//
// Input:	VOID *IfrPtr,	UINT16 Token
//
// Output:	VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiSetPromptField(VOID *IfrPtr,UINT16 Token)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_REF_OP:
		((EFI_IFR_REF*)OpHeader)->Prompt = Token;
		break;
	case EFI_IFR_NUMERIC_OP:
	case EFI_IFR_TIME_OP:
	case EFI_IFR_DATE_OP:
		((EFI_IFR_NUMERIC*)OpHeader)->Prompt = Token;
		break;
	case EFI_IFR_ONE_OF_OP:
		((EFI_IFR_ONE_OF*)OpHeader)->Prompt = Token;
		break;
	case EFI_IFR_ORDERED_LIST_OP:
		((EFI_IFR_ORDERED_LIST*)OpHeader)->Prompt = Token;
		break;
	case EFI_IFR_CHECKBOX_OP:
		((EFI_IFR_CHECK_BOX*)OpHeader)->Prompt = Token;
		break;
	case EFI_IFR_PASSWORD_OP:
		((EFI_IFR_PASSWORD*)OpHeader)->Prompt = Token;
		break;
	case EFI_IFR_STRING_OP:
		((EFI_IFR_STRING*)OpHeader)->Prompt = Token;
		break;
	}
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiCreateSubTitleTemplate
//
// Description:	Function to prepare the template for sub-title
//
// Input:		UINT16 Token
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID * UefiCreateSubTitleTemplate(UINT16 Token)
{
	EFI_IFR_OP_HEADER *OpHeader = EfiLibAllocateZeroPool(sizeof(EFI_IFR_SUBTITLE));
	
	OpHeader->OpCode = EFI_IFR_SUBTITLE_OP ;
	OpHeader->Length = sizeof(EFI_IFR_SUBTITLE) ;
	UefiSetSubTitleField((VOID *)OpHeader,Token);
	return (VOID*)OpHeader;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetIfrLength
//
// Description:	Function to get the length of Ifr
//
// Input:		VOID *IfrPtr
//
// Output:		Length
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT8 UefiGetIfrLength(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;
	return OpHeader->Length;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetMinValue
//
// Description: Function to get the minimum value
//
// Input:		VOID *IfrPtr
//
// Output:		UINT64
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT64 UefiGetMinValue(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_NUMERIC_OP:
		return (UINT64)((EFI_IFR_NUMERIC*)OpHeader)->Minimum;
		break;
	case EFI_IFR_PASSWORD_OP:
		return (UINT64)((EFI_IFR_PASSWORD*)OpHeader)->MinSize;
		break;
	case EFI_IFR_STRING_OP:
		return (UINT64)((EFI_IFR_STRING*)OpHeader)->MinSize;
		break;
	default:
		break;
	}
	return (UINT64)0;

}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetMaxValue
//
// Description:	Function to get the max value
//
// Input:		VOID *IfrPtr
//
// Output:		UINT64
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT64 UefiGetMaxValue(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_NUMERIC_OP:
		return (UINT64)((EFI_IFR_NUMERIC*)OpHeader)->Maximum;
		break;
	case EFI_IFR_PASSWORD_OP:
		return (UINT64)((EFI_IFR_PASSWORD*)OpHeader)->MaxSize;
		break;
	case EFI_IFR_STRING_OP:
		return (UINT64)((EFI_IFR_STRING*)OpHeader)->MaxSize;
		break;
	default:
		break;
	}
	return (UINT64)0;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetStepValue
//
// Description:	Function to get the step value
//
// Input:		VOID *IfrPtr
//
// Output:		UINT64
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT64 UefiGetStepValue(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_NUMERIC_OP:
		return (UINT64)((EFI_IFR_NUMERIC*)OpHeader)->Step;
		break;
	default:
		break;
	}
	return (UINT64)0;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetBaseValue
//
// Description:	Function to get the base value
//
// Input:		VOID *IfrPtr
//
// Output:		UINT8
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT8 UefiGetBaseValue(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_NUMERIC_OP:
		return AMI_BASE_DEC;
		break;
	default:
		break;
	}
	return AMI_BASE_DEC;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetWidth
//
// Description:	Function to get width
//
// Input:		VOID *IfrPtr
//
// Output:		UINT16
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiGetWidth(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_NUMERIC_OP:
		return (UINT16)((EFI_IFR_NUMERIC*)OpHeader)->Width;
		break;
	case EFI_IFR_PASSWORD_OP:
		return (UINT16)((EFI_IFR_PASSWORD*)OpHeader)->Width;
		break;
	case EFI_IFR_STRING_OP:
		return (UINT16)((EFI_IFR_STRING*)OpHeader)->Width;
		break;
	case EFI_IFR_ONE_OF_OP:
		return (UINT16)((EFI_IFR_ONE_OF*)OpHeader)->Width;
		break;
	case EFI_IFR_CHECKBOX_OP:
		return (UINT16)((EFI_IFR_CHECK_BOX*)OpHeader)->Width;
		break;
	case EFI_IFR_EQ_ID_VAL_OP:
		return (UINT16)((EFI_IFR_EQ_ID_VAL*)OpHeader)->Width;
		break;
	case EFI_IFR_EQ_ID_LIST_OP:
		return (UINT16)((EFI_IFR_EQ_ID_LIST*)OpHeader)->Width;
		break;
	case EFI_IFR_EQ_ID_ID_OP:
		return (UINT16)((EFI_IFR_EQ_ID_ID*)OpHeader)->Width;
		break;
	default:
		break;
	}
	return (UINT16)0;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiSetWidth
//
// Description:	Function to set width
//
// Input:		VOID *IfrPtr
//
// Output:		UINT16
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiSetWidth(VOID *IfrPtr,UINT8 Width)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_NUMERIC_OP:
		((EFI_IFR_NUMERIC*)OpHeader)->Width = Width;
		break;
	case EFI_IFR_PASSWORD_OP:
		((EFI_IFR_PASSWORD*)OpHeader)->Width = Width ;
		break;
	case EFI_IFR_STRING_OP:
		((EFI_IFR_STRING*)OpHeader)->Width = Width;
		break;
	case EFI_IFR_ONE_OF_OP:
		((EFI_IFR_ONE_OF*)OpHeader)->Width = Width;
		break;
	case EFI_IFR_CHECKBOX_OP:
		((EFI_IFR_CHECK_BOX*)OpHeader)->Width = Width;
		break;
	case EFI_IFR_EQ_ID_VAL_OP:
		((EFI_IFR_EQ_ID_VAL*)OpHeader)->Width = Width;
		break;
	case EFI_IFR_EQ_ID_LIST_OP:
		((EFI_IFR_EQ_ID_LIST*)OpHeader)->Width = Width;
		break;
	case EFI_IFR_EQ_ID_ID_OP:
		((EFI_IFR_EQ_ID_ID*)OpHeader)->Width = Width;
		break;
	default:
		break;
	}
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetQuestionOffset
//
// Description:	Function to get question offset
//
// Input:		VOID *IfrPtr
//
// Output:		UINT16
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiGetQuestionOffset(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	return (UINT16)((EFI_IFR_NV_DATA*)OpHeader)->QuestionId;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetDateTimeDetails
//
// Description:	Function to get the details of data and time
//
// Input:		VOID *IfrPtr,
//				UINT8 Type,
//				UINT16 * Help,
//				UINT16 * Min,
//				UINT16 * Max
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiGetDateTimeDetails(VOID *IfrPtr,UINT8 Type,UINT16 * Help,UINT16 * Min,UINT16 * Max)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;
	EFI_IFR_NUMERIC *NumIfr=NULL;
	switch(OpHeader->OpCode)
	{
	case EFI_IFR_TIME_OP:
		if(Type == AMI_TIME_HOUR)
			NumIfr = &(((EFI_IFR_TIME*)OpHeader)->Hour);
		else if (Type == AMI_TIME_MIN)
			NumIfr = &(((EFI_IFR_TIME*)OpHeader)->Minute);
		else if (Type == AMI_TIME_SEC)
			NumIfr = &(((EFI_IFR_TIME*)OpHeader)->Second);
		break;
	case EFI_IFR_DATE_OP:
		if(Type == AMI_DATE_YEAR)
			NumIfr = &(((EFI_IFR_DATE*)OpHeader)->Year);
		else if (Type == AMI_DATE_MONTH)
			NumIfr = &(((EFI_IFR_DATE*)OpHeader)->Month);
		else if (Type == AMI_DATE_DAY)
			NumIfr = &(((EFI_IFR_DATE*)OpHeader)->Day);
		break;
	default:
		break;
	}
	if(NumIfr)
	{
		*Help = NumIfr->Help;
		*Min = NumIfr->Minimum;
		*Max = NumIfr->Maximum;
	}

}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetOneOfOptions
//
// Description:	Function to get OneOf options
//
// Input:	VOID *IfrPtr,
//					VOID **Handle,
//					UINT16  **OptionPtrTokens,
//					UINT64 **ValuePtrTokens,
//					UINT16 * ItemCount,
//					UINT16 * Interactive,
//					UINT16 * CallBackKey
//
// Output:	Status
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS UefiGetOneOfOptions(CONTROL_INFO *CtrlInfo,VOID **Handle,UINT16  **OptionPtrTokens, UINT64 **ValuePtrTokens, UINT16 * ItemCount,UINT16 * Interactive,UINT16 * CallBackKey )
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)(CtrlInfo->ControlPtr);
	EFI_IFR_ONE_OF_OPTION *ptrData;
	UINT8 Opcode = OpHeader->OpCode;
	EFI_STATUS Status = EFI_SUCCESS;
	UINT16 Index= 0 ;

	if(Opcode == EFI_IFR_ORDERED_LIST_OP)
		ptrData = (EFI_IFR_ONE_OF_OPTION *)((UINT8 *)(OpHeader) +sizeof(EFI_IFR_ORDERED_LIST) );
	else
		ptrData = (EFI_IFR_ONE_OF_OPTION *)((UINT8 *)(OpHeader) +sizeof(EFI_IFR_ONE_OF) );

	switch ( Opcode )
	{
		case EFI_IFR_ONE_OF_OP:
		case EFI_IFR_ORDERED_LIST_OP: // ordered list option 
			while( ptrData[Index].Header.OpCode != EFI_IFR_END_ONE_OF_OP )
				Index++;
			break;

		case EFI_IFR_CHECKBOX_OP:
			Index = 2;
			*Handle = gHiiHandle;
			break;
	}
	if( *OptionPtrTokens != NULL )
      MemFreePointer( (VOID **)OptionPtrTokens);

	if(ValuePtrTokens)
		if( *ValuePtrTokens != NULL )
			MemFreePointer( (VOID **)ValuePtrTokens);

	
	*OptionPtrTokens = EfiLibAllocatePool( Index * sizeof(UINT16) );

	if(ValuePtrTokens)
		*ValuePtrTokens = EfiLibAllocatePool( Index * sizeof(UINT64) );

	if ( *OptionPtrTokens == NULL )
		Status = EFI_OUT_OF_RESOURCES;
	else
	{
		*ItemCount = Index;

		for ( Index = 0; Index < *ItemCount; Index++ )
		{
			if( ((Opcode == EFI_IFR_ONE_OF_OP)|(Opcode == EFI_IFR_ORDERED_LIST_OP)) && (ptrData->Header.OpCode == EFI_IFR_ONE_OF_OPTION_OP) )
			{
				(*OptionPtrTokens)[Index] = ptrData[Index].Option;
				if(ValuePtrTokens)
					(*ValuePtrTokens)[Index] = ptrData[Index].Value;
				
                if(ptrData[Index].Flags & EFI_IFR_FLAG_INTERACTIVE)
                {
                    if(Interactive) *Interactive = TRUE;
                    if(CallBackKey) *CallBackKey = ptrData[Index].Key;
                }
			}
			else
			{
				(*OptionPtrTokens)[Index] = gCheckboxTokens[Index];
				if(ValuePtrTokens)
					(*ValuePtrTokens)[Index] = Index;
                if(((EFI_IFR_CHECK_BOX *)OpHeader)->Flags & EFI_IFR_FLAG_INTERACTIVE)
                {
                    if(Interactive) *Interactive = TRUE;
                    if(CallBackKey) *CallBackKey = ((EFI_IFR_CHECK_BOX *)OpHeader)->Key;
                }

			}
		}
	}
	return Status;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetMaxEntries
//
// Description:	Function to get max entries
//
// Input:	VOID *IfrPtr,
//
// Output:	UINT8
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT8 UefiGetMaxEntries(VOID *IfrPtr)
{
	EFI_IFR_OP_HEADER *OpHeader=(EFI_IFR_OP_HEADER *)IfrPtr;

	switch(OpHeader->OpCode)
	{
	case EFI_IFR_ORDERED_LIST_OP:
		return ((EFI_IFR_ORDERED_LIST*)OpHeader)->MaxEntries;
		break;
	default:
		break;
	}
	return 0;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiTseLiteGetBootOverRideIndex
//
// Description:	Function to get boot override index
//
// Input:	VOID *Ptr,
//
// Output:	UINT16
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiTseLiteGetBootOverRideIndex(VOID *Ptr)
{
	UINT16 Index=0xFFFF;
	EFI_IFR_OP_HEADER * OpHeader = (EFI_IFR_OP_HEADER *)Ptr;
	EFI_IFR_EQ_ID_LIST *EqIdList;

	if ((OpHeader != NULL) && (OpHeader->OpCode == EFI_IFR_SUPPRESS_IF_OP))
	{
		while(OpHeader->OpCode != EFI_IFR_EQ_ID_LIST_OP)
		{
			OpHeader = (EFI_IFR_OP_HEADER*)((UINT8*)OpHeader + OpHeader->Length);
			if(OpHeader->OpCode == EFI_IFR_END_IF_OP) // Not found
				return Index;
		}
	
		// FIX ME : Do it better. Check the list length and 
		if(OpHeader->OpCode == EFI_IFR_EQ_ID_LIST_OP)
		{
			EqIdList = (EFI_IFR_EQ_ID_LIST*)OpHeader;
			Index = EqIdList->ListLength - 1;
		}
	}

	return Index;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiTseLiteGetAmiCallbackIndex
//
// Description:	Function to get ami callback index
//
// Input:	VOID *Ptr,
//
// Output:	UINT16
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiTseLiteGetAmiCallbackIndex(VOID * Ptr, VOID * Ptr2)
{
	UINT16 Index=0xFFFF;
	EFI_IFR_OP_HEADER * OpHeader = (EFI_IFR_OP_HEADER *)Ptr;

	if ((OpHeader != NULL) && (OpHeader->OpCode == EFI_IFR_SUPPRESS_IF_OP))
	{
		while(OpHeader->OpCode != EFI_IFR_EQ_ID_VAL_OP)
		{
			OpHeader = (EFI_IFR_OP_HEADER*)((UINT8*)OpHeader + OpHeader->Length);
			if(OpHeader->OpCode == EFI_IFR_END_IF_OP) // Not found
				return Index;
		}
	
		// FIX ME : Do it better. Check the list length and 
		if(OpHeader->OpCode == EFI_IFR_EQ_ID_VAL_OP)
		{
			Index = ((EFI_IFR_EQ_ID_VAL*)OpHeader)->Value;
		}
	}

	return Index;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiFormCallbackNVRead
//
// Description:	Function to get callback nvread
//
// Input:		CHAR16 *name,
//					EFI_GUID *guid,
//					UINT32 *attributes,
//					UINTN *size,
//					VOID **buffer
//
// Output:		Status
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS UefiFormCallbackNVRead(CHAR16 *name, EFI_GUID *guid, UINT32 *attributes, UINTN *size, VOID **buffer)
{
	EFI_FORM_CALLBACK_PROTOCOL *FormCallBack=NULL;
	EFI_STATUS Status = EFI_UNSUPPORTED;
	EFI_IFR_FORM_SET *FmSet=NULL;
	UINTN i=0;

    if(gSetupCount)
    {
        for ( i = 0; i < gSetupCount - 1; i++ )
        {
            FmSet = HiiGetFormSet( i );
            if(!FmSet)
                continue;

            if( EfiCompareGuid(&(FmSet->Guid),guid) && (EFI_HANDLE)((UINTN)FmSet->CallbackHandle) )
            {
                Status = gBS->HandleProtocol(
                                    (EFI_HANDLE)((UINTN)FmSet->CallbackHandle),
                                    &gEfiFormCallbackProtocolGuid,
                                    &FormCallBack );
            }

	        if ( ! EFI_ERROR( Status ) )
	        {
        		if( FormCallBack->NvRead )
		        {
                    Status = FormCallBack->NvRead( FormCallBack, name, guid, attributes, size, *buffer );

        		    if ( Status != EFI_BUFFER_TOO_SMALL )
						break;

        		    *buffer = EfiLibAllocatePool( *size );

        		    if ( *buffer == NULL )
			            return EFI_OUT_OF_RESOURCES;

        		    Status = FormCallBack->NvRead( FormCallBack, name, guid, attributes, size, *buffer );
                    break;
		        }
		        else
			        Status = EFI_UNSUPPORTED;
	        }
        }
    }

	return Status;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiFormCallbackNVWrite
//
// Description:	Function to get callback nvwrite
//
// Input:		CHAR16 *name,
//				EFI_GUID *guid,
//				UINT32 *attributes,
//				VOID **buffer
//				UINTN *size,
//
// Output:		Status
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS UefiFormCallbackNVWrite(CHAR16 *name, EFI_GUID *guid, UINT32 attributes, VOID *buffer, UINTN size)
{
	EFI_FORM_CALLBACK_PROTOCOL *FormCallBack=NULL;
	BOOLEAN Reset=FALSE;
	EFI_STATUS Status = EFI_UNSUPPORTED;
	EFI_IFR_FORM_SET * FmSet=NULL;
	UINTN i=0;

    if(gSetupCount)
    {
        for ( i = 0; i < gSetupCount - 1; i++ )
        { 
            FmSet = HiiGetFormSet( i );

            if(!FmSet)
                continue;

            if( EfiCompareGuid(&(FmSet->Guid),guid) && (EFI_HANDLE)((UINTN)FmSet->CallbackHandle) )
            {
        		Status = gBS->HandleProtocol(
                                    (EFI_HANDLE)((UINTN)FmSet->CallbackHandle),
                                    &gEfiFormCallbackProtocolGuid,
                                    &FormCallBack );
            }

	        if ( ! EFI_ERROR(Status ) )
	        {
		        if( FormCallBack->NvWrite )
                {
					Reset = FALSE;
					Status = FormCallBack->NvWrite(
				                        FormCallBack,
				                        name,
				                        guid,
				                        attributes,
				                        size,
				                        buffer,
				                        &Reset
				                        );
			        if ( ( ! EFI_ERROR(Status ) ) && Reset )
						gResetRequired = TRUE;
                    break;
                }
		        else
			        Status = EFI_UNSUPPORTED;
	        }
        }
    }
	return Status;

}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	InitMiniSetupStrings
//
// Description:	Function to init minisetup strings
//
// Input:		VOID
//
// Output:		Status
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
#if APTIO_4_00 != 1 && SETUP_USE_GUIDED_SECTION !=1
EFI_STATUS InitMiniSetupStrings( VOID )
{
	EFI_STATUS          Status=EFI_SUCCESS;
	UINT16              Index = 0;

#if HII_VERSION == 0
	EFI_HII_PACK_LIST   PackList;
	EFI_HII_PACK_LIST   *PackageList;
#else
	EFI_HII_PACKAGES	*PackageList = NULL;
#endif
	VOID **Package = NULL;
	EFI_GUID            MiniSetupGuid = MINI_SETUP_GUID;

	Status = HiiInitializeProtocol();
	if ( EFI_ERROR ( Status ) )
		return Status;

	gHiiHandle = HiiFindHandle( &MiniSetupGuid, &Index );

	if ( gHiiHandle == INVALID_HANDLE )
	{
#if HII_VERSION == 0
		PackList.IfrPack      = NULL;
		PackList.StringPack   = (EFI_HII_STRING_PACK *)STRING_ARRAY_NAME;
		PackList.FontPack     = NULL;
		PackList.KeyboardPack = NULL;
		PackList.GuidId       = &MiniSetupGuid;
		PackageList = &PackList;
#else
		PackageList = EfiLibAllocateZeroPool( sizeof(EFI_HII_PACKAGES) + sizeof(VOID *) );
		if ( PackageList == NULL )
			return EFI_OUT_OF_RESOURCES;

		PackageList->GuidId = &MiniSetupGuid;
		PackageList->NumberOfPackages = 1;
		Package = (VOID **) ((UINT8 *)PackageList + sizeof (EFI_HII_PACKAGES));
#ifdef USE_DEPRICATED_INTERFACE
		*Package = (VOID *)STRING_ARRAY_NAME;
#else
		*Package = (VOID *)&STRING_ARRAY_NAME;
#endif
#endif

		Status = gHiiProtocol->NewPack( gHiiProtocol, PackageList, (EFI_HII_HANDLE *)&gHiiHandle );
#if HII_VERSION != 0
		MemFreePointer( (VOID **)&PackageList );
#endif
	} 

	return Status;
}
#endif
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiIsEfiVariable
//
// Description:	Function to check efi variable
//
// Input:		UINT32 variable, VARIABLE_INFO *varInfo
//
// Output:		BOOLEAN
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
BOOLEAN UefiIsEfiVariable(UINT32 variable, VARIABLE_INFO *varInfo)
{
	return TRUE;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiVarGetNvram
//
// Description:	Function to get nvram
//
// Parameter:	    VARIABLE_INFO *VariableInfo, VOID **Buffer, UINTN Offset, 
//					UINTN Size
//
// Output:		STATUS
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS UefiVarGetNvram(VARIABLE_INFO *VariableInfo, VOID **Buffer, UINTN Offset, UINTN Size)
{
	return EFI_UNSUPPORTED;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiVarGetNvram
//
// Description:	Function to set nvram
//
// Parameter:	    VARIABLE_INFO *VariableInfo, VOID *Buffer, UINTN Offset,
//					UINTN Size
//
// Output:		STATUS
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS UefiVarSetNvram(VARIABLE_INFO *VariableInfo, VOID *Buffer, UINTN Offset, UINTN Size)
{
	return EFI_UNSUPPORTED;
}

#define AMI_FLAG_MANUFACTURING	EFI_IFR_FLAG_MANUFACTURING
#define AMI_FLAG_DEFAULT	EFI_IFR_FLAG_DEFAULT
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	HiiGetManufactuingMask
//
// Description:	Function to get manufacturing mask
//
// Input:		VOID
//
// Output:		UINTN
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINTN HiiGetManufactuingMask(VOID)
{
	return AMI_FLAG_MANUFACTURING;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	HiiGetDefaultMask
//
// Description:	Function to get default mask
//
// Input:		VOID
//
// Output:		UINTN
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINTN HiiGetDefaultMask(VOID)
{
	return AMI_FLAG_DEFAULT;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	GetControlConditionVarId
//
// Description:	Function to get control variable id
//
// Input:		CONTROL_INFO *control
//
// Output:		UINT32
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT32 GetControlConditionVarId(CONTROL_INFO *control)
{
	return (control->ControlConditionalVariable[0])?control->ControlConditionalVariable[0]:0xFFFF;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	BBSUpdateControlOffset
//
// Description:	Function to update control offset
//
// Input:		CONTROL_INFO *control
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID   BBSUpdateControlOffset(CONTROL_INFO *control)
{
    UINT16 offset=  ((EFI_IFR_ONE_OF*)control->ControlPtr)->QuestionId;

    offset = offset +sizeof(UINT32)+sizeof(UINT16);
    offset = (UINT16)(offset + gCurrLegacyBootData->LegacyEntryOffset);

    ((EFI_IFR_ONE_OF*)control->ControlPtr)->QuestionId = offset;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetSpecialEqIDIfrPtr
//
// Description:	Function to get special eqID Ifr pointer
//
// Input:		VOID *Conditional, UINT32 Variable, GUID_INFO **GuidInfo
//
// Output:		VOID*
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID* UefiGetSpecialEqIDIfrPtr(CONTROL_INFO *ControlInfo, UINT32 *Variable, GUID_INFO **GuidInfo)
{
    VOID *Conditional = ControlInfo->ControlConditionalPtr;
    VOID *ControlPtr = ControlInfo->ControlPtr;
	EFI_IFR_OP_HEADER *ifrPtr;
	VARIABLE_INFO *varInfo;
	UINTN i;
	GUID_INFO *specialGuid = NULL;

	ifrPtr = (EFI_IFR_OP_HEADER *)Conditional;

    if((ifrPtr==NULL) || (ControlPtr <= Conditional))
        return NULL;

	if ( ( ifrPtr->OpCode != EFI_IFR_SUPPRESS_IF_OP ) && ( ifrPtr->OpCode != EFI_IFR_GRAYOUT_IF_OP ) )
		return NULL;

	ifrPtr = (EFI_IFR_OP_HEADER *)((UINTN)ifrPtr + ifrPtr->Length);
	if ( ( ifrPtr->OpCode == EFI_IFR_VARSTORE_SELECT_OP ) || ( ifrPtr->OpCode == EFI_IFR_VARSTORE_SELECT_PAIR_OP ) )
		ifrPtr = (EFI_IFR_OP_HEADER *)((UINTN)ifrPtr + ifrPtr->Length);

	// skip NOT if it is present
	if ( ifrPtr->OpCode == EFI_IFR_NOT_OP )
		ifrPtr = (EFI_IFR_OP_HEADER *)((UINTN)ifrPtr + ifrPtr->Length);

	if(NoVarStoreSupport())
	{
	    if(*Variable == VARIABLE_ID_SETUP)
	    {
			*Variable = FindVarFromITKQuestionId(UefiGetEqIDQuestionID(ifrPtr));
	    }
	}

	varInfo = VarGetVariableInfoIndex( *Variable );
	if ( varInfo == NULL )
		return NULL;

	for ( i = 0; i < gGuidList->GuidCount; i++ )
	{
		GUID_INFO *guidInfo = (GUID_INFO *)((UINTN)gGuidList + gGuidList->GuidList[i]);
		if ( EfiCompareGuid( &varInfo->VariableGuid, &guidInfo->GuidValue ) )
		{
			specialGuid = guidInfo;
			break;
		}
	}

	if ( specialGuid != NULL )
	{
		if ( GuidInfo != NULL )
			*GuidInfo = specialGuid;
	}
    else
    {
    	ifrPtr = NULL;
    }   

    // See if Other condition is Special condition
    if(ifrPtr == NULL)
    {
        if(ControlPtr > Conditional)
        {
            ifrPtr = (EFI_IFR_OP_HEADER *)Conditional;
            ifrPtr = (EFI_IFR_OP_HEADER *)((UINTN)ifrPtr + ifrPtr->Length); // To skip the SuppressIf or GrayOutIf
            // to skip current expression.
            while( (VOID*)ifrPtr < ControlPtr)
            {
            	if ( (ifrPtr != ControlPtr) && ( ifrPtr->OpCode != EFI_IFR_SUPPRESS_IF_OP ) && ( ifrPtr->OpCode != EFI_IFR_GRAYOUT_IF_OP ) )
                    ifrPtr = (EFI_IFR_OP_HEADER *)((UINTN)ifrPtr + ifrPtr->Length); // To skip the SuppressIf or GrayOutIf
                else
                    break;
            }

            Conditional = ifrPtr;
            if(ControlPtr > Conditional)
            {
                 CONTROL_INFO TempCtlInfo;
                 MemCopy(&TempCtlInfo, ControlInfo, sizeof (CONTROL_INFO));
                 TempCtlInfo.ControlConditionalPtr = Conditional;
                 ifrPtr = (EFI_IFR_OP_HEADER *)((UINTN)ifrPtr + ifrPtr->Length); // To skip the SuppressIf or GrayOutIf
            	 if ( ( ifrPtr->OpCode == EFI_IFR_VARSTORE_SELECT_OP ) )
                    VarGetVariableInfoId( ((EFI_IFR_VARSTORE_SELECT*)((char*)ifrPtr))->VarId, Variable );
                 ifrPtr = UefiGetSpecialEqIDIfrPtr(&TempCtlInfo, Variable, GuidInfo);
            }
            else
                ifrPtr = NULL;
        }
    }

	return ifrPtr;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetSpecialEqIDValue
//
// Description:	Function to get special eqID value
//
// Input:		CONTROL_INFO *ControlInfo, GUID_INFO **GuidInfo
//
// Output:		UINT16
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiGetSpecialEqIDValue(CONTROL_INFO *ControlInfo, GUID_INFO **GuidInfo)
{
  UINT16 value = (UINT16)-2;
  UINT32 condVarID = 0;
  EFI_IFR_OP_HEADER *ifrPtr = NULL;

  condVarID = (UINT32)GetControlConditionVarId(ControlInfo);
  ifrPtr = (EFI_IFR_OP_HEADER *)UefiGetSpecialEqIDIfrPtr(ControlInfo, &condVarID, GuidInfo);

  if(ifrPtr != NULL)
  {
    switch(ifrPtr->OpCode)
    {
    case EFI_IFR_EQ_ID_LIST_OP:
      value = ((EFI_IFR_EQ_ID_LIST *)ifrPtr)->ValueList[0];
      break;
    case EFI_IFR_EQ_ID_VAL_OP:
      value = ((EFI_IFR_EQ_ID_VAL *)ifrPtr)->Value;
      break;
    default:
      break;
    }
  }

  return value;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiSpecialGuidCallback
//
// Description:	Function to get special guid callback
//
// Input:		VOID * HiiHandle, UINT16 Key, EFI_GUID *pGUID
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiSpecialGuidCallback(VOID * HiiHandle, UINT16 Key, EFI_GUID *pGUID)
{
	EFI_FORM_CALLBACK_PROTOCOL *FormCallBack=NULL;
	EFI_IFR_FORM_SET *FormSet = NULL;
	EFI_IFR_DATA_ARRAY callbackData;
	EFI_STATUS	Status;

	MemSet( &callbackData, sizeof(callbackData), 0 );

	FormSet = HiiGetFormSetFromHandle( HiiHandle );

	if ( FormSet != NULL )
    {
	    Status = gBS->HandleProtocol ( (EFI_HANDLE)((UINTN) FormSet->CallbackHandle), &gEfiFormCallbackProtocolGuid,  &FormCallBack);

		if(!EFI_ERROR(Status))
		{
			(VOID*)callbackData.NvRamMap = (VOID*)pGUID;
			if ( ( FormCallBack != NULL ) && ( FormCallBack->Callback != NULL ) )
		    	FormCallBack->Callback( FormCallBack, Key, &callbackData, NULL );
		}
	}

}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiSetEqIDValue
//
// Description:	Function to set EqID value
//
// Input:		VOID *IfrPtr, UINT16 Value
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiSetEqIDValue(VOID *IfrPtr, UINT16 Value)
{
  EFI_IFR_OP_HEADER *opHeader = (EFI_IFR_OP_HEADER *)IfrPtr;

  switch(opHeader->OpCode)
  {
  case EFI_IFR_EQ_ID_LIST_OP:
    ((EFI_IFR_EQ_ID_LIST *)IfrPtr)->ValueList[0] = Value;
    break;
  case EFI_IFR_EQ_ID_VAL_OP:
    ((EFI_IFR_EQ_ID_VAL *)IfrPtr)->Value = Value;
    break;
  default:
    break;
  }
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiIsOneOfControl
//
// Description:	Function to check for OneOf controls
//
// Input:		VOID *IfrPtr
//
// Output:		BOOLEAN
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
BOOLEAN UefiIsOneOfControl(VOID *IfrPtr)
{
  return (((EFI_IFR_OP_HEADER *)IfrPtr)->OpCode == EFI_IFR_ONE_OF_OP)? TRUE : FALSE;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetEqIDQuestionID
//
// Description:	Function to check EqID question ID
//
// Input:		VOID *IfrPtr
//
// Output:		UINT16
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiGetEqIDQuestionID(VOID *IfrPtr)
{
  EFI_IFR_OP_HEADER *opHeader = (EFI_IFR_OP_HEADER *)IfrPtr;
  UINT16 questionID = 0;

  switch(opHeader->OpCode)
  {
  case EFI_IFR_EQ_ID_ID_OP:
    break;
  case EFI_IFR_EQ_ID_LIST_OP:
    questionID = ((EFI_IFR_EQ_ID_LIST *)opHeader)->QuestionId;
    break;
  case EFI_IFR_EQ_ID_VAL_OP:
    questionID = ((EFI_IFR_EQ_ID_VAL *)opHeader)->QuestionId;
    break;
  default:
    break;
  }

  return questionID;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiSetEqIDQuestionID
//
// Description:	Function to set EqID question ID
//
// Input:		VOID *IfrPtr, UINT16 Value
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiSetEqIDQuestionID(VOID *IfrPtr, UINT16 Value)
{
  EFI_IFR_OP_HEADER *opHeader = (EFI_IFR_OP_HEADER *)IfrPtr;

  switch(opHeader->OpCode)
  {
  case EFI_IFR_EQ_ID_ID_OP:
    break;
  case EFI_IFR_EQ_ID_LIST_OP:
    ((EFI_IFR_EQ_ID_LIST *)opHeader)->QuestionId = Value;
    break;
  case EFI_IFR_EQ_ID_VAL_OP:
    ((EFI_IFR_EQ_ID_VAL *)opHeader)->QuestionId = Value;
    break;
  default:
    break;
  }
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiCreateOneOfWithOptionsTemplate
//
// Description:	Function to create OneOf option template
//
// Input:		UINTN OptionCount, CONTROL_INFO *CtrlInfo
//
// Output:		VOID*
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID* UefiCreateOneOfWithOptionsTemplate(UINTN OptionCount, CONTROL_INFO *CtrlInfo)
{
  VOID *buffer = NULL;
  UINTN length = 0;
  UINTN offset = (UINTN)CtrlInfo->ControlPtr - (UINTN)CtrlInfo->ControlConditionalPtr;
  UINT32 size = (UINT32)((UINT32)offset + sizeof(EFI_IFR_ONE_OF) + sizeof(EFI_IFR_END_ONE_OF) + OptionCount * sizeof(EFI_IFR_ONE_OF_OPTION));

  buffer = EfiLibAllocateZeroPool(size);
  if(buffer == NULL)
  {
    goto DONE;
  }
  MemCopy(buffer, CtrlInfo->ControlConditionalPtr, offset);

  length = UefiGetIfrLength(CtrlInfo->ControlPtr);
  CtrlInfo->ControlConditionalPtr = buffer;
  MemCopy( (UINT8 *)buffer + offset, CtrlInfo->ControlPtr, length );
  CtrlInfo->ControlPtr = (UINT8 *)buffer + offset;
DONE:
  return (buffer == NULL)?NULL:((UINT8*)buffer + offset);
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiSetOneOfOption
//
// Description:	Function to set OneOf option
//
// Input:		VOID *IfrPtr, UINT64 Value, UINT32 Size, UINT8 Flag, UINT16 Option
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiSetOneOfOption(VOID *IfrPtr, UINT64 Value, UINT32 Size, UINT8 Flag, UINT16 Option)
{
  EFI_IFR_ONE_OF_OPTION *option = (EFI_IFR_ONE_OF_OPTION *)IfrPtr;
  UINT8 flag = 0;

  flag |= ((Flag & AMI_FLAG_DEFAULT) == AMI_FLAG_DEFAULT)? EFI_IFR_FLAG_DEFAULT : 0;
  flag |= ((Flag & AMI_FLAG_MANUFACTURING) == AMI_FLAG_MANUFACTURING)? EFI_IFR_FLAG_MANUFACTURING : 0;

  option->Value = (UINT16)Value;
  option->Option = Option;
  option->Flags = flag;
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiUpdateControlVarOffset
//
// Description:	Function to update control variable offset
//
// Input:		VOID *IfrPtr, UINT16 Value
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiUpdateControlVarOffset(VOID *IfrPtr, UINT16 Value)
{
  EFI_IFR_OP_HEADER *opHeader = (EFI_IFR_OP_HEADER *)IfrPtr;

  switch(opHeader->OpCode)
  {
  case EFI_IFR_ONE_OF_OP:
    ((EFI_IFR_ONE_OF *)opHeader)->QuestionId = Value;
    break;
  default:
    break;
  }
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiAddEndOp
//
// Description:	Function to add end op code
//
// Input:		VOID *IfrPtr
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiAddEndOp(VOID *IfrPtr)
{
  EFI_IFR_OP_HEADER *opHeader =  (EFI_IFR_OP_HEADER *)IfrPtr;

  opHeader->OpCode = EFI_IFR_END_OP;
  opHeader->Length = sizeof(EFI_IFR_OP_HEADER);
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiGetQuestionID
//
// Description:	Function to get question ID
//
// Input:		CONTROL_INFO *control
//
// Output:		UINT16
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiGetQuestionID(CONTROL_INFO *control)
{
	return UefiGetQuestionOffset(control->ControlPtr);
}
#pragma warning( disable : 4204 )
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiCreateDynamicControlCondition
//
// Description:	Function to create dynamic control condition
//
// Input:		CONTROL_INFO *control,UINT16 VarId, UINT16 PrevControlQuestionID,UINT16 Value
//
// Output:		VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiCreateDynamicControlCondition(CONTROL_INFO *control,UINT16 VarId, UINT16 PrevControlQuestionID,UINT16 Value)
{
	struct SuppressCondition 
	{
		EFI_IFR_SUPPRESS Suppress;
		EFI_IFR_VARSTORE_SELECT	VarStroreSelect;
		EFI_IFR_EQ_ID_VAL	IDEqVal;
		EFI_IFR_END_IF	Endif;
	}Condition= { 	{EFI_IFR_SUPPRESS_IF_OP,sizeof(EFI_IFR_SUPPRESS),0},
					{EFI_IFR_VARSTORE_SELECT_OP,sizeof(EFI_IFR_VARSTORE_SELECT),0},
					{EFI_IFR_EQ_ID_VAL_OP,sizeof(EFI_IFR_EQ_ID_VAL),0,sizeof(UINT16),Value },
					{EFI_IFR_END_IF_OP,sizeof(EFI_IFR_END_IF)}};

	Condition.VarStroreSelect.VarId = VarId;
	Condition.IDEqVal.QuestionId = PrevControlQuestionID;
// Add the New code to update the ControlConditionalPtr
	MemCopy((void*)control->ControlConditionalPtr,(void*)&Condition,sizeof(Condition));
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	    UefiCreateStringTemplate
//
// Description:   Function to create uefi string template
//
// Parameter:	    UINT16 Token
//
// Return value:  VOID *
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID * UefiCreateStringTemplate(UINT16 Token)
{
  EFI_IFR_OP_HEADER *OpHeader = EfiLibAllocateZeroPool(sizeof(EFI_IFR_STRING));

  OpHeader->OpCode = EFI_IFR_STRING_OP ;
  OpHeader->Length = sizeof(EFI_IFR_STRING) ;
  UefiSetPromptField((VOID *)OpHeader,Token);
  return (VOID*)OpHeader;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	ProcessActionQuestionConfiguration
//
// Description:	Function to process Action Control Configuration String.
//				UEFI Action control is a 2.1 control
//
// Input:		CONTROL_INFO *control
//
// Output:		EFI_STATUS
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS ProcessActionQuestionConfiguration(CONTROL_INFO *control)
{
  return EFI_SUCCESS;
}

//EIP 23354 : Start
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	IsPasswordEncodeEnabled
//
// Description:	Function to Password Encoding Status.
//
// Input:		VOID *PwDataPtr
//
// Output:		TRUE/FALSE
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>

BOOLEAN IsPasswordEncodeEnabled ( CONTROL_INFO * controlInfo )
{
	EFI_IFR_PASSWORD *PwData = ((EFI_IFR_PASSWORD *)controlInfo->ControlPtr);
	return (PwData->Encoding == TRUE)? TRUE:FALSE;
}
//EIP 23354 : End
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	    UefiGetTime
//
// Description:	    Function to get time
//
// Parameter:	    CONTROL_INFO *control, EFI_TIME *Tm
//
// Return value:    STATUS
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS UefiGetTime(CONTROL_INFO *control, EFI_TIME *Tm)
{
  return gRT->GetTime( Tm, NULL );
}
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	    UefiSetTime
//
// Description:     Function to set time
//
// Parameter:	    CONTROL_INFO *control, EFI_TIME *Tm
//
// Return value:    STATUS
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS UefiSetTime(CONTROL_INFO *control, EFI_TIME *Tm)
{
  return gRT->SetTime( Tm );
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
//
// Procedure:     UefiIsProceedWithPageChange
//
// Description:   	For UEFI 2.0 Just return EFI_SUCCESS;
//
// Parameter:     EFI_STATUS
//
// Return Value:  EFI_STATUS
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS UefiIsProceedWithPageChange(EFI_STATUS Status)
{
    return EFI_SUCCESS;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
//
// Procedure:     UefiPreControlUpdate
//
// Description:   In UEFI 2.0 this is Dummy function.
//
// Parameter:     CONTROL_INFO * ControlData
//
// Return Value:  EFI_STATUS
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiPreControlUpdate(CONTROL_INFO *ControlData)
{

}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	    UefiRefershQuestionValueNvRAM
//
// Description:	    Function Refresh the question
//
// Parameter:	    CONTROL_INFO *control
//
// Return value:    STATUS
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS UefiRefershQuestionValueNvRAM(CONTROL_INFO *ControlData)
{
    return EFI_SUCCESS;
}

//EIP:56413 START
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	UefiupdateResetButtonDefault
//
// Description:	In UEFI 2.0 this is Dummy function.
//
// Input:	CONTROL_INFO ControlData, UINT16 DefaultId
//
// Output:	EFI_STATUS
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS UefiupdateResetButtonDefault(CONTROL_INFO ControlData, UINT16 DefaultId)
{
	return EFI_SUCCESS;
}

//EIP:56413: START
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	    UefiGetResetButtonDefaultid
//
// Description:	  In UEFI 2.0 this is Dummy function.
//
// Parameter:	    VOID *IfrPtr
//
// Return value:    UINT16
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 UefiGetResetButtonDefaultid(VOID *IfrPtr)
{
return 0xffff;
}
//EIP:56413 END

//EIP: 55762 Start
//<AMI_PHDR_START>
//---------------------------------------------------------------------------
// Procedure:   UpdateDestiantionQuestion
//
// Description: Dummy function for 2.0
//
// Input:	UINT32 CurrPageID - Current page ID
//          UINT32 DestQuestionId - Destination question ID to set focus
//          UINT32 *FocusControlIndex - 
//
// Output:	EFI_STATUS status - EFI_SUCCESS is successful
//---------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS UpdateDestiantionQuestion (UINT32 CurrPageID, UINT32 DestQuestionId, UINT32 *FocusControlIndex)
{
	return EFI_UNSUPPORTED;
}
//EIP: 55762 End

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	FindDriverHealthDriverName
//
// Description:	Finds the driver name which supports driver health protocol
//
// Input:		UINT16 = Entry for which driver name has to be return
//
// Output:		CHAR16 * = Driver Name
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
CHAR16 *FindDriverHealthDriverName (UINT16 DriverEntry)
{
	return NULL;
}

//<AMI_PHDR_START>
//-----------------------------------------------------------------------------------------------------
// Procedure:	CtrlsSupportsHealthProtocol
//
// Description:	Finds the number of controllers supports driver health protocol for the driver entry
//
// Input:		UINT16 = Entry for driver to which total controllers has to be find
//
// Output:		UINT16 = Total number of controllers supports driver health
//
//-----------------------------------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 CtrlsSupportsHealthProtocol (UINT16 EntryItem)
{
	return 0;
}	

//<AMI_PHDR_START>
//----------------------------------------------------------------------------------
// Procedure:	GetCtrlNameAndHealth
//
// Description:	Finds the controller name with its health
//
// Input:		UINT16 = Entry for controller to which name has to be find
//
// Output:		CHAR16 * = Controller name with its health status
//
//-----------------------------------------------------------------------------------
//<AMI_PHDR_END>
CHAR16 *GetCtrlNameAndHealth (UINT16 ControllerEntry)
{
    return NULL;
}

//<AMI_PHDR_START>
//-------------------------------------------------------------------------------------------
// Procedure:	SetDrvHealthHandleAndCtrlCount
//
// Description:	Finds and sets the number of controllers supports the driver health handle
//
//	Input:		UINT16 = Driver health handle entry
//
// Output:		VOID
//
//--------------------------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID SetDrvHealthHandleAndCtrlCount (UINT16 ItemEntry)
{
}

//EIP57661 Starts
//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	SetDriverHealthCount
//
// Description:	Sets the DriverHealthCount and DriverHlthEnable variables
//
// Input:	VOID
//
// Output:	VOID
//
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID SetDriverHealthCount (VOID)
{
}

//<AMI_PHDR_START>
//-------------------------------------------------------------------------------------------
// Procedure:	DoDriverHealthOperation
//
// Description:	Performs the driver health operations for the corresponding controller entry
//
//	Input:		VOID * = Control Info for the correponding controller entry
//				UINT16 = Controller entry in the page
//
// Output:		VOID
//
//--------------------------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID DoDriverHealthOperation (VOID *Tempcontrol, UINT16 ControllerEntry)
{
}

//<AMI_PHDR_START>
//---------------------------------------------------------------------------
// Procedure:   UefiGetValidOptionSize
//
// Description: Function to get sizeof option.UEFI2.0 doesn't have EFI_IFR_TYPE support
//
// Input:	CONTROL_INFO *CtrlInfo - Pointer to the control info data
//          UINTN *Type - Returns EFI_IFR_TYPE_NUM_SIZE
//
// Output:	VOID
//---------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UefiGetValidOptionType(CONTROL_INFO *CtrlInfo, UINTN *Type, UINT32 *SizeOfData)
{
	*SizeOfData = sizeof(UINT8);//UEFI2.0 Supports UINT8 size of data for OrderList Control					
}
//<AMI_PHDR_START>
//---------------------------------------------------------------------------
// Procedure:   CheckTimeFlags
//
// Description: Function to check the time flags.
//
// Input:	UINT8 Flags
//
// Output:	BOOLEAN
//---------------------------------------------------------------------------
//<AMI_PHDR_END>
BOOLEAN CheckTimeFlags(UINT8 Flags)
{
	return FALSE;
}

//<AMI_PHDR_START>
//---------------------------------------------------------------------------
// Procedure:   CheckDateFlags
//
// Description: Function to check the Date flags.
//
// Input:	UINT8 Flags
//
// Output:	BOOLEAN
//---------------------------------------------------------------------------
//<AMI_PHDR_END>
BOOLEAN CheckDateFlags(UINT8 Flags)
{
	return FALSE;
}

//<AMI_PHDR_START>
//---------------------------------------------------------------------------
// Procedure:   ProcessPackNotification
//
// Description: Processes the IFR notification queue
//
// Input:	None
//
// Output:	EFI_STATUS status - EFI_ABORTED, By default
//                              EFI_SUCCESS, if successful
//                              EFI_ERROR, otherwise
//---------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS ProcessPackNotification (VOID)
{
	return EFI_ABORTED;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
//
// Procedure:    RegFormNotification
//
// Description:  Registers the hii pack notification
//
// Parameter: VOID
//
// Return value: EFI_STATUS
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
EFI_STATUS RegFormNotification (VOID)
{	
	return EFI_SUCCESS;
}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
//
// Procedure:    UnRegFormNotification
//
// Description:	Unregisters the form notification
//
// Parameter:	VOID
//
// Return value: VOID	
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
VOID UnRegFormNotification (VOID)
{

}

//<AMI_PHDR_START>
//----------------------------------------------------------------------------
// Procedure:	    EvaluateControlDefault
//
// Description:
//
// Parameter:	    CONTROL_INFO *CtrlInfo
//
// Return value:  UINT64
//----------------------------------------------------------------------------
//<AMI_PHDR_END>
UINT16 EvaluateControlDefault (CONTROL_INFO *CtrlInfo, UINT64 *Defaults)
{
   return 0;
}

//**********************************************************************
//**********************************************************************
//**                                                                  **
//**        (C)Copyright 1985-2013, American Megatrends, Inc.         **
//**                                                                  **
//**                       All Rights Reserved.                       **
//**                                                                  **
//**     5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093     **
//**                                                                  **
//**                       Phone: (770)-246-8600                      **
//**                                                                  **
//**********************************************************************
//**********************************************************************