Skip to content

Fix correct method being loaded when not using conptydll #703

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading