mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 07:43:50 +00:00
1. Updated os.Name and os.name() to fetch Windows name from older versions of Windows
2. Fixed compiler warning
This commit is contained in:
@@ -203,7 +203,6 @@ duk_ret_t ILibDuktape_ChildProcess_waitExit(duk_context *ctx)
|
|||||||
duk_put_prop_string(ctx, -2, "\xFF_WaitExit"); // [spawnedProcess]
|
duk_put_prop_string(ctx, -2, "\xFF_WaitExit"); // [spawnedProcess]
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
duk_thread_state ts;
|
|
||||||
duk_ctx_context_data(ctx)->apc_flags = 1;
|
duk_ctx_context_data(ctx)->apc_flags = 1;
|
||||||
while ((result=WaitForSingleObjectEx(eptr, duk_is_number(ctx, 0) ? duk_require_int(ctx, 0) : INFINITE, TRUE)) != WAIT_OBJECT_0 && result != WAIT_TIMEOUT);
|
while ((result=WaitForSingleObjectEx(eptr, duk_is_number(ctx, 0) ? duk_require_int(ctx, 0) : INFINITE, TRUE)) != WAIT_OBJECT_0 && result != WAIT_TIMEOUT);
|
||||||
duk_ctx_context_data(ctx)->apc_flags = 0;
|
duk_ctx_context_data(ctx)->apc_flags = 0;
|
||||||
|
|||||||
@@ -2204,7 +2204,10 @@ void ILibDuktape_ScriptContainer_OS_Push(duk_context *ctx, void *chain)
|
|||||||
winstr = require('win-registry').QueryKey(require('win-registry').HKEY.LocalMachine, 'SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion', 'ProductName') + ' - ' +\
|
winstr = require('win-registry').QueryKey(require('win-registry').HKEY.LocalMachine, 'SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion', 'ProductName') + ' - ' +\
|
||||||
require('win-registry').QueryKey(require('win-registry').HKEY.LocalMachine, 'SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion', 'ReleaseID') + ' ' + winstr.substring(winstr.indexOf('['));\
|
require('win-registry').QueryKey(require('win-registry').HKEY.LocalMachine, 'SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion', 'ReleaseID') + ' ' + winstr.substring(winstr.indexOf('['));\
|
||||||
}\
|
}\
|
||||||
catch(xx) {}\
|
catch(xx)\
|
||||||
|
{\
|
||||||
|
winstr = require('win-registry').QueryKey(require('win-registry').HKEY.LocalMachine, 'SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion', 'ProductName') + ' ' + winstr.substring(winstr.indexOf('['));\
|
||||||
|
}\
|
||||||
}\
|
}\
|
||||||
ret = winstr;\
|
ret = winstr;\
|
||||||
break;\
|
break;\
|
||||||
@@ -2282,7 +2285,10 @@ void ILibDuktape_ScriptContainer_OS_Push(duk_context *ctx, void *chain)
|
|||||||
winstr = require('win-registry').QueryKey(require('win-registry').HKEY.LocalMachine, 'SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion', 'ProductName') + ' - ' +\
|
winstr = require('win-registry').QueryKey(require('win-registry').HKEY.LocalMachine, 'SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion', 'ProductName') + ' - ' +\
|
||||||
require('win-registry').QueryKey(require('win-registry').HKEY.LocalMachine, 'SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion', 'ReleaseID') + ' ' + winstr.substring(winstr.indexOf('['));\
|
require('win-registry').QueryKey(require('win-registry').HKEY.LocalMachine, 'SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion', 'ReleaseID') + ' ' + winstr.substring(winstr.indexOf('['));\
|
||||||
}\
|
}\
|
||||||
catch(xx) {}\
|
catch(xx)\
|
||||||
|
{\
|
||||||
|
winstr = require('win-registry').QueryKey(require('win-registry').HKEY.LocalMachine, 'SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion', 'ProductName') + ' ' + winstr.substring(winstr.indexOf('['));\
|
||||||
|
}\
|
||||||
}\
|
}\
|
||||||
this.promise._acc(winstr);\
|
this.promise._acc(winstr);\
|
||||||
break;\
|
break;\
|
||||||
|
|||||||
Reference in New Issue
Block a user