-
-
Notifications
You must be signed in to change notification settings - Fork 421
Conversation
|
Thanks for your pull request and interest in making D better, @etcimon! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + druntime#2940" |
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.
Please maintain the style of the existing code in contributions.
src/core/sys/windows/sdkddkver.d
Outdated
| // set _WIN32_IE based on _WIN32_WINNT | ||
| static if (_WIN32_WINNT <= _WIN32_WINNT_NT4) | ||
| enum _WIN32_IE = _WIN32_IE_IE50; | ||
| else static if (_WIN32_WINNT <= _WIN32_WINNT_WIN2K) | ||
| enum _WIN32_IE = _WIN32_IE_IE501; | ||
| else static if (_WIN32_WINNT <= _WIN32_WINNT_WINXP) | ||
| enum _WIN32_IE = _WIN32_IE_IE60; | ||
| else static if (_WIN32_WINNT <= _WIN32_WINNT_WS03) | ||
| enum _WIN32_IE = _WIN32_IE_WS03; | ||
| else static if (_WIN32_WINNT <= _WIN32_WINNT_VISTA) | ||
| enum _WIN32_IE = _WIN32_IE_LONGHORN; | ||
| else static if (_WIN32_WINNT <= _WIN32_WINNT_WIN7) | ||
| enum _WIN32_IE = _WIN32_IE_WIN7; | ||
| else static if (_WIN32_WINNT <= _WIN32_WINNT_WIN8) | ||
| enum _WIN32_IE = _WIN32_IE_WIN8; | ||
| else | ||
| enum _WIN32_IE = 0x0A00; |
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.
I think we already have this here:
druntime/src/core/sys/windows/w32api.d
Lines 48 to 84 in d7800b5
| version (IE11) { | |
| enum uint _WIN32_IE = 0xA00; | |
| } else version (IE10) { | |
| enum uint _WIN32_IE = 0xA00; | |
| } else version (IE9) { | |
| enum uint _WIN32_IE = 0x900; | |
| } else version (IE8) { | |
| enum uint _WIN32_IE = 0x800; | |
| } else version (IE7) { | |
| enum uint _WIN32_IE = 0x700; | |
| } else version (IE602) { | |
| enum uint _WIN32_IE = 0x603; | |
| } else version (IE601) { | |
| enum uint _WIN32_IE = 0x601; | |
| } else version (IE6) { | |
| enum uint _WIN32_IE = 0x600; | |
| } else version (IE56) { | |
| enum uint _WIN32_IE = 0x560; | |
| } else version (IE55) { | |
| enum uint _WIN32_IE = 0x550; | |
| } else version (IE501) { | |
| enum uint _WIN32_IE = 0x501; | |
| } else version (IE5) { | |
| enum uint _WIN32_IE = 0x500; | |
| } else version (IE401) { | |
| enum uint _WIN32_IE = 0x401; | |
| } else version (IE4) { | |
| enum uint _WIN32_IE = 0x400; | |
| } else version (IE3) { | |
| enum uint _WIN32_IE = 0x300; | |
| } else static if (_WIN32_WINNT >= 0x500) { | |
| enum uint _WIN32_IE = 0x600; | |
| } else static if (_WIN32_WINNT >= 0x410) { | |
| enum uint _WIN32_IE = 0x400; | |
| } else { | |
| enum uint _WIN32_IE = 0; | |
| } |
src/core/sys/windows/winbase.d
Outdated
| @@ -2257,7 +2257,8 @@ WINBASEAPI BOOL WINAPI SetEvent(HANDLE); | |||
| BOOL IsTextUnicode(PCVOID, int, LPINT); | |||
| BOOL IsValidAcl(PACL); | |||
| BOOL IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR); | |||
| BOOL IsValidSid(PSID); | |||
| BOOL IsValidSid(PSID); | |||
| BOOL CreateWellKnownSid(WELL_KNOWN_SID_TYPE, PSID, PSID, PDWORD); | |||
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.
Whitespace
src/core/sys/windows/winnt.d
Outdated
| @@ -2436,6 +2437,10 @@ struct TOKEN_USER { | |||
| } | |||
| alias TOKEN_USER* PTOKEN_USER; | |||
|
|
|||
| struct TOKEN_MANDATORY_LABEL { | |||
| SID_AND_ATTRIBUTES Label; | |||
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.
Whitespace. We use an indent of 4 spaces in D source code.
src/core/sys/windows/winnt.d
Outdated
| enum TOKEN_ELEVATION_TYPE { | ||
| TokenElevationTypeDefault = 1, | ||
| TokenElevationTypeFull, | ||
| TokenElevationTypeLimited |
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.
Ditto
mak/WINDOWS
Outdated
| @@ -1202,6 +1202,9 @@ $(IMPDIR)\core\sys\windows\rpcnterr.d : src\core\sys\windows\rpcnterr.d | |||
|
|
|||
| $(IMPDIR)\core\sys\windows\schannel.d : src\core\sys\windows\schannel.d | |||
| copy $** $@ | |||
|
|
|||
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.
Please remove the tab character from this line. Trailing whitespace is not allowed by CI rules.
7c72c4d to
e40186e
Compare
src/core/sys/windows/winbase.d
Outdated
| @@ -2257,7 +2257,8 @@ WINBASEAPI BOOL WINAPI SetEvent(HANDLE); | |||
| BOOL IsTextUnicode(PCVOID, int, LPINT); | |||
| BOOL IsValidAcl(PACL); | |||
| BOOL IsValidSecurityDescriptor(PSECURITY_DESCRIPTOR); | |||
| BOOL IsValidSid(PSID); | |||
| BOOL IsValidSid(PSID); | |||
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.
Trailing whitespace, here and elsewhere (see CI log).
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.
Diff LGTM but as previously mentioned in the other PRs, please improve the commit message. It should briefly describe the changes and mention a Bugzilla issue number. See @dlang-bot 's message above and the contributing guide for details.
|
I don't have a bugzilla number though, any chance I could get this merged anyways? |
Just create an issue. This is one of two ways that changes get publicly documented (which all non-trivial ones should be). The other way is generally left for bigger changes, as they get a better spot in the changelog.
No, but I can finish the rest for you if you like. |
To test this, I used the some D translation I made of this code: https://github.com/modzero/fix-windows-privacy/blob/master/fix-privacy-base/SelfElevate.cpp How would I go making an issue without copying my D version of it? |
|
The issue only needs to hold a short description of the goal that this PR aims to achieve. You could add more details such as your motivation for pursuing said goal, or include D code that currently doesn't work but you wish will work, but it's not necessary. The goal is that D users who read the changelog would have something to click and read in order to understand why the change was performed and what the benefit that it brought to D was. |
|
The relevant issue has been added: https://issues.dlang.org/show_bug.cgi?id=20577 |
|
Great. Now you need to edit the commit message (not PR title/description) to reference the issue number. E.g. you could use: |
|
Should I use the issue number in the commit description as well? Or just the title of the PR is fine? Edit: nvm |
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.
Nit, commit messages should be wrapped at 60-80 characters. (https://chris.beams.io/posts/git-commit/ and elsewhere)
Add extern(Windows) symbols and types related to Windows UAC elevation and improve related types and enums.
Merge of #2937 #2938 #2939