]>
glassweightruler.freedombox.rocks Git - Ventoy.git/blob - Vlnk/src/vlnk.c
7 int ventoy_create_vlnk(uint32_t disksig
, uint64_t partoffset
, const char *path
, ventoy_vlnk
*vlnk
)
10 ventoy_guid guid
= VENTOY_GUID
;
12 memcpy(&(vlnk
->guid
), &guid
, sizeof(ventoy_guid
));
13 vlnk
->disk_signature
= disksig
;
14 vlnk
->part_offset
= partoffset
;
17 strcpy_s(vlnk
->filepath
, sizeof(vlnk
->filepath
) - 1, path
);
19 strncpy(vlnk
->filepath
, path
, sizeof(vlnk
->filepath
) - 1);
22 crc
= ventoy_getcrc32c(0, vlnk
, sizeof(ventoy_vlnk
));
29 int CheckVlnkData(ventoy_vlnk
*vlnk
)
31 uint32_t readcrc
, calccrc
;
32 ventoy_guid guid
= VENTOY_GUID
;
34 if (memcmp(&vlnk
->guid
, &guid
, sizeof(guid
)))
39 readcrc
= vlnk
->crc32
;
41 calccrc
= ventoy_getcrc32c(0, vlnk
, sizeof(ventoy_vlnk
));
43 if (readcrc
!= calccrc
)
51 int IsSupportedImgSuffix(char *suffix
)
54 const char *suffixs
[] =
56 ".iso", ".img", ".wim", ".efi", ".vhd", ".vhdx", ".dat", ".vtoy", NULL
68 if (_stricmp(suffixs
[i
], suffix
) == 0)
70 if (strcasecmp(suffixs
[i
], suffix
) == 0)