From c00557900b5e84ee9b7039a84d358c01e9f251db Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 10 Jul 2017 13:08:42 +0100 Subject: [PATCH] [misc] drop WDK compilation support --- src/bled/libbb.h | 13 ---- src/getopt/getopt.c | 2 +- src/missing.h | 2 +- src/msapi_utf8.h | 4 - src/rufus.c | 20 +---- src/rufus.h | 6 -- src/rufus.rc | 10 +-- wdk_build.cmd | 178 -------------------------------------------- 8 files changed, 11 insertions(+), 224 deletions(-) delete mode 100644 wdk_build.cmd diff --git a/src/bled/libbb.h b/src/bled/libbb.h index 4673ed67..d6132ab5 100644 --- a/src/bled/libbb.h +++ b/src/bled/libbb.h @@ -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; } diff --git a/src/getopt/getopt.c b/src/getopt/getopt.c index 64416810..85bc4468 100644 --- a/src/getopt/getopt.c +++ b/src/getopt/getopt.c @@ -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 #else extern char *getenv (); diff --git a/src/missing.h b/src/missing.h index 6fabe57b..17fd6f23 100644 --- a/src/missing.h +++ b/src/missing.h @@ -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 diff --git a/src/msapi_utf8.h b/src/msapi_utf8.h index b9bd8178..f8557b30 100644 --- a/src/msapi_utf8.h +++ b/src/msapi_utf8.h @@ -33,9 +33,7 @@ #include #include #include -#if !defined(DDKBUILD) #include -#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) { diff --git a/src/rufus.c b/src/rufus.c index 16c651e7..072189da 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -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 diff --git a/src/rufus.h b/src/rufus.h index 4a9981f8..4aabdf5c 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -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 diff --git a/src/rufus.rc b/src/rufus.rc index 026eceb9..1d163277 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -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" diff --git a/wdk_build.cmd b/wdk_build.cmd deleted file mode 100644 index e8118fd6..00000000 --- a/wdk_build.cmd +++ /dev/null @@ -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% \ No newline at end of file