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

Fixing broken plugin lockdown check #69

Merged
merged 3 commits into from
Mar 21, 2023
Merged

Conversation

EricJohnson327
Copy link
Contributor

Summary of the pull request

Turns out GetCurrentThread() returns -2, while we want -5 or -6 (-6 is slightly better). -2 and -5 are both values for current thread pseudo-handle, but what you then use it for can make a difference. Switching to hard-coded value.

References and relevant issues

Detailed description of the pull request / Additional comments

Validation steps performed

PR checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated

@EricJohnson327
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@@ -81,16 +83,16 @@ private unsafe bool IsMicrosoftPluginHost()
return false;
}

uint a = 0;
if (PInvoke.GetPackageFamilyNameFromToken((HANDLE)(IntPtr)(-6), &a, null) != WIN32_ERROR.ERROR_INSUFFICIENT_BUFFER)
uint buffer = 0;
Copy link
Member

Choose a reason for hiding this comment

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

bufferLength ?

@EricJohnson327 EricJohnson327 merged commit ccef0d9 into main Mar 21, 2023
@crutkas crutkas deleted the user/ejohn/lockdownFix branch May 18, 2023 20:32
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.

3 participants