diff options
| author | Simon Rettberg | 2016-02-12 21:49:05 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2016-02-12 21:49:05 +0100 |
| commit | 870fc91a5d0c0ce2150cacdcdc4f333e4660a5bf (patch) | |
| tree | 31437e4260d9d6aaaaa03b0b2739fd5be87cfedc /remote/modules | |
| parent | [auth-freiburg] pam_script_mount_persistent: Just added comment for nfs mount (diff) | |
| download | tm-scripts-870fc91a5d0c0ce2150cacdcdc4f333e4660a5bf.tar.gz tm-scripts-870fc91a5d0c0ce2150cacdcdc4f333e4660a5bf.tar.xz tm-scripts-870fc91a5d0c0ce2150cacdcdc4f333e4660a5bf.zip | |
[run-virt] openslx.exe: disable screensaver/standby, don't show error if patching shutdown button caption fails on the first try
Diffstat (limited to 'remote/modules')
| -rwxr-xr-x | remote/modules/run-virt/compile | 5 | ||||
| -rwxr-xr-x | remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe | bin | 15360 -> 15360 bytes | |||
| -rw-r--r-- | remote/modules/run-virt/winres.c | 13 |
3 files changed, 13 insertions, 5 deletions
diff --git a/remote/modules/run-virt/compile b/remote/modules/run-virt/compile new file mode 100755 index 00000000..4db15686 --- /dev/null +++ b/remote/modules/run-virt/compile @@ -0,0 +1,5 @@ +#!/bin/sh + +rm -- winres.exe +i686-w64-mingw32-gcc -std=c99 -Os -Wl,--subsystem,windows -o winres.exe winres.c -lole32 -luuid -lgdi32 #-lws2_32 +strip winres.exe && echo "Successfully created winres.exe" diff --git a/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe b/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe Binary files differindex a1616798..114a0dc0 100755 --- a/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe +++ b/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe diff --git a/remote/modules/run-virt/winres.c b/remote/modules/run-virt/winres.c index a9037b61..c9065c03 100644 --- a/remote/modules/run-virt/winres.c +++ b/remote/modules/run-virt/winres.c @@ -51,15 +51,18 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine // Mute sound by default if (retVer && version.dwMajorVersion >= 6) muteSound(); + // Disable screen saver as it might give the false impression that the session is securely locked + SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, FALSE, NULL, 0); + // Disable standby and idle-mode (this is a VM!) + if (version.dwMajorVersion >= 6) { // Vista+ + SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED | ES_AWAYMODE_REQUIRED); + } else { // XP/2003 + SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED); + } // Shutdown button label if (retVer && version.dwMajorVersion == 6 && version.dwMinorVersion == 1) { // Only on Windows 7 char buffer[100]; - ret = setShutdownText(); - if (ret != 0) { - snprintf(buffer, 100, "Returned %d", ret); - MessageBoxA(0, buffer, "Set caption", 0); - } // Repeatedly set caption UINT_PTR tRet = SetTimer(NULL, 0, 5000, (TIMERPROC)&resetShutdown); if (tRet == 0) { |
