]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - Ventoy2Disk/Ventoy2Disk/DiskService.h
Ventoy2Disk update:
[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 DWORD ClusterSize;
34 }VDS_PARA;
35
36 //DISK API
37 BOOL DISK_CleanDisk(int DriveIndex);
38 BOOL DISK_DeleteVtoyEFIPartition(int DriveIndex, UINT64 EfiPartOffset);
39 BOOL DISK_ChangeVtoyEFIAttr(int DriveIndex, UINT64 Offset, UINT64 Attr);
40 BOOL DISK_ChangeVtoyEFI2ESP(int DriveIndex, UINT64 Offset);
41 BOOL DISK_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset);
42 BOOL DISK_ShrinkVolume(int DriveIndex, const char* VolumeGuid, CHAR DriveLetter, UINT64 OldBytes, UINT64 ReduceBytes);
43 BOOL DISK_FormatVolume(char DriveLetter, int fs, UINT64 VolumeSize);
44
45
46 //VDS com
47 BOOL VDS_CleanDisk(int DriveIndex);
48 BOOL VDS_DeleteAllPartitions(int DriveIndex);
49 BOOL VDS_DeleteVtoyEFIPartition(int DriveIndex, UINT64 EfiPartOffset);
50 BOOL VDS_ChangeVtoyEFIAttr(int DriveIndex, UINT64 Offset, UINT64 Attr);
51 BOOL VDS_ChangeVtoyEFI2ESP(int DriveIndex, UINT64 Offset);
52 BOOL VDS_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset);
53 BOOL VDS_ShrinkVolume(int DriveIndex, const char* VolumeGuid, CHAR DriveLetter, UINT64 OldBytes, UINT64 ReduceBytes);
54 BOOL VDS_IsLastAvaliable(void);
55 BOOL VDS_FormatVolume(char DriveLetter, int fs, DWORD ClusterSize);
56
57 //diskpart.exe
58 BOOL DSPT_CleanDisk(int DriveIndex);
59 BOOL DSPT_FormatVolume(char DriveLetter, int fs, DWORD ClusterSize);
60
61 //powershell.exe
62 BOOL PSHELL_CleanDisk(int DriveIndex);
63 BOOL PSHELL_DeleteVtoyEFIPartition(int DriveIndex, UINT64 EfiPartOffset);
64 BOOL PSHELL_ChangeVtoyEFI2ESP(int DriveIndex, UINT64 Offset);
65 BOOL PSHELL_ChangeVtoyEFI2Basic(int DriveIndex, UINT64 Offset);
66 BOOL PSHELL_ShrinkVolume(int DriveIndex, const char* VolumeGuid, CHAR DriveLetter, UINT64 OldBytes, UINT64 ReduceBytes);
67 BOOL PSHELL_FormatVolume(char DriveLetter, int fs, DWORD ClusterSize);
68
69 //
70 // Internel define
71 //
72
73
74
75
76 #endif