diff --git a/build.win32x86/common/Makefile.msvc.tools b/build.win32x86/common/Makefile.msvc.tools index abdd78ed79..25ea2ebbc3 100644 --- a/build.win32x86/common/Makefile.msvc.tools +++ b/build.win32x86/common/Makefile.msvc.tools @@ -53,8 +53,8 @@ ifdef MSVC MEMACCESS:=-DUSE_INLINE_MEMORY_ACCESSORS=1 endif -# Set minimum version to WindowsXP (see /cygwin/usr/include/w32api/w32api.h) -WINVER:=-D_WIN32_WINNT=0x0501 -DWINVER=0x0501 +# Set minimum version to Windows 8 (see /cygwin/usr/include/w32api/w32api.h) +WINVER:=-D_WIN32_WINNT=0x0602 -DWINVER=0x0602 # define _MT to eliminate the inline versions of printf et al in mingw/stdio.h #NOBUILTIN:= -fno-builtin-printf -fno-builtin-putchar -fno-builtin-fprintf @@ -62,7 +62,8 @@ NOBUILTIN:=-D_MT MACHINE:=x86 DEFS:= $(COGDEFS) $(MEMACCESS) $(WINVER) \ - -DWIN32=1 -DUNICODE=1 -DWIN32_FILE_SUPPORT -DNO_ISNAN -DNO_SERVICE \ + -DWIN32=1 -D_WIN32=1 -DUNICODE=1 \ + -DWIN32_FILE_SUPPORT -DNO_ISNAN -DNO_SERVICE \ $(NDEBUG) -DLSB_FIRST -D'VM_NAME="$(VM_NAME)"' $(XDEFS) $(CROQUET) ############################################################################# diff --git a/build.win32x86/common/Makefile.tools b/build.win32x86/common/Makefile.tools index 959a36dfcb..24eb6975bf 100644 --- a/build.win32x86/common/Makefile.tools +++ b/build.win32x86/common/Makefile.tools @@ -42,8 +42,8 @@ else COGDEFS:= $(COGDEFS) -DCOGMTVM=0 -DDEBUGVM=$(DEBUGVM) endif -# Set minimum version to WindowsXP (see /cygwin/usr/include/w32api/w32api.h) -WINVER:=-D_WIN32_WINNT=0x0501 -DWINVER=0x0501 +# Set minimum version to Windows Vista (see /cygwin/usr/include/w32api/w32api.h) +WINVER:=-D_WIN32_WINNT=0x0600 -DWINVER=0x0600 # define _MT to eliminate the inline versions of printf et al in mingw/stdio.h NOBUILTIN:= -D_MT -fno-builtin-printf -fno-builtin-putchar -fno-builtin-fprintf @@ -51,8 +51,9 @@ CFLAGS:= -msse2 -ggdb2 -m32 \ -mno-rtd -mms-bitfields $(OFLAGS) $(NOBUILTIN) $(WARNINGS) TZ:=$(shell date +%Z) -DEFS:= $(COGDEFS) $(WINVER) -DWIN32=1 -DWIN32_FILE_SUPPORT -DNO_ISNAN \ - -DNO_SERVICE -D'TZ="$(TZ)"' \ +DEFS:= $(COGDEFS) $(WINVER) \ + -DWIN32=1 -D_WIN32=1 \ + -DWIN32_FILE_SUPPORT -DNO_ISNAN -DNO_SERVICE -D'TZ="$(TZ)"' \ $(NDEBUG) -DLSB_FIRST -D'VM_NAME="$(VM_NAME)"' $(XDEFS) $(CROQUET) ############################################################################# diff --git a/build.win64x64/common/Makefile.msvc.tools b/build.win64x64/common/Makefile.msvc.tools index 36bbfa8f83..3dbef14c54 100644 --- a/build.win64x64/common/Makefile.msvc.tools +++ b/build.win64x64/common/Makefile.msvc.tools @@ -59,10 +59,7 @@ MEMACCESS:=-DUSE_INLINE_MEMORY_ACCESSORS=1 endif # Set minimum version to Windows 8 (see /cygwin/usr/include/w32api/w32api.h) -#but if so, sqWin32AEC.cpp includes DeviceTopology.h & barfs -#WINVER:=-D_WIN32_WINNT=0x0801 -DWINVER=0x0801 -# Set minimum version to Windows 10 -WINVER:=-D_WIN64=1 -D_WIN32_WINNT=0x1001 -DWINVER=0x1001 +WINVER:=-D_WIN32_WINNT=0x0602 -DWINVER=0x0602 # define _MT to eliminate the inline versions of printf et al in mingw/stdio.h #NOBUILTIN:= -fno-builtin-printf -fno-builtin-putchar -fno-builtin-fprintf @@ -70,7 +67,8 @@ NOBUILTIN:=-D_MT MACHINE:=x64 DEFS:= -D$(VM)VM=1 $(COGDEFS) $(MEMACCESS) $(WINVER) \ - -DWIN32=1 -DUNICODE=1 -DWIN32_FILE_SUPPORT -DNO_ISNAN -DNO_SERVICE \ + -DWIN32=1 -DWIN64=1 -D_WIN32=1 -D_WIN64=1 -DUNICODE=1 \ + -DWIN32_FILE_SUPPORT -DNO_ISNAN -DNO_SERVICE \ $(NDEBUG) -DLSB_FIRST -DVM_NAME='"$(VM_NAME)"' $(XDEFS) $(CROQUET) ############################################################################# diff --git a/build.win64x64/common/Makefile.tools b/build.win64x64/common/Makefile.tools index 9577e1c6d3..bd7aa403ce 100644 --- a/build.win64x64/common/Makefile.tools +++ b/build.win64x64/common/Makefile.tools @@ -49,8 +49,8 @@ ifeq ($(COMPILER_TO_USE),clang) COGDEFS:=$(COGDEFS) -mno-stack-arg-probe endif -# Set minimum version to WindowsXP (see /cygwin/usr/include/w32api/w32api.h) -WINVER:=-D_WIN32_WINNT=0x0501 -DWINVER=0x0501 +# Set minimum version to Windows Vista (see /cygwin/usr/include/w32api/w32api.h) +WINVER:=-D_WIN32_WINNT=0x0600 -DWINVER=0x0600 # define _MT to eliminate the inline versions of printf et al in mingw/stdio.h NOBUILTIN:= -D_MT -fno-builtin-printf -fno-builtin-putchar -fno-builtin-fprintf @@ -59,7 +59,8 @@ CFLAGS:= -fdeclspec -msse2 -ggdb2 -m64 \ TZ:=$(shell date +%Z) DEFS:= -D$(VM)VM=1 $(COGDEFS) $(WINVER) \ - -DWIN64=1 -DWIN32_FILE_SUPPORT -DNO_ISNAN -DNO_SERVICE \ + -DWIN32=1 -DWIN64=1 -D_WIN32=1 -D_WIN64=1 \ + -DWIN32_FILE_SUPPORT -DNO_ISNAN -DNO_SERVICE \ $(NDEBUG) -DLSB_FIRST -D'VM_NAME="$(VM_NAME)"' $(XDEFS) $(CROQUET) ############################################################################# diff --git a/platforms/win32/vm/sqWin32.h b/platforms/win32/vm/sqWin32.h index 94ba64cf3b..ceedfbe3fb 100644 --- a/platforms/win32/vm/sqWin32.h +++ b/platforms/win32/vm/sqWin32.h @@ -323,47 +323,6 @@ void pluginHandleEvent(MSG* msg); int recordDragDropEvent(HWND wnd, int dragType, int x, int y, int numFiles); #endif -/****************************************************************************/ -/* few addtional definitions for those having older include files */ -/****************************************************************************/ -#if (WINVER < 0x0400) && !defined(_GNU_H_WINDOWS_H) -/* CreateWindowEx params since Win95/NT4 */ -#define WS_EX_WINDOWEDGE 0x00000100L -#define WS_EX_CLIENTEDGE 0x00000200L -#define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE) -#define WS_EX_APPWINDOW 0x00040000L -#define WS_EX_TOOLWINDOW 0x00000080L -#define WS_EX_CONTEXTHELP 0x00000400L - -/* WM_USERCHANGED since Win95/NT4 */ -#define WM_USERCHANGED 0x0054 - -/* Shell_NoifiyIcon() for the system tray on Win95/NT4 */ -typedef struct _NOTIFYICONDATAA { - DWORD cbSize; - HWND hWnd; - UINT uID; - UINT uFlags; - UINT uCallbackMessage; - HICON hIcon; - CHAR szTip[64]; -} NOTIFYICONDATA, *PNOTIFYICONDATA; - -#define NIM_ADD 0x00000000 -#define NIM_MODIFY 0x00000001 -#define NIM_DELETE 0x00000002 - -#define NIF_MESSAGE 0x00000001 -#define NIF_ICON 0x00000002 -#define NIF_TIP 0x00000004 - -#endif /* WINVER < 0x0400 */ - -/* WM_MOUSEWHEEL since Win98/NT4 */ -#ifndef WM_MOUSEWHEEL -#define WM_MOUSEWHEEL 0x020A -#endif - /******************************************************/ /* Profiling support */ /******************************************************/ diff --git a/platforms/win32/vm/sqWin32Main.c b/platforms/win32/vm/sqWin32Main.c index e0272b2fd7..199f90551c 100644 --- a/platforms/win32/vm/sqWin32Main.c +++ b/platforms/win32/vm/sqWin32Main.c @@ -38,55 +38,11 @@ # endif #endif - -/************************************************************************************************************/ -/* few addtional definitions for those having older include files especially #include */ -/************************************************************************************************************/ -#if (WINVER < 0x0600) - /*Copied from winbase.h*/ - typedef struct _FILE_NAME_INFO { - DWORD FileNameLength; - WCHAR FileName[1]; - } FILE_NAME_INFO, *PFILE_NAME_INFO; - typedef enum _FILE_INFO_BY_HANDLE_CLASS { - FileBasicInfo = 0, - FileStandardInfo = 1, - FileNameInfo = 2, - FileRenameInfo = 3, - FileDispositionInfo = 4, - FileAllocationInfo = 5, - FileEndOfFileInfo = 6, - FileStreamInfo = 7, - FileCompressionInfo = 8, - FileAttributeTagInfo = 9, - FileIdBothDirectoryInfo = 10, // 0xA - FileIdBothDirectoryRestartInfo = 11, // 0xB - FileIoPriorityHintInfo = 12, // 0xC - FileRemoteProtocolInfo = 13, // 0xD - FileFullDirectoryInfo = 14, // 0xE - FileFullDirectoryRestartInfo = 15, // 0xF - FileStorageInfo = 16, // 0x10 - FileAlignmentInfo = 17, // 0x11 - FileIdInfo = 18, // 0x12 - FileIdExtdDirectoryInfo = 19, // 0x13 - FileIdExtdDirectoryRestartInfo = 20, // 0x14 - MaximumFileInfoByHandlesClass - } FILE_INFO_BY_HANDLE_CLASS, *PFILE_INFO_BY_HANDLE_CLASS; -#endif //(WINVER < 0x0600) - #if !defined(IMAGE_SIZEOF_NT_OPTIONAL_HEADER) #include #define IMAGE_SIZEOF_NT_OPTIONAL_HEADER sizeof(IMAGE_OPTIONAL_HEADER) #endif -/* Windows Vista support - * AUTHOR: Korakurider (kr) - * CHANGE NOTES: - * 1) new command line option "-lowRights" was introduced - * to support IE7/protected mode. - */ -#define VISTA_SECURITY 1 /* IE7/Vista protected mode support */ - # define VMOPTION(arg) "-"arg /*** Crash debug -- Imported from Virtual Machine ***/ @@ -135,10 +91,8 @@ static WCHAR vmLogDirW[MAX_PATH]; WCHAR *logName = L""; /* full path and name to log file */ -#ifdef VISTA_SECURITY -BOOL fLowRights = 0; /* started as low integiry process, +BOOL fLowRights = 0; /* started as low integrity process, need to use alternate untrustedUserDirectory */ -#endif /* VISTA_SECURITY */ /* Service stuff */ WCHAR serviceName[MAX_PATH+1]; /* The name of the NT service */ @@ -926,26 +880,12 @@ sqInt fileHandleType(HANDLE fdHandle) { FILE_NAME_INFO *nameinfo; WCHAR *p = NULL; - typedef BOOL(WINAPI *pfnGetFileInformationByHandleEx)( - HANDLE hFile, - FILE_INFO_BY_HANDLE_CLASS FileInformationClass, - LPVOID lpFileInformation, - DWORD dwBufferSize - ); - static pfnGetFileInformationByHandleEx pGetFileInformationByHandleEx = NULL; - if (!pGetFileInformationByHandleEx) { - pGetFileInformationByHandleEx = (pfnGetFileInformationByHandleEx) - GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetFileInformationByHandleEx"); - if (!pGetFileInformationByHandleEx) - return -1; - } - nameinfo = malloc(size); if (nameinfo == NULL) { return -1; } /* Check the name of the pipe: '\{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master' */ - if (pGetFileInformationByHandleEx(fdHandle, FileNameInfo, nameinfo, size)) { + if (GetFileInformationByHandleEx(fdHandle, FileNameInfo, nameinfo, size)) { nameinfo->FileName[nameinfo->FileNameLength / sizeof(WCHAR)] = L'\0'; p = nameinfo->FileName; //Check that the pipe name contains msys or cygwin @@ -955,9 +895,10 @@ sqInt fileHandleType(HANDLE fdHandle) { free(nameinfo); return 4; } - else + else { free(nameinfo); return 2; //else it is just a standard pipe + } } free(nameinfo); return -1; @@ -1896,10 +1837,8 @@ parseVMArgument(int argc, char *argv[]) printPhaseTime(1); return 1; } -#ifdef VISTA_SECURITY /* IE7/Vista protected mode support */ - /* started with low rights, use alternate untrustedUserDirectory */ else if (!strcmp(argv[0], VMOPTION("lowRights"))) { fLowRights = true; return 1; } -#endif /* VISTA_SECURITY */ + #if (STACKVM || NewspeakVM) && !COGVM else if (!strcmp(argv[0], VMOPTION("sendtrace"))) { extern sqInt sendTrace; sendTrace = 1; return 1; }