Update winlibs.js

This commit is contained in:
Namhyeon Go 2020-07-26 20:46:46 +09:00
parent a2c475a89a
commit aaacd28dbe

View File

@ -11,19 +11,17 @@ var SHELL = require("lib/shell");
exports.loadLibrary = function(LIB) { exports.loadLibrary = function(LIB) {
return { return {
call: function(FN, args) { call: function(FN, args) {
var commandOptions = []; var cmd = [
"rundll32.exe"
];
if (typeof(FN) === "undefined") { if (typeof(FN) === "undefined") {
FN = "DllMain"; FN = "DllMain";
} }
cmd.push(LIB + ".dll," + FN);
commandOptions.push("rundll32.exe");
commandOptions.push(LIB + ".dll," + FN);
if (typeof(args) !== "undefined") { if (typeof(args) !== "undefined") {
commandOptions.push("\"" + args.join("\" \"") + "\""); cmd = cmd.concat(args);
} }
return SHELL.exec(cmd);
return SHELL.exec(commandOptions.join(' '));
} }
}; };
}; };