mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 07:43:50 +00:00
Added support for mesage-box to display on lock/login screen on Windows
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -156,9 +156,16 @@ function childContainer()
|
|||||||
if ((tsid = require('user-sessions').getProcessOwnerName(process.pid).tsid) == 0)
|
if ((tsid = require('user-sessions').getProcessOwnerName(process.pid).tsid) == 0)
|
||||||
{
|
{
|
||||||
// We are running as LocalSystem
|
// We are running as LocalSystem
|
||||||
|
if (process.platform == 'win32' && options.uid == -1)
|
||||||
|
{
|
||||||
|
child_options.type = require('child_process').SpawnTypes.WINLOGON;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
child_options.uid = options.uid;
|
child_options.uid = options.uid;
|
||||||
child_options.type = require('child_process').SpawnTypes.USER;
|
child_options.type = require('child_process').SpawnTypes.USER;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// We won't be able to switch session IDs, so check to make sure we are running as this sid
|
// We won't be able to switch session IDs, so check to make sure we are running as this sid
|
||||||
|
|||||||
@@ -69,12 +69,20 @@ function messageBox()
|
|||||||
{
|
{
|
||||||
ret.options.uid = sid == null ? require('user-sessions').consoleUid() : sid;
|
ret.options.uid = sid == null ? require('user-sessions').consoleUid() : sid;
|
||||||
if (ret.options.uid == require('user-sessions').getProcessOwnerName(process.pid).tsid) { delete ret.options.uid; }
|
if (ret.options.uid == require('user-sessions').getProcessOwnerName(process.pid).tsid) { delete ret.options.uid; }
|
||||||
|
if (sid == null && require('user-sessions').locked()) { ret.options.uid = -1; }
|
||||||
}
|
}
|
||||||
catch (ee)
|
catch (ee)
|
||||||
{
|
{
|
||||||
ret._rej('No logged on users');
|
if (sid == null)
|
||||||
|
{
|
||||||
|
ret.options.uid = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ret._rej(ee);
|
||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ret._ipc = require('child-container').create(ret.options);
|
ret._ipc = require('child-container').create(ret.options);
|
||||||
ret._ipc.master = ret;
|
ret._ipc.master = ret;
|
||||||
|
|||||||
@@ -65,7 +65,12 @@ function UserSessions()
|
|||||||
require('events').EventEmitter.call(this, true)
|
require('events').EventEmitter.call(this, true)
|
||||||
.createEvent('changed')
|
.createEvent('changed')
|
||||||
.createEvent('locked')
|
.createEvent('locked')
|
||||||
.createEvent('unlocked');
|
.createEvent('unlocked')
|
||||||
|
.addMethod('locked', function () { return (this._locked); })
|
||||||
|
.addMethod('unlocked', function () { return (!this._locked); });
|
||||||
|
this._locked = false;
|
||||||
|
this.on('locked', function () { this._locked = true; });
|
||||||
|
this.on('unlocked', function () { this._locked = false; });
|
||||||
|
|
||||||
if (process.platform == 'win32')
|
if (process.platform == 'win32')
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user