}
cleanup:
- RevertToSelf();
if (Session->hUserActivity)
CloseHandle(Session->hUserActivity);
if (Session->hEndOfScreenSaver)
CloseHandle(Session->hEndOfScreenSaver);
+ RevertToSelf();
+
#ifndef USE_GETLASTINPUTINFO
if (Session->KeyboardHook)
UnhookWindowsHookEx(Session->KeyboardHook);
CloseHandle(Session->hEndOfScreenSaverThread);
CloseHandle(Session->hScreenSaverParametersChanged);
+
return 0;
}
&hCurrentUser);
if (rc != ERROR_SUCCESS)
{
- ERR("WL: RegOpenCurrentUser Error!\n");
+ ERR("WL: RegOpenCurrentUser error %lu\n", rc);
goto cleanup;
}
&hKey);
if (rc != ERROR_SUCCESS)
{
- ERR("WL: RegOpenKeyEx Error!\n");
+ ERR("WL: RegOpenKeyEx error %lu\n", rc);
goto cleanup;
}
&bufferSize);
if (rc != ERROR_SUCCESS || dwType != REG_SZ)
{
- ERR("WL: RegQueryValueEx Error!\n");
+ if (rc != ERROR_FILE_NOT_FOUND)
+ ERR("WL: RegQueryValueEx error %lu\n", rc);
goto cleanup;
}
SystemParametersInfoW(SPI_SETSCREENSAVERRUNNING, TRUE, NULL, 0);
+ CallNotificationDlls(Session, StartScreenSaverHandler);
+
/* Wait the end of the process or some other activity */
ResetEvent(Session->hUserActivity);
HandleArray[0] = ProcessInformation.hProcess;
CloseHandle(ProcessInformation.hProcess);
+ CallNotificationDlls(Session, StopScreenSaverHandler);
+
cleanup:
- RevertToSelf();
if (hKey)
RegCloseKey(hKey);
if (hCurrentUser)
RegCloseKey(hCurrentUser);
+ RevertToSelf();
+
if (!ret)
{
PostMessageW(Session->SASWindow, WLX_WM_SAS, WLX_SAS_TYPE_SCRNSVR_ACTIVITY, 0);