koffi 2.6.8 → 2.6.9
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/CHANGELOG.md +6 -2
- package/build/koffi/darwin_arm64/koffi.node +0 -0
- package/build/koffi/darwin_x64/koffi.node +0 -0
- package/build/koffi/freebsd_arm64/koffi.node +0 -0
- package/build/koffi/freebsd_ia32/koffi.node +0 -0
- package/build/koffi/freebsd_x64/koffi.node +0 -0
- package/build/koffi/linux_arm32hf/koffi.node +0 -0
- package/build/koffi/linux_arm64/koffi.node +0 -0
- package/build/koffi/linux_ia32/koffi.node +0 -0
- package/build/koffi/linux_riscv64hf64/koffi.node +0 -0
- package/build/koffi/linux_x64/koffi.node +0 -0
- package/build/koffi/openbsd_ia32/koffi.node +0 -0
- package/build/koffi/openbsd_x64/koffi.node +0 -0
- package/build/koffi/win32_arm64/koffi.node +0 -0
- package/build/koffi/win32_ia32/koffi.node +0 -0
- package/build/koffi/win32_x64/koffi.node +0 -0
- package/index.js +2 -2
- package/indirect.js +2 -2
- package/package.json +2 -2
- package/src/koffi/src/ffi.cc +16 -7
package/CHANGELOG.md
CHANGED
|
@@ -4,13 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
### Koffi 2.6
|
|
6
6
|
|
|
7
|
-
#### Koffi 2.6.
|
|
7
|
+
#### Koffi 2.6.9 (2023-11-25)
|
|
8
8
|
|
|
9
9
|
- Search in DLL directory for additional dependencies on Windows
|
|
10
10
|
- Ignore prototype properties when making structs or unions
|
|
11
11
|
- Show detected version of Node when not adequate
|
|
12
12
|
- Minor documentation fixes
|
|
13
13
|
|
|
14
|
+
```{warning}
|
|
15
|
+
Loading Win32 system libraries can fail in Koffi 2.6.8, skip this version.
|
|
16
|
+
```
|
|
17
|
+
|
|
14
18
|
#### Koffi 2.6.6 (2023-10-28)
|
|
15
19
|
|
|
16
20
|
- Better handle errors while making struct or union types
|
|
@@ -280,7 +284,7 @@ Pre-built binaries don't work correctly in Koffi 2.5.13 to 2.5.15, skip those ve
|
|
|
280
284
|
- Avoid CNoke dependency
|
|
281
285
|
- Clear out development dependencies from package.json
|
|
282
286
|
|
|
283
|
-
#### Koffi 2.3.1 (2023-01-
|
|
287
|
+
#### Koffi 2.3.1 (2023-01-30)
|
|
284
288
|
|
|
285
289
|
- Error out when trying to use ambiguous `void *` arguments (input and/or output)
|
|
286
290
|
- Adjust TypeScript definitions ([@insraq](https://github.com/insraq))
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/index.js
CHANGED
|
@@ -378,8 +378,8 @@ var require_package = __commonJS({
|
|
|
378
378
|
"build/dist/src/koffi/package.json"(exports2, module2) {
|
|
379
379
|
module2.exports = {
|
|
380
380
|
name: "koffi",
|
|
381
|
-
version: "2.6.
|
|
382
|
-
stable: "2.6.
|
|
381
|
+
version: "2.6.9",
|
|
382
|
+
stable: "2.6.9",
|
|
383
383
|
description: "Fast and simple C FFI (foreign function interface) for Node.js",
|
|
384
384
|
keywords: [
|
|
385
385
|
"foreign",
|
package/indirect.js
CHANGED
|
@@ -378,8 +378,8 @@ var require_package = __commonJS({
|
|
|
378
378
|
"build/dist/src/koffi/package.json"(exports2, module2) {
|
|
379
379
|
module2.exports = {
|
|
380
380
|
name: "koffi",
|
|
381
|
-
version: "2.6.
|
|
382
|
-
stable: "2.6.
|
|
381
|
+
version: "2.6.9",
|
|
382
|
+
stable: "2.6.9",
|
|
383
383
|
description: "Fast and simple C FFI (foreign function interface) for Node.js",
|
|
384
384
|
keywords: [
|
|
385
385
|
"foreign",
|
package/package.json
CHANGED
package/src/koffi/src/ffi.cc
CHANGED
|
@@ -1640,19 +1640,28 @@ static Napi::Value UnloadLibrary(const Napi::CallbackInfo &info)
|
|
|
1640
1640
|
}
|
|
1641
1641
|
|
|
1642
1642
|
#ifdef _WIN32
|
|
1643
|
-
static HANDLE LoadWindowsLibrary(Napi::Env env, const char
|
|
1643
|
+
static HANDLE LoadWindowsLibrary(Napi::Env env, Span<const char> path)
|
|
1644
1644
|
{
|
|
1645
1645
|
BlockAllocator temp_alloc;
|
|
1646
1646
|
|
|
1647
|
-
|
|
1647
|
+
Span<wchar_t> filename_w = AllocateSpan<wchar_t>(&temp_alloc, path.len + 1);
|
|
1648
1648
|
|
|
1649
|
-
|
|
1650
|
-
Span<wchar_t> filename_w = AllocateSpan<wchar_t>(&temp_alloc, filename.len + 1);
|
|
1651
|
-
|
|
1652
|
-
if (ConvertUtf8ToWin32Wide(filename, filename_w) < 0)
|
|
1649
|
+
if (ConvertUtf8ToWin32Wide(path, filename_w) < 0)
|
|
1653
1650
|
return nullptr;
|
|
1654
1651
|
|
|
1655
|
-
HMODULE module =
|
|
1652
|
+
HMODULE module = LoadLibraryW(filename_w.ptr);
|
|
1653
|
+
|
|
1654
|
+
if (!module) {
|
|
1655
|
+
DWORD flags = LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR;
|
|
1656
|
+
|
|
1657
|
+
Span<const char> filename = NormalizePath(path, GetWorkingDirectory(), &temp_alloc);
|
|
1658
|
+
Span<wchar_t> filename_w = AllocateSpan<wchar_t>(&temp_alloc, filename.len + 1);
|
|
1659
|
+
|
|
1660
|
+
if (ConvertUtf8ToWin32Wide(filename, filename_w) < 0)
|
|
1661
|
+
return nullptr;
|
|
1662
|
+
|
|
1663
|
+
module = LoadLibraryExW(filename_w.ptr, nullptr, flags);
|
|
1664
|
+
}
|
|
1656
1665
|
|
|
1657
1666
|
if (!module) {
|
|
1658
1667
|
if (GetLastError() == ERROR_BAD_EXE_FORMAT) {
|