1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-28 22:23:17 +00:00

1. Added usernameToUserKey() to win-registry

2. Added getRawSessionAttribute() to user-sessions for Windows
This commit is contained in:
Bryan Roe
2019-11-05 13:35:49 -08:00
parent 6e9b165452
commit 9a84f82a50
3 changed files with 42 additions and 8 deletions

View File

@@ -249,6 +249,22 @@ function UserSessions()
return (ret);
};
this.getRawSessionAttribute = function getRawSessionAttribute(sessionId, attr)
{
var buffer = this._marshal.CreatePointer();
var bytesReturned = this._marshal.CreateVariable(4);
if (this._wts.WTSQuerySessionInformationW(0, sessionId, attr, buffer, bytesReturned).Val == 0)
{
throw ('Error calling WTSQuerySessionInformationW: ' + this._kernel32.GetLastError.Val);
}
var b = buffer.Deref().Deref(0, bytesReturned.toBuffer().readUInt32LE()).toBuffer();
var ret = Buffer.alloc(bytesReturned.toBuffer().readUInt32LE());
b.copy(ret);
this._wts.WTSFreeMemory(buffer.Deref());
return (ret);
}
this.getSessionAttribute = function getSessionAttribute(sessionId, attr)
{
var buffer = this._marshal.CreatePointer();