]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - EDK2/edk2_mod/edk2-edk2-stable201911/MdeModulePkg/Application/VtoyUtil/VtoyUtil.h
1.1.07 release
[Ventoy.git] / EDK2 / edk2_mod / edk2-edk2-stable201911 / MdeModulePkg / Application / VtoyUtil / VtoyUtil.h
1 /******************************************************************************
2 * VtoyUtil.h
3 *
4 * Copyright (c) 2020, longpanda <admin@ventoy.net>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 3 of the
9 * License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21 #ifndef __VTOYUTIL_H__
22 #define __VTOYUTIL_H__
23
24 #pragma pack(1)
25
26 typedef EFI_STATUS (*VTOY_UTIL_PROC_PF)(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdLine);
27 typedef int (*grub_env_set_pf)(const char *name, const char *val);
28 typedef const char * (*grub_env_get_pf)(const char *name);
29 typedef int (*grub_env_printf_pf)(const char *fmt, ...);
30
31 #define VTOY_MAX_CONF_REPLACE 2
32
33 typedef struct ventoy_grub_param_file_replace
34 {
35 UINT32 magic;
36 char old_file_name[4][256];
37 UINT32 old_file_cnt;
38 UINT32 new_file_virtual_id;
39 }ventoy_grub_param_file_replace;
40
41 typedef struct ventoy_grub_param
42 {
43 grub_env_get_pf grub_env_get;
44 grub_env_set_pf grub_env_set;
45 ventoy_grub_param_file_replace file_replace;
46 ventoy_grub_param_file_replace img_replace[VTOY_MAX_CONF_REPLACE];
47 grub_env_printf_pf grub_env_printf;
48 }ventoy_grub_param;
49 #pragma pack()
50
51
52 typedef struct VtoyUtilFeature
53 {
54 CONST CHAR16 *Cmd;
55 VTOY_UTIL_PROC_PF MainProc;
56 }VtoyUtilFeature;
57
58 extern BOOLEAN gVtoyDebugPrint;
59 VOID EFIAPI VtoyUtilDebug(IN CONST CHAR8 *Format, ...);
60 #define debug(expr, ...) if (gVtoyDebugPrint) VtoyUtilDebug("[VTOY] "expr"\n", ##__VA_ARGS__)
61 #define Printf VtoyUtilDebug
62
63 EFI_STATUS VtoyGetComponentName(IN UINTN Ver, IN VOID *Protocol, OUT CHAR16 **DriverName);
64 EFI_STATUS FixWindowsMemhole(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdLine);
65 EFI_STATUS ShowEfiDrivers(IN EFI_HANDLE ImageHandle, IN CONST CHAR16 *CmdLine);
66
67 #endif
68