Skip to content

Commit

Permalink
Fix correct method being loaded when not using conptydll
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Aug 9, 2024
1 parent 8fc21c9 commit ef1cefc
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 ef1cefc

Please sign in to comment.