From 87f830efcdb6c5ab26a295ea61077c00141b3d09 Mon Sep 17 00:00:00 2001 From: Raymond Zhao <7199958+rzhao271@users.noreply.github.com> Date: Fri, 1 Mar 2024 14:07:27 -0800 Subject: [PATCH] fix: comment out invalid API call --- src/win/conpty.cc | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/win/conpty.cc b/src/win/conpty.cc index c41796ca9..8f4d2569e 100644 --- a/src/win/conpty.cc +++ b/src/win/conpty.cc @@ -252,7 +252,7 @@ static Napi::Value PtyStartProcess(const Napi::CallbackInfo& info) { if (SUCCEEDED(hr)) { // We were able to instantiate a conpty const int ptyId = InterlockedIncrement(&ptyCounter); - marshal.Set("pty", Napi::Number::New(env, ptyId)); + marshal.Set("pty", Napi::Number::New(env, ptyId)); ptyHandles.insert(ptyHandles.end(), new pty_baton(ptyId, hIn, hOut, hpc)); } else { throw Napi::Error::New(env, "Cannot launch conpty"); @@ -429,22 +429,22 @@ static Napi::Value PtyClear(const Napi::CallbackInfo& info) { throw Napi::Error::New(env, "Usage: pty.clear(id)"); } - int id = info[0].As().Int32Value(); - - const pty_baton* handle = get_pty_baton(id); - - if (handle != nullptr) { - HANDLE hLibrary = LoadLibraryExW(L"kernel32.dll", 0, 0); - bool fLoadedDll = hLibrary != nullptr; - if (fLoadedDll) - { - PFNCLEARPSEUDOCONSOLE const pfnClearPseudoConsole = (PFNCLEARPSEUDOCONSOLE)GetProcAddress((HMODULE)hLibrary, "ClearPseudoConsole"); - if (pfnClearPseudoConsole) - { - pfnClearPseudoConsole(handle->hpc); - } - } - } + // int id = info[0].As().Int32Value(); + + // const pty_baton* handle = get_pty_baton(id); + + // if (handle != nullptr) { + // HANDLE hLibrary = LoadLibraryExW(L"kernel32.dll", 0, 0); + // bool fLoadedDll = hLibrary != nullptr; + // if (fLoadedDll) + // { + // PFNCLEARPSEUDOCONSOLE const pfnClearPseudoConsole = (PFNCLEARPSEUDOCONSOLE)GetProcAddress((HMODULE)hLibrary, "ClearPseudoConsole"); + // if (pfnClearPseudoConsole) + // { + // pfnClearPseudoConsole(handle->hpc); + // } + // } + // } return env.Undefined(); }