BOOL InitializeSAS( IN OUT PWLSESSION Session) { WNDCLASSEXW swc; BOOL ret = FALSE; if (!SwitchDesktop(Session->WinlogonDesktop)) { ERR("WL: Failed to switch to winlogon desktop\n"); goto cleanup; } /* Register SAS window class */ swc.cbSize = sizeof(WNDCLASSEXW); swc.style = CS_SAVEBITS; swc.lpfnWndProc = SASWindowProc; swc.cbClsExtra = 0; swc.cbWndExtra = 0; swc.hInstance = hAppInstance; swc.hIcon = NULL; swc.hCursor = NULL; swc.hbrBackground = NULL; swc.lpszMenuName = NULL; swc.lpszClassName = WINLOGON_SAS_CLASS; swc.hIconSm = NULL; if (RegisterClassExW(&swc) == 0) { ERR("WL: Failed to register SAS window class\n"); goto cleanup; } /* Create invisible SAS window */ Session->SASWindow = CreateWindowExW( 0, WINLOGON_SAS_CLASS, WINLOGON_SAS_TITLE, WS_POPUP, 0, 0, 0, 0, 0, 0, hAppInstance, Session); if (!Session->SASWindow) { ERR("WL: Failed to create SAS window\n"); goto cleanup; } /* Register SAS window to receive SAS notifications */ if (!SetLogonNotifyWindow(Session->SASWindow)) { ERR("WL: Failed to register SAS window\n"); goto cleanup; } if (!SetDefaultLanguage(NULL)) return FALSE; ret = TRUE; cleanup: if (!ret) UninitializeSAS(Session); return ret; }
BOOL ZSetLogonNotifyWindow(HWINSTA hWindowStation, HWND hWndNotify) { return SetLogonNotifyWindow( hWindowStation, hWndNotify) ; }