Create winlibs.js

This commit is contained in:
Namhyeon Go 2020-07-26 05:33:42 +09:00 committed by GitHub
parent 8033688c63
commit 9db9f4d4eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

23
lib/winlibs.js Normal file
View File

@ -0,0 +1,23 @@
////////////////////////////////////////////////////////////////////////
// Windows Library API
////////////////////////////////////////////////////////////////////////
var SHELL = require("lib/shell");
exports.loadLibrary = function(LIB) {
return {
call: function(FN, args) {
var commandOptions = [];
if (typeof(FN) === "undefined") {
FN = "DllMain";
}
commandOptions.push("rundll32.exe");
commandOptions.push(LIB + ".dll," + FN);
commandOptions.push(args.join(' '));
return SHELL.exec(commandOptions.join(' '));
}
};
};