-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump minimal supported Windows version to Windows Vista (0x0600). #499
Open
marceltaeumel
wants to merge
4
commits into
OpenSmalltalk:Cog
Choose a base branch
from
marceltaeumel:marceltaeumel/patch-1
base: Cog
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
fbedb8e
Bump minimal supported Windows version to Windows 8 (0x0602).
marceltaeumel eae037b
Merge branch 'Cog' into marceltaeumel/patch-1
marceltaeumel 14e3dd2
Revert alloca to malloc
marceltaeumel 7c8bea5
Bump min. supported version to Windows Vista (0x0600) instead of Wind…
marceltaeumel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,55 +38,11 @@ | |
# endif | ||
#endif | ||
|
||
|
||
/************************************************************************************************************/ | ||
/* few addtional definitions for those having older include files especially #include <fileextd.h> */ | ||
/************************************************************************************************************/ | ||
#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 <winnt.h> | ||
#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 */ | ||
|
@@ -925,41 +879,20 @@ sqInt fileHandleType(HANDLE fdHandle) { | |
int size = sizeof(FILE_NAME_INFO) + sizeof(WCHAR) * MAX_PATH; | ||
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; | ||
} | ||
nameinfo = alloca(size); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not, alloca is a bit shorter, but the pairs of malloc and free seems correct here... |
||
/* 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 | ||
if ((((wcsstr(p, L"msys-") || wcsstr(p, L"cygwin-"))) && | ||
(wcsstr(p, L"-pty") && wcsstr(p, L"-master")))) { | ||
//The openned pipe is a msys xor cygwin pipe to pty | ||
free(nameinfo); | ||
return 4; | ||
} | ||
else | ||
free(nameinfo); | ||
return 2; //else it is just a standard pipe | ||
} | ||
free(nameinfo); | ||
return -1; | ||
} | ||
|
||
|
@@ -1896,10 +1829,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; } | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As suggested on the mailing list, I would just use 0x0600
See also https://docs.microsoft.com/en-us/cpp/porting/modifying-winver-and-win32-winnt?view=vs-2019 for the list of _WIN32_WINNT version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would you feel about setting minimum supported version to 8.0? I want to do this because of the GetSystemTimePreciseAsFileTime function, which appears in 8.0 nd neatly solves the time issues in the win32 VM (use of the millisecond clock to derive greater precision than the 15ms tick in GetSystemTimeAsFileTime causes significant direct over the course of several days).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can have
0x6000
(Vista) and use that function. Ping me in a week or so, when I'm back from vacation