Skip to content

Commit

Permalink
Merge pull request microsoft#703 from microsoft/tyriar/conpty_prefix
Browse files Browse the repository at this point in the history
Fix correct method being loaded when not using conptydll
  • Loading branch information
Tyriar authored Aug 9, 2024
2 parents 8fc21c9 + ef1cefc commit 8c0a6d7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/win/conpty.cc
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,9 @@ static Napi::Value PtyResize(const Napi::CallbackInfo& info) {
bool fLoadedDll = hLibrary != nullptr;
if (fLoadedDll)
{
PFNRESIZEPSEUDOCONSOLE const pfnResizePseudoConsole = (PFNRESIZEPSEUDOCONSOLE)GetProcAddress((HMODULE)hLibrary, "ConptyResizePseudoConsole");
PFNRESIZEPSEUDOCONSOLE const pfnResizePseudoConsole = (PFNRESIZEPSEUDOCONSOLE)GetProcAddress(
(HMODULE)hLibrary,
useConptyDll ? "ConptyResizePseudoConsole" : "ResizePseudoConsole");
if (pfnResizePseudoConsole)
{
COORD size = {cols, rows};
Expand Down Expand Up @@ -491,7 +493,9 @@ static Napi::Value PtyClear(const Napi::CallbackInfo& info) {
// bool fLoadedDll = hLibrary != nullptr;
// if (fLoadedDll)
// {
// PFNCLEARPSEUDOCONSOLE const pfnClearPseudoConsole = (PFNCLEARPSEUDOCONSOLE)GetProcAddress((HMODULE)hLibrary, "ClearPseudoConsole");
// PFNCLEARPSEUDOCONSOLE const pfnClearPseudoConsole = (PFNCLEARPSEUDOCONSOLE)GetProcAddress(
// (HMODULE)hLibrary,
// useConptyDll ? "ConptyClearPseudoConsole" : "ClearPseudoConsole");
// if (pfnClearPseudoConsole)
// {
// pfnClearPseudoConsole(handle->hpc);
Expand Down Expand Up @@ -522,7 +526,9 @@ static Napi::Value PtyKill(const Napi::CallbackInfo& info) {
bool fLoadedDll = hLibrary != nullptr;
if (fLoadedDll)
{
PFNCLOSEPSEUDOCONSOLE const pfnClosePseudoConsole = (PFNCLOSEPSEUDOCONSOLE)GetProcAddress((HMODULE)hLibrary, "ConptyClosePseudoConsole");
PFNCLOSEPSEUDOCONSOLE const pfnClosePseudoConsole = (PFNCLOSEPSEUDOCONSOLE)GetProcAddress(
(HMODULE)hLibrary,
useConptyDll ? "ConptyClosePseudoConsole" : "ClosePseudoConsole");
if (pfnClosePseudoConsole)
{
pfnClosePseudoConsole(handle->hpc);
Expand Down

0 comments on commit 8c0a6d7

Please sign in to comment.