mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-20 18:05:21 -04: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:
parent
0e65b1c920
commit
db0880e534
30 changed files with 352 additions and 75 deletions
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
|
@ -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
|
|
@ -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)
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
174
src/syslinux/win/.msvc/win.vcxproj
Normal file
174
src/syslinux/win/.msvc/win.vcxproj
Normal 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>
|
23
src/syslinux/win/.msvc/win.vcxproj.filters
Normal file
23
src/syslinux/win/.msvc/win.vcxproj.filters
Normal 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>
|
15
src/syslinux/win/.msvc/win_sources
Normal file
15
src/syslinux/win/.msvc/win_sources
Normal 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
|
|
@ -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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue