1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-10 21:33:38 +00:00

1. Added process.pid on windows

2. Added user-sessions.consoleUid() on windows
3. updated message-box to dispatch to consoleUid when necessary on Windows
This commit is contained in:
Bryan Roe
2019-05-17 14:23:51 -07:00
parent 26d86ce449
commit 1fc476d31e
4 changed files with 41 additions and 11 deletions

View File

@@ -90,6 +90,7 @@ function UserSessions()
this._marshal = require('_GenericMarshal');
this._kernel32 = this._marshal.CreateNativeProxy('Kernel32.dll');
this._kernel32.CreateMethod('GetLastError');
this._kernel32.CreateMethod('WTSGetActiveConsoleSessionId')
try
{
@@ -202,7 +203,12 @@ function UserSessions()
this._wts.WTSFreeMemory(buffer.Deref());
return (retVal);
};
this.consoleUid = function consoleUid()
{
var id = this._kernel32.WTSGetActiveConsoleSessionId().Val;
if(id==0xFFFFFFFF) {throw('Nobody logged in');}
return (id);
};
this.Current = function Current(cb)
{
var retVal = {};