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:
@@ -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 = {};
|
||||
|
||||
Reference in New Issue
Block a user