1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[syslinux] update Syslinux to better align with its official source

* This means disabling some warnings and removing explicit casts, but so be it...
* Also fix the minfatsize check for Large FAT32
This commit is contained in:
Pete Batard 2016-02-23 20:52:06 +00:00
parent 0e65b1c920
commit db0880e534
30 changed files with 352 additions and 75 deletions

3
configure vendored
View file

@ -3922,6 +3922,8 @@ ac_config_files="$ac_config_files src/syslinux/libfat/Makefile"
ac_config_files="$ac_config_files src/syslinux/libinstaller/Makefile"
ac_config_files="$ac_config_files src/syslinux/win/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@ -4657,6 +4659,7 @@ do
"src/ms-sys/Makefile") CONFIG_FILES="$CONFIG_FILES src/ms-sys/Makefile" ;;
"src/syslinux/libfat/Makefile") CONFIG_FILES="$CONFIG_FILES src/syslinux/libfat/Makefile" ;;
"src/syslinux/libinstaller/Makefile") CONFIG_FILES="$CONFIG_FILES src/syslinux/libinstaller/Makefile" ;;
"src/syslinux/win/Makefile") CONFIG_FILES="$CONFIG_FILES src/syslinux/win/Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac

View file

@ -80,4 +80,5 @@ AC_CONFIG_FILES([res/localization/Makefile])
AC_CONFIG_FILES([src/ms-sys/Makefile])
AC_CONFIG_FILES([src/syslinux/libfat/Makefile])
AC_CONFIG_FILES([src/syslinux/libinstaller/Makefile])
AC_CONFIG_FILES([src/syslinux/win/Makefile])
AC_OUTPUT

View file

@ -1,7 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rufus", "src\.msvc\rufus.vcxproj", "{731858A7-0303-4988-877B-9C0DD6471864}"
EndProject
@ -11,6 +10,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "syslinux-libfat", "src\sysl
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "syslinux-libinstaller", "src\syslinux\libinstaller\.msvc\libinstaller.vcxproj", "{266502AC-CD74-4581-B707-938A7D05AD7A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "syslinux-win", "src\syslinux\win\.msvc\win.vcxproj", "{7D2E9784-DDF7-4988-A887-CF099BC3B340}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcdio-iso9660", "src\libcdio\iso9660\.msvc\iso9660.vcxproj", "{D4E80F35-2604-40AC-B436-97B052ECB572}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcdio-udf", "src\libcdio\udf\.msvc\udf.vcxproj", "{0CEC40A6-A195-4BE5-A88B-0AB00EB142EC}"
@ -61,6 +62,14 @@ Global
{266502AC-CD74-4581-B707-938A7D05AD7A}.Release|x86_32.Build.0 = Release|Win32
{266502AC-CD74-4581-B707-938A7D05AD7A}.Release|x86_64.ActiveCfg = Release|x64
{266502AC-CD74-4581-B707-938A7D05AD7A}.Release|x86_64.Build.0 = Release|x64
{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Debug|x86_32.ActiveCfg = Debug|Win32
{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Debug|x86_32.Build.0 = Debug|Win32
{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Debug|x86_64.ActiveCfg = Debug|x64
{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Debug|x86_64.Build.0 = Debug|x64
{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Release|x86_32.ActiveCfg = Release|Win32
{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Release|x86_32.Build.0 = Release|Win32
{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Release|x86_64.ActiveCfg = Release|x64
{7D2E9784-DDF7-4988-A887-CF099BC3B340}.Release|x86_64.Build.0 = Release|x64
{D4E80F35-2604-40AC-B436-97B052ECB572}.Debug|x86_32.ActiveCfg = Debug|Win32
{D4E80F35-2604-40AC-B436-97B052ECB572}.Debug|x86_32.Build.0 = Debug|Win32
{D4E80F35-2604-40AC-B436-97B052ECB572}.Debug|x86_64.ActiveCfg = Debug|x64

View file

@ -84,7 +84,7 @@
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\syslinux\win;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ExceptionHandling>false</ExceptionHandling>
@ -108,7 +108,7 @@
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\syslinux\win;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
@ -136,7 +136,7 @@
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\syslinux\win;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ExceptionHandling>false</ExceptionHandling>
@ -163,7 +163,7 @@
<PreprocessorDefinitions>_OFF_T_DEFINED;_off_t=__int64;off_t=_off_t;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\msvc-missing;..\ms-sys\inc;..\syslinux\libinstaller;..\syslinux\libfat;..\syslinux\win;..\libcdio;..\getopt;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>CompileAsC</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ExceptionHandling>false</ExceptionHandling>
@ -262,6 +262,9 @@
<ProjectReference Include="..\syslinux\libinstaller\.msvc\libinstaller.vcxproj">
<Project>{266502ac-cd74-4581-b707-938a7d05ad7a}</Project>
</ProjectReference>
<ProjectReference Include="..\syslinux\win\.msvc\win.vcxproj">
<Project>{7d2e9784-ddf7-4988-a887-cf099bc3b340}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View file

@ -3,7 +3,7 @@ TARGETTYPE=PROGRAM
UMTYPE=windows
UMENTRY=winmain
INCLUDES=$(DDK_INC_PATH);.\ms-sys\inc;.\syslinux\libfat;.\syslinux\libinstaller;.\msvc-missing;.\libcdio;.\getopt;.\bled
INCLUDES=$(DDK_INC_PATH);.\ms-sys\inc;.\syslinux\libfat;.\syslinux\libinstaller;.\syslinux\win;.\msvc-missing;.\libcdio;.\getopt;.\bled
C_DEFINES = $(C_DEFINES) /DDDKBUILD /DUNICODE /D_UNICODE /DRUFUS_LOC /DISOLATION_AWARE_ENABLED
!IFNDEF MSC_WARNING_LEVEL
@ -25,6 +25,7 @@ TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \
.\ms-sys\ms-sys.lib \
.\syslinux\libfat\libfat.lib \
.\syslinux\libinstaller\libinstaller.lib \
.\syslinux\win\win.lib \
.\libcdio\iso9660\iso9660.lib \
.\libcdio\udf\udf.lib \
.\libcdio\driver\driver.lib \

View file

@ -1,4 +1,4 @@
SUBDIRS = bled ms-sys syslinux/libfat syslinux/libinstaller libcdio/iso9660 libcdio/udf libcdio/driver ../res/localization
SUBDIRS = bled ms-sys syslinux/libfat syslinux/libinstaller syslinux/win libcdio/iso9660 libcdio/udf libcdio/driver ../res/localization
noinst_PROGRAMS = rufus
@ -12,7 +12,7 @@ AM_V_WINDRES = $(AM_V_WINDRES_$(V))
rufus_SOURCES = badblocks.c checksum.c dos.c dos_locale.c drive.c format.c icon.c iso.c localization.c net.c parser.c \
pki.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c usb.c vhd.c
rufus_CFLAGS = -I./ms-sys/inc -I./syslinux/libfat -I./syslinux/libinstaller -I./libcdio $(AM_CFLAGS)
rufus_CFLAGS = -I./ms-sys/inc -I./syslinux/libfat -I./syslinux/libinstaller -I./syslinux/win -I./libcdio $(AM_CFLAGS)
rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows
rufus_LDADD = rufus_rc.o bled/libbled.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a \
rufus_LDADD = rufus_rc.o bled/libbled.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \
libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a -lsetupapi -lole32 -lgdi32 -lwininet -lshlwapi -lcrypt32 -lwintrust

View file

@ -100,8 +100,8 @@ am_rufus_OBJECTS = rufus-badblocks.$(OBJEXT) rufus-checksum.$(OBJEXT) \
rufus_OBJECTS = $(am_rufus_OBJECTS)
rufus_DEPENDENCIES = rufus_rc.o bled/libbled.a ms-sys/libmssys.a \
syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a \
libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a \
libcdio/driver/libdriver.a
syslinux/win/libwin.a libcdio/iso9660/libiso9660.a \
libcdio/udf/libudf.a libcdio/driver/libdriver.a
rufus_LINK = $(CCLD) $(rufus_CFLAGS) $(CFLAGS) $(rufus_LDFLAGS) \
$(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@)
@ -265,7 +265,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = bled ms-sys syslinux/libfat syslinux/libinstaller libcdio/iso9660 libcdio/udf libcdio/driver ../res/localization
SUBDIRS = bled ms-sys syslinux/libfat syslinux/libinstaller syslinux/win libcdio/iso9660 libcdio/udf libcdio/driver ../res/localization
AM_V_WINDRES_0 = @echo " RC $@";$(WINDRES)
AM_V_WINDRES_1 = $(WINDRES)
AM_V_WINDRES_ = $(AM_V_WINDRES_$(AM_DEFAULT_VERBOSITY))
@ -273,9 +273,9 @@ AM_V_WINDRES = $(AM_V_WINDRES_$(V))
rufus_SOURCES = badblocks.c checksum.c dos.c dos_locale.c drive.c format.c icon.c iso.c localization.c net.c parser.c \
pki.c rufus.c smart.c stdfn.c stdio.c stdlg.c syslinux.c usb.c vhd.c
rufus_CFLAGS = -I./ms-sys/inc -I./syslinux/libfat -I./syslinux/libinstaller -I./libcdio $(AM_CFLAGS)
rufus_CFLAGS = -I./ms-sys/inc -I./syslinux/libfat -I./syslinux/libinstaller -I./syslinux/win -I./libcdio $(AM_CFLAGS)
rufus_LDFLAGS = $(AM_LDFLAGS) -mwindows
rufus_LDADD = rufus_rc.o bled/libbled.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a \
rufus_LDADD = rufus_rc.o bled/libbled.a ms-sys/libmssys.a syslinux/libfat/libfat.a syslinux/libinstaller/libinstaller.a syslinux/win/libwin.a \
libcdio/iso9660/libiso9660.a libcdio/udf/libudf.a libcdio/driver/libdriver.a -lsetupapi -lole32 -lgdi32 -lwininet -lshlwapi -lcrypt32 -lwintrust
all: all-recursive

View file

@ -371,7 +371,7 @@ extern char szFolderPath[MAX_PATH], app_dir[MAX_PATH], system_dir[MAX_PATH], sys
extern char* image_path;
extern DWORD FormatStatus, DownloadStatus;
extern BOOL PromptOnError;
extern DWORD syslinux_ldlinux_len[2];
extern unsigned long syslinux_ldlinux_len[2];
extern RUFUS_DRIVE_INFO SelectedDrive;
extern const int nb_steps[FS_MAX];
extern BOOL use_own_c32[NB_OLD_C32], detect_fakes, iso_op_in_progress, format_op_in_progress, right_to_left_mode;

View file

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 242, 376
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 2.8.864"
CAPTION "Rufus 2.8.865"
FONT 8, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -320,8 +320,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,8,864,0
PRODUCTVERSION 2,8,864,0
FILEVERSION 2,8,865,0
PRODUCTVERSION 2,8,865,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -338,13 +338,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "2.8.864"
VALUE "FileVersion", "2.8.865"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2016 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "2.8.864"
VALUE "ProductVersion", "2.8.865"
END
END
BLOCK "VarFileInfo"

View file

@ -40,9 +40,9 @@
#include "ntfssect.h"
unsigned char* syslinux_ldlinux[2] = { NULL, NULL };
DWORD syslinux_ldlinux_len[2];
unsigned long syslinux_ldlinux_len[2];
unsigned char* syslinux_mboot = NULL;
DWORD syslinux_mboot_len;
unsigned long syslinux_mboot_len;
// Workaround for 4K support
uint32_t SECTOR_SHIFT = 9;

View file

@ -104,6 +104,7 @@
<AdditionalIncludeDirectories>..;..\..\..\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -124,6 +125,7 @@
<AdditionalIncludeDirectories>..;..\..\..\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>
</ClCompile>
<Lib>
<TargetMachine>MachineX86</TargetMachine>
@ -139,6 +141,7 @@
<AdditionalIncludeDirectories>..;..\..\..\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -159,6 +162,7 @@
<AdditionalIncludeDirectories>..;..\..\..\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4018;4244</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View file

@ -5,7 +5,7 @@ INCLUDES=$(DDK_INC_PATH);..\..\msvc-missing
C_DEFINES=$(C_DEFINES) /Dinline=__inline /DDDKBUILD /DUNICODE /D_UNICODE /DISOLATION_AWARE_ENABLED
!IFNDEF MSC_WARNING_LEVEL
MSC_WARNING_LEVEL=/W3
MSC_WARNING_LEVEL=/W2
!ENDIF
USE_MSVCRT=1

View file

@ -66,7 +66,7 @@ libfat_sector_t libfat_nextsector(struct libfat_filesystem * fs,
if (~rs & clustmask)
return s + 1; /* Next sector in cluster */
cluster = (int32_t) (2 + (rs >> fs->clustshift));
cluster = 2 + (rs >> fs->clustshift);
if (cluster >= fs->endcluster)
return -1;

View file

@ -77,7 +77,7 @@ libfat_open(int (*readfunc) (intptr_t, void *, size_t, libfat_sector_t),
goto barf;
/* Figure out how many clusters */
nclusters = (uint32_t) ((fs->end - fs->data) >> fs->clustshift);
nclusters = (fs->end - fs->data) >> fs->clustshift;
fs->endcluster = nclusters + 2;
if (nclusters <= 0xff4) {
@ -92,15 +92,10 @@ libfat_open(int (*readfunc) (intptr_t, void *, size_t, libfat_sector_t),
} else
goto barf; /* Impossibly many clusters */
/* This check doesn't hold for Large FAT32 => remove it */
#if 0
minfatsize = (minfatsize + LIBFAT_SECTOR_SIZE - 1) >> LIBFAT_SECTOR_SHIFT;
minfatsize >>= LIBFAT_SECTOR_SHIFT;
if (minfatsize > fatsize)
goto barf; /* The FATs don't fit */
#else
(void)(minfatsize); /* silence an unused warning in MinGW */
#endif
if (fs->fat_type == FAT28)
fs->rootcluster = read32(&bs->u.fat32.bpb_rootclus);

View file

@ -25,7 +25,7 @@ int32_t libfat_searchdir(struct libfat_filesystem *fs, int32_t dirclust,
const void *name, struct libfat_direntry *direntry)
{
struct fat_dirent *dep;
unsigned int nent;
int nent;
libfat_sector_t s = libfat_clustertosector(fs, dirclust);
while (1) {

View file

@ -20,7 +20,6 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\advconst.h" />
<ClInclude Include="..\ntfssect.h" />
<ClInclude Include="..\syslinux.h" />
<ClInclude Include="..\syslxcom.h" />
<ClInclude Include="..\syslxfs.h" />
@ -28,7 +27,6 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\fs.c" />
<ClCompile Include="..\ntfssect.c" />
<ClCompile Include="..\setadv.c" />
<ClCompile Include="..\syslxmod.c" />
</ItemGroup>
@ -106,6 +104,7 @@
<AdditionalIncludeDirectories>..;..\..\..\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -126,6 +125,7 @@
<AdditionalIncludeDirectories>..;..\..\..\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>
</ClCompile>
<Lib>
<TargetMachine>MachineX86</TargetMachine>
@ -141,6 +141,7 @@
<AdditionalIncludeDirectories>..;..\..\..\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -161,6 +162,7 @@
<AdditionalIncludeDirectories>..;..\..\..\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4244;4267</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View file

@ -26,9 +26,6 @@
<ClInclude Include="..\syslxcom.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\ntfssect.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\fs.c">
@ -40,8 +37,5 @@
<ClCompile Include="..\syslxmod.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\ntfssect.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View file

@ -5,7 +5,7 @@ INCLUDES=$(DDK_INC_PATH);..\..\msvc-missing
C_DEFINES=$(C_DEFINES) /Dinline=__inline /DDDKBUILD /DUNICODE /D_UNICODE /DISOLATION_AWARE_ENABLED
!IFNDEF MSC_WARNING_LEVEL
MSC_WARNING_LEVEL=/W3
MSC_WARNING_LEVEL=/W2
!ENDIF
USE_MSVCRT=1
@ -13,6 +13,5 @@ TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\user32.lib
SOURCES=fs.c \
ntfssect.c \
setadv.c \
syslxmod.c

View file

@ -1,4 +1,4 @@
noinst_LIBRARIES = libinstaller.a
libinstaller_a_SOURCES = fs.c ntfssect.c setadv.c syslxmod.c
libinstaller_a_SOURCES = fs.c setadv.c syslxmod.c
libinstaller_a_CFLAGS = $(AM_CFLAGS)

View file

@ -94,7 +94,6 @@ am__v_AR_1 =
libinstaller_a_AR = $(AR) $(ARFLAGS)
libinstaller_a_LIBADD =
am_libinstaller_a_OBJECTS = libinstaller_a-fs.$(OBJEXT) \
libinstaller_a-ntfssect.$(OBJEXT) \
libinstaller_a-setadv.$(OBJEXT) \
libinstaller_a-syslxmod.$(OBJEXT)
libinstaller_a_OBJECTS = $(am_libinstaller_a_OBJECTS)
@ -244,7 +243,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LIBRARIES = libinstaller.a
libinstaller_a_SOURCES = fs.c ntfssect.c setadv.c syslxmod.c
libinstaller_a_SOURCES = fs.c setadv.c syslxmod.c
libinstaller_a_CFLAGS = $(AM_CFLAGS)
all: all-am
@ -307,12 +306,6 @@ libinstaller_a-fs.o: fs.c
libinstaller_a-fs.obj: fs.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-fs.obj `if test -f 'fs.c'; then $(CYGPATH_W) 'fs.c'; else $(CYGPATH_W) '$(srcdir)/fs.c'; fi`
libinstaller_a-ntfssect.o: ntfssect.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-ntfssect.o `test -f 'ntfssect.c' || echo '$(srcdir)/'`ntfssect.c
libinstaller_a-ntfssect.obj: ntfssect.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-ntfssect.obj `if test -f 'ntfssect.c'; then $(CYGPATH_W) 'ntfssect.c'; else $(CYGPATH_W) '$(srcdir)/ntfssect.c'; fi`
libinstaller_a-setadv.o: setadv.c
$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libinstaller_a_CFLAGS) $(CFLAGS) -c -o libinstaller_a-setadv.o `test -f 'setadv.c' || echo '$(srcdir)/'`setadv.c

View file

@ -20,7 +20,6 @@
* Return 0 on success, -1 on error, and set errno.
*
*/
//#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
@ -110,8 +109,8 @@ int syslinux_setadv(int tag, size_t size, const void *data)
return -1;
}
*p++ = (uint8_t) tag;
*p++ = (uint8_t) size;
*p++ = tag;
*p++ = size;
memcpy(p, data, size);
p += size;
left -= size + 2;

View file

@ -13,7 +13,6 @@
#ifndef SYSLINUX_H
#define SYSLINUX_H
#include <windows.h>
#include <inttypes.h>
#include "advconst.h"
#include "setadv.h"
@ -28,7 +27,7 @@
/* The standard boot sector and ldlinux image */
extern unsigned char* syslinux_ldlinux[2];
extern DWORD syslinux_ldlinux_len[2];
extern unsigned long syslinux_ldlinux_len[2];
extern const int syslinux_ldlinux_mtime[2];
#define boot_sector syslinux_ldlinux[1]
@ -40,12 +39,9 @@ extern unsigned char syslinux_mbr[];
extern const unsigned int syslinux_mbr_len;
extern const int syslinux_mbr_mtime;
/* Sector size assumptions... */
// Workaround for 4K support
/* Sector size variables are defined externally for 4K support */
extern uint32_t SECTOR_SHIFT;
extern uint32_t SECTOR_SIZE;
//#define SECTOR_SHIFT 9
//#define SECTOR_SIZE (1 << SECTOR_SHIFT)
/* This takes a boot sector and merges in the syslinux fields */
void syslinux_make_bootsect(void *bs, int fs_type);

View file

@ -92,8 +92,8 @@ static inline void set_16(uint16_t *p, uint16_t v)
*p = v;
#else
uint8_t *pp = (uint8_t *) p;
pp[0] = (v & 0xff);
pp[1] = ((v >> 8) & 0xff);
pp[0] = v;
pp[1] = v >> 8;
#endif
}

View file

@ -60,7 +60,7 @@ static void generate_extents(struct syslinux_extent _slimg *ex, int nptrs,
}
set_64_sl(&ex->lba, lba);
set_16_sl(&ex->len, (uint16_t) len);
set_16_sl(&ex->len, len);
ex++;
}
@ -75,7 +75,7 @@ static void generate_extents(struct syslinux_extent _slimg *ex, int nptrs,
if (len) {
set_64_sl(&ex->lba, lba);
set_16_sl(&ex->len, (uint16_t) len);
set_16_sl(&ex->len, len);
ex++;
}
}
@ -132,8 +132,8 @@ int syslinux_patch(const sector_t *sectp, int nsectors,
epa = slptr(boot_image, &patcharea->epaoffset);
/* First sector need pointer in boot sector */
set_32(ptr(sbs, &epa->sect1ptr0), (uint32_t) sectp[0]);
set_32(ptr(sbs, &epa->sect1ptr1), (uint32_t) (sectp[0] >> 32));
set_32(ptr(sbs, &epa->sect1ptr0), sectp[0]);
set_32(ptr(sbs, &epa->sect1ptr1), sectp[0] >> 32);
sectp++;
/* Handle RAID mode */
@ -176,7 +176,7 @@ int syslinux_patch(const sector_t *sectp, int nsectors,
/* Poke in the base directory path */
if (subdir) {
int sublen = (int) (strlen(subdir) + 1);
int sublen = strlen(subdir) + 1;
if (get_16_sl(&epa->dirlen) < sublen) {
fprintf(stderr, "Subdirectory path too long... aborting install!\n");
exit(1);
@ -186,7 +186,7 @@ int syslinux_patch(const sector_t *sectp, int nsectors,
/* Poke in the subvolume information */
if (subvol) {
int sublen = (int) (strlen(subvol) + 1);
int sublen = strlen(subvol) + 1;
if (get_16_sl(&epa->subvollen) < sublen) {
fprintf(stderr, "Subvol name too long... aborting install!\n");
exit(1);

View file

@ -0,0 +1,174 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\ntfssect.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\ntfssect.c" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7D2E9784-DDF7-4988-A887-CF099BC3B340}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>win</RootNamespace>
<ProjectName>syslinux-win</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)x86_32\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)x86_32\$(Configuration)\$(ProjectName)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)x86_32\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)x86_32\$(Configuration)\$(ProjectName)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)x86_64\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)x86_64\$(Configuration)\$(ProjectName)\</IntDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)x86_64\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)x86_64\$(Configuration)\$(ProjectName)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..;..\..\..\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Lib>
<TargetMachine>MachineX86</TargetMachine>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..;..\..\..\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings>
</ClCompile>
<Lib>
<TargetMachine>MachineX86</TargetMachine>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>inline=__inline;_CRTDBG_MAP_ALLOC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..;..\..\..\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Lib>
<TargetMachine>MachineX64</TargetMachine>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>inline=__inline;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..;..\..\..\msvc-missing;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4244;4267;4996</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<Lib>
<TargetMachine>MachineX64</TargetMachine>
</Lib>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\ntfssect.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\ntfssect.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View file

@ -0,0 +1,15 @@
TARGETNAME=win
TARGETTYPE=LIBRARY
INCLUDES=$(DDK_INC_PATH);..\..\msvc-missing
C_DEFINES=$(C_DEFINES) /Dinline=__inline /DDDKBUILD /DUNICODE /D_UNICODE /DISOLATION_AWARE_ENABLED
!IFNDEF MSC_WARNING_LEVEL
MSC_WARNING_LEVEL=/W2
!ENDIF
USE_MSVCRT=1
TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\user32.lib
SOURCES=ntfssect.c

View file

@ -18,9 +18,6 @@
* With special thanks to Mark Roddy for his article:
* http://www.wd-3.com/archive/luserland.htm
*/
#if defined(_MSC_VER)
#pragma warning(disable:4996)
#endif
#include <windows.h>
#include <winioctl.h>
@ -33,6 +30,10 @@
#define M_ERR(msg) (NtfsSectLastErrorMessage = (msg))
/*** Function declarations */
static DWORD NtfsSectGetVolumeHandle(
CHAR * VolumeName,
S_NTFSSECT_VOLINFO * VolumeInfo
);
static DWORD NtfsSectGetVolumePartitionLba(S_NTFSSECT_VOLINFO * VolumeInfo);
/*** Objects */
@ -44,7 +45,7 @@ DWORD M_NTFSSECT_API NtfsSectGetFileVcnExtent(
LARGE_INTEGER * Vcn,
S_NTFSSECT_EXTENT * Extent
) {
BOOL bad, ok;
BOOL bad;
DWORD output_size, rc;
STARTING_VCN_INPUT_BUFFER input;
RETRIEVAL_POINTERS_BUFFER output;
@ -59,7 +60,7 @@ DWORD M_NTFSSECT_API NtfsSectGetFileVcnExtent(
return ERROR_INVALID_PARAMETER;
input.StartingVcn = *Vcn;
ok = DeviceIoControl(
DeviceIoControl(
File,
FSCTL_GET_RETRIEVAL_POINTERS,
&input,
@ -69,7 +70,6 @@ DWORD M_NTFSSECT_API NtfsSectGetFileVcnExtent(
&output_size,
NULL
);
ok = ok;
rc = GetLastError();
switch (rc) {
case NO_ERROR:
@ -89,6 +89,52 @@ DWORD M_NTFSSECT_API NtfsSectGetFileVcnExtent(
return rc;
}
/* Internal use only */
static DWORD NtfsSectGetVolumeHandle(
CHAR * VolumeName,
S_NTFSSECT_VOLINFO * VolumeInfo
) {
#define M_VOL_PREFIX "\\\\.\\"
CHAR volname[sizeof M_VOL_PREFIX - 1 + MAX_PATH + 1] = M_VOL_PREFIX;
CHAR * const volname_short = volname + sizeof M_VOL_PREFIX - 1;
CHAR * c;
DWORD rc;
/* Prefix "\\.\" onto the passed volume name */
strcpy(volname + sizeof M_VOL_PREFIX - 1, VolumeName);
/* Find the last non-null character */
for (c = volname_short; *c; ++c)
;
/* Remove trailing back-slash */
if (c[-1] == '\\')
c[-1] = 0;
/* Open the volume */
VolumeInfo->Handle = CreateFileA(
volname,
GENERIC_READ,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL
);
rc = GetLastError();
if (VolumeInfo->Handle == INVALID_HANDLE_VALUE) {
M_ERR("Unable to open volume handle!");
goto err_handle;
}
return ERROR_SUCCESS;
CloseHandle(VolumeInfo->Handle);
err_handle:
return rc;
}
DWORD M_NTFSSECT_API NtfsSectGetVolumeInfo(
CHAR * VolumeName,
S_NTFSSECT_VOLINFO * VolumeInfo
@ -100,6 +146,10 @@ DWORD M_NTFSSECT_API NtfsSectGetVolumeInfo(
if (!VolumeName || !VolumeInfo)
return ERROR_INVALID_PARAMETER;
rc = NtfsSectGetVolumeHandle(VolumeName, VolumeInfo);
if (rc != ERROR_SUCCESS)
goto err_handle;
rc = NtfsSectLoadXpFuncs(&xp_funcs);
if (rc != ERROR_SUCCESS)
goto err_xp_funcs;
@ -135,6 +185,7 @@ DWORD M_NTFSSECT_API NtfsSectGetVolumeInfo(
CloseHandle(VolumeInfo->Handle);
VolumeInfo->Handle = INVALID_HANDLE_VALUE;
}
err_handle:
return rc;
}

View file

@ -70,6 +70,21 @@ copy obj%BUILD_ALT_DIR%\%ARCH_DIR%\libinstaller.lib . >NUL 2>&1
if EXIST Makefile.hide ren Makefile.hide Makefile
if EXIST sources del sources >NUL 2>&1
::# SysLinux win Library
cd ..\win
if EXIST Makefile ren Makefile Makefile.hide
copy .msvc\win_sources sources >NUL 2>&1
@echo on
%BUILD_CMD%
@echo off
if errorlevel 1 goto builderror
copy obj%BUILD_ALT_DIR%\%ARCH_DIR%\win.lib . >NUL 2>&1
if EXIST Makefile.hide ren Makefile.hide Makefile
if EXIST sources del sources >NUL 2>&1
::# libcdio iso9660 Library
cd ..\..\libcdio\iso9660
if EXIST Makefile ren Makefile Makefile.hide