Skip to content

Commit

Permalink
Revert "Fix environment block creation (#7401)"
Browse files Browse the repository at this point in the history
This reverts commit 7886f16.

(cherry picked from commit e46ba65)
(cherry picked from commit d1b2608)
  • Loading branch information
DHowett committed Jan 25, 2021
1 parent f3cdf68 commit 95b9b7c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/types/Environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "precomp.h"
#include "inc/Environment.hpp"
#include "wil/token_helpers.h"

using namespace ::Microsoft::Console::Utils;

Expand All @@ -15,8 +14,7 @@ using namespace ::Microsoft::Console::Utils;
EnvironmentBlockPtr Microsoft::Console::Utils::CreateEnvironmentBlock()
{
void* newEnvironmentBlock{ nullptr };
auto processToken{ wil::open_current_access_token(TOKEN_QUERY | TOKEN_DUPLICATE) };
if (!::CreateEnvironmentBlock(&newEnvironmentBlock, processToken.get(), FALSE))
if (!::CreateEnvironmentBlock(&newEnvironmentBlock, GetCurrentProcessToken(), FALSE))
{
return nullptr;
}
Expand Down

0 comments on commit 95b9b7c

Please sign in to comment.