1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-31 15:43:57 +00:00

1. Updated fs.readdirSync(), so when enumerating windir with a 32 bit agent on 64 bit windows, it will add 'sysnative' to the results

2. Added documentation for sysinfo
This commit is contained in:
Bryan Roe
2022-10-14 01:10:45 -07:00
parent 72de10d955
commit 62bcda48c9
2 changed files with 65 additions and 18 deletions

View File

@@ -2590,7 +2590,9 @@ void ILibDuktape_fs_PUSH(duk_context *ctx, void *chain)
exports.statSync = function statSync(pathstr) { return(this._statSync(this._fixwinpath(pathstr))); };\
exports.readdirSync = function readdirSync(pathstr)\
{\
var sysnative=false;\
pathstr = exports._fixwinpath(pathstr);\
if(require('os').arch()=='x64' && require('_GenericMarshal').PointerSize==4 && pathstr.split('\\\\*').join('').toLowerCase()==process.env['windir'].toLowerCase()) { sysnative=true; }\
if(!pathstr.endsWith('*'))\
{\
if(pathstr.endsWith('\\\\'))\
@@ -2602,7 +2604,9 @@ void ILibDuktape_fs_PUSH(duk_context *ctx, void *chain)
pathstr += '\\\\*';\
}\
}\
return(exports._readdirSync(pathstr));\
var ret = exports._readdirSync(pathstr);\
if(sysnative) { ret.push('sysnative'); }\
return(ret);\
};\
}";
ILibDuktape_ModSearch_AddHandler_AlsoIncludeJS(ctx, copyFile, sizeof(copyFile) - 1);