[misc] drop WDK compilation support

This commit is contained in:
Pete Batard 2017-07-10 13:08:42 +01:00
parent 86c530ac50
commit c00557900b
8 changed files with 11 additions and 224 deletions

View File

@ -20,15 +20,6 @@
#error Only Windows platforms are supported
#endif
#if defined(DDKBUILD)
#pragma warning(disable: 4242) // "Conversion from x to y, possible loss of data"
#pragma warning(disable: 4244)
struct timeval {
long tv_sec;
long tv_usec;
};
#endif
#include "platform.h"
#include "msapi_utf8.h"
@ -193,12 +184,8 @@ static inline int full_read(int fd, void *buf, size_t count) {
}
static inline struct tm *localtime_r(const time_t *timep, struct tm *result) {
#if defined(DDKBUILD)
result = localtime(timep);
#else
if (localtime_s(result, timep) != 0)
result = NULL;
#endif
return result;
}

View File

@ -210,7 +210,7 @@ static char *posixly_correct;
#ifndef getenv
#ifdef _MSC_VER
// DDK will complain if you don't use the stdlib defined getenv
// MSVC will complain if you don't use the stdlib defined getenv
#include <stdlib.h>
#else
extern char *getenv ();

View File

@ -108,7 +108,7 @@ static __inline void *_reallocf(void *ptr, size_t size) {
#define _RT_RCDATA MAKEINTRESOURCEA(10)
#define _RT_GROUP_ICON MAKEINTRESOURCEA((ULONG_PTR)(MAKEINTRESOURCEA(3) + 11))
/* UI redefinitions for WDK and MinGW */
/* UI redefinitions for MinGW */
#ifndef PBM_SETSTATE
#define PBM_SETSTATE (WM_USER+16)
#endif

View File

@ -33,9 +33,7 @@
#include <io.h>
#include <sys/types.h>
#include <sys/stat.h>
#if !defined(DDKBUILD)
#include <psapi.h>
#endif
#pragma once
#if defined(_MSC_VER)
@ -584,7 +582,6 @@ static __inline DWORD GetModuleFileNameU(HMODULE hModule, char* lpFilename, DWOR
return ret;
}
#if !defined(DDKBUILD)
static __inline DWORD GetModuleFileNameExU(HANDLE hProcess, HMODULE hModule, char* lpFilename, DWORD nSize)
{
DWORD ret = 0, err = ERROR_INVALID_DATA;
@ -600,7 +597,6 @@ static __inline DWORD GetModuleFileNameExU(HANDLE hProcess, HMODULE hModule, cha
SetLastError(err);
return ret;
}
#endif
static __inline DWORD GetFullPathNameU(const char* lpFileName, DWORD nBufferLength, char* lpBuffer, char** lpFilePart)
{

View File

@ -47,15 +47,11 @@
#include "../res/grub/grub_version.h"
#include "../res/grub2/grub2_version.h"
// MinGW doesn't know these
PF_TYPE(WINAPI, HIMAGELIST, ImageList_Create, (int, int, UINT, int, int));
PF_TYPE(WINAPI, int, ImageList_AddIcon, (HIMAGELIST, HICON));
PF_TYPE(WINAPI, int, ImageList_ReplaceIcon, (HIMAGELIST, int, HICON));
// ImageList calls are unavailable on XP
PF_TYPE_DECL(WINAPI, HIMAGELIST, ImageList_Create, (int, int, UINT, int, int));
PF_TYPE_DECL(WINAPI, int, ImageList_AddIcon, (HIMAGELIST, HICON));
PF_TYPE_DECL(WINAPI, int, ImageList_ReplaceIcon, (HIMAGELIST, int, HICON));
// WDK blows up when trying to using PF_TYPE_DECL() for the ImageList calls... so we don't.
PF_DECL(ImageList_Create);
PF_DECL(ImageList_AddIcon);
PF_DECL(ImageList_ReplaceIcon);
PF_TYPE_DECL(WINAPI, BOOL, SHChangeNotifyDeregister, (ULONG));
PF_TYPE_DECL(WINAPI, ULONG, SHChangeNotifyRegister, (HWND, int, LONG, UINT, int, const MY_SHChangeNotifyEntry*));
@ -3500,11 +3496,3 @@ out:
return 0;
}
// The old WDK is showing its age and becoming a pain to support
#if defined(DDKBUILD)
BOOL SearchProcess(char* HandleName, BOOL bPartialMatch, BOOL bIgnoreSelf) {
uprintf("NOTE: Process search is not implemented on this platform");
return FALSE;
}
#endif

View File

@ -24,12 +24,6 @@
#pragma warning(disable: 4996) // Ignore deprecated (eg. GetVersionEx()), as we have to contend with XP
#pragma warning(disable: 28159) // We use GetTickCount64() where possible, but it's not available on XP
#pragma warning(disable: 6258) // I know what I'm using TerminateThread for
// Burn in HELL Windows XP!!!
#ifdef DDKBUILD
#if (_WIN32_WINNT < _WIN32_WINNT_VISTA)
#error The Windows XP target is no longer supported for WDK compilation.
#endif
#endif
#endif
#pragma once

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.15.1123"
CAPTION "Rufus 2.15.1124"
FONT 8, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
@ -334,8 +334,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 2,15,1123,0
PRODUCTVERSION 2,15,1123,0
FILEVERSION 2,15,1124,0
PRODUCTVERSION 2,15,1124,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -352,13 +352,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "2.15.1123"
VALUE "FileVersion", "2.15.1124"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2017 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "2.15.1123"
VALUE "ProductVersion", "2.15.1124"
END
END
BLOCK "VarFileInfo"

View File

@ -1,178 +0,0 @@
@echo off
if Test%BUILD_ALT_DIR%==Test goto usage
::# /M 2 for multiple cores
set BUILD_CMD=build -bcwgZ -M12
set PWD=%~dp0
::# Set target platform type
set ARCH_DIR=%_BUILDARCH%
if /I Test%_BUILDARCH%==Testx86 set ARCH_DIR=i386
::# Bled Library
cd src\bled
if EXIST Makefile ren Makefile Makefile.hide
copy .msvc\bled_sources sources >NUL 2>&1
@echo on
%BUILD_CMD%
@echo off
if errorlevel 1 goto builderror
copy obj%BUILD_ALT_DIR%\%ARCH_DIR%\bled.lib . >NUL 2>&1
if EXIST Makefile.hide ren Makefile.hide Makefile
if EXIST sources del sources >NUL 2>&1
::# MS-SYS Library
cd ..\ms-sys
if EXIST Makefile ren Makefile Makefile.hide
copy .msvc\ms-sys_sources sources >NUL 2>&1
@echo on
%BUILD_CMD%
@echo off
if errorlevel 1 goto builderror
copy obj%BUILD_ALT_DIR%\%ARCH_DIR%\ms-sys.lib . >NUL 2>&1
if EXIST Makefile.hide ren Makefile.hide Makefile
if EXIST sources del sources >NUL 2>&1
::# SysLinux libfat Library
cd ..\syslinux\libfat
if EXIST Makefile ren Makefile Makefile.hide
copy .msvc\libfat_sources sources >NUL 2>&1
@echo on
%BUILD_CMD%
@echo off
if errorlevel 1 goto builderror
copy obj%BUILD_ALT_DIR%\%ARCH_DIR%\libfat.lib . >NUL 2>&1
if EXIST Makefile.hide ren Makefile.hide Makefile
if EXIST sources del sources >NUL 2>&1
::# SysLinux libinstaller Library
cd ..\libinstaller
if EXIST Makefile ren Makefile Makefile.hide
copy .msvc\libinstaller_sources sources >NUL 2>&1
@echo on
%BUILD_CMD%
@echo off
if errorlevel 1 goto builderror
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
copy .msvc\iso9660_sources sources >NUL 2>&1
@echo on
%BUILD_CMD%
@echo off
if errorlevel 1 goto builderror
copy obj%BUILD_ALT_DIR%\%ARCH_DIR%\iso9660.lib . >NUL 2>&1
if EXIST Makefile.hide ren Makefile.hide Makefile
if EXIST sources del sources >NUL 2>&1
::# libcdio udf Library
cd ..\udf
if EXIST Makefile ren Makefile Makefile.hide
copy .msvc\udf_sources sources >NUL 2>&1
@echo on
%BUILD_CMD%
@echo off
if errorlevel 1 goto builderror
copy obj%BUILD_ALT_DIR%\%ARCH_DIR%\udf.lib . >NUL 2>&1
if EXIST Makefile.hide ren Makefile.hide Makefile
if EXIST sources del sources >NUL 2>&1
::# libcdio driver Library
cd ..\driver
if EXIST Makefile ren Makefile Makefile.hide
copy .msvc\driver_sources sources >NUL 2>&1
@echo on
%BUILD_CMD%
@echo off
if errorlevel 1 goto builderror
copy obj%BUILD_ALT_DIR%\%ARCH_DIR%\driver.lib . >NUL 2>&1
if EXIST Makefile.hide ren Makefile.hide Makefile
if EXIST sources del sources >NUL 2>&1
::# getopt Library
cd ..\..\getopt
if EXIST Makefile ren Makefile Makefile.hide
copy .msvc\getopt_sources sources >NUL 2>&1
@echo on
%BUILD_CMD%
@echo off
if errorlevel 1 goto builderror
copy obj%BUILD_ALT_DIR%\%ARCH_DIR%\getopt.lib . >NUL 2>&1
if EXIST Makefile.hide ren Makefile.hide Makefile
if EXIST sources del sources >NUL 2>&1
::# Rufus Application
cd ..
if EXIST Makefile ren Makefile Makefile.hide
copy .msvc\rufus_sources sources >NUL 2>&1
@echo on
%BUILD_CMD%
@echo off
if errorlevel 1 goto builderror
copy obj%BUILD_ALT_DIR%\%ARCH_DIR%\rufus.exe .. >NUL 2>&1
if EXIST Makefile.hide ren Makefile.hide Makefile
if EXIST sources del sources >NUL 2>&1
goto done
:builderror
if EXIST Makefile.hide ren Makefile.hide Makefile
if EXIST sources del sources >NUL 2>&1
echo Build failed
goto done
:usage
echo This command must be run in a Windows Driver Kit build environment.
echo See: http://msdn.microsoft.com/en-us/windows/hardware/gg487463
echo:
pause
:done
cd %PWD%