]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - Ventoy2Disk/Ventoy2Disk/DiskService.h
4e197cbcb74bf57052382dd7d78ad549da18209c
[Ventoy.git] / Ventoy2Disk / Ventoy2Disk / DiskService.h
1 /******************************************************************************
2 * DiskService.h
3 *
4 * Copyright (c) 2021, 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 __DISKSERVICE_H__
22 #define __DISKSERVICE_H__
23
24 typedef struct VDS_PARA
25 {
26 UINT64 Attr;
27 GUID Type;
28 GUID Id;
29 WCHAR Name[36];
30 ULONG NameLen;
31 ULONGLONG Offset;
32 CHAR DriveLetter;
33 }VDS_PARA;
34
35 //DISK API
36 BOOL DISK_CleanDisk(int DriveIndex);
37 BOOL DISK_DeleteVtoyEFIPartition(int DriveIndex, UINT64 EfiPartOffset);
38 BOOL DISK_ChangeVtoyEFIAttr(int DriveIndex, UINT64 Offset, UINT64 Attr);
39 BOOL DISK_ChangeVtoyEFI2ESP(int DriveIndex, UINT64 Offset);
40 BOOL DISK_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset);
41 BOOL DISK_ShrinkVolume(int DriveIndex, const char* VolumeGuid, CHAR DriveLetter, UINT64 OldBytes, UINT64 ReduceBytes);
42 BOOL DISK_FormatVolume(char DriveLetter, int fs);
43
44
45 //VDS com
46 BOOL VDS_CleanDisk(int DriveIndex);
47 BOOL VDS_DeleteAllPartitions(int DriveIndex);
48 BOOL VDS_DeleteVtoyEFIPartition(int DriveIndex, UINT64 EfiPartOffset);
49 BOOL VDS_ChangeVtoyEFIAttr(int DriveIndex, UINT64 Offset, UINT64 Attr);
50 BOOL VDS_ChangeVtoyEFI2ESP(int DriveIndex, UINT64 Offset);
51 BOOL VDS_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset);
52 BOOL VDS_ShrinkVolume(int DriveIndex, const char* VolumeGuid, CHAR DriveLetter, UINT64 OldBytes, UINT64 ReduceBytes);
53 BOOL VDS_IsLastAvaliable(void);
54 BOOL VDS_FormatVolume(char DriveLetter, int fs);
55
56 //diskpart.exe
57 BOOL DSPT_CleanDisk(int DriveIndex);
58 BOOL DSPT_FormatVolume(char DriveLetter, int fs);
59
60 //powershell.exe
61 BOOL PSHELL_CleanDisk(int DriveIndex);
62 BOOL PSHELL_DeleteVtoyEFIPartition(int DriveIndex, UINT64 EfiPartOffset);
63 BOOL PSHELL_ChangeVtoyEFI2ESP(int DriveIndex, UINT64 Offset);
64 BOOL PSHELL_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset);
65 BOOL PSHELL_ShrinkVolume(int DriveIndex, const char* VolumeGuid, CHAR DriveLetter, UINT64 OldBytes, UINT64 ReduceBytes);
66 BOOL PSHELL_FormatVolume(char DriveLetter, int fs);
67
68 //
69 // Internel define
70 //
71
72
73
74
75 #endif