Skip to content
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

Bugfix #960

Closed
wants to merge 9 commits into from
Closed

Bugfix #960

wants to merge 9 commits into from

Conversation

wendig0x
Copy link
Contributor

Some performance fixes and check return value of StringFromGUID2

minor bugfixes
GlobalMemoryStatus deprecated in x64
Some perfomance fixes and check return value of StringFromGUID2
@wendig0x wendig0x closed this Aug 25, 2022
@wendig0x wendig0x deleted the bugfix branch August 25, 2022 16:56
@wendig0x wendig0x restored the bugfix branch August 25, 2022 17:00
@wendig0x wendig0x reopened this Aug 25, 2022
@andreas-becker
Copy link
Contributor

@wendig0x, please fix the conflicts.

@wendig0x
Copy link
Contributor Author

wendig0x commented Jan 3, 2023

@andreas-becker done

Copy link
Contributor

@alt3r-3go alt3r-3go left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Halfway through the review I realized that some of the commits included into this PR were already separately merged in #950, but I decided to leave my comments in place, as they are still relevant in my opinion, even if late.

One general comment I have is that the commit messages are relatively low-information, so even though VC as a project doesn't have formal rules for those, I'd suggest to rework them in accordance with well-established recommendations (e.g. see here, but there are many summaries by now) and maybe consider splitting some of the commits to make them single-purpose/change, or more atomic.

.gitignore Outdated Show resolved Hide resolved
src/Common/Dlgcode.c Outdated Show resolved Hide resolved
src/Common/Dlgcode.c Outdated Show resolved Hide resolved
src/Common/Dlgcode.c Outdated Show resolved Hide resolved
src/Common/BootEncryption.cpp Outdated Show resolved Hide resolved
src/Common/BootEncryption.cpp Outdated Show resolved Hide resolved
src/Common/BootEncryption.cpp Show resolved Hide resolved
.gitignore Outdated Show resolved Hide resolved
@wendig0x
Copy link
Contributor Author

wendig0x commented Jan 8, 2023

@alt3r-3go Thanks for the great code review! I'm a little busy at the moment, I'll add comments and corrections later.

Copy link
Contributor

@alt3r-3go alt3r-3go left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes, we're getting closer to it :) Please see my inline comments though, there are still some things to address.

Comment on lines +14556 to +14563
if (!AdjustTokenPrivileges(hThreadToken, FALSE, &tkp, 0, NULL, NULL))
{
dwLastErr = GetLastError();
goto cleanup;
}
if (GetLastError() == ERROR_NOT_ALL_ASSIGNED)
{
dwLastErr = ERROR_NOT_ALL_ASSIGNED;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are not really necessary, the previous logic covered all the error paths and did it more concisely at that.

@@ -14552,10 +14553,14 @@ static bool RunAsDesktopUser(
goto cleanup;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My previous comment about thise piece of code is still not resolved. dwLastError needs to be set in case of such an early exit, for the cleanup logic around SetLastError() to work properly.

Comment on lines -1 to -2
# For those using Visual Studio Code for development
.vscode/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file must not be removed from the version control. If you meant to keep your changes to it (in those vcxproj files, per my earlier review comment) locally, then just don't include it into your commit (skip during git add).

@@ -15263,7 +15268,7 @@ void PasswordEditDropTarget::GotLeave(void)
DWORD PasswordEditDropTarget::GotEnter(void)
{
TCHAR szClassName[64];
DWORD dwStyles;
LONG_PTR dwStyles;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this. There's another one in ::GotDrop further below, still not fixed.

#endif // VC_COMREG
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this irrelevant whitespace change to avoid polluting the change history.

Comment on lines +4700 to +4701
DWORD str_input = strlen(input);
DWORD str_mszDest = strlen(mszDest);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two still have snake case (or even a mixed one for str_mszDest), so my previous comment about variable name casing is still actual. Moreover, the naming of those variables is still misleading (str_input suggests it's a "string of something we got as an input" or some such, and this is not the case). Using len prefix for the app name string length was good, so I'd suggest to do the same here.

In addition I did not repeat the comment for other variables and files for brevity in my previous review, but it's also applicable to other changes in this PR (e.g. str_len introduced in Dlgcode.c) - please correct them all.

src/Common/BootEncryption.cpp Show resolved Hide resolved
@DLL125
Copy link
Contributor

DLL125 commented Jun 28, 2023

@wendig0x
Are you still working on these?

@wendig0x wendig0x closed this Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants