Fix zfile stale/double freed file handle.
Updated filesys.cpp from latest WinUAE sources
This commit is contained in:
parent
0365e4330b
commit
b3fe55363e
13 changed files with 6360 additions and 4723 deletions
1
Makefile
1
Makefile
|
@ -301,6 +301,7 @@ OBJS = \
|
|||
src/cia.o \
|
||||
src/crc32.o \
|
||||
src/custom.o \
|
||||
src/def_icons.o \
|
||||
src/devices.o \
|
||||
src/disk.o \
|
||||
src/diskutil.o \
|
||||
|
|
|
@ -211,6 +211,7 @@
|
|||
<ClCompile Include="..\..\src\cpustbl.cpp" />
|
||||
<ClCompile Include="..\..\src\crc32.cpp" />
|
||||
<ClCompile Include="..\..\src\custom.cpp" />
|
||||
<ClCompile Include="..\..\src\def_icons.cpp" />
|
||||
<ClCompile Include="..\..\src\devices.cpp" />
|
||||
<ClCompile Include="..\..\src\disk.cpp" />
|
||||
<ClCompile Include="..\..\src\diskutil.cpp" />
|
||||
|
|
|
@ -592,6 +592,9 @@
|
|||
<ClCompile Include="..\..\src\scp.cpp">
|
||||
<Filter>Source files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\def_icons.cpp">
|
||||
<Filter>Source files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\src\threaddep\thread.h">
|
||||
|
|
|
@ -390,6 +390,24 @@ static int device_func_init (int flags)
|
|||
return 1;
|
||||
}
|
||||
|
||||
bool blkdev_get_info(struct uae_prefs* p, int unitnum, struct device_info* di)
|
||||
{
|
||||
bool open = true, opened = false, ok = false;
|
||||
struct blkdevstate* st = &state[unitnum];
|
||||
if (!st->isopen) {
|
||||
blkdev_fix_prefs(p);
|
||||
install_driver(0);
|
||||
opened = true;
|
||||
open = sys_command_open_internal(unitnum, p->cdslots[unitnum].name[0] ? p->cdslots[unitnum].name : NULL, CD_STANDARD_UNIT_DEFAULT) != 0;
|
||||
}
|
||||
if (open) {
|
||||
ok = sys_command_info(unitnum, di, true) != 0;
|
||||
}
|
||||
if (open && opened)
|
||||
sys_command_close_internal(unitnum);
|
||||
return ok;
|
||||
}
|
||||
|
||||
void blkdev_entergui (void)
|
||||
{
|
||||
for (int i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) {
|
||||
|
|
|
@ -3689,17 +3689,11 @@ static void get_filesys_controller(const TCHAR* hdc, int* type, int* typenum, in
|
|||
if (hdunit < 0 || hdunit >= 8 + 2)
|
||||
hdunit = 0;
|
||||
}
|
||||
else if (_tcslen(hdc) >= 6 && !_tcsncmp(hdc, _T("scsram"), 6))
|
||||
{
|
||||
hdcv = HD_CONTROLLER_TYPE_PCMCIA;
|
||||
hdunit = 0;
|
||||
idx = 0;
|
||||
}
|
||||
else if (_tcslen(hdc) >= 5 && !_tcsncmp(hdc, _T("scide"), 5))
|
||||
{
|
||||
hdcv = HD_CONTROLLER_TYPE_PCMCIA;
|
||||
hdunit = 0;
|
||||
idx = 1;
|
||||
else if (_tcslen(hdc) >= 7 && !_tcsncmp(hdc, _T("custom"), 6)) {
|
||||
hdcv = HD_CONTROLLER_TYPE_CUSTOM_FIRST;
|
||||
hdunit = hdc[6] - '0';
|
||||
if (hdunit < 0 || hdunit >= 8)
|
||||
hdunit = 0;
|
||||
}
|
||||
if (hdcv == HD_CONTROLLER_TYPE_UAE)
|
||||
{
|
||||
|
|
79
src/def_icons.cpp
Normal file
79
src/def_icons.cpp
Normal file
|
@ -0,0 +1,79 @@
|
|||
unsigned char def_drawer[] = {
|
||||
0xe3, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x19,
|
||||
0x00, 0x05, 0x00, 0x03, 0x00, 0x01, 0x10, 0x12, 0x15, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00,
|
||||
0x00, 0x00, 0x10, 0x25, 0xa6, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32,
|
||||
0x00, 0x32, 0x01, 0x90, 0x00, 0x64, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x02, 0x7f,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x28, 0xff, 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x18, 0x00, 0x01,
|
||||
0x00, 0x06, 0xfc, 0x4c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xf0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xf0, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x39, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xfe, 0x70, 0x39, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x70, 0x39, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xfe, 0x70, 0x39, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x70, 0x39, 0xff, 0xff, 0x9f, 0xe7, 0xff,
|
||||
0xfe, 0x70, 0x39, 0xff, 0xff, 0x9f, 0xe7, 0xff, 0xfe, 0x70, 0x39, 0xff, 0xff, 0x80, 0x07, 0xff,
|
||||
0xfe, 0x70, 0x39, 0xff, 0xff, 0x80, 0x07, 0xff, 0xfe, 0x70, 0x39, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xfe, 0x70, 0x39, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x70, 0x39, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xfe, 0x70, 0x39, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x70, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x70, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xf0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
unsigned int def_drawer_len = 352;
|
||||
|
||||
unsigned char def_tool[] = {
|
||||
0xe3, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x17,
|
||||
0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x10, 0x12, 0xdc, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x33, 0x00, 0x16, 0x00, 0x02, 0x00, 0x06, 0xe8, 0xf8, 0x03, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x80, 0x00, 0x3c, 0x0f, 0xf0, 0x00, 0x1f, 0xff, 0x80, 0x00, 0x3d, 0xf7, 0xcf, 0xff, 0xe3, 0xff,
|
||||
0x80, 0x00, 0x3d, 0xf8, 0x3f, 0xff, 0xfc, 0x7f, 0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xff, 0x9f,
|
||||
0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xef, 0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xf7,
|
||||
0x80, 0x00, 0x3d, 0xf8, 0x3f, 0xff, 0xe0, 0x07, 0x80, 0x00, 0x3d, 0xf7, 0xdf, 0xff, 0xdf, 0xff,
|
||||
0x80, 0x00, 0x3c, 0x0f, 0xe7, 0xff, 0x3f, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xf9, 0xfc, 0xff, 0xff,
|
||||
0x80, 0x00, 0x3f, 0xff, 0xfd, 0xfd, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xfd, 0xfd, 0xff, 0xff,
|
||||
0x80, 0x00, 0x3f, 0xff, 0xfd, 0xfd, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xfc, 0x01, 0xff, 0xff,
|
||||
0x80, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00
|
||||
};
|
||||
unsigned int def_tool_len = 450;
|
||||
|
||||
unsigned char def_project[] = {
|
||||
0xe3, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x00, 0x15,
|
||||
0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x10, 0x14, 0x47, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x31, 0x00, 0x14, 0x00, 0x01, 0x00, 0x03, 0x61, 0x34, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x80, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xfe, 0xbf,
|
||||
0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xfe, 0xdf, 0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xfe, 0xef,
|
||||
0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xfe, 0x07, 0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xf7,
|
||||
0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xf7,
|
||||
0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xf7,
|
||||
0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xf7,
|
||||
0x80, 0x00, 0x3d, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x80, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x07,
|
||||
0x80, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0x80, 0x00
|
||||
};
|
||||
unsigned int def_project_len = 258;
|
8547
src/filesys.cpp
8547
src/filesys.cpp
File diff suppressed because it is too large
Load diff
|
@ -94,7 +94,7 @@ extern uaecptr ROM_hardfile_resname, ROM_hardfile_resid;
|
|||
extern uaecptr ROM_hardfile_init;
|
||||
extern uaecptr filesys_initcode, filesys_initcode_ptr, filesys_initcode_real;
|
||||
|
||||
//extern int is_hardfile (int unit_no);
|
||||
extern int is_hardfile (int unit_no);
|
||||
extern int nr_units (void);
|
||||
extern int nr_directory_units (struct uae_prefs*);
|
||||
extern uaecptr need_uae_boot_rom(struct uae_prefs*);
|
||||
|
@ -116,7 +116,7 @@ extern TCHAR *validatedevicename (TCHAR *s, const TCHAR *def);
|
|||
extern TCHAR *validatevolumename (TCHAR *s, const TCHAR *def);
|
||||
|
||||
int filesys_insert (int nr, const TCHAR *volume, const TCHAR *rootdir, bool readonly, int flags);
|
||||
//int filesys_eject (int nr);
|
||||
int filesys_eject(int nr);
|
||||
int filesys_media_change (const TCHAR *rootdir, int inserted, struct uaedev_config_data *uci);
|
||||
|
||||
extern TCHAR *filesys_createvolname (const TCHAR *volname, const TCHAR *rootdir, struct zvolume *zv, const TCHAR *def);
|
||||
|
|
|
@ -137,6 +137,7 @@ struct device_functions
|
|||
static int device_func_init(int flags);
|
||||
extern void device_func_free(void);
|
||||
extern void device_func_reset(void);
|
||||
extern int sys_command_open(int unitnum);
|
||||
extern void sys_command_close (int unitnum);
|
||||
extern struct device_info *sys_command_info (int unitnum, struct device_info *di, int);
|
||||
extern int sys_command_cd_pause (int unitnum, int paused);
|
||||
|
@ -147,6 +148,7 @@ extern int sys_command_cd_qcode (int unitnum, uae_u8*, int lsn, bool all);
|
|||
extern int sys_command_cd_toc (int unitnum, struct cd_toc_head*);
|
||||
extern int sys_command_cd_rawread (int unitnum, uae_u8 *data, int sector, int size, int sectorsize);
|
||||
extern int sys_command_ismedia (int unitnum, int quick);
|
||||
extern bool blkdev_get_info(struct uae_prefs* p, int unitnum, struct device_info* di);
|
||||
|
||||
extern void blkdev_vsync(void);
|
||||
extern void restore_blkdev_start(void);
|
||||
|
|
|
@ -110,7 +110,8 @@ struct hd_hardfiledata {
|
|||
#define HD_CONTROLLER_TYPE_SCSI_EXPANSION_FIRST (HD_CONTROLLER_TYPE_SCSI_FIRST + 1)
|
||||
#define HD_CONTROLLER_TYPE_SCSI_LAST (HD_CONTROLLER_TYPE_SCSI_EXPANSION_FIRST + HD_CONTROLLER_EXPANSION_MAX - 1)
|
||||
|
||||
#define HD_CONTROLLER_TYPE_PCMCIA (HD_CONTROLLER_TYPE_SCSI_LAST + 1)
|
||||
#define HD_CONTROLLER_TYPE_CUSTOM_FIRST (HD_CONTROLLER_TYPE_SCSI_LAST + 1)
|
||||
#define HD_CONTROLLER_TYPE_CUSTOM_LAST (HD_CONTROLLER_TYPE_CUSTOM_FIRST + HD_CONTROLLER_EXPANSION_MAX - 1)
|
||||
|
||||
#define FILESYS_VIRTUAL 0
|
||||
#define FILESYS_HARDFILE 1
|
||||
|
@ -140,7 +141,6 @@ extern int get_native_path(TrapContext *ctx, uae_u32 lock, TCHAR *out);
|
|||
extern void hardfile_do_disk_change (struct uaedev_config_data *uci, bool insert);
|
||||
extern void hardfile_send_disk_change (struct hardfiledata *hfd, bool insert);
|
||||
extern int hardfile_media_change (struct hardfiledata *hfd, struct uaedev_config_info *ci, bool inserted, bool timer);
|
||||
extern int hardfile_added (struct uaedev_config_info *ci);
|
||||
|
||||
void hdf_hd_close(struct hd_hardfiledata *hfd);
|
||||
int hdf_hd_open(struct hd_hardfiledata *hfd);
|
||||
|
|
|
@ -8,63 +8,64 @@ typedef uae_s64 (*ZFILEWRITE)(const void*, uae_u64, uae_u64, struct zfile*);
|
|||
typedef uae_s64 (*ZFILESEEK)(struct zfile*, uae_s64, int);
|
||||
|
||||
struct zfile {
|
||||
TCHAR *name;
|
||||
TCHAR *zipname;
|
||||
TCHAR *mode;
|
||||
TCHAR *name;
|
||||
TCHAR *zipname;
|
||||
TCHAR *mode;
|
||||
TCHAR *originalname;
|
||||
FILE *f; // real file handle if physical file
|
||||
uae_u8 *data; // unpacked data
|
||||
int dataseek; // use seek position even if real file
|
||||
FILE *f; // real file handle if physical file
|
||||
uae_u8 *data; // unpacked data
|
||||
int dataseek; // use seek position even if real file
|
||||
struct zfile *archiveparent; // set if parent is archive and this has not yet been unpacked (datasize < size)
|
||||
int archiveid;
|
||||
uae_s64 size; // real size
|
||||
uae_s64 size; // real size
|
||||
uae_s64 datasize; // available size (not yet unpacked completely?)
|
||||
uae_s64 allocsize; // memory allocated before realloc() needed again
|
||||
uae_s64 seek; // seek position
|
||||
int deleteafterclose;
|
||||
int textmode;
|
||||
struct zfile *next;
|
||||
int zfdmask;
|
||||
struct zfile *parent;
|
||||
uae_u64 offset; // byte offset from parent file
|
||||
int opencnt;
|
||||
ZFILEREAD zfileread;
|
||||
ZFILEWRITE zfilewrite;
|
||||
ZFILESEEK zfileseek;
|
||||
void *userdata;
|
||||
int useparent;
|
||||
uae_s64 seek; // seek position
|
||||
int deleteafterclose;
|
||||
int textmode;
|
||||
struct zfile *next;
|
||||
int zfdmask;
|
||||
struct zfile *parent;
|
||||
uae_u64 offset; // byte offset from parent file
|
||||
int opencnt;
|
||||
ZFILEREAD zfileread;
|
||||
ZFILEWRITE zfilewrite;
|
||||
ZFILESEEK zfileseek;
|
||||
void *userdata;
|
||||
int useparent;
|
||||
};
|
||||
|
||||
#define ZNODE_FILE 0
|
||||
#define ZNODE_DIR 1
|
||||
#define ZNODE_VDIR -1
|
||||
struct znode {
|
||||
int type;
|
||||
struct znode *sibling;
|
||||
struct znode *child;
|
||||
struct zvolume *vchild;
|
||||
struct znode *parent;
|
||||
struct zvolume *volume;
|
||||
struct znode *next;
|
||||
struct znode *prev;
|
||||
struct znode *vfile; // points to real file when this node is virtual directory
|
||||
TCHAR *name;
|
||||
TCHAR *fullname;
|
||||
uae_s64 size;
|
||||
struct zfile *f;
|
||||
TCHAR *comment;
|
||||
int flags;
|
||||
struct mytimeval mtime;
|
||||
/* decompressor specific */
|
||||
unsigned int offset;
|
||||
unsigned int offset2;
|
||||
unsigned int method;
|
||||
unsigned int packedsize;
|
||||
int type;
|
||||
struct znode *sibling;
|
||||
struct znode *child;
|
||||
struct zvolume *vchild;
|
||||
struct znode *parent;
|
||||
struct zvolume *volume;
|
||||
struct znode *next;
|
||||
struct znode *prev;
|
||||
struct znode *vfile; // points to real file when this node is virtual directory
|
||||
TCHAR *name;
|
||||
TCHAR *fullname;
|
||||
uae_s64 size;
|
||||
struct zfile *f;
|
||||
TCHAR *comment;
|
||||
int flags;
|
||||
struct mytimeval mtime;
|
||||
/* decompressor specific */
|
||||
unsigned int offset;
|
||||
unsigned int offset2;
|
||||
unsigned int method;
|
||||
unsigned int packedsize;
|
||||
};
|
||||
|
||||
struct zvolume
|
||||
{
|
||||
struct zfile *archive;
|
||||
bool autofree;
|
||||
void *handle;
|
||||
struct znode root;
|
||||
struct zvolume *next;
|
||||
|
|
|
@ -39,6 +39,54 @@ int dos_errno(void)
|
|||
}
|
||||
}
|
||||
|
||||
/* return supported combination */
|
||||
int fsdb_mode_supported(const a_inode* aino)
|
||||
{
|
||||
int mask = aino->amigaos_mode;
|
||||
return mask;
|
||||
}
|
||||
|
||||
bool my_createshortcut(const char* source, const char* target, const char* description)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool my_resolvesoftlink(TCHAR* linkfile, int size, bool linkonly)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void my_canonicalize_path(const TCHAR* path, TCHAR* out, int size)
|
||||
{
|
||||
_tcsncpy(out, path, size);
|
||||
out[size - 1] = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
int my_issamevolume(const TCHAR* path1, const TCHAR* path2, TCHAR* path)
|
||||
{
|
||||
TCHAR p1[MAX_DPATH];
|
||||
TCHAR p2[MAX_DPATH];
|
||||
unsigned int len, cnt;
|
||||
|
||||
my_canonicalize_path(path1, p1, sizeof p1 / sizeof(TCHAR));
|
||||
my_canonicalize_path(path2, p2, sizeof p2 / sizeof(TCHAR));
|
||||
len = _tcslen(p1);
|
||||
if (len > _tcslen(p2))
|
||||
len = _tcslen(p2);
|
||||
if (_tcsnicmp(p1, p2, len))
|
||||
return 0;
|
||||
_tcscpy(path, p2 + len);
|
||||
cnt = 0;
|
||||
for (unsigned int i = 0; i < _tcslen(path); i++) {
|
||||
if (path[i] == '\\' || path[i] == '/') {
|
||||
path[i] = '/';
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
write_log(_T("'%s' (%s) matched with '%s' (%s), extra = '%s'\n"), path1, p1, path2, p2, path);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
bool my_stat(const TCHAR *name, struct mystat *statbuf)
|
||||
{
|
||||
|
|
2277
src/zfile.cpp
2277
src/zfile.cpp
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue