260{
272
274 {
275 ERR(
"WL: ImpersonateLoggedOnUser() failed with error %lu\n",
GetLastError());
277 }
278
280 &hCurrentUser);
282 {
283 ERR(
"WL: RegOpenCurrentUser error %lu\n", rc);
285 }
286
288 L"Control Panel\\Desktop",
289 0,
293 {
294 ERR(
"WL: RegOpenKeyEx error %lu\n", rc);
296 }
297
300 0,
301 &dwType,
302 (
LPBYTE)szApplicationName,
305 {
307 ERR(
"WL: RegQueryValueEx error %lu\n", rc);
309 }
310
312 {
313 ERR(
"WL: Buffer size is NULL!\n");
315 }
316
318
319 if (
wcslen(szApplicationName) == 0)
320 {
321 ERR(
"WL: Application Name length is zero!\n");
323 }
324
325 wsprintfW(szCommandLine,
L"%s /s", szApplicationName);
326 TRACE(
"WL: Executing %S\n", szCommandLine);
327
332
333
335
337 szApplicationName,
338 szCommandLine,
345 &StartupInfo,
346 &ProcessInformation);
348 {
349 ERR(
"WL: Unable to start %S, error %lu\n", szApplicationName,
GetLastError());
351 }
352
354
356
358
359
361 HandleArray[0] = ProcessInformation.
hProcess;
362 HandleArray[1] = Session->hUserActivity;
365 {
366
368 }
369
370 SetEvent(Session->hEndOfScreenSaver);
371
373
375
379
380 if (hCurrentUser)
382
384
386 {
388#ifndef USE_GETLASTINPUTINFO
390#endif
391 }
392}
VOID CallNotificationDlls(PWLSESSION pSession, NOTIFICATION_TYPE Type)
#define RegCloseKey(hKey)
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserW(_In_opt_ HANDLE hToken, _In_opt_ LPCWSTR lpApplicationName, _Inout_opt_ LPWSTR lpCommandLine, _In_opt_ LPSECURITY_ATTRIBUTES lpProcessAttributes, _In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes, _In_ BOOL bInheritHandles, _In_ DWORD dwCreationFlags, _In_opt_ LPVOID lpEnvironment, _In_opt_ LPCWSTR lpCurrentDirectory, _In_ LPSTARTUPINFOW lpStartupInfo, _Out_ LPPROCESS_INFORMATION lpProcessInformation)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegOpenCurrentUser(IN REGSAM samDesired, OUT PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define ERROR_FILE_NOT_FOUND
struct _STARTUPINFOW STARTUPINFOW
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
#define STARTF_SCREENSAVER
#define IDLE_PRIORITY_CLASS
@ StartScreenSaverHandler
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define WLX_SAS_TYPE_SCRNSVR_ACTIVITY