Changeset View
Changeset View
Standalone View
Standalone View
lib/libfstyp/ntfs.c
- This file was moved from usr.sbin/fstyp/ntfs.c.
Show All 35 Lines | |||||
#include <iconv.h> | #include <iconv.h> | ||||
#endif | #endif | ||||
#include <stdint.h> | #include <stdint.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include "fstyp.h" | #include "fstyp.h" | ||||
#include "fstyp_p.h" | |||||
#define NTFS_A_VOLUMENAME 0x60 | #define NTFS_A_VOLUMENAME 0x60 | ||||
#define NTFS_FILEMAGIC ((uint32_t)(0x454C4946)) | #define NTFS_FILEMAGIC ((uint32_t)(0x454C4946)) | ||||
#define NTFS_VOLUMEINO 3 | #define NTFS_VOLUMEINO 3 | ||||
struct ntfs_attr { | struct ntfs_attr { | ||||
uint32_t a_type; | uint32_t a_type; | ||||
uint32_t reclen; | uint32_t reclen; | ||||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | |||||
#endif /* WITH_ICONV */ | #endif /* WITH_ICONV */ | ||||
filerecp = NULL; | filerecp = NULL; | ||||
bf = (struct ntfs_bootfile *)read_buf(fp, 0, 512); | bf = (struct ntfs_bootfile *)read_buf(fp, 0, 512); | ||||
if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0) | if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0) | ||||
goto fail; | goto fail; | ||||
#ifdef WITH_ICONV | #ifdef WITH_ICONV | ||||
if (!show_label) | if (!encodings_enabled) | ||||
goto ok; | goto ok; | ||||
mftrecsz = bf->bf_mftrecsz; | mftrecsz = bf->bf_mftrecsz; | ||||
recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz); | recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz); | ||||
voloff = bf->bf_mftcn * bf->bf_spc * bf->bf_bps + | voloff = bf->bf_mftcn * bf->bf_spc * bf->bf_bps + | ||||
recsize * NTFS_VOLUMEINO; | recsize * NTFS_VOLUMEINO; | ||||
Show All 32 Lines |