node-pty 1.1.0-beta17 → 1.1.0-beta18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/win/conpty.cc +12 -8
package/package.json
CHANGED
package/src/win/conpty.cc
CHANGED
|
@@ -171,20 +171,24 @@ HANDLE LoadConptyDll(const Napi::CallbackInfo& info,
|
|
|
171
171
|
return LoadLibraryExW(L"kernel32.dll", 0, 0);
|
|
172
172
|
}
|
|
173
173
|
wchar_t currentDir[MAX_PATH];
|
|
174
|
-
|
|
174
|
+
HMODULE hModule = GetModuleHandleA("conpty.node");
|
|
175
|
+
if (hModule == NULL) {
|
|
176
|
+
throw errorWithCode(info, "Failed to get conpty.node module handle");
|
|
177
|
+
}
|
|
178
|
+
DWORD result = GetModuleFileNameW(hModule, currentDir, MAX_PATH);
|
|
175
179
|
if (result == 0) {
|
|
176
|
-
throw errorWithCode(info, "Failed to get
|
|
180
|
+
throw errorWithCode(info, "Failed to get conpty.node module file name");
|
|
177
181
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
PathRemoveFileSpecW(currentDir);
|
|
183
|
+
wchar_t conptyDllPath[MAX_PATH];
|
|
184
|
+
PathCombineW(conptyDllPath, currentDir, L"conpty\\conpty.dll");
|
|
181
185
|
if (!path_util::file_exists(conptyDllPath)) {
|
|
182
|
-
std::wstring errorMessage = L"Cannot find conpty.dll at " + conptyDllPath;
|
|
183
|
-
std::string errorMessageStr(errorMessage
|
|
186
|
+
std::wstring errorMessage = L"Cannot find conpty.dll at " + std::wstring(conptyDllPath);
|
|
187
|
+
std::string errorMessageStr = path_util::wstring_to_string(errorMessage);
|
|
184
188
|
throw errorWithCode(info, errorMessageStr.c_str());
|
|
185
189
|
}
|
|
186
190
|
|
|
187
|
-
return LoadLibraryW(conptyDllPath
|
|
191
|
+
return LoadLibraryW(conptyDllPath);
|
|
188
192
|
}
|
|
189
193
|
|
|
190
194
|
HRESULT CreateNamedPipesAndPseudoConsole(const Napi::CallbackInfo& info,
|