mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-10 21:33:38 +00:00
1. Added ability to get/set remote mouse render
2. Fixed remoteMouseRender flag for Windows
This commit is contained in:
@@ -1189,9 +1189,21 @@ void kvm_relay_StdErrHandler(ILibProcessPipe_Process sender, char *buffer, int b
|
|||||||
|
|
||||||
int kvm_relay_restart(int paused, void *pipeMgr, char *exePath, ILibKVM_WriteHandler writeHandler, void *reserved)
|
int kvm_relay_restart(int paused, void *pipeMgr, char *exePath, ILibKVM_WriteHandler writeHandler, void *reserved)
|
||||||
{
|
{
|
||||||
char * parms0[] = { " -kvm0", g_ILibCrashDump_path != NULL ? "-coredump" : NULL, NULL };
|
char * parms0[] = { " -kvm0", g_ILibCrashDump_path != NULL ? "-coredump" : NULL, NULL, NULL };
|
||||||
char * parms1[] = { " -kvm1", g_ILibCrashDump_path != NULL ? "-coredump" : NULL, NULL };
|
char * parms1[] = { " -kvm1", g_ILibCrashDump_path != NULL ? "-coredump" : NULL, NULL, NULL };
|
||||||
void **user = (void**)ILibMemory_Allocate(4 * sizeof(void*), 0, NULL, NULL);
|
void **user = (void**)ILibMemory_Allocate(4 * sizeof(void*), 0, NULL, NULL);
|
||||||
|
|
||||||
|
if (parms0[1] == NULL)
|
||||||
|
{
|
||||||
|
parms0[1] = (gRemoteMouseRenderDefault != 0 ? "-remotecursor" : NULL);
|
||||||
|
parms1[1] = (gRemoteMouseRenderDefault != 0 ? "-remotecursor" : NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
parms0[2] = (gRemoteMouseRenderDefault != 0 ? "-remotecursor" : NULL);
|
||||||
|
parms1[2] = (gRemoteMouseRenderDefault != 0 ? "-remotecursor" : NULL);
|
||||||
|
}
|
||||||
|
|
||||||
user[0] = writeHandler;
|
user[0] = writeHandler;
|
||||||
user[1] = reserved;
|
user[1] = reserved;
|
||||||
user[2] = pipeMgr;
|
user[2] = pipeMgr;
|
||||||
|
|||||||
@@ -1804,6 +1804,18 @@ duk_ret_t ILibDuktape_MeshAgent_getStartupOptions(duk_context *ctx)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
duk_ret_t ILibDuktape_MeshAgent_remoteMouseRender_get(duk_context *ctx)
|
||||||
|
{
|
||||||
|
duk_push_int(ctx, gRemoteMouseRenderDefault);
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
duk_ret_t ILibDuktape_MeshAgent_remoteMouseRender_set(duk_context *ctx)
|
||||||
|
{
|
||||||
|
gRemoteMouseRenderDefault = duk_require_int(ctx, 0);
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
void ILibDuktape_MeshAgent_PUSH(duk_context *ctx, void *chain)
|
void ILibDuktape_MeshAgent_PUSH(duk_context *ctx, void *chain)
|
||||||
{
|
{
|
||||||
MeshAgentHostContainer *agent;
|
MeshAgentHostContainer *agent;
|
||||||
@@ -1879,6 +1891,9 @@ void ILibDuktape_MeshAgent_PUSH(duk_context *ctx, void *chain)
|
|||||||
#ifdef _LINKVM
|
#ifdef _LINKVM
|
||||||
ILibDuktape_CreateReadonlyProperty_int(ctx, "hasKVM", 1);
|
ILibDuktape_CreateReadonlyProperty_int(ctx, "hasKVM", 1);
|
||||||
ILibDuktape_EventEmitter_CreateEventEx(emitter, "kvmConnected");
|
ILibDuktape_EventEmitter_CreateEventEx(emitter, "kvmConnected");
|
||||||
|
|
||||||
|
ILibDuktape_CreateEventWithGetterAndSetterEx(ctx, "remoteMouseRender", ILibDuktape_MeshAgent_remoteMouseRender_get, ILibDuktape_MeshAgent_remoteMouseRender_set);
|
||||||
|
|
||||||
#if defined(_POSIX) && !defined(__APPLE__)
|
#if defined(_POSIX) && !defined(__APPLE__)
|
||||||
ILibDuktape_CreateInstanceMethod(ctx, "enableKvmSlaveLog", ILibDuktape_MeshAgent_enableKvmSlaveLog, 1);
|
ILibDuktape_CreateInstanceMethod(ctx, "enableKvmSlaveLog", ILibDuktape_MeshAgent_enableKvmSlaveLog, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ INT_PTR CALLBACK DialogHandler(HWND, UINT, WPARAM, LPARAM);
|
|||||||
MeshAgentHostContainer *agent = NULL;
|
MeshAgentHostContainer *agent = NULL;
|
||||||
DWORD g_serviceArgc;
|
DWORD g_serviceArgc;
|
||||||
char **g_serviceArgv;
|
char **g_serviceArgv;
|
||||||
|
extern int gRemoteMouseRenderDefault;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
extern int g_TrustedHashSet;
|
extern int g_TrustedHashSet;
|
||||||
@@ -1109,6 +1111,11 @@ int wmain(int argc, char* wargv[])
|
|||||||
parm[0] = kvm_serviceWriteSink;
|
parm[0] = kvm_serviceWriteSink;
|
||||||
((int*)&(parm[2]))[0] = 0;
|
((int*)&(parm[2]))[0] = 0;
|
||||||
((int*)&(parm[3]))[0] = (argc > 2 && strcasecmp(argv[2], "-coredump") == 0) ? 1 : 0;
|
((int*)&(parm[3]))[0] = (argc > 2 && strcasecmp(argv[2], "-coredump") == 0) ? 1 : 0;
|
||||||
|
if ((argc > 2 && strcasecmp(argv[2], "-remotecursor") == 0) ||
|
||||||
|
(argc > 3 && strcasecmp(argv[3], "-remotecursor") == 0))
|
||||||
|
{
|
||||||
|
gRemoteMouseRenderDefault = 1;
|
||||||
|
}
|
||||||
|
|
||||||
HMODULE shCORE = LoadLibraryExA((LPCSTR)"Shcore.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
HMODULE shCORE = LoadLibraryExA((LPCSTR)"Shcore.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||||
DpiAwarenessFunc dpiAwareness = NULL;
|
DpiAwarenessFunc dpiAwareness = NULL;
|
||||||
@@ -1141,6 +1148,11 @@ int wmain(int argc, char* wargv[])
|
|||||||
parm[0] = kvm_serviceWriteSink;
|
parm[0] = kvm_serviceWriteSink;
|
||||||
((int*)&(parm[2]))[0] = 1;
|
((int*)&(parm[2]))[0] = 1;
|
||||||
((int*)&(parm[3]))[0] = (argc > 2 && strcasecmp(argv[2], "-coredump") == 0) ? 1 : 0;
|
((int*)&(parm[3]))[0] = (argc > 2 && strcasecmp(argv[2], "-coredump") == 0) ? 1 : 0;
|
||||||
|
if ((argc > 2 && strcasecmp(argv[2], "-remotecursor") == 0) ||
|
||||||
|
(argc > 3 && strcasecmp(argv[3], "-remotecursor") == 0))
|
||||||
|
{
|
||||||
|
gRemoteMouseRenderDefault = 1;
|
||||||
|
}
|
||||||
|
|
||||||
HMODULE shCORE = LoadLibraryExA((LPCSTR)"Shcore.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
HMODULE shCORE = LoadLibraryExA((LPCSTR)"Shcore.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
|
||||||
DpiAwarenessFunc dpiAwareness = NULL;
|
DpiAwarenessFunc dpiAwareness = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user