blob: 7f917052eb822f5099e2f9d9a7705d3ea01a7e71 (
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
|
/* -------------------------------------------
Copyright (C) 2025, Amlal El Mahrouss, all rights reserved.
FILE: DiskImage+HeFS.cc
PURPOSE: Disk Imaging framework.
------------------------------------------- */
#include <DiskImage.fwrk/headers/DiskImage.h>
#include <FSKit/HeFS.h>
#include <FirmwareKit/EPM.h>
/// @brief format HeFS over an EPM disk.
/// @param img disk image structure.
/// @return Status code upon completion.
SInt32 DI::DIFormatFilesystemHeFS(struct DI_DISK_IMAGE& img) noexcept {
if (!img.sector_sz || (img.sector_sz % kDISectorSz != 0)) return kDIFailureStatus;
if (*img.out_name == 0 || *img.disk_name == 0) return kDIFailureStatus;
IORef handle = IoOpenFile(img.out_name, nullptr);
if (!handle) return kDIFailureStatus;
::IoCloseFile(handle);
handle = nullptr;
return kDISuccessStatus;
}
|