ReactOS 0.4.16-dev-122-g325d74c
|
#include "../version.h"
#include <linux/hdreg.h>
#include <linux/fs.h>
#include <linux/fd.h>
#include <endian.h>
#include <mntent.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>
#include <asm/byteorder.h>
#include <linux/unistd.h>
Go to the source code of this file.
Classes | |
struct | msdos_volume_info |
struct | msdos_boot_sector |
struct | fat32_fsinfo |
struct | msdos_dir_entry |
Typedefs | |
typedef long long | ll_t |
Functions | |
static | _syscall5 (int, _llseek, uint, fd, ulong, hi, ulong, lo, loff_t *, res, uint, wh) |
static loff_t | llseek (int fd, loff_t offset, int whence) |
int | cdiv (int a, int b) |
struct msdos_volume_info | __attribute__ ((packed)) |
static void | fatal_error (const char *fmt_string) __attribute__((noreturn)) |
static void | mark_FAT_cluster (int cluster, unsigned int value) |
static void | mark_FAT_sector (int sector, unsigned int value) |
static long | do_check (char *buffer, int try, unsigned int current_block) |
static void | alarm_intr (int alnum) |
static void | check_blocks (void) |
static void | get_list_blocks (char *filename) |
static int | valid_offset (int fd, loff_t offset) |
static int | count_blocks (char *filename) |
static void | check_mount (char *device_name) |
static void | establish_params (int device_num, int size) |
static void | setup_tables (void) |
static void | write_tables (void) |
void | usage (void) |
static void | check_atari (void) |
int | main (int argc, char **argv) |
#define ATTR_UNUSED (ATTR_VOLUME | ATTR_ARCH | ATTR_SYS | ATTR_HIDDEN) |
#define die | ( | str | ) | fatal_error( "%s: " str "\n" ) |
#define FAT_EOF (atari_format ? 0x0fffffff : 0x0ffffff8) |
#define mark_sector_bad | ( | sector | ) | mark_FAT_sector( sector, FAT_BAD ) |
#define MSDOS_FAT12_SIGN "FAT12 " /* FAT12 filesystem signature */ |
#define MSDOS_FAT16_SIGN "FAT16 " /* FAT16 filesystem signature */ |
#define MSDOS_FAT32_SIGN "FAT32 " /* FAT32 filesystem signature */ |
#define SECTORS_PER_BLOCK ( BLOCK_SIZE / HARD_SECTOR_SIZE ) |
Definition at line 43 of file framebased-gcchack.c.
|
static |
Definition at line 668 of file mkdosfs.c.
Referenced by alarm_intr(), and check_blocks().
Definition at line 1700 of file mkdosfs.c.
Referenced by main().
Definition at line 684 of file mkdosfs.c.
Referenced by main().
Definition at line 782 of file mkdosfs.c.
Referenced by main().
Definition at line 644 of file mkdosfs.c.
Referenced by check_blocks().
Definition at line 924 of file mkdosfs.c.
Referenced by main().
Definition at line 736 of file mkdosfs.c.
Referenced by main().
Definition at line 321 of file mkdosfs.c.
Referenced by do_check(), main(), and valid_offset().
Definition at line 1728 of file mkdosfs.c.
Definition at line 587 of file mkdosfs.c.
Referenced by mark_FAT_sector(), and setup_tables().
Definition at line 628 of file mkdosfs.c.
Definition at line 1108 of file mkdosfs.c.
Referenced by main().
Definition at line 1686 of file mkdosfs.c.
Referenced by main().
Definition at line 1629 of file mkdosfs.c.
Referenced by create_patch(), and main().
|
static |
Definition at line 521 of file mkdosfs.c.
Referenced by check_atari(), establish_params(), main(), and setup_tables().
|
static |
Definition at line 530 of file mkdosfs.c.
Referenced by check_backup_boot(), main(), setup_tables(), and write_tables().
|
static |
Definition at line 532 of file mkdosfs.c.
Referenced by check_blocks(), and get_list_blocks().
|
static |
Definition at line 548 of file mkdosfs.c.
Referenced by setup_tables(), and write_tables().
|
static |
Definition at line 527 of file mkdosfs.c.
Referenced by __ext4_journal_start(), add_block_index(), alarm_intr(), check_blocks(), chop_fourth_byte(), decode_modified_limit4(), establish_params(), ext2_read_inode(), ext2_write_inode(), Ext2Format(), ext3_add_entry(), ext4_ext_convert_to_initialized(), main(), setup_tables(), test__hwrite(), test__lwrite(), and test_wintrust_digest().
|
static |
Definition at line 539 of file mkdosfs.c.
Referenced by af_latin_metrics_init_blues(), bad_alloc_test1(), dct64(), establish_params(), GetComputerObjectNameW(), GetScanCode(), mark_FAT_sector(), mpg123_tpf(), path_remove_file(), path_strip_path(), ptransfer(), CFolderItem::put_Name(), send_thread(), SendSubvolGUIW(), setup_tables(), StringTest::short_string(), stub_ScrubDlgProc(), stub_SendDlgProc(), ui_resize_window(), write_tables(), ZSTD_compress_insertDictionary(), ZSTD_loadCEntropy(), ZSTD_loadZstdDictionary(), and ZSTD_reset_compressedBlockState().
uint8_t cluster_size |
Definition at line 4 of file mkdosfs.c.
Referenced by get_cluster_data(), GetDiskInfoA(), read_boot(), ScriptXtoCP(), and test_GetDiskInfoA().
|
static |
Definition at line 525 of file mkdosfs.c.
Referenced by alloc_cookie(), main(), and setup_tables().
Definition at line 4 of file mkdosfs.c.
Referenced by CloseTrace(), create_msft_typelib(), disk_set_information(), LogErrorConsole(), LogInfoConsole(), LogOpen(), LogWarningConsole(), OpenTrace(), send_utimes_command(), send_utimes_command_dir(), setup_tables(), test_CallNtPowerInformation(), Test_ctime(), test_ctime(), vers_write(), write_one_file(), and WriteDefaultFirewallPrefs().
Definition at line 538 of file mkdosfs.c.
Referenced by alarm_intr(), and check_blocks().
__u16 date |
Definition at line 8 of file mkdosfs.c.
Referenced by _strdate(), _strdate_s(), _wstrdate(), _wstrdate_s(), add_cert_to_view(), add_date_string_to_control(), create_date(), create_date_constr(), create_utc_string(), date_dos2unix(), Date_getDate(), Date_getDay(), Date_getFullYear(), Date_getHours(), Date_getMilliseconds(), Date_getMinutes(), Date_getMonth(), Date_getSeconds(), Date_getTime(), Date_getTimezoneOffset(), Date_getUTCDate(), Date_getUTCDay(), Date_getUTCFullYear(), Date_getUTCHours(), Date_getUTCMilliseconds(), Date_getUTCMinutes(), Date_getUTCMonth(), Date_getUTCSeconds(), Date_getYear(), Date_setDate(), Date_setFullYear(), Date_setHours(), Date_setMilliseconds(), Date_setMinutes(), Date_setMonth(), Date_setSeconds(), Date_setTime(), Date_setUTCDate(), Date_setUTCFullYear(), Date_setUTCHours(), Date_setUTCMilliseconds(), Date_setUTCMinutes(), Date_setUTCMonth(), Date_setUTCSeconds(), Date_setYear(), Date_toDateString(), Date_toISOString(), Date_toLocaleDateString(), Date_toLocaleString(), Date_toLocaleTimeString(), Date_toString(), Date_toTimeString(), Date_valueOf(), DateConstr_value(), dateobj_to_date_string(), dateobj_to_string(), DATETIME_ApplySelectedField(), DATETIME_IncreaseField(), DATETIME_IsDateInValidRange(), DATETIME_ReturnTxt(), daylight_saving_ta(), ExtCabCallback(), file_get_DateLastModified(), file_stat(), filetime_to_str(), folder_get_DateCreated(), folder_get_DateLastAccessed(), folder_get_DateLastModified(), get_bios_releasedate(), get_date_format(), get_date_from_filetime(), get_date_str(), Global_Date(), Global_Now(), local_time(), MONTHCAL_CalculateDayOfWeek(), MONTHCAL_CircleDay(), MONTHCAL_GetDayPos(), MONTHCAL_GetDayRect(), MONTHCAL_GetMaxDate(), MONTHCAL_GetMinDate(), MONTHCAL_GetMonth(), MONTHCAL_GetNextMonth(), MONTHCAL_GetPrevMonth(), MONTHCAL_IsDateInValidRange(), MONTHCAL_PaintCalendar(), CAttributesDialog::OnInitDialog(), output_int_len(), publish_install_properties(), return_date(), SHFormatDateTimeW(), summaryinfo_invoke(), test_GetFile(), test_hash_value(), test_IWinHttpRequest(), test_publish(), test_register_product(), test_strdate(), test_VarFormatFromTokens(), test_wstrdate(), TIME_DayLightCompareDate(), to_system_time(), urlcache_delete_file(), utc(), VarBstrFromDate(), and VARIANT_FormatDate().
Definition at line 520 of file mkdosfs.c.
Referenced by check_mount(), fatal_error(), main(), and setup_tables().
char dummy_boot_code[BOOTCODE_SIZE] |
Definition at line 491 of file mkdosfs.c.
Referenced by main(), and setup_tables().
char dummy_boot_jump[3] = { 0xeb, 0x3c, 0x90 } |
Definition at line 487 of file mkdosfs.c.
Referenced by setup_tables().
char dummy_boot_jump_m68k[2] = { 0x60, 0x1c } |
Definition at line 489 of file mkdosfs.c.
Referenced by setup_tables().
Definition at line 542 of file mkdosfs.c.
Referenced by EndLog(), f_getfree(), FatGetFatEntry(), FormatBufferFat(), get_fat(), mark_FAT_cluster(), setup_tables(), and write_tables().
uint16_t fat_length |
Definition at line 10 of file mkdosfs.c.
Referenced by read_boot(), setup_tables(), and write_tables().
uint8_t fs_type |
Definition at line 5 of file mkdosfs.c.
Referenced by set_fs_defaults().
uint32_t hidden |
Definition at line 13 of file mkdosfs.c.
Referenced by ewmh_get_window_state(), fsctl_set_xattr(), TOOLBAR_SetRows(), ui_seamless_begin(), and warning().
|
static |
uint8_t media |
Definition at line 9 of file mkdosfs.c.
Referenced by _test_style_media(), _test_style_put_media(), MsiSourceListEnumMediaDisksW(), MsiSourceListGetInfoW(), MsiSourceListSetInfoW(), patch_add_media(), test_MsiSourceListAddMediaDisk(), test_MsiSourceListEnumMediaDisks(), test_MsiSourceListGetInfo(), test_MsiSourceListSetInfo(), test_publish_product(), and wmain().
|
static |
Definition at line 533 of file mkdosfs.c.
Referenced by main(), setup_tables(), and write_tables().
|
static |
|
static |
Definition at line 531 of file mkdosfs.c.
Referenced by main(), setup_tables(), and write_tables().
|
static |
Definition at line 544 of file mkdosfs.c.
Referenced by setup_tables(), and write_tables().
|
static |
Definition at line 547 of file mkdosfs.c.
Referenced by main(), and setup_tables().
uint8_t sector_size = 512 |
Definition at line 3 of file mkdosfs.c.
Referenced by add_chunk(), FormatEx2(), init_device(), is_mounted_multi_device(), main(), mark_FAT_sector(), raid6_recover2(), setup_tables(), Storage_Construct(), StorageImpl_Construct(), test_vol(), write_btrfs(), write_superblocks(), and write_tables().
|
static |
Definition at line 529 of file mkdosfs.c.
Referenced by main(), and setup_tables().
uint8_t sectors |
Definition at line 8 of file mkdosfs.c.
Referenced by check_csum(), do_calc_job(), dump_boot(), IdeVerify(), main(), raid6_recover2(), read_boot(), read_data_dup(), read_data_raid10(), read_data_raid5(), read_data_raid6(), SetupCreateDiskSpaceListW(), and VfdOpenImage().
|
static |
Definition at line 546 of file mkdosfs.c.
Referenced by main(), setup_tables(), test_GetDiskFreeSpaceA(), and test_GetDiskFreeSpaceW().
|
static |
Definition at line 534 of file mkdosfs.c.
Referenced by establish_params(), main(), mark_FAT_cluster(), setup_tables(), and write_tables().
|
static |
Definition at line 535 of file mkdosfs.c.
Referenced by main(), and setup_tables().
|
static |
Definition at line 545 of file mkdosfs.c.
Referenced by setup_tables(), and write_tables().
|
static |
Definition at line 541 of file mkdosfs.c.
Referenced by check_blocks(), and setup_tables().
|
static |
Definition at line 540 of file mkdosfs.c.
Referenced by mark_FAT_sector(), and setup_tables().
uint8_t system_id |
Definition at line 1 of file mkdosfs.c.
Referenced by dump_boot(), pvd_write(), XMLStorage::XMLDoc::read_buffer(), XMLStorage::XMLDoc::read_stream(), XMLStorage::XMLMessageFromString::XMLMessageFromString(), and XMLStorage::XMLMessageReader::XMLMessageReader().
Definition at line 8 of file mkdosfs.c.
Referenced by __attribute__(), __get_date_order(), __xmlInitializeDict(), ATL::_ATL_MSG::_ATL_MSG(), _Dispatch_type_(), _Function_class_(), _gmtime32_s(), _gmtime64_s(), _gmtime_worker(), _ILGetFileDate(), _Init_timeinfo(), _Init_timeinfo_base(), _mkgmtime(), _mkgmtime32(), _mktime32(), _strtime(), _strtime_s(), _tctime_s(), _time(), _wstrtime(), add_special_defines(), AtapiQueueTimerDpc(), AtapiTimerDpc(), attr_cache_entry_expired(), attr_cache_update(), AVIStreamSampleToTime(), bind_lease(), CloseTrace(), BtrfsRecv::cmd_utimes(), collect_query_data(), CommandShell(), convert_time(), ConvertTickToDateTime(), create_date(), create_directory_fcb(), create_msft_typelib(), create_snapshot(), create_stream(), create_subvol(), create_systemtime(), CRYPT_CheckSimpleChain(), ATL::CTime::CTime(), ATL::CTimeSpan::CTimeSpan(), d3drm_animation1_AddPositionKey(), d3drm_animation1_AddRotateKey(), d3drm_animation1_AddScaleKey(), d3drm_animation1_DeleteKey(), d3drm_animation1_SetTime(), d3drm_animation2_AddPositionKey(), d3drm_animation2_AddRotateKey(), d3drm_animation2_AddScaleKey(), d3drm_animation2_DeleteKey(), d3drm_animation2_SetTime(), d3drm_animation_get_index_max(), d3drm_animation_get_index_min(), d3drm_animation_get_insert_position(), d3drm_animation_lookup_key(), date_dos2unix(), date_from_time(), Date_getFullYear(), date_now(), date_to_string(), Date_toTimeString(), dateobj_to_date_string(), dateobj_to_string(), day(), day_within_year(), daylight_saving_ta(), DaytimeHandler(), DECLARE_INTERFACE_(), delete_fileref(), delete_reparse_point(), dhcpack(), dhcpoffer(), DirectSoundDevice_Initialize(), dispatch(), do_create_snapshot(), DoOpen(), DoOutput(), duplicate_extents(), empty_message_queue(), entry_invis(), EnumEventsThread(), ExtCabCallback(), Fbt_CreateFiber(), file_create2(), filetime_to_str(), FileTimeToUnixTime(), fill_in_file_basic_information(), fill_in_file_network_open_information(), fill_in_file_stat_information(), fill_in_file_stat_lx_information(), FillBookmarkInfo(), FillBuffer(), flush_events(), ATL::CTimeSpan::Format(), ATL::CTime::Format(), FormatDateTime(), ATL::CTime::FormatGmt(), FTP_SendData(), FTPGetOneF(), FTPOpenHost(), FTPOpenHostNoLogin(), FTPUpdateIOTimer(), FTPUtime(), generate_reloc_directory(), get_fattime(), get_longlong_time(), get_signature(), get_test_year(), get_volume_size_info(), ATL::CTime::GetAsDBTIMESTAMP(), ATL::CTime::GetAsSystemTime(), ATL::CTime::GetCurrentTime(), ATL::CTime::GetDay(), ATL::CTime::GetDayOfWeek(), CFontExt::GetDetailsOf(), ATL::CTime::GetHour(), ATL::CTime::GetMinute(), ATL::CTime::GetMonth(), ATL::CTime::GetSecond(), GetStartSpoolDate(), ATL::CTime::GetYear(), Global_Time(), handle_button_event(), hour_from_time(), idmap_lookup_group(), idmap_lookup_user(), in_leap_year(), init(), init_fs_tree(), InitGL(), InitLsMonths(), initrand(), InternetTimeFromSystemTimeA(), InternetTimeFromSystemTimeA_test(), InternetTimeFromSystemTimeW(), InternetTimeFromSystemTimeW_test(), InternetTimeToSystemTimeA(), InternetTimeToSystemTimeA_test(), InternetTimeToSystemTimeW(), InternetTimeToSystemTimeW_test(), IrotGetTimeOfLastChange(), IrotRegister(), keep_responsive(), load_persistent_cookie(), local_time(), locale::locale(), localtime(), LogErrorConsole(), LogInfoConsole(), logMess(), LogMessage(), LogOpen(), LogWarningConsole(), look_for_roots(), LsCacheAdd(), LsCacheLookup(), LsL(), main(), make_date(), make_day(), master_IReferenceClock_GetTime(), Tokenizer::match(), MediaSeeking_GetCurrentPosition(), MediaSeeking_GetPositions(), MediaSeeking_GetStopPosition(), min_from_time(), MiniDumpWriteDump(), mknod(), mktime(), mktime_worker(), month_from_time(), MONTHCAL_ValidateDate(), MONTHCAL_ValidateTime(), move_across_subvols(), ms_from_time(), msi_create_empty_local_file(), MSVCRT__create_locale(), name_cache_entry_updated(), nfs41_create_session(), nfs41_open(), OnCreate(), open_file3(), OpenTrace(), ATL::CTime::operator!=(), ATL::CTime::operator-(), ATL::CTime::operator<(), ATL::CTime::operator<=(), ATL::CTime::operator=(), ATL::CTime::operator==(), ATL::CTime::operator>(), ATL::CTime::operator>=(), pause_scrub(), PerfDataGetText(), PlaceMines(), pos_from_time(), print_ttl(), PrintElapsedTime(), process_pdu_logon(), ProcessExe(), ProcessLayers(), processPendingMessages(), processRequest(), PROPVAR_ConvertFILETIME(), query_dir_item(), query_scrub(), queue_add_timer(), queue_event(), queue_get_timeout(), queue_move_timer(), rdp_send_input(), rdp_send_logon_info(), rdp_send_scancode(), recover_delegation_open(), recvd_subvol(), refclock_GetTime(), ATL::CRegObject::RegDeleteTreeX(), RegisterSdbEntry(), RendererPosPassThru_EOS(), reset_modifier_keys(), RPC_UuidGetSystemTime(), rpcb_gettime(), SampleGrabber_callback(), save_persistent_cookie(), SClose(), ScmAcquireServiceStartLock(), ScmQueryServiceLockStatusA(), ScmQueryServiceLockStatusW(), sec_from_time(), send_discover(), send_request(), SendRun(), SendTime(), set_basic_information(), set_default_subvol(), set_end_of_file_information(), set_file_security(), set_link_information(), set_rename_information(), set_reparse_point2(), set_symlink(), set_valid_data_length_information(), set_zero_data(), CTooltips::SetDelayTime(), SetInstallationCompleted(), SHFormatDateTimeW(), sleep(), SpoolName(), SRead(), SRecv(), SRecvfrom(), SSend(), SSendto(), SSendtoByName(), START_TEST(), FxWatchdog::StartTimer(), state_bound(), state_init(), state_reboot(), state_selecting(), stream_set_end_of_file_information(), SWaitUntilReadyForReading(), SWaitUntilReadyForWriting(), swapchain_gdi_present(), swapchain_gl_present(), SWrite(), SynthPortImpl_IDirectMusicPort_PlayBuffer(), SystemFunction036(), TaskTriggerConstructor(), test__hwrite(), test__lwrite(), Test_asctime(), Test_ctime(), test_dbcs_wm_char(), test_FileTimeToLocalFileTime(), test_FileTimeToSystemTime(), test_localtime32_s(), test_localtime64_s(), test_pack_EVENTMSG(), test_pack_KBDLLHOOKSTRUCT(), test_pack_KEYBDINPUT(), test_pack_MOUSEINPUT(), test_pack_MSG(), test_pack_MSLLHOOKSTRUCT(), test_PdhCollectQueryDataWithTime(), test_RealizationInfo(), test_SetTrigger_GetTrigger(), test_strtime(), test_verifyRevocation(), test_WinHttpTimeFromSystemTime(), test_WinHttpTimeToSystemTime(), test_wm_set_get_text(), test_wstrtime(), testTimeDecoding(), testTimeEncoding(), time_clip(), time_within_day(), Database::toSdb(), Trace(), TruncBatchLog(), UDFEjectReqWaiter(), UefiGetTime(), UnDate(), uninit(), UnLslR(), UnMDTMDate(), UNUSED(), upcall_parse(), update_chunk_caches(), urlcache_delete_file(), urlcache_hash_entry_is_locked(), urlcache_rate_entry(), utc(), UuidCreateSequential(), VarBstrFromDate(), verify_cert_revocation_from_dist_points_ext(), vncKey(), vncMouse(), wait_move_event(), week_day(), WinHttpTimeFromSystemTime(), WinHttpTimeToSystemTime(), WINTRUST_GetTimeFromCounterSigner(), WINTRUST_GetTimeFromSigner(), WMReaderAdvanced_DeliverTime(), WMWriterAdvanced2_GetInputSetting(), write_btrfs(), write_one_file(), write_volume_label(), WriteDefaultFirewallPrefs(), xmlMemDisplay(), xwin_process_events(), and year_from_time().
|
static |
Definition at line 523 of file mkdosfs.c.
Referenced by check_blocks(), main(), and setup_tables().
Definition at line 440 of file mkdosfs.c.
Referenced by getline(), setup_tables(), START_TEST(), and UninstallThread().
static long volume_id |
Definition at line 3 of file mkdosfs.c.
Referenced by main(), pvd_write(), and setup_tables().
__u8 volume_label[11] |
Definition at line 4 of file mkdosfs.c.
Referenced by msi_package_add_media_disk().
|
static |
Definition at line 526 of file mkdosfs.c.
Referenced by main(), setup_tables(), and source_matches_volume().