-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdiskstructure.h
85 lines (80 loc) · 3.5 KB
/
diskstructure.h
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//----------------------------------------------------------------------------
// EnsoniqFS plugin for TotalCommander
//
// DISK structure header file
//----------------------------------------------------------------------------
//
// (c) 2006 Thoralt Franz
//
// This source code was written using Dev-Cpp 4.9.9.2
// If you want to compile it, get Dev-Cpp. Normally the code should compile
// with other IDEs/compilers too (with small modifications), but I did not
// test it.
//
//----------------------------------------------------------------------------
// License
//----------------------------------------------------------------------------
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
// MA 02110-1301, USA.
//
// Alternatively, download a copy of the license here:
// http://www.gnu.org/licenses/gpl.txt
//----------------------------------------------------------------------------
#ifndef _DISKSTRUCTURE_H_
#define _DISKSTRUCTURE_H_
#define TYPE_DISK 0
#define TYPE_CDROM 1
#define TYPE_FILE 2
#define TYPE_FLOPPY 3
#define IMAGE_FILE_UNKNOWN 0
#define IMAGE_FILE_ISO 1
#define IMAGE_FILE_MODE1 2
#define IMAGE_FILE_GKH 3
#define IMAGE_FILE_GIEBLER 4
//----------------------------------------------------------------------------
// disk descriptor
//----------------------------------------------------------------------------
typedef struct _DISK
{
char cMsDosName[260]; // device name starting with "\\.\" or image file
char cLongName[260]; // long device name or image file
char cDiskLabel[8]; // Ensoniq disk label
char cLegalDiskLabel[8];// DOS disk label made out of cDiskLabel
DWORD dwBlocks; // number of logical blocks on this disk
DWORD dwBlocksFree; // number of free blocks on this disk
DWORD dwPhysicalBlocks; // number of physical blocks on this disk
HANDLE hHandle; // handle for direct access
int iType; // TYPE_DISK | TYPE_CDROM | TYPE_FILE | TYPE_FLOPPY
int iImageType; // subtype if disk is an image file
DWORD dwDataOffset; // for image files: offset of data in image file
unsigned char *ucGieblerMap; // for Giebler images only
DWORD dwGieblerMapOffset;
unsigned char *ucCache; // pointer to cache memory
DWORD *dwCacheTable; // which blocks are in cache?
DWORD *dwCacheAge; // the age of each cache entry
unsigned char *ucCacheFlags; // flags (dirty flag)
DWORD dwCacheHits;
DWORD dwCacheMisses;
DWORD dwFATCacheBlock; // number of block in FAT cache
DWORD dwFATMiss, dwFATHit;
DWORD dwLastFreeFATEntry; // marks the last free FAT entry to speedup
// the search for the next free one
unsigned char ucFATCache[512]; // FAT cache (one block)
DWORD dwReadCounter; // counter of read accesses (for cache age)
DISK_GEOMETRY_EX DiskGeometry;
int iIsEnsoniq; // flag for filesystem type
struct _DISK *pNext; // pointer to next disk descriptor
} DISK;
#endif