koffi 2.5.18-beta.1 → 2.5.18-beta.3

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.
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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koffi",
3
- "version": "2.5.18-beta.1",
3
+ "version": "2.5.18-beta.3",
4
4
  "stable": "2.5.16",
5
5
  "description": "Fast and simple C FFI (foreign function interface) for Node.js",
6
6
  "keywords": [
@@ -29,18 +29,21 @@
29
29
  #include <windows.h>
30
30
  #include <delayimp.h>
31
31
 
32
+ static HMODULE node_dll;
33
+
32
34
  static FARPROC WINAPI self_exe_hook(unsigned int event, DelayLoadInfo *info)
33
35
  {
34
- if (event == dliNotePreLoadLibrary && !stricmp(info->szDll, "node.exe")) {
35
- if (GetModuleHandleW(L"nw.dll")) {
36
- HMODULE h = GetModuleHandleW(L"node.dll");
37
- return (FARPROC)h;
38
- } else {
39
- HMODULE h = GetModuleHandleW(NULL);
40
- return (FARPROC)h;
36
+ if (event == dliStartProcessing) {
37
+ node_dll = GetModuleHandleA("node.dll");
38
+ if (!node_dll) {
39
+ node_dll = GetModuleHandle(NULL);
41
40
  }
41
+ return NULL;
42
42
  }
43
43
 
44
+ if (event == dliNotePreLoadLibrary && !stricmp(info->szDll, "node.exe"))
45
+ return (FARPROC)node_dll;
46
+
44
47
  return NULL;
45
48
  }
46
49
 
package/src/index.js CHANGED
@@ -4,9 +4,9 @@ var __commonJS = (cb, mod) => function __require() {
4
4
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
5
5
  };
6
6
 
7
- // build/dist/src/cnoke/src/tools.js
7
+ // src/cnoke/src/tools.js
8
8
  var require_tools = __commonJS({
9
- "build/dist/src/cnoke/src/tools.js"(exports2, module2) {
9
+ "src/cnoke/src/tools.js"(exports2, module2) {
10
10
  "use strict";
11
11
  var crypto = require("crypto");
12
12
  var fs2 = require("fs");
@@ -373,12 +373,12 @@ var require_tools = __commonJS({
373
373
  }
374
374
  });
375
375
 
376
- // build/dist/src/koffi/package.json
376
+ // src/koffi/package.json
377
377
  var require_package = __commonJS({
378
- "build/dist/src/koffi/package.json"(exports2, module2) {
378
+ "src/koffi/package.json"(exports2, module2) {
379
379
  module2.exports = {
380
380
  name: "koffi",
381
- version: "2.5.18-beta.1",
381
+ version: "2.5.18-beta.3",
382
382
  stable: "2.5.16",
383
383
  description: "Fast and simple C FFI (foreign function interface) for Node.js",
384
384
  keywords: [
@@ -429,7 +429,7 @@ var require_package = __commonJS({
429
429
  }
430
430
  });
431
431
 
432
- // build/dist/src/koffi/src/index.js
432
+ // src/koffi/src/index.js
433
433
  var util = require("util");
434
434
  var fs = require("fs");
435
435
  var { get_napi_version, determine_arch } = require_tools();