mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-08 19:44:06 +00:00
Added support to lock local input on windows
This commit is contained in:
@@ -374,6 +374,7 @@ void CheckDesktopSwitch(int checkres, ILibKVM_WriteHandler writeHandler, void *r
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char g_blockinput = 0;
|
||||
|
||||
// Feed network data into the KVM. Return the number of bytes consumed.
|
||||
// This method consumes a single command.
|
||||
@@ -399,6 +400,38 @@ int kvm_server_inputdata(char* block, int blocklen, ILibKVM_WriteHandler writeHa
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case MNG_KVM_INPUT_LOCK:
|
||||
// 0 = unlock
|
||||
// 1 = lock
|
||||
// 2 = query
|
||||
if (size == 5)
|
||||
{
|
||||
switch (block[4])
|
||||
{
|
||||
case 0:
|
||||
g_blockinput = 0;
|
||||
BlockInput(0);
|
||||
break;
|
||||
case 1:
|
||||
g_blockinput = 1;
|
||||
BlockInput(1);
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
default:
|
||||
return(size);
|
||||
break;
|
||||
}
|
||||
|
||||
unsigned char buffer[5];
|
||||
((unsigned short*)buffer)[0] = (unsigned short)htons((unsigned short)MNG_KVM_INPUT_LOCK); // Write the type
|
||||
((unsigned short*)buffer)[1] = (unsigned short)htons((unsigned short)5); // Write the size
|
||||
buffer[4] = g_blockinput; // status
|
||||
|
||||
writeHandler((char*)buffer, 5, reserved);
|
||||
}
|
||||
|
||||
break;
|
||||
case MNG_KVM_KEY: // Key
|
||||
{
|
||||
if (size != 6) break;
|
||||
|
||||
@@ -23,6 +23,7 @@ limitations under the License.
|
||||
|
||||
typedef enum RemoteManagementCommands
|
||||
{
|
||||
MNG_KVM_INPUT_LOCK = 87,
|
||||
MNG_KVM_NOP = 0,
|
||||
MNG_KVM_KEY = 1,
|
||||
MNG_KVM_KEY_UNICODE = 85,
|
||||
|
||||
Reference in New Issue
Block a user