259{
271
273 {
274 ERR(
"WL: ImpersonateLoggedOnUser() failed with error %lu\n",
GetLastError());
276 }
277
279 &hCurrentUser);
281 {
282 ERR(
"WL: RegOpenCurrentUser error %lu\n", rc);
284 }
285
287 L"Control Panel\\Desktop",
288 0,
292 {
293 ERR(
"WL: RegOpenKeyEx error %lu\n", rc);
295 }
296
299 0,
300 &dwType,
301 (
LPBYTE)szApplicationName,
304 {
306 ERR(
"WL: RegQueryValueEx error %lu\n", rc);
308 }
309
311 {
312 ERR(
"WL: Buffer size is NULL!\n");
314 }
315
317
318 if (
wcslen(szApplicationName) == 0)
319 {
320 ERR(
"WL: Application Name length is zero!\n");
322 }
323
324 wsprintfW(szCommandLine,
L"%s /s", szApplicationName);
325 TRACE(
"WL: Executing %S\n", szCommandLine);
326
331
332
334
336 szApplicationName,
337 szCommandLine,
344 &StartupInfo,
345 &ProcessInformation);
347 {
348 ERR(
"WL: Unable to start %S, error %lu\n", szApplicationName,
GetLastError());
350 }
351
353
355
357
358
360 HandleArray[0] = ProcessInformation.
hProcess;
361 HandleArray[1] = Session->hUserActivity;
364 {
365
367 }
368
369 SetEvent(Session->hEndOfScreenSaver);
370
372
374
378
379 if (hCurrentUser)
381
383
385 {
387#ifndef USE_GETLASTINPUTINFO
389#endif
390 }
391}
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
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
#define STARTF_SCREENSAVER
#define IDLE_PRIORITY_CLASS
struct _STARTUPINFOW STARTUPINFOW
@ StartScreenSaverHandler
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
#define WLX_SAS_TYPE_SCRNSVR_ACTIVITY