Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
filesystem.h
Go to the documentation of this file.
1/*
2 * This file is part of the Ultibo project, https://ultibo.org/
3 *
4 * The MIT License (MIT)
5 *
6 * Copyright (c) 2026 Garry Wood <garry@softoz.com.au>
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to deal
10 * in the Software without restriction, including without limitation the rights
11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 * copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 * THE SOFTWARE.
25 */
26#ifndef _ULTIBO_FILESYSTEM_H
27#define _ULTIBO_FILESYSTEM_H
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include "ultibo/globaltypes.h"
34#include "ultibo/globalconst.h"
35#include "ultibo/storage.h"
36#include "ultibo/ultibo.h"
37
39#define FILESYS_LOGGING_DESCRIPTION "Filesystem Logging"
40
41#define FILESYS_STORAGE_TIMER_INTERVAL 100
42
44#define FILESYS_LOCK_NONE 0
45#define FILESYS_LOCK_READ 1
46#define FILESYS_LOCK_WRITE 2
47#define FILESYS_LOCK_AUTO 3
48
50#define FILESYS_CACHE_THREAD_NAME "Filesystem Cache"
51#define FILESYS_CACHE_THREAD_PRIORITY THREAD_PRIORITY_HIGHER
52
53#define FILESYS_CACHE_TIMER_INTERVAL 50
54#define FILESYS_CACHE_FLUSH_TIMEOUT 3000
55#define FILESYS_CACHE_DISCARD_TIMEOUT 180000
56
58#define FILESYS_ENTRY_TIMER_INTERVAL 1000
59#define FILESYS_ENTRY_DELETE_TIMEOUT 30000
60
62#define CACHE_TIMER_KEY_NONE TIMER_KEY_NONE
63#define CACHE_TIMER_KEY_MAX TIMER_KEY_MAX
64#define CACHE_TIMER_KEY_MIN TIMER_KEY_MIN
65
67#define ENTRY_TIMER_KEY_NONE TIMER_KEY_NONE
68#define ENTRY_TIMER_KEY_MAX TIMER_KEY_MAX
69#define ENTRY_TIMER_KEY_MIN TIMER_KEY_MIN
70
72#define MIN_FLOPPY_DEVICE 0x00
73#define MAX_FLOPPY_DEVICE 0x7F
74
75#define MIN_FIXED_DEVICE 0x80
76#define MAX_FIXED_DEVICE 0xFF
77
78#define MIN_CDROM_DEVICE 0xE0
79#define MAX_CDROM_DEVICE 0xEF
80
81#define MIN_OTHER_DEVICE 0xF0
82#define MAX_OTHER_DEVICE 0xFF
83
84#define INVALID_PARTITION -1
85#define INVALID_DEVICE -1
86#define INVALID_VOLUME 0
87
88#define MIN_PARTITION 0
89#define MAX_PARTITION 3
90#define MAX_EXTENDED 1
91#define MAX_PARTITION_COUNT 4
92
93#define MIN_FLOPPY_DRIVE MIN_DRIVE
94#define MAX_FLOPPY_DRIVE MIN_DRIVE + 1
95
96#define MIN_FIXED_DRIVE MIN_DRIVE + 2
97#define MAX_FIXED_DRIVE MAX_DRIVE
98
99#define MIN_SECTOR_SIZE 512
100#define MAX_SECTOR_SIZE 4096
101#define ISO_SECTOR_SIZE 2048
102
103#define VOLUME_PREFIX "\\Volume"
104#define EXTENDED_PREFIX "\\Extended"
105#define PARTITION_PREFIX "\\Partition"
106#define CONTROLLER_PREFIX "\\Controller"
107#define CDROM_DEVICE_PREFIX "\\Cdrom"
108#define OTHER_DEVICE_PREFIX "\\Other"
109#define FIXED_DEVICE_PREFIX "\\Harddisk"
110#define FLOPPY_DEVICE_PREFIX "\\Floppy"
111#define UNKNOWN_DEVICE_PREFIX "\\Unknown"
112
113#define VOLUME_PATH_PREFIX "\\\\?"
114#define DEVICE_PATH_PREFIX "\\\."
115#define REPARSE_PATH_PREFIX "\\??\\"
116
117#define BOOT_RECORD_SIGNATURE 0xAA55
118#define PARTITION_RECORD_SIGNATURE 0xAA55
119#define BOOT_SECTOR_SIGNATURE 0xAA55
120
122#define FIND_FLAG_NONE 0x00000000
123#define FIND_FLAG_FILE_NAMES 0x00000001
124
126#define FIND_WILDCARD_NAME "*.*"
127#define FIND_WILDCARD_STREAM "*"
128
130#define fsFromBeginning 0
131#define fsFromCurrent 1
132#define fsFromEnd 2
133
135#define fmOpenRead 0x0000
136#define fmOpenWrite 0x0001
137#define fmOpenReadWrite 0x0002
138#define fmShareCompat 0x0000
139#define fmShareExclusive 0x0010
140#define fmShareDenyWrite 0x0020
141#define fmShareDenyRead 0x0030
142#define fmShareDenyNone 0x0040
143
144#define fmOpenMask 0x000F
145#define fmShareMask 0x00F0
146
148#define faReadOnly 0x00000001
149#define faHidden 0x00000002
150#define faSysFile 0x00000004
151#define faVolumeID 0x00000008
152#define faDirectory 0x00000010
153#define faArchive 0x00000020
154#define faSymLink 0x00000400
155#define faVirtual 0x00010000
156#define faAnyFile 0x000001FF
157
158#define faDot 0x01000000
159#define faDotDot 0x02000000
160#define faFile 0x04000000
161#define faStream 0x08000000
162#define faFlagName 0x00100000
163#define faFlagExt 0x00200000
164#define faFlagBoth (faFlagName | faFlagExt)
165#define faFlagLong 0x00400000
166#define faFlagMetafile 0x00800000
167
168#define faFlagMask 0x0FFF0000
169#define faFindMask 0x0000FFFF
170#define faMatchMask (faFile | faStream | faVolumeID | faDirectory)
171
173#define faDevice 0x00000040
174#define faNormal 0x00000080
175#define faTemporary 0x00000100
176#define faSparse 0x00000200
177#define faReparse 0x00000400
178#define faCompressed 0x00000800
179#define faOffline 0x00001000
180#define faNotIndexed 0x00002000
181#define faEncrypted 0x00004000
182
183#define faMftDirectory 0x10000000
184#define faMftIndexView 0x20000000
185
187
189#define faNone 0x00000000
190#define faStandard (faReadOnly | faHidden | faSysFile | faArchive)
191#define faLongName (faReadOnly | faHidden | faSysFile | faVolumeID)
192#define faLongMask (faReadOnly | faHidden | faSysFile | faVolumeID | faDirectory | faArchive)
193
195#define vaNone 0x00000000
196#define vaCaseSensitive 0x00000001
197#define vaCasePreserved 0x00000002
198#define vaUnicode 0x00000004
199#define vaPersistentAcls 0x00000008
200#define vaFileCompression 0x00000010
201#define vaVolumeQuotas 0x00000020
202#define vaSparseFiles 0x00000040
203#define vaReparsePoints 0x00000080
204#define vaRemoteStorage 0x00000100
205#define vaLongNamesApi 0x00004000
206#define vaVolumeCompressed 0x00008000
207#define vaObjectIds 0x00010000
208#define vaEncryption 0x00020000
209#define vaNamedStreams 0x00040000
210#define vaReadOnly 0x00080000
211
213#define vaBootCatalog 0x01000000
214#define vaVirtualVolume 0x02000000
215#define vaFolderEncryption 0x04000000
216#define vaFolderCompression 0x08000000
217
219#define daNone 0x00000000
220#define daWriteable 0x00000001
221#define daVirtual 0x00000002
222
224#define iaNone 0x00000000
225#define iaDisk 0x00000001
226#define iaPartition 0x00000002
227#define iaVolume 0x00000004
228#define iaDrive 0x00000008
229#define iaCDROM 0x00000010
230#define iaDVD 0x00000020
231#define iaFlat 0x00000040
232#define iaSparse 0x00000080
233#define iaGrowing 0x00000100
234#define iaFixed 0x00000200
235#define iaDynamic 0x00000400
236#define iaSplit 0x00000800
237#define iaUndoable 0x00001000
238
239#define iaReadable 0x00010000
240#define iaWriteable 0x00020000
241#define iaEraseable 0x00040000
242
244#define caNone 0x00000000
245#define caDefault 0x00000001
246#define caBootable 0x00000002
247#define caNoEmulation 0x00000004
248#define caFloppy12M 0x00000008
249#define caFloppy144M 0x00000010
250#define caFloppy288M 0x00000020
251#define caHardDisk 0x00000040
252
254#define NAME_HASH_SIZE 8
255
257#define MAX_PARTITION_ID 255
258#define pidUnused 0
259#define pidFAT12 1
260#define pidXENIXROOT 2
261#define pidXENIXUSR 3
262#define pidFAT16 4
263#define pidExtended 5
264#define pidFAT16HUGE 6
265#define pidHPFSNTFS 7
266#define pidAIXOS2 8
267#define pidAIX 9
268#define pidOS2BOOT 10
269#define pidFAT32 11
270#define pidFAT32LBA 12
271#define pidUnknown013 13
272#define pidFAT16LBA 14
273#define pidExtLBA 15
274#define pidOPUS 16
275#define pidHIDDEN12 17
276#define pidCompaqDiag 18
277#define pidUnknown019 19
278#define pidHIDDEN16 20
279#define pidUnknown021 21
280#define pidHIDDEN16HUGE 22
281#define pidHIDDENHPFS 23
282#define pidASTSWAP 24
283#define pidWillowtech 25
284#define pidUnknown026 26
285#define pidHIDDEN32 27
286#define pidHIDDEN32LBA 28
287#define pidUnknown029 29
288#define pidHIDDEN16LBA 30
289#define pidUnknown031 31
290#define pidWillowsoft 32
291#define pidOxygen 33
292#define pidOxygenExtended 34
293#define pidReserved035 35
294#define pidNECMSDOS 36
295#define pidUnknown037 37
296#define pidUnknown038 38
297#define pidUnknown039 39
298#define pidUnknown040 40
299#define pidUnknown041 41
300#define pidUnknown042 42
301#define pidUnknown043 43
302#define pidUnknown044 44
303#define pidUnknown045 45
304#define pidUnknown046 46
305#define pidUnknown047 47
306#define pidUnknown048 48
307#define pidReserved049 49
308#define pidAlienNOS 50
309#define pidReserved051 51
310#define pidReserved052 52
311#define pidOS2JFS 53
312#define pidReserved054 54
313#define pidUnknown055 55
314#define pidTheos057 56
315#define pidPlan9 57
316#define pidTheos058 58
317#define pidTheos059 59
318#define pidPowerQuest 60
319#define pidHiddenNetware 61
320#define pidUnknown062 62
321#define pidUnknown063 63
322#define pidVENIX286 64
323#define pidPersonalRISC 65
324#define pidSFS 66
325#define pidPTSDOS 67
326#define pidGoBack 68
327#define pidEUMEL069 69
328#define pidEUMEL070 70
329#define pidEUMEL071 71
330#define pidEUMEL072 72
331#define pidUnknown073 73
332#define pidAdaOS 74
333#define pidUnknown075 75
334#define pidOberon 76
335#define pidQNX4077 77
336#define pidQNX4078 78
337#define pidQNX4079 79
338#define pidOnTrack080 80
339#define pidNOVELL081 81
340#define pidCPM 82
341#define pidOnTrack083 83
342#define pidOnTrack084 84
343#define pidEZDrive 85
344#define pidGoldenBow 86
345#define pidUnknown087 87
346#define pidUnknown088 88
347#define pidUnknown089 89
348#define pidUnknown090 90
349#define pidUnknown091 91
350#define pidPriamEdisk 92
351#define pidUnknown093 93
352#define pidUnknown094 94
353#define pidUnknown095 95
354#define pidUnknown096 96
355#define pidSpeedStor097 97
356#define pidUnknown098 98
357#define pidSysV 99
358#define pidNetware286 100
359#define pidNWFS 101
360#define pidUnknown102 102
361#define pidNovell103 103
362#define pidNovell104 104
363#define pidNSS 105
364#define pidUnknown106 106
365#define pidUnknown107 107
366#define pidUnknown108 108
367#define pidUnknown109 109
368#define pidUnknown110 110
369#define pidUnknown111 111
370#define pidDiskSecure 112
371#define pidUnknown113 113
372#define pidUnknown114 114
373#define pidReserved115 115
374#define pidReserved116 116
375#define pidPCIX 117
376#define pidReserved118 118
377#define pidUnknown119 119
378#define pidUnknown120 120
379#define pidUnknown121 121
380#define pidUnknown122 122
381#define pidUnknown123 123
382#define pidUnknown124 124
383#define pidUnknown125 125
384#define pidUnknown126 126
385#define pidUnknown127 127
386#define pidMinix 128
387#define pidLinuxMinix 129
388#define pidLinuxSwap 130
389#define pidLinuxNative 131
390#define pidHIDDENC 132
391#define pidLinuxExtended 133
392#define pidFAT16Stripe 134
393#define pidNTFSStripe 135
394#define pidUnknown136 136
395#define pidUnknown137 137
396#define pidUnknown138 138
397#define pidUnknown139 139
398#define pidUnknown140 140
399#define pidUnknown141 141
400#define pidUnknown142 142
401#define pidUnknown143 143
402#define pidUnknown144 144
403#define pidUnknown145 145
404#define pidUnknown146 146
405#define pidAmoeba 147
406#define pidAmoebaBBT 148
407#define pidUnknown149 149
408#define pidUnknown150 150
409#define pidUnknown151 151
410#define pidUnknown152 152
411#define pidUnknown153 153
412#define pidUnknown154 154
413#define pidUnknown155 155
414#define pidUnknown156 156
415#define pidUnknown157 157
416#define pidUnknown158 158
417#define pidUnknown159 159
418#define pidPhoenixPM 160
419#define pidReserved161 161
420#define pidUnknown162 162
421#define pidReserved163 163
422#define pidReserved164 164
423#define pidFreeBSD 165
424#define pidOpenBSD 166
425#define pidNeXTStep 167
426#define pidUnknown168 168
427#define pidUnknown169 169
428#define pidUnknown170 170
429#define pidDarwinBoot 171
430#define pidUnknown172 172
431#define pidUnknown173 173
432#define pidUnknown174 174
433#define pidUnknown175 175
434#define pidUnknown176 176
435#define pidUnknown177 177
436#define pidUnknown178 178
437#define pidUnknown179 179
438#define pidReserved180 180
439#define pidUnknown181 181
440#define pidFAT16MirrorA 182
441#define pidNTFSMirrorA 183
442#define pidBSDIswap 184
443#define pidUnknown185 185
444#define pidUnknown186 186
445#define pidUnknown187 187
446#define pidUnknown188 188
447#define pidUnknown189 189
448#define pidUnknown190 190
449#define pidUnknown191 191
450#define pidUnknown192 192
451#define pidDRDOSFAT12 193
452#define pidUnknown194 194
453#define pidUnknown195 195
454#define pidDRDOSFAT16 196
455#define pidUnknown197 197
456#define pidFAT16MirrorB 198
457#define pidNTFSMirrorB 199
458#define pidUnknown200 200
459#define pidUnknown201 201
460#define pidUnknown202 202
461#define pidUnknown203 203
462#define pidUnknown204 204
463#define pidUnknown205 205
464#define pidUnknown206 206
465#define pidUnknown207 207
466#define pidUnknown208 208
467#define pidUnknown209 209
468#define pidTinyEFAT 210
469#define pidEFAT 211
470#define pidSecuredEFAT 212
471#define pidOpticalEFAT 213
472#define pidUnknown214 214
473#define pidUnknown215 215
474#define pidCPM86 216
475#define pidUnknown217 217
476#define pidUnknown218 218
477#define pidConcurrentCPM 219
478#define pidUnknown220 220
479#define pidUnknown221 221
480#define pidUnknown222 222
481#define pidUnknown223 223
482#define pidUnknown224 224
483#define pidSpeedStorFAT12 225
484#define pidUnknown226 226
485#define pidUnknown227 227
486#define pidSpeedStorFAT16 228
487#define pidReserved229 229
488#define pidReserved230 230
489#define pidUnknown231 231
490#define pidUnknown232 232
491#define pidUnknown233 233
492#define pidUnknown234 234
493#define pidBeOSBFS1 235
494#define pidUnknown236 236
495#define pidUnknown237 237
496#define pidUnknown238 238
497#define pidUnknown239 239
498#define pidLinuxRISC 240
499#define pidStorageDimension 241
500#define pidDOS33Secondary 242
501#define pidSpeedStor243 243
502#define pidSpeedStor244 244
503#define pidPrologue 245
504#define pidSpeedStor246 246
505#define pidOSGEFAT 247
506#define pidUnknown248 248
507#define pidUnknown249 249
508#define pidBochsX86 250
509#define pidVMware 251
510#define pidVMwareSwap 252
511#define pidLinuxRAID 253
512#define pidLANstep 254
513#define pidXenixBBT 255
514
516#define FILESYS_ATA_DEVICE_DESCRIPTION "ATA Storage Device"
517#define FILESYS_ATAPI_DEVICE_DESCRIPTION "ATAPI Storage Device"
518#define FILESYS_SCSI_DEVICE_DESCRIPTION "SCSI Storage Device"
519#define FILESYS_USB_DEVICE_DESCRIPTION "USB Storage Device"
520#define FILESYS_MMC_DEVICE_DESCRIPTION "MMC/SD Storage Device"
521
523#define FILESYS_ATA_CONTROLLER_DESCRIPTION "ATA Storage Controller"
524#define FILESYS_ATAPI_CONTROLLER_DESCRIPTION "ATAPI Storage Controller"
525#define FILESYS_SCSI_CONTROLLER_DESCRIPTION "SCSI Storage Controller"
526#define FILESYS_USB_CONTROLLER_DESCRIPTION "USB Storage Controller"
527#define FILESYS_MMC_CONTROLLER_DESCRIPTION "MMC/SD Storage Controller"
528
536
548
560
574
581
588
594
602
611
615{
616 // Information
617 uint32_t pagesize;
618 uint32_t pagecount;
619 uint32_t cachesize;
622 uint32_t flushtimeout;
624 // Read / Write
625 int64_t readcached;
626 int64_t readdirect;
627 int64_t writeback;
629 int64_t writedirect;
630 // Hit / Miss
631 int64_t hitcount;
632 int64_t misscount;
633 // Allocate Success / Failure
634 int64_t failcount;
636 // Page Flush / Discard
637 int64_t flushcount;
640 // Page Times
641 int64_t oldestclean;
642 int64_t newestclean;
643 int64_t oldestdirty;
644 int64_t newestdirty;
645};
646
653
663
672
686
700
719
733
740
747
754
761
763typedef struct _BIOS_PB
764{
765 uint16_t bytespersector;
768 uint8_t numberoffats;
769 uint16_t rootentrycount;
770 // RootEntryCount * 32 must be even multiple of BytesPerSector
771 uint16_t totalsectors16;
772 uint8_t mediaid;
775 uint16_t numberofheads;
776 uint32_t hiddensectors;
777 // Only valid on Partitioned media
778 uint32_t totalsectors32;
780
782typedef struct _EXT_BIOS_PB
783{
784 uint16_t bytespersector;
787 uint8_t numberoffats;
788 uint16_t rootentrycount;
789 // RootEntryCount * 32 must be even multiple of BytesPerSector
790 uint16_t totalsectors16;
791 uint8_t mediaid;
794 uint16_t numberofheads;
795 uint32_t hiddensectors;
796 // Only valid on Partitioned media
797 uint32_t totalsectors32;
799 uint16_t extendedflags;
800 // is disabled.
801 // Bits 4-6 -- Reserved.
802 // Bit 7 -- 0 means the FAT is mirrored at runtime into all FATs.
803 // it is the one referenced}
804 // in bits 0-3.
805 // Bits 8-15 -- Reserved.
806 uint16_t filesysversion;
807 uint32_t rootcluster;
810 uint8_t reserved[12];
812
814typedef struct _NTFS_BIOS_PB
815{
816 uint16_t bytespersector;
819 uint8_t reserved1[3];
820 uint16_t reserved2;
821 uint8_t mediaid;
822 uint16_t reserved3;
824 uint16_t numberofheads;
825 uint32_t hiddensectors;
826 uint32_t reserved4;
827 uint32_t reserved5;
828 int64_t totalsectors;
829 int64_t mftcluster;
830 int64_t mftmirror;
833 int64_t volumeserial;
834 uint32_t checksum;
836
851
856
857typedef uint8_t MASTER_BOOT_CODE[446];
858
865
866typedef uint8_t EXT_MASTER_BOOT_CODE[440];
867
876
883
885typedef uint8_t DISK_SECTOR[512];
886
887typedef uint8_t BOOT_SECTOR_JUMP[3];
888typedef uint8_t BOOT_SECTOR_CODE[448];
889
904
905typedef uint8_t EXT_BOOT_SECTOR_JUMP[3];
906typedef uint8_t EXT_BOOT_SECTOR_CODE[420];
907
922
923typedef uint8_t NTFS_BOOT_SECTOR_JUMP[3];
924typedef uint8_t NTFS_BOOT_SECTOR_CODE[426];
925
934
935typedef struct _EXTFS_BOOT_SECTOR
936{
937 // To Do
939
941uint32_t STDCALL file_sys_start(void);
942uint32_t STDCALL file_sys_stop(void);
943
948
950
953uint8_t STDCALL GetPathDrive(const char *path);
955void STDCALL GetDriveData(uint8_t drive, DRIVE_DATA *data);
956uint32_t STDCALL GetDriveAttr(uint8_t drive);
957uint32_t STDCALL GetDriveLabel(uint8_t drive, char *label, uint32_t len);
958BOOL STDCALL SetDriveLabel(uint8_t drive, const char *label);
959uint32_t STDCALL GetDriveSerial(uint8_t drive);
960BOOL STDCALL SetDriveSerial(uint8_t drive, uint32_t serial);
961BOOL STDCALL IsDriveValid(uint8_t drive);
962uint32_t STDCALL GetValidDrives(void);
963uint32_t STDCALL GetValidDriveNames(char *names, uint32_t len);
964uint32_t STDCALL GetDriveFreeSpace(uint8_t drive);
965int64_t STDCALL GetDriveFreeSpaceEx(uint8_t drive);
966uint32_t STDCALL GetDriveTotalSpace(uint8_t drive);
967int64_t STDCALL GetDriveTotalSpaceEx(uint8_t drive);
968
969BOOL STDCALL GetDriveInformation(const char *path, uint32_t *clustersize, int64_t *totalclustercount, int64_t *freeclustercount);
970
972BOOL STDCALL SetCurrentDrive(const char *drive);
973
975HANDLE STDCALL FileOpen(const char *filename, int mode);
976HANDLE STDCALL FileCreate(const char *filename);
977BOOL STDCALL DeleteFile(const char *filename);
979BOOL STDCALL RenameFile(const char *oldname, const char *newname);
980int32_t STDCALL FileSeek(HANDLE handle, int32_t offset, int32_t origin);
984
986int32_t STDCALL FilePos(HANDLE handle);
987int32_t STDCALL FileSize(HANDLE handle);
988
989int STDCALL FileAge(const char *filename);
990BOOL STDCALL FileExists(const char *filename);
991int STDCALL FileGetAttr(const char *filename);
993int STDCALL FileSetAttr(const char *filename, int attr);
994int STDCALL FileSetDate(HANDLE handle, int age);
995
996int32_t STDCALL FileRead(HANDLE handle, void *buffer, int32_t count);
997int32_t STDCALL FileWrite(HANDLE handle, void *buffer, int32_t count);
998
1000BOOL STDCALL CreateDir(const char *dirname);
1001BOOL STDCALL RemoveDir(const char *dirname);
1002BOOL STDCALL RenameDir(const char *oldname, const char *newname);
1003uint32_t STDCALL GetCurrentDir(char *dirname, uint32_t len);
1004BOOL STDCALL SetCurrentDir(const char *dirname);
1005BOOL STDCALL DirectoryExists(const char *dirname);
1006void STDCALL ForceDirectories(char *dirname);
1007void STDCALL DeleteTree(const char *dirname);
1008
1010
1012BOOL STDCALL FileCopy(const char *sourcefile, const char *destfile, BOOL failifexists);
1013BOOL STDCALL FileCopyEx(const char *sourcefile, const char *destfile, BOOL failifexists, BOOL usesourcedate, int destdate, BOOL usesourceattr, int destattr);
1014
1015uint32_t STDCALL GetShortName(const char *filename, char *shortname, uint32_t len);
1016uint32_t STDCALL GetLongName(const char *filename, char *longname, uint32_t len);
1017uint32_t STDCALL GetTrueName(const char *filename, char *truename, uint32_t len);
1018
1020int64_t STDCALL FileSeekEx(HANDLE handle, int64_t offset, int32_t origin);
1021
1023int64_t STDCALL FilePosEx(HANDLE handle);
1024int64_t STDCALL FileSizeEx(HANDLE handle);
1025
1026FILETIME STDCALL FileAgeEx(const char *filename);
1027
1029
1032
1033BOOL STDCALL GetFileTime(HANDLE handle, FILETIME *createtime, FILETIME *accesstime, FILETIME *writetime);
1034BOOL STDCALL SetFileTime(HANDLE handle, FILETIME *createtime, FILETIME *accesstime, FILETIME *writetime);
1035
1036int STDCALL FindFirstEx(const char *path, FILE_SEARCH_REC *searchrec);
1039
1042BOOL STDCALL DefineDosDevice(uint32_t dwflags, const char *lpdevicename, const char *lptargetpath);
1043UINT STDCALL GetDiskType(const char *lprootpathname);
1044BOOL STDCALL GetDiskFreeSpace(const char *lprootpathname, uint32_t *lpsectorspercluster, uint32_t *lpbytespersector, uint32_t *lpnumberoffreeclusters, uint32_t *lptotalnumberofclusters);
1045BOOL STDCALL GetDiskFreeSpaceEx(const char *lpdirectoryname, ULARGE_INTEGER *lpfreebytesavailabletocaller, ULARGE_INTEGER *lptotalnumberofbytes, ULARGE_INTEGER *lptotalnumberoffreebytes);
1047uint32_t STDCALL GetLogicalDriveStrings(uint32_t nbufferlength, char *lpbuffer);
1048BOOL STDCALL GetVolumeInformation(const char *lprootpathname, char *lpvolumenamebuffer, uint32_t nvolumenamesize, DWORD *lpvolumeserialnumber, uint32_t *lpmaximumcomponentlength, uint32_t *lpfilesystemflags, char *lpfilesystemnamebuffer, uint32_t nfilesystemnamesize);
1049uint32_t STDCALL QueryDosDevice(const char *lpdevicename, char *lptargetpath, uint32_t ucchmax);
1050BOOL STDCALL SetVolumeLabel(const char *lprootpathname, const char *lpvolumename);
1051
1055BOOL STDCALL CopyFile(const char *lpexistingfilename, const char *lpnewfilename, BOOL bfailifexists);
1056HANDLE STDCALL CreateFile(const char *lpfilename, uint32_t dwdesiredaccess, uint32_t dwsharemode, SECURITY_ATTRIBUTES *lpsecurityattributes, uint32_t dwcreationdisposition, uint32_t dwflagsandattributes, HANDLE htemplatefile);
1058HANDLE STDCALL FindFirstFile(const char *lpfilename, WIN32_FIND_DATAA *lpfindfiledata);
1061uint32_t STDCALL GetFileAttributes(const char *lpfilename);
1063uint32_t STDCALL GetFileSize(HANDLE hfile, DWORD *lpfilesizehigh);
1064uint32_t STDCALL GetFullPathName(const char *lpfilename, uint32_t nbufferlength, char *lpbuffer, char *lpfilepart);
1065uint32_t STDCALL GetShortPathName(const char *lpszlongpath, char *lpszshortpath, uint32_t cchbuffer);
1066BOOL STDCALL MoveFile(const char *lpexistingfilename, const char *lpnewfilename);
1067BOOL STDCALL ReadFile(HANDLE hfile, void *lpbuffer, uint32_t nnumberofbytestoread, DWORD *lpnumberofbytesread, OVERLAPPED *lpoverlapped);
1070BOOL STDCALL SetFileAttributes(const char *lpfilename, uint32_t dwfileattributes);
1071uint32_t STDCALL SetFilePointer(HANDLE hfile, long ldistancetomove, long *lpdistancetomovehigh, uint32_t dwmovemethod);
1072BOOL STDCALL SetFilePointerEx(HANDLE hfile, LARGE_INTEGER lidistancetomove, LARGE_INTEGER *lpnewfilepointer, uint32_t dwmovemethod);
1073BOOL STDCALL WriteFile(HANDLE hfile, void *lpbuffer, uint32_t nnumberofbytestowrite, DWORD *lpnumberofbyteswritten, OVERLAPPED *lpoverlapped);
1074uint32_t STDCALL GetLongPathName(const char *lpszshortpath, char *lpszlongpath, uint32_t cchbuffer);
1075uint32_t STDCALL GetFinalPathNameByHandle(HANDLE hfile, char *lpszFilePath, uint32_t cchFilePath, uint32_t dwFlags);
1076
1077BOOL STDCALL SetFileShortName(HANDLE hfile, const char *lpshortname);
1078BOOL STDCALL CreateHardLink(const char *lpfilename, const char *lpexistingfilename, SECURITY_ATTRIBUTES *lpsecurityattributes);
1079BOOL STDCALL CreateSymbolicLink(const char *lpsymlinkfilename, const char *lptargetfilename, uint32_t dwflags);
1080
1082BOOL STDCALL CreateDirectory(const char *lppathname, SECURITY_ATTRIBUTES *lpsecurityattributes);
1083uint32_t STDCALL GetCurrentDirectory(uint32_t nbufferlength, char *lpbuffer);
1084BOOL STDCALL RemoveDirectory(const char *lppathname);
1085BOOL STDCALL SetCurrentDirectory(const char *lppathname);
1086
1088
1097
1106
1110int STDCALL compare_partitions(void *partition1, void *partition2);
1111
1112uint32_t STDCALL disk_media_type_to_string(MEDIA_TYPE _type, char *string, uint32_t len);
1113uint32_t STDCALL floppy_type_to_string(FLOPPY_TYPE _type, char *string, uint32_t len);
1114uint32_t STDCALL image_type_to_string(IMAGE_TYPE _type, char *string, uint32_t len);
1115
1116uint32_t STDCALL drive_type_to_string(DRIVE_TYPE _type, char *string, uint32_t len);
1117
1118uint32_t STDCALL file_sys_type_to_string(FILE_SYS_TYPE _type, char *string, uint32_t len);
1120
1121uint32_t STDCALL partition_id_to_string(uint8_t id, char *string, uint32_t len);
1122uint8_t STDCALL string_to_partition_id(char *partitionid);
1123
1124uint32_t STDCALL cache_mode_to_string(CACHE_MODE cachemode, char *string, uint32_t len);
1125
1132
1139uint32_t STDCALL cache_state_to_string(CACHE_STATE cachestate, char *string, uint32_t len);
1140
1141#ifdef __cplusplus
1142}
1143#endif
1144
1145#endif // _ULTIBO_FILESYSTEM_H
struct _LINK_SEARCH_REC LINK_SEARCH_REC
enum _IMAGE_TYPE IMAGE_TYPE
struct _PARTITION_SEARCH_REC PARTITION_SEARCH_REC
int STDCALL FindNextEx(FILE_SEARCH_REC *searchrec)
int STDCALL FileGetAttr(const char *filename)
int STDCALL FileSetDateEx(HANDLE handle, FILETIME age)
void STDCALL ForceDirectories(char *dirname)
BOOL STDCALL FileCopyEx(const char *sourcefile, const char *destfile, BOOL failifexists, BOOL usesourcedate, int destdate, BOOL usesourceattr, int destattr)
uint8_t NTFS_BOOT_SECTOR_JUMP[3]
Definition filesystem.h:923
uint8_t STDCALL string_to_partition_id(char *partitionid)
uint32_t STDCALL GetFileSize(HANDLE hfile, DWORD *lpfilesizehigh)
uint8_t EXT_BOOT_SECTOR_JUMP[3]
Definition filesystem.h:905
BOOL STDCALL FileExists(const char *filename)
BOOL STDCALL RemoveDirectory(const char *lppathname)
BOOL STDCALL SetFileShortName(HANDLE hfile, const char *lpshortname)
BOOL STDCALL SetEndOfFile(HANDLE handle)
BOOL STDCALL DefineDosDevice(uint32_t dwflags, const char *lpdevicename, const char *lptargetpath)
BOOL STDCALL GetDiskFreeSpaceEx(const char *lpdirectoryname, ULARGE_INTEGER *lpfreebytesavailabletocaller, ULARGE_INTEGER *lptotalnumberofbytes, ULARGE_INTEGER *lptotalnumberoffreebytes)
int STDCALL FindFirstEx(const char *path, FILE_SEARCH_REC *searchrec)
HANDLE STDCALL CreateFile(const char *lpfilename, uint32_t dwdesiredaccess, uint32_t dwsharemode, SECURITY_ATTRIBUTES *lpsecurityattributes, uint32_t dwcreationdisposition, uint32_t dwflagsandattributes, HANDLE htemplatefile)
void STDCALL SetFileApisToANSI(void)
void STDCALL file_sys_async_start(void *data)
enum _CACHE_MODE CACHE_MODE
BOOL STDCALL CopyFile(const char *lpexistingfilename, const char *lpnewfilename, BOOL bfailifexists)
uint32_t STDCALL GetFileAttributes(const char *lpfilename)
BOOL STDCALL FindNextFile(HANDLE hfindfile, WIN32_FIND_DATAA *lpfindfiledata)
CACHE_MODE STDCALL string_to_cache_mode(char *cachemode)
Convert a string value to a cache mode enum.
BOOL STDCALL SetFilePointerEx(HANDLE hfile, LARGE_INTEGER lidistancetomove, LARGE_INTEGER *lpnewfilepointer, uint32_t dwmovemethod)
BOOL STDCALL FileCopy(const char *sourcefile, const char *destfile, BOOL failifexists)
int64_t STDCALL GetDriveFreeSpaceEx(uint8_t drive)
_IMAGE_TYPE
Definition filesystem.h:562
@ itVBOX
Definition filesystem.h:572
@ itUNKNOWN
Definition filesystem.h:563
@ itVPC
Definition filesystem.h:571
@ itINVALID
Definition filesystem.h:564
@ itVMWARE
Definition filesystem.h:570
@ itDEVICE
Definition filesystem.h:567
@ itMEMORY
Definition filesystem.h:565
@ itISO
Definition filesystem.h:568
@ itFILE
Definition filesystem.h:566
@ itBOCHS
Definition filesystem.h:569
struct _STORAGE_DEVICE_EVENT STORAGE_DEVICE_EVENT
Definition filesystem.h:530
BOOL STDCALL CloseHandle(HANDLE hobject)
uint8_t EXT_MASTER_BOOT_CODE[440]
Definition filesystem.h:866
uint32_t STDCALL file_sys_stop(void)
uint32_t STDCALL partition_id_to_string(uint8_t id, char *string, uint32_t len)
uint8_t BOOT_SECTOR_JUMP[3]
Definition filesystem.h:887
BOOL STDCALL file_sys_redirect_input(HANDLE handle)
Redirect standard input to the file specified by Handle.
BOOL STDCALL MoveFile(const char *lpexistingfilename, const char *lpnewfilename)
uint32_t STDCALL cache_mode_to_string(CACHE_MODE cachemode, char *string, uint32_t len)
BOOL STDCALL CreateHardLink(const char *lpfilename, const char *lpexistingfilename, SECURITY_ATTRIBUTES *lpsecurityattributes)
int64_t STDCALL FilePosEx(HANDLE handle)
BOOL STDCALL IsDriveValid(uint8_t drive)
BOOL STDCALL EndOfFile(HANDLE handle)
HANDLE STDCALL FileOpen(const char *filename, int mode)
BOOL STDCALL RenameDir(const char *oldname, const char *newname)
uint32_t STDCALL file_sys_type_to_string(FILE_SYS_TYPE _type, char *string, uint32_t len)
CACHE_MODE STDCALL const_to_cache_mode(uint32_t cachemode)
Convert a cache mode constant to a cache mode enum.
struct _JUNCTION_SEARCH_REC JUNCTION_SEARCH_REC
struct _CACHE_STATISTICS CACHE_STATISTICS
Definition filesystem.h:613
BOOL STDCALL WriteFile(HANDLE hfile, void *lpbuffer, uint32_t nnumberofbytestowrite, DWORD *lpnumberofbyteswritten, OVERLAPPED *lpoverlapped)
_CACHE_STATE
Definition filesystem.h:577
@ csDIRTY
Definition filesystem.h:579
@ csCLEAN
Definition filesystem.h:578
_CACHE_PAGE_CONTENT
Definition filesystem.h:604
@ pcUNKNOWN
Definition filesystem.h:605
@ pcDIRECTORY
Definition filesystem.h:607
@ pcDATA
Definition filesystem.h:606
@ pcENTRY
Definition filesystem.h:608
@ pcSYSTEM
Definition filesystem.h:609
FILETIME STDCALL FileAgeEx(const char *filename)
int STDCALL FileSetAttr(const char *filename, int attr)
BOOL STDCALL GetVolumeInformation(const char *lprootpathname, char *lpvolumenamebuffer, uint32_t nvolumenamesize, DWORD *lpvolumeserialnumber, uint32_t *lpmaximumcomponentlength, uint32_t *lpfilesystemflags, char *lpfilesystemnamebuffer, uint32_t nfilesystemnamesize)
BOOL STDCALL SetDriveSerial(uint8_t drive, uint32_t serial)
uint8_t DISK_SECTOR[512]
Definition filesystem.h:885
enum _CACHE_PAGE_STATE CACHE_PAGE_STATE
uint32_t STDCALL GetLongPathName(const char *lpszshortpath, char *lpszlongpath, uint32_t cchbuffer)
uint32_t STDCALL GetLogicalDriveStrings(uint32_t nbufferlength, char *lpbuffer)
void STDCALL FindCloseEx(FILE_SEARCH_REC *searchrec)
void STDCALL GetDriveData(uint8_t drive, DRIVE_DATA *data)
uint32_t STDCALL GetLongName(const char *filename, char *longname, uint32_t len)
int32_t STDCALL FileRead(HANDLE handle, void *buffer, int32_t count)
int64_t STDCALL FileSeekEx(HANDLE handle, int64_t offset, int32_t origin)
BOOL STDCALL RemoveDir(const char *dirname)
uint32_t STDCALL disk_media_type_to_string(MEDIA_TYPE _type, char *string, uint32_t len)
void STDCALL SetFileApisToOEM(void)
BOOL STDCALL SetDriveLabel(uint8_t drive, const char *label)
int32_t STDCALL FilePos(HANDLE handle)
uint32_t STDCALL image_type_to_string(IMAGE_TYPE _type, char *string, uint32_t len)
BOOL STDCALL FileFlush(HANDLE handle)
int64_t STDCALL FileSizeEx(HANDLE handle)
FILETIME STDCALL FileGetDateEx(HANDLE handle)
struct _EXTFS_BOOT_SECTOR EXTFS_BOOT_SECTOR
BOOL STDCALL ReadFile(HANDLE hfile, void *lpbuffer, uint32_t nnumberofbytestoread, DWORD *lpnumberofbytesread, OVERLAPPED *lpoverlapped)
int STDCALL compare_partitions(void *partition1, void *partition2)
Sort partitions in order of start sector.
struct _BIOS_PB BIOS_PB
struct _MASTER_BOOT_RECORD MASTER_BOOT_RECORD
BOOL STDCALL RenameFile(const char *oldname, const char *newname)
struct _VOLUME_SEARCH_REC VOLUME_SEARCH_REC
struct _DRIVE_SEARCH_REC DRIVE_SEARCH_REC
uint32_t STDCALL floppy_type_to_string(FLOPPY_TYPE _type, char *string, uint32_t len)
struct _CATALOG_SEARCH_REC CATALOG_SEARCH_REC
uint32_t STDCALL file_sys_start(void)
BOOL STDCALL AreFileApisANSI(void)
enum _MEDIA_TYPE MEDIA_TYPE
BOOL STDCALL GetFileTime(HANDLE handle, FILETIME *createtime, FILETIME *accesstime, FILETIME *writetime)
int32_t STDCALL FileSize(HANDLE handle)
BOOL STDCALL FindCloseFile(HANDLE hfindfile)
struct _STREAM_SEARCH_REC STREAM_SEARCH_REC
BOOL STDCALL EndOfFileEx(HANDLE handle)
_MEDIA_TYPE
Definition filesystem.h:538
@ mtFLOPPY
Definition filesystem.h:541
@ mtCDROM
Definition filesystem.h:544
@ mtINVALID
Definition filesystem.h:540
@ mtUNKNOWN
Definition filesystem.h:539
@ mtDVD
Definition filesystem.h:545
@ mtOTHER
Definition filesystem.h:546
@ mtREMOVABLE
Definition filesystem.h:543
@ mtFIXED
Definition filesystem.h:542
BOOL STDCALL FlushFileBuffers(HANDLE hfile)
BOOL STDCALL SetCurrentDrive(const char *drive)
uint32_t STDCALL GetDriveTotalSpace(uint8_t drive)
uint8_t BOOT_SECTOR_CODE[448]
Definition filesystem.h:888
int STDCALL FileSetDate(HANDLE handle, int age)
uint8_t MASTER_BOOT_CODE[446]
Definition filesystem.h:857
DRIVE_TYPE STDCALL GetDriveType(uint8_t drive)
uint32_t STDCALL GetDriveLabel(uint8_t drive, char *label, uint32_t len)
BOOL STDCALL GetDiskFreeSpace(const char *lprootpathname, uint32_t *lpsectorspercluster, uint32_t *lpbytespersector, uint32_t *lpnumberoffreeclusters, uint32_t *lptotalnumberofclusters)
BOOL STDCALL CreateDir(const char *dirname)
struct _EXT_BIOS_PB EXT_BIOS_PB
uint32_t STDCALL GetCurrentDirectory(uint32_t nbufferlength, char *lpbuffer)
_CACHE_PAGE_STATE
Definition filesystem.h:596
@ psCLEAN
Definition filesystem.h:599
@ psDIRTY
Definition filesystem.h:600
@ psUNKNOWN
Definition filesystem.h:597
@ psEMPTY
Definition filesystem.h:598
_CACHE_MODE
Definition filesystem.h:583
@ cmREADWRITE
Definition filesystem.h:586
@ cmREADONLY
Definition filesystem.h:585
@ cmNONE
Definition filesystem.h:584
void STDCALL DeleteTree(const char *dirname)
enum _CACHE_PAGE_CONTENT CACHE_PAGE_CONTENT
int STDCALL FileGetDate(HANDLE handle)
struct _PARTITION_TABLE PARTITION_TABLE
BOOL STDCALL SetCurrentDir(const char *dirname)
enum _FLOPPY_TYPE FLOPPY_TYPE
BOOL STDCALL DeleteFile(const char *filename)
BOOL STDCALL FileTruncate(HANDLE handle)
struct _NTFS_BIOS_PB NTFS_BIOS_PB
uint32_t STDCALL SetFilePointer(HANDLE hfile, long ldistancetomove, long *lpdistancetomovehigh, uint32_t dwmovemethod)
uint8_t EXT_BOOT_SECTOR_CODE[420]
Definition filesystem.h:906
struct _FILE_SEARCH_REC FILE_SEARCH_REC
uint8_t NTFS_BOOT_SECTOR_CODE[426]
Definition filesystem.h:924
int32_t STDCALL FileSeek(HANDLE handle, int32_t offset, int32_t origin)
struct _EXT_BOOT_SECTOR EXT_BOOT_SECTOR
uint32_t STDCALL GetCurrentDir(char *dirname, uint32_t len)
uint32_t STDCALL GetFinalPathNameByHandle(HANDLE hfile, char *lpszFilePath, uint32_t cchFilePath, uint32_t dwFlags)
enum _CACHE_STATE CACHE_STATE
_FLOPPY_TYPE
Definition filesystem.h:550
@ ftINVALID
Definition filesystem.h:552
@ ft360K
Definition filesystem.h:553
@ ft288M
Definition filesystem.h:557
@ ftATAPI
Definition filesystem.h:558
@ ft12M
Definition filesystem.h:554
@ ftUNKNOWN
Definition filesystem.h:551
@ ft144M
Definition filesystem.h:556
@ ft720K
Definition filesystem.h:555
struct _EXT_MASTER_BOOT_RECORD EXT_MASTER_BOOT_RECORD
int64_t STDCALL GetDriveTotalSpaceEx(uint8_t drive)
BOOL STDCALL DirectoryExists(const char *dirname)
enum _CACHE_PAGE_TYPE CACHE_PAGE_TYPE
uint32_t STDCALL QueryDosDevice(const char *lpdevicename, char *lptargetpath, uint32_t ucchmax)
uint32_t STDCALL drive_type_to_string(DRIVE_TYPE _type, char *string, uint32_t len)
BOOL STDCALL file_sys_redirect_output(HANDLE handle)
Redirect standard output to the file specified by Handle.
BOOL STDCALL GetFileInformationByHandle(HANDLE hfile, BY_HANDLE_FILE_INFORMATION *lpfileinformation)
uint32_t STDCALL GetDriveSerial(uint8_t drive)
BOOL STDCALL GetDriveInformation(const char *path, uint32_t *clustersize, int64_t *totalclustercount, int64_t *freeclustercount)
int STDCALL FileGetAttrEx(HANDLE handle)
uint32_t STDCALL GetLogicalDrives(void)
BOOL STDCALL SetFileTime(HANDLE handle, FILETIME *createtime, FILETIME *accesstime, FILETIME *writetime)
uint32_t STDCALL GetDriveAttr(uint8_t drive)
struct _NTFS_BOOT_SECTOR NTFS_BOOT_SECTOR
void STDCALL FileClose(HANDLE handle)
BOOL STDCALL SetCurrentDirectory(const char *lppathname)
HANDLE STDCALL FileCreate(const char *filename)
uint32_t STDCALL GetTrueName(const char *filename, char *truename, uint32_t len)
uint32_t STDCALL GetValidDrives(void)
BOOL STDCALL SetVolumeLabel(const char *lprootpathname, const char *lpvolumename)
struct _DISK_SEARCH_REC DISK_SEARCH_REC
struct _PARTITION_RECORD PARTITION_RECORD
uint32_t STDCALL GetFullPathName(const char *lpfilename, uint32_t nbufferlength, char *lpbuffer, char *lpfilepart)
struct _MOUNT_SEARCH_REC MOUNT_SEARCH_REC
struct _IMAGE_SEARCH_REC IMAGE_SEARCH_REC
uint32_t STDCALL cache_state_to_string(CACHE_STATE cachestate, char *string, uint32_t len)
#define MAX_PARTITION_COUNT
Definition filesystem.h:91
uint8_t STDCALL GetPathDrive(const char *path)
uint32_t STDCALL GetShortPathName(const char *lpszlongpath, char *lpszshortpath, uint32_t cchbuffer)
int32_t STDCALL FileWrite(HANDLE handle, void *buffer, int32_t count)
FILE_SYS_TYPE STDCALL string_to_file_sys_type(char *filesystype)
BOOL STDCALL CreateDirectory(const char *lppathname, SECURITY_ATTRIBUTES *lpsecurityattributes)
BOOL STDCALL file_sys_start_completed(void)
Returns True if the filesystem has been started.
struct _BOOT_SECTOR BOOT_SECTOR
uint32_t STDCALL GetDriveFreeSpace(uint8_t drive)
BOOL STDCALL SetFileAttributes(const char *lpfilename, uint32_t dwfileattributes)
int STDCALL FileAge(const char *filename)
struct _PARTITION_ENTRY PARTITION_ENTRY
_CACHE_PAGE_TYPE
Definition filesystem.h:590
@ ptDEVICE
Definition filesystem.h:592
@ ptNONE
Definition filesystem.h:591
uint32_t STDCALL GetShortName(const char *filename, char *shortname, uint32_t len)
BOOL STDCALL CreateSymbolicLink(const char *lpsymlinkfilename, const char *lptargetfilename, uint32_t dwflags)
uint32_t STDCALL GetValidDriveNames(char *names, uint32_t len)
uint8_t STDCALL GetCurrentDrive(void)
HANDLE STDCALL FindFirstFile(const char *lpfilename, WIN32_FIND_DATAA *lpfindfiledata)
UINT STDCALL GetDiskType(const char *lprootpathname)
GetDriveType - Already defined above.
size_t HANDLE
Definition globaltypes.h:51
#define STDCALL
Definition globaltypes.h:45
#define PACKED
Definition globaltypes.h:48
_Bool BOOL
Built in Boolean type (1 byte) (Redeclared here for flexibility).
Definition globaltypes.h:55
struct _OVERLAPPED OVERLAPPED
Definition globaltypes.h:70
uint32_t DWORD
Definition globaltypes.h:53
HANDLE TIMER_HANDLE
Definition globaltypes.h:119
struct _STORAGE_DEVICE STORAGE_DEVICE
Definition storage.h:90
Definition filesystem.h:764
uint8_t numberoffats
Usually 2.
Definition filesystem.h:768
uint8_t sectorspercluster
1,2,4,8,16,32,64,128
Definition filesystem.h:766
uint16_t totalsectors16
Total Sectors on the drive or 0 if TotalSectors32 used.
Definition filesystem.h:771
uint16_t bytespersector
512,1024,2048,4096 - Usually 512
Definition filesystem.h:765
uint32_t totalsectors32
Total Sectors on the drive or 0 if TotalSectors16 used.
Definition filesystem.h:778
uint16_t numberofheads
Number of Header for Int13 eg 1.44MB = 2.
Definition filesystem.h:775
uint32_t hiddensectors
Number of Hidden Sectors preceeding Partition.
Definition filesystem.h:776
uint16_t reservedsectors
FAT12/16 - Usually 1, FAT32 - Usually 32.
Definition filesystem.h:767
uint8_t mediaid
F8 for Fixed media, F0 usually for Removable media.
Definition filesystem.h:772
uint16_t sectorsperfat16
FAT32 always 0, Number of Sectors per FAT.
Definition filesystem.h:773
uint16_t sectorspertrack
Sectors Per Track for Int13.
Definition filesystem.h:774
uint16_t rootentrycount
FAT32 always 0, FAT16 usually 512.
Definition filesystem.h:769
Definition filesystem.h:891
BOOT_SECTOR_CODE bootcode
Executable Code.
Definition filesystem.h:901
uint8_t reserved1
Always 00h.
Definition filesystem.h:896
BOOT_SECTOR_JUMP bootjump
JMP - EBh,??h,90h or E9h,??h,??h.
Definition filesystem.h:892
uint16_t signature
Magic Number 0xAA55.
Definition filesystem.h:902
uint8_t drivenumber
BIOS Int13 Drive No 00h, 80h, FFh etc.
Definition filesystem.h:895
char volumename[11]
Volume Label or "NO NAME".
Definition filesystem.h:899
uint32_t volumeserial
Serial No (Date/Time when Formatted).
Definition filesystem.h:898
char systemname[8]
System Type FAT12, FAT16, FAT32 etc.
Definition filesystem.h:900
char oemname[8]
MSWIN4.0/MSWIN4.1/MSDOS5.0.
Definition filesystem.h:893
uint8_t bootsignature
Always 29h.
Definition filesystem.h:897
BIOS_PB bpb
See Above.
Definition filesystem.h:894
Definition filesystem.h:615
uint32_t discardtimeout
Definition filesystem.h:623
uint32_t cachesize
Definition filesystem.h:619
int64_t oldestdirty
Definition filesystem.h:643
int64_t writethrough
Definition filesystem.h:628
int64_t flushcount
Definition filesystem.h:637
int64_t newestdirty
Definition filesystem.h:644
int64_t writedirect
Definition filesystem.h:629
int64_t readdirect
Definition filesystem.h:626
int64_t writeback
Definition filesystem.h:627
int64_t unknowncount
Definition filesystem.h:639
int64_t readcached
Definition filesystem.h:625
int64_t oldestclean
Definition filesystem.h:641
int64_t misscount
Definition filesystem.h:632
uint32_t pagesize
Definition filesystem.h:617
int64_t newestclean
Definition filesystem.h:642
uint32_t flushtimeout
Definition filesystem.h:622
int64_t discardcount
Definition filesystem.h:638
int64_t failcount
Definition filesystem.h:634
CACHE_MODE cachemode
Definition filesystem.h:620
int64_t successcount
Definition filesystem.h:635
CACHE_STATE cachestate
Definition filesystem.h:621
uint32_t pagecount
Definition filesystem.h:618
int64_t hitcount
Definition filesystem.h:631
Definition filesystem.h:721
uint32_t context
Definition filesystem.h:731
MEDIA_TYPE mediatype
Definition filesystem.h:725
char name[MAX_PATH]
Definition filesystem.h:722
char path[MAX_PATH]
Definition filesystem.h:723
int64_t sectorcount
Definition filesystem.h:729
FLOPPY_TYPE floppytype
Definition filesystem.h:726
uint32_t attributes
Definition filesystem.h:727
uint16_t sectorsize
Definition filesystem.h:728
uint32_t catalogno
Definition filesystem.h:724
HANDLE findhandle
Definition filesystem.h:730
Definition filesystem.h:655
uint32_t context
Definition filesystem.h:660
MEDIA_TYPE mediatype
Definition filesystem.h:657
char name[MAX_PATH]
Definition filesystem.h:656
FLOPPY_TYPE floppytype
Definition filesystem.h:658
HANDLE findhandle
Definition filesystem.h:659
BOOL verbose
Definition filesystem.h:661
Definition filesystem.h:688
uint32_t context
Definition filesystem.h:697
char name[MAX_PATH]
Definition filesystem.h:689
DRIVE_TYPE drivetype
Definition filesystem.h:694
uint32_t attributes
Definition filesystem.h:690
char volumelabel[64]
Definition filesystem.h:691
uint32_t volumeserial
Definition filesystem.h:693
FILE_SYS_TYPE filesystype
Definition filesystem.h:695
HANDLE findhandle
Definition filesystem.h:696
BOOL verbose
Definition filesystem.h:698
char volumeguid[64]
Definition filesystem.h:692
Definition filesystem.h:936
Definition filesystem.h:783
uint32_t sectorsperfat32
Number of Sectors per FAT.
Definition filesystem.h:798
uint8_t numberoffats
Usually 2.
Definition filesystem.h:787
uint8_t sectorspercluster
1,2,4,8,16,32,64,128
Definition filesystem.h:785
uint16_t filesysinfosector
Usually 1.
Definition filesystem.h:808
uint16_t backupbootsector
Usually 6.
Definition filesystem.h:809
uint16_t totalsectors16
Total Sectors on the drive or 0 if TotalSectors32 used.
Definition filesystem.h:790
uint32_t rootcluster
Usually Cluster 2.
Definition filesystem.h:807
uint16_t bytespersector
512,1024,2048,4096 - Usually 512
Definition filesystem.h:784
uint32_t totalsectors32
Total Sectors on the drive or 0 if TotalSectors16 used.
Definition filesystem.h:797
uint16_t numberofheads
Number of Header for Int13 eg 1.44MB = 2.
Definition filesystem.h:794
uint8_t reserved[12]
Always 0.
Definition filesystem.h:810
uint32_t hiddensectors
Number of Hidden Sectors preceeding Partition.
Definition filesystem.h:795
uint16_t reservedsectors
FAT12/16 - Usually 1, FAT32 - Usually 32.
Definition filesystem.h:786
uint8_t mediaid
F8 for Fixed media, F0 usually for Removable media.
Definition filesystem.h:791
uint16_t sectorsperfat16
FAT32 always 0, Number of Sectors per FAT.
Definition filesystem.h:792
uint16_t extendedflags
Bits 0-3 – Zero-based number of active FAT. Only valid if mirroring.
Definition filesystem.h:799
uint16_t sectorspertrack
Sectors Per Track for Int13.
Definition filesystem.h:793
uint16_t filesysversion
FAT32 Version (Current 0:0).
Definition filesystem.h:806
uint16_t rootentrycount
FAT32 always 0, FAT16 usually 512.
Definition filesystem.h:788
Definition filesystem.h:909
EXT_BIOS_PB bpb
See Above.
Definition filesystem.h:912
uint8_t reserved1
Always 00h.
Definition filesystem.h:914
uint16_t signature
Magic Number 0xAA55.
Definition filesystem.h:920
uint8_t drivenumber
BIOS Int13 Drive No 00h, 80h, FFh etc.
Definition filesystem.h:913
char volumename[11]
Volume Label or "NO NAME".
Definition filesystem.h:917
uint32_t volumeserial
Serial No (Date/Time when Formatted).
Definition filesystem.h:916
EXT_BOOT_SECTOR_JUMP bootjump
JMP - EBh,??h,90h or E9h,??h,??h.
Definition filesystem.h:910
char systemname[8]
System Type FAT12, FAT16, FAT32 etc.
Definition filesystem.h:918
char oemname[8]
MSWIN4.1.
Definition filesystem.h:911
EXT_BOOT_SECTOR_CODE bootcode
Executable Code.
Definition filesystem.h:919
uint8_t bootsignature
Always 29h.
Definition filesystem.h:915
Definition filesystem.h:869
uint32_t disksignature
Definition filesystem.h:871
EXT_MASTER_BOOT_CODE bootcode
Definition filesystem.h:870
uint16_t reserved1
Definition filesystem.h:872
uint16_t signature
Magic Number 0xAA55.
Definition filesystem.h:874
PARTITION_TABLE partitiontable
Definition filesystem.h:873
Definition filesystem.h:649
HANDLE findhandle
Definition filesystem.h:650
WIN32_FIND_DATA finddata
Definition filesystem.h:651
Definition filesystem.h:702
uint32_t context
Definition filesystem.h:716
MEDIA_TYPE mediatype
Definition filesystem.h:706
char name[MAX_PATH]
Definition filesystem.h:703
int64_t sectorcount
Definition filesystem.h:710
int imageno
Definition filesystem.h:704
IMAGE_TYPE imagetype
Definition filesystem.h:705
uint32_t cylinders
Definition filesystem.h:711
FLOPPY_TYPE floppytype
Definition filesystem.h:707
uint8_t partitionid
Definition filesystem.h:714
uint32_t attributes
Definition filesystem.h:708
uint32_t sectors
Definition filesystem.h:713
uint16_t sectorsize
Definition filesystem.h:709
uint32_t heads
Definition filesystem.h:712
HANDLE findhandle
Definition filesystem.h:715
BOOL verbose
Definition filesystem.h:717
Definition filesystem.h:742
uint32_t context
Definition filesystem.h:745
char name[MAX_PATH]
Definition filesystem.h:743
HANDLE findhandle
Definition filesystem.h:744
Definition filesystem.h:860
MASTER_BOOT_CODE bootcode
Definition filesystem.h:861
uint16_t signature
Magic Number 0xAA55.
Definition filesystem.h:863
PARTITION_TABLE partitiontable
Definition filesystem.h:862
Definition filesystem.h:735
uint32_t context
Definition filesystem.h:738
char name[MAX_PATH]
Definition filesystem.h:736
HANDLE findhandle
Definition filesystem.h:737
Definition filesystem.h:815
uint16_t reserved2
Must always be 0 on NTFS.
Definition filesystem.h:820
uint32_t reserved5
Not used by NTFS - Usually 80008000.
Definition filesystem.h:827
uint8_t sectorspercluster
1,2,4,8,16,32,64,128 - Usually 8
Definition filesystem.h:817
uint32_t reserved4
Must always be 0 on NTFS.
Definition filesystem.h:826
uint16_t bytespersector
512,1024,2048,4096 - Usually 512
Definition filesystem.h:816
int32_t clustersperfile
Clusters Per File Record (Can be negative) (F6 = 1024 - See Notes).
Definition filesystem.h:831
uint16_t numberofheads
Number of Header for Int13 eg 1.44MB = 2.
Definition filesystem.h:824
int64_t mftcluster
Start Cluster of $MFT.
Definition filesystem.h:829
int64_t totalsectors
Total Sectors on the drive.
Definition filesystem.h:828
int32_t clustersperindex
Clusters Per Index Record (Can be negative) (F6 = 1024 - See Notes).
Definition filesystem.h:832
uint32_t hiddensectors
Number of Hidden Sectors preceeding Partition.
Definition filesystem.h:825
int64_t mftmirror
Start Cluster of $MFTMirr.
Definition filesystem.h:830
uint32_t checksum
Checksum.
Definition filesystem.h:834
uint16_t reservedsectors
Must always be 0 on NTFS.
Definition filesystem.h:818
uint16_t reserved3
Must always be 0 on NTFS.
Definition filesystem.h:822
uint8_t mediaid
F8 for Fixed media, F0 usually for Removable media.
Definition filesystem.h:821
uint16_t sectorspertrack
Sectors Per Track for Int13.
Definition filesystem.h:823
uint8_t reserved1[3]
Must always be 0 on NTFS.
Definition filesystem.h:819
int64_t volumeserial
Volume Serial Number.
Definition filesystem.h:833
Definition filesystem.h:927
NTFS_BIOS_PB bpb
See Above (73 Bytes BPB and ExtBPB).
Definition filesystem.h:930
NTFS_BOOT_SECTOR_JUMP bootjump
JMP - EBh,??h,90h.
Definition filesystem.h:928
uint16_t signature
Magic Number 0xAA55.
Definition filesystem.h:932
char oemname[8]
Always NTFS.
Definition filesystem.h:929
NTFS_BOOT_SECTOR_CODE bootcode
Executable Code.
Definition filesystem.h:931
Definition filesystem.h:839
uint8_t endhead
Either Bits 0-3 only or Bits 0-7 depending on BIOS.
Definition filesystem.h:845
uint32_t sectoroffset
Offset in sectors from current position to Start of Partition.
Definition filesystem.h:848
uint8_t bootindicator
80 for active partition
Definition filesystem.h:840
uint8_t starthead
Either Bits 0-3 only or Bits 0-7 depending on BIOS.
Definition filesystem.h:841
uint8_t startcylinder
Bits 0-7 Only, Bits 8-9 in Sector.
Definition filesystem.h:843
uint32_t sectorcount
Size in Sectors of the Partition.
Definition filesystem.h:849
uint8_t endsector
Bits 0-5 = Sector, Bits 6-7 = Bits 8-9 of Cylinder.
Definition filesystem.h:846
uint8_t endcylinder
Bits 0-7 Only, Bits 8-9 in Sector.
Definition filesystem.h:847
uint8_t startsector
Bits 0-5 = Sector, Bits 6-7 = Bits 8-9 of Cylinder.
Definition filesystem.h:842
uint8_t typeindicator
See Table in Interrupt List and Below.
Definition filesystem.h:844
Definition filesystem.h:878
uint16_t signature
Magic Number 0xAA55.
Definition filesystem.h:881
uint8_t dummy[446]
Definition filesystem.h:879
PARTITION_TABLE partitiontable
Only first 2 ever used.
Definition filesystem.h:880
Definition filesystem.h:665
uint32_t context
Definition filesystem.h:669
char name[MAX_PATH]
Definition filesystem.h:666
uint32_t index
Definition filesystem.h:667
HANDLE findhandle
Definition filesystem.h:668
BOOL verbose
Definition filesystem.h:670
Definition filesystem.h:853
PARTITION_ENTRY partitionentry[MAX_PARTITION_COUNT]
Definition filesystem.h:854
Definition filesystem.h:532
STORAGE_DEVICE * device
Definition filesystem.h:534
TIMER_HANDLE timer
Definition filesystem.h:533
Definition filesystem.h:749
HANDLE findhandle
Definition filesystem.h:750
void * context
Definition filesystem.h:751
WIN32_FIND_STREAM_DATA finddata
Definition filesystem.h:752
Definition filesystem.h:674
uint32_t context
Definition filesystem.h:683
char name[MAX_PATH]
Definition filesystem.h:675
DRIVE_TYPE drivetype
Definition filesystem.h:680
uint32_t attributes
Definition filesystem.h:676
char volumelabel[64]
Definition filesystem.h:677
uint32_t volumeserial
Definition filesystem.h:679
FILE_SYS_TYPE filesystype
Definition filesystem.h:681
HANDLE findhandle
Definition filesystem.h:682
BOOL verbose
Definition filesystem.h:684
char volumeguid[64]
Definition filesystem.h:678
struct _WIN32_FIND_DATAA WIN32_FIND_DATAA
struct _FILETIME FILETIME
#define MAX_PATH
Maximum length for a file path.
Definition sysutils.h:37
struct _BY_HANDLE_FILE_INFORMATION BY_HANDLE_FILE_INFORMATION
unsigned int UINT
Definition ultibo.h:188
struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES
enum _FILE_SYS_TYPE FILE_SYS_TYPE
WIN32_FIND_DATAA WIN32_FIND_DATA
Definition ultibo.h:340
enum _DRIVE_TYPE DRIVE_TYPE
struct _WIN32_FIND_STREAM_DATA WIN32_FIND_STREAM_DATA
union _LARGE_INTEGER LARGE_INTEGER
struct _DRIVE_DATA DRIVE_DATA
union _ULARGE_INTEGER ULARGE_INTEGER