From d4cc454a34be6966f8297153063524ed9c19b3e3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 22 Oct 2018 11:33:55 +0200 Subject: [run-virt] Explicitly unmute if muteSound=0 --- .../data/opt/openslx/vmchooser/data/openslx.exe | Bin 55296 -> 55296 bytes core/modules/run-virt/winres/src/winres.c | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'core/modules/run-virt') diff --git a/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe b/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe index e8b87aa9..a547ddd2 100755 Binary files a/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe and b/core/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe differ diff --git a/core/modules/run-virt/winres/src/winres.c b/core/modules/run-virt/winres/src/winres.c index 851150f7..27a3c9af 100644 --- a/core/modules/run-virt/winres/src/winres.c +++ b/core/modules/run-virt/winres/src/winres.c @@ -85,7 +85,7 @@ static BOOL _createMissingRemap = FALSE; static void setPowerState(); static int setResolution(); -static int muteSound(); +static int muteSound(BOOL bMute); static int setShutdownText(); static void readShareFile(); static BOOL mountNetworkShares(); @@ -388,8 +388,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine } // Mute sound? BOOL mute = GetPrivateProfileIntA("openslx", "muteSound", 1, SETTINGS_FILE) != 0; - if (mute && retVer && winVer.dwMajorVersion >= 6) - muteSound(); + if (retVer && winVer.dwMajorVersion >= 6) + muteSound(mute); // Disable screen saver as it might give the false impression that the session is securely locked SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, FALSE, NULL, 0); // Same with standby @@ -612,7 +612,7 @@ static int setResolution() return 0; } -static int muteSound() +static int muteSound(BOOL bMute) { IMMDeviceEnumerator *deviceEnumerator = NULL; HRESULT hr = CoCreateInstance(&ID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &ID_IMMDeviceEnumerator, (LPVOID *)&deviceEnumerator); @@ -639,7 +639,7 @@ static int muteSound() //defaultDevice->lpVtbl->Release(defaultDevice); float targetVolume = 1; endpointVolume->lpVtbl->SetMasterVolumeLevelScalar(endpointVolume, targetVolume, NULL); - endpointVolume->lpVtbl->SetMute(endpointVolume, TRUE, NULL); + endpointVolume->lpVtbl->SetMute(endpointVolume, bMute, NULL); //endpointVolume->lpVtbl->Release(endpointVolume); //CoUninitialize(); return 0; -- cgit v1.2.3-55-g7522