19#define WIN32_NO_STATUS
35#define WINE_DEFAULT_DEBUG_CHANNEL_EX(ch, flags) \
36 static struct __wine_debug_channel __wine_dbch_##ch = { (unsigned char)(flags), #ch }; \
37 static struct __wine_debug_channel * const __wine_dbch___default = &__wine_dbch_##ch
47#define NOTIFY_PKG_NAME L"WLNotifyTests"
48#define NOTIFY_REG_PATH L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Notify\\" NOTIFY_PKG_NAME
50#define DEFAULT_WINSTA0 L"WinSta0"
51#define DESKTOP_WINLOGON L"Winlogon"
52#define DESKTOP_DEFAULT L"Default"
53#define DESKTOP_SCRSAVE L"Screen-saver"
142#define DPRINTF(fmt, ...) DPRINTF_FN(__FUNCTION__, fmt, ##__VA_ARGS__ )
201 ERR(
"RegOpenKeyExW() failed; error %lu\n", lError);
234 g_dwMaxWait = !!dwValue;
271 PWSTR pszBuffer = (cchBufLength ? PreAllocBuffer :
NULL);
272 DWORD dwBufSize = (pszBuffer ? cchBufLength *
sizeof(
WCHAR) : 0);
284 if (dwReqSize > dwBufSize)
287 dwBufSize = dwReqSize;
341 DWORD cbTokenBuffer = 0;
346 DWORD cbUserName = 0;
347 DWORD cbDomainName = 0;
401 *DomainName = pDomainName;
433 _In_ HDESK hNotifDesktop)
476 BufSize =
sizeof(*pSysUserInfo) +
492 *pSysUserInfo = LocalInfo;
499 pSysUserInfo->pProcUserName =
pString;
505 pSysUserInfo->pProcDomainName =
pString;
511 pSysUserInfo->pThrdUserName =
pString;
517 pSysUserInfo->pThrdDomainName =
pString;
523 pSysUserInfo->pNotifUserName =
pString;
529 pSysUserInfo->pNotifDomainName =
pString;
535 pSysUserInfo->pszWinSta =
pString;
541 pSysUserInfo->pszThreadDesk =
pString;
547 pSysUserInfo->pszInputDesk =
pString;
553 pSysUserInfo->pszNotifDesk =
pString;
615 "\nWLNOTIFY(%lx.%lx) [Async: %s, Impers: %s]: Entering `%s`\n"
616 "\tProcess Token : 0x%p - User: '%S\\%S'\n"
617 "\tThread Token : 0x%p - User: '%S\\%S'\n"
618 "\tNotif Token : 0x%p - User: '%S\\%S'\n"
619 "\tProcess WinSta : 0x%p '%S'\n"
620 "\tThread Desktop : 0x%p '%S'\n"
621 "\tInput Desktop : 0x%p '%S'\n"
622 "\tNotif Desktop : 0x%p '%S'\n",
626 g_fFlags.bImpersonate ?
"TRUE" :
"FALSE",
628 SysUserInfo->hProcToken, SysUserInfo->pProcDomainName, SysUserInfo->pProcUserName,
629 SysUserInfo->hThrdToken, SysUserInfo->pThrdDomainName, SysUserInfo->pThrdUserName,
630 pInfo->hToken, SysUserInfo->pNotifDomainName, SysUserInfo->pNotifUserName,
631 SysUserInfo->hWinSta, SysUserInfo->pszWinSta,
632 SysUserInfo->hThreadDesk, SysUserInfo->pszThreadDesk,
633 SysUserInfo->hInputDesk, SysUserInfo->pszInputDesk,
634 pInfo->hDesktop, SysUserInfo->pszNotifDesk);
637 "\tInfo.Size : %lu\n"
638 "\tInfo.Flags : 0x%lx\n"
639 "\tInfo.UserName : '%S'\n"
640 "\tInfo.Domain : '%S'\n"
641 "\tInfo.WindowStation : '%S'\n"
642 "\tInfo.hToken : 0x%p\n"
643 "\tInfo.hDesktop : 0x%p\n"
644 "\tInfo.pStatusCallback: 0x%p\n",
645 pInfo->Size, pInfo->Flags, pInfo->UserName,
646 pInfo->Domain, pInfo->WindowStation, pInfo->hToken,
647 pInfo->hDesktop, pInfo->pStatusCallback);
650#define DUMP_WLX_NOTIFICATION(SysUserInfo, pInfo) \
651 DumpNotificationState(__RELFILE__, __LINE__, __FUNCTION__, (SysUserInfo), (pInfo))
665 "**** %s: %s state %s %s %s\n",
667 bChange ?
"Changing" :
"Restoring",
669 bChange ?
"to" :
"back to",
675#define CHANGE_STATE(bChange, NewState) \
676 ChangeNotificationState(__RELFILE__, __LINE__, __FUNCTION__, (bChange), (NewState))
687 if (!pStatusCallback)
709 if (!pStatusCallback)
729 static const struct test winetest_testlist[] = { { __FUNCTION__, NULL } }; \
730 init_test( &winetest_testlist[0] ); \
731 winetest_push_context("**** %s", __FUNCTION__); \
736 winetest_pop_context(); \
740#define ok_state_1(state1) \
741 ok(g_CurrentState == (state1), \
742 "ERROR: Wrong state %s, expected %s\n", \
743 NotifyStateToName(g_CurrentState), \
744 NotifyStateToName(state1))
746#define ok_state_2(state1, state2) \
747 ok(g_CurrentState == (state1) || g_CurrentState == (state2), \
748 "ERROR: Wrong state %s, expected %s or %s\n", \
749 NotifyStateToName(g_CurrentState), \
750 NotifyStateToName(state1), \
751 NotifyStateToName(state2))
753#define ok_state_3(state1, state2, state3) \
754 ok(g_CurrentState == (state1) || g_CurrentState == (state2) || g_CurrentState == (state3), \
755 "ERROR: Wrong state %s, expected %s or %s or %s\n", \
756 NotifyStateToName(g_CurrentState), \
757 NotifyStateToName(state1), \
758 NotifyStateToName(state2), \
759 NotifyStateToName(state3))
767 BOOL bThrdToken, bUserLoggedIn;
768 PCWSTR pszWinSta, pszThreadDesk;
783 if (pTest->NumStates == 1)
785 else if (pTest->NumStates == 2)
786 ok_state_2(pTest->AllowedStates[0], pTest->AllowedStates[1]);
787 else if (pTest->NumStates == 3)
788 ok_state_3(pTest->AllowedStates[0], pTest->AllowedStates[1], pTest->AllowedStates[2]);
790 skip(
"Unsupported number of allowed notify states: %lu\n", pTest->NumStates);
792 ok(SysUserInfo->hProcToken !=
NULL,
"Expected hProcToken != NULL\n");
793 ok(SysUserInfo->pProcDomainName !=
NULL,
"Expected pProcDomainName != NULL\n");
794 ok(SysUserInfo->pProcUserName !=
NULL,
"Expected pProcUserName != NULL\n");
796 if (pTest->bThrdToken)
798 ok(SysUserInfo->hThrdToken !=
NULL,
"Expected hThrdToken != NULL\n");
800 ok(SysUserInfo->pThrdDomainName !=
NULL,
"Expected pThrdDomainName != NULL\n");
801 if (!SysUserInfo->pThrdDomainName || !SysUserInfo->pNotifDomainName)
802 skip(
"Skipped pThrdDomainName/pNotifDomainName test\n");
804 ok_wstr(SysUserInfo->pThrdDomainName, SysUserInfo->pNotifDomainName);
806 ok(SysUserInfo->pThrdUserName !=
NULL,
"Expected pThrdUserName != NULL\n");
807 if (!SysUserInfo->pThrdUserName || !SysUserInfo->pNotifUserName)
808 skip(
"Skipped pThrdUserName/pNotifUserName test\n");
810 ok_wstr(SysUserInfo->pThrdUserName, SysUserInfo->pNotifUserName);
814 ok(SysUserInfo->hThrdToken ==
NULL,
"Expected hThrdToken == NULL\n");
815 ok(SysUserInfo->pThrdDomainName ==
NULL,
"Expected pThrdDomainName == NULL\n");
816 ok(SysUserInfo->pThrdUserName ==
NULL,
"Expected pThrdUserName == NULL\n");
819 if (pTest->bUserLoggedIn)
822 ok(pInfo->hToken !=
NULL,
"Expected pInfo->hToken != NULL\n");
823 ok(SysUserInfo->pNotifDomainName !=
NULL,
"Expected pNotifDomainName != NULL\n");
824 ok(SysUserInfo->pNotifUserName !=
NULL,
"Expected pNotifUserName != NULL\n");
828 ok(pInfo->hToken ==
NULL,
"Expected pInfo->hToken == NULL\n");
829 ok(SysUserInfo->pNotifDomainName ==
NULL,
"Expected pNotifDomainName == NULL\n");
830 ok(SysUserInfo->pNotifUserName ==
NULL,
"Expected pNotifUserName == NULL\n");
834 ok(SysUserInfo->hWinSta !=
NULL,
"Expected hProcWinSta != NULL\n");
835 ok(SysUserInfo->pszWinSta !=
NULL,
"Expected pszWinSta != NULL\n");
836 if (!SysUserInfo->pszWinSta)
837 skip(
"Skipped pszWinSta test\n");
842 ok(SysUserInfo->hThreadDesk !=
NULL,
"Expected hThreadDesk != NULL\n");
843 ok(SysUserInfo->pszThreadDesk !=
NULL,
"Expected pszThreadDesk != NULL\n");
844 if (!SysUserInfo->pszThreadDesk)
845 skip(
"Skipped pszThreadDesk test\n");
849 if (pTest->pszInputDesk)
851 ok(SysUserInfo->hInputDesk !=
NULL,
"Expected hInputDesk != NULL\n");
852 ok(SysUserInfo->pszInputDesk !=
NULL,
"Expected pszInputDesk != NULL\n");
853 if (!SysUserInfo->pszInputDesk)
854 skip(
"Skipped pszInputDesk test\n");
856 ok_wstr(SysUserInfo->pszInputDesk, pTest->pszInputDesk);
860 ok(SysUserInfo->hInputDesk ==
NULL,
"Expected hInputDesk == NULL\n");
861 ok(SysUserInfo->pszInputDesk ==
NULL,
"Expected pszInputDesk == NULL\n");
865 ok(pInfo->hDesktop !=
NULL,
"Expected pInfo->hDesktop != NULL\n");
866 ok(SysUserInfo->pszNotifDesk !=
NULL,
"Expected pszNotifDesk != NULL\n");
867 if (!SysUserInfo->pszNotifDesk)
868 skip(
"Skipped pszNotifDesk test\n");
870 ok_wstr(SysUserInfo->pszNotifDesk, pTest->pszNotifDesk);
872 ok_int(pInfo->Size,
sizeof(*pInfo));
875 if (pTest->bUserLoggedIn)
877 ok(pInfo->UserName !=
NULL,
"Expected pInfo->UserName != NULL\n");
878 ok(pInfo->Domain !=
NULL,
"Expected pInfo->Domain != NULL\n");
881 if (!pInfo->UserName || !SysUserInfo->pNotifUserName)
882 skip(
"Skipped UserName/pNotifUserName test\n");
884 ok_wstr(pInfo->UserName, SysUserInfo->pNotifUserName);
886 if (!pInfo->Domain || !SysUserInfo->pNotifDomainName)
887 skip(
"Skipped Domain/pNotifDomainName test\n");
889 ok_wstr(pInfo->Domain, SysUserInfo->pNotifDomainName);
893 ok(pInfo->UserName ==
NULL,
"Expected pInfo->UserName == NULL\n");
894 ok(pInfo->Domain ==
NULL,
"Expected pInfo->Domain == NULL\n");
898 ok(pInfo->WindowStation !=
NULL,
"Expected pInfo->WindowStation != NULL\n");
899 if (!pInfo->WindowStation || !SysUserInfo->pszWinSta)
900 skip(
"Skipped WindowStation/pszWinSta test\n");
902 ok_wstr(pInfo->WindowStation, SysUserInfo->pszWinSta);
905 ok(pInfo->hDesktop == SysUserInfo->hThreadDesk,
"Expected pInfo->hDesktop == hThreadDesk\n");
907 ok(pInfo->hDesktop != SysUserInfo->hThreadDesk,
"Expected pInfo->hDesktop != hThreadDesk\n");
910 ok(pInfo->pStatusCallback ==
NULL,
"Expected pStatusCallback == NULL, was: 0x%p\n", pInfo->pStatusCallback);
912 ok(pInfo->pStatusCallback !=
NULL,
"Expected pStatusCallback != NULL\n");
918#define __HANDLER_PARAM(pNotifInfo)(_In_ PWLX_NOTIFICATION_INFO pNotifInfo)
919#define WLNOTIFY_HANDLER(name) \
920 VOID WINAPI name __HANDLER_PARAM
922#define BEGIN_HANDLER \
923 PSYSTEM_USER_INFO SysUserInfo; \
924 SysUserInfo = GetSystemUserInfo(pInfo->hToken, pInfo->hDesktop); \
925 DUMP_WLX_NOTIFICATION(SysUserInfo, pInfo); \
926 DisplayWlxMessageA(pInfo->pStatusCallback, FALSE, __FUNCTION__); \
929#define END_HANDLER(bChangeState, NewState) \
930 FreeSystemUserInfo(SysUserInfo); \
932 CHANGE_STATE(bChangeState, NewState);
1001 "Expected pInfo->Flags == EWX_LOGOFF (0) or EWX_SHUTDOWN (1) or EWX_SHUTDOWN|EWX_REBOOT (3), got %lu\n",
1061 "Expected pInfo->Flags == EWX_LOGOFF (0) or EWX_SHUTDOWN (1) or EWX_SHUTDOWN|EWX_REBOOT (3), got %lu\n",
1108 PWSTR pszInputDesk =
1163 PWSTR pszInputDesk =
1225 PWSTR pszInputDesk =
1252 ERR(
"**** %s: Previous state %s\n",
1290 TRACE(
"\nWLNOTIFY(%lx.%lx): Entering `%s`(hInst: 0x%p, dwReason: 0x%x, pReserved: 0x%p)\n",
1305 ERR(
"\nWLNOTIFY(%lx.%lx): Entering `%s`(hInst: 0x%p, dwReason: 0x%x, pReserved: 0x%p)\n",
1330 {
L"Startup" ,
L"WLEventStartup"},
1331 {
L"Shutdown",
L"WLEventShutdown"},
1332 {
L"Logon" ,
L"WLEventLogon"},
1333 {
L"Logoff",
L"WLEventLogoff"},
1334 {
L"StartShell",
L"WLEventStartShell"},
1335 {
L"PostShell" ,
L"WLEventPostShell"},
1336 {
L"Lock" ,
L"WLEventLock"},
1337 {
L"Unlock",
L"WLEventUnlock"},
1338 {
L"StartScreenSaver",
L"WLEventStartScreenSaver"},
1339 {
L"StopScreenSaver" ,
L"WLEventStopScreenSaver"},
1340 {
L"Disconnect",
L"WLEventDisconnect"},
1341 {
L"Reconnect" ,
L"WLEventReconnect"},
1356 if ( !((dwPathSize != 0) && (dwPathSize <
_countof(szModule)) &&
1374 ERR(
"RegCreateKeyExW() failed; error %lu\n", lError);
1418 ERR(
"RegDeleteKeyW() failed; error %lu\n", lError);
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char * FunctionName
#define InterlockedExchange
#define ok_int(expression, result)
#define RegCloseKey(hKey)
#define ERROR_INSUFFICIENT_BUFFER
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NT_SUCCESS(StatCode)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI LookupAccountSidW(LPCWSTR pSystemName, PSID pSid, LPWSTR pAccountName, LPDWORD pdwAccountName, LPWSTR pDomainName, LPDWORD pdwDomainName, PSID_NAME_USE peUse)
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
BOOL WINAPI OpenThreadToken(HANDLE ThreadHandle, DWORD DesiredAccess, BOOL OpenAsSelf, HANDLE *TokenHandle)
#define DLL_PROCESS_ATTACH
#define DLL_PROCESS_DETACH
#define GetCurrentProcess()
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
BOOL WINAPI IsDebuggerPresent(void)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
NTSYSAPI void WINAPI DbgBreakPoint(void)
#define InterlockedCompareExchange
macro IMPORT Name endm macro EXPORT Name global &Name endm macro TEXTAREA section rx align endm macro DATAAREA section rw endm macro RODATAAREA section rw endm macro NESTED_ENTRY Name FuncName equ &Name PrologName equ &Name &_Prolog FuncEndName equ &Name &_end global &FuncName align func &FuncName & FuncName
enum _SID_NAME_USE SID_NAME_USE
#define ERROR_FILE_NOT_FOUND
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
HRESULT WINAPI DllRegisterServer(void)
HRESULT WINAPI DllUnregisterServer(void)
#define _Out_writes_opt_z_(s)
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
#define REG_OPTION_NON_VOLATILE
#define STANDARD_RIGHTS_READ
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define STRSAFE_NULL_ON_FAILURE
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
const char int int int ros_dbg_log(enum __wine_debug_class cls, struct __wine_debug_channel *ch, const char *file, const char *func, const int line, const char *format,...) __WINE_PRINTF_ATTR(6
STRSAFEAPI StringCchVPrintfExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat, va_list argList)
STRSAFEAPI StringCchPrintfExW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat,...)
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
DWORD WINAPI GetLastError(void)
HANDLE WINAPI GetCurrentThread(void)
DWORD WINAPI GetCurrentThreadId(void)
DWORD WINAPI GetCurrentProcessId(void)
HWINSTA WINAPI GetProcessWindowStation(void)
#define GetInstanceModule(hInstance)
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
#define HKEY_LOCAL_MACHINE
HDESK WINAPI GetThreadDesktop(_In_ DWORD)
HDESK WINAPI OpenInputDesktop(_In_ DWORD, _In_ BOOL, _In_ DWORD)
BOOL WINAPI GetUserObjectInformationW(_In_ HANDLE hObj, _In_ int nIndex, _Out_writes_bytes_opt_(nLength) PVOID pvInfo, _In_ DWORD nLength, _Out_opt_ LPDWORD lpnLengthNeeded)
BOOL WINAPI CloseDesktop(_In_ HDESK)
DWORD(CALLBACK * PFNMSGECALLBACK)(_In_ BOOL bVerbose, _In_ LPWSTR lpMessage)
static struct @1772 g_fFlags
static BOOL g_bInitialized
TRUE when the flags have been initialized.
static VOID FreeSystemUserInfo(_Inout_ PSYSTEM_USER_INFO SysUserInfo)
static const PCSTR NotifyStateName[]
#define ok_state_2(state1, state2)
FORCEINLINE VOID DbgBreakOnEvent(VOID)
WLNOTIFY_HANDLER() WLEventReconnect(pInfo)
Invoked at workstation reconnect (Terminal Services).
static VOID ChangeNotificationState(_In_ PCSTR FileName, _In_ INT LineNum, _In_ PCSTR FuncName, _In_ BOOL bChange, _In_ WLNOTIFY_STATE NewState)
WLNOTIFY_HANDLER() WLEventStartShell(pInfo)
Invoked just before starting the user shell.
static DWORD DisplayWlxMessageW(_In_opt_ PFNMSGECALLBACK pStatusCallback, _In_ BOOL bVerbose, _In_ PCWSTR pMessage)
WLNOTIFY_HANDLER() WLEventShutdown(pInfo)
Invoked at system shutdown.
WLNOTIFY_HANDLER() WLEventDisconnect(pInfo)
Invoked at workstation disconnect (Terminal Services).
static WLNOTIFY_STATE g_PreviousState
struct _TEST_ENTRY TEST_ENTRY
static PSYSTEM_USER_INFO GetSystemUserInfo(_In_ HANDLE hNotifToken, _In_ HDESK hNotifDesktop)
static ULONG g_fLogoffShutdownFlags
WLNOTIFY_HANDLER() WLEventStopScreenSaver(pInfo)
Invoked at screensaver stop.
#define ok_state_1(state1)
static VOID DumpNotificationState(_In_ PCSTR FileName, _In_ INT LineNum, _In_ PCSTR FuncName, _In_ PSYSTEM_USER_INFO SysUserInfo, _In_ PWLX_NOTIFICATION_INFO pInfo)
struct _SYSTEM_USER_INFO * PSYSTEM_USER_INFO
#define WLNOTIFY_HANDLER(name)
static void DoTest(const char *file, int line, const char *funcname, _In_ PSYSTEM_USER_INFO SysUserInfo, _In_ PWLX_NOTIFICATION_INFO pInfo, _In_ PTEST_ENTRY pTest)
static WLNOTIFY_STATE g_CurrentState
WLNOTIFY_HANDLER() WLEventUnlock(pInfo)
Invoked at workstation unlocking.
WLNOTIFY_HANDLER() WLEventLogoff(pInfo)
Invoked at user logoff.
WLNOTIFY_HANDLER() WLEventLock(pInfo)
Invoked at workstation locking.
#define END_HANDLER(bChangeState, NewState)
#define ok_state_3(state1, state2, state3)
WLNOTIFY_HANDLER() WLEventPostShell(pInfo)
Invoked just after starting the user shell.
static PWSTR GetUserObjectName(_In_ HANDLE hObj, _Out_writes_opt_z_(cchBufLength) PWSTR PreAllocBuffer, _In_range_(0, MAXDWORD/sizeof(WCHAR)) DWORD cchBufLength)
Retrieves the name of the specified window station or desktop object.
#define WINE_DEFAULT_DEBUG_CHANNEL_EX(ch, flags)
static PCSTR NotifyStateToName(_In_ WLNOTIFY_STATE State)
Maps a WLNOTIFY_STATE value to its human-readable name.
WLNOTIFY_HANDLER() WLEventStartup(pInfo)
Invoked at system startup.
static VOID GetSettings(VOID)
Retrieves the notification settings from the registry.
BOOL WINAPI DllMain(_In_ HINSTANCE hInstance, _In_ DWORD dwReason, _In_ PVOID pReserved)
WLNOTIFY_HANDLER() WLEventLogon(pInfo)
Invoked at user logon.
FORCEINLINE BOOL IsUserLoggedIn(_In_ WLNOTIFY_STATE State)
@ WLNotify_StopScreenSaver
@ WLNotify_StartScreenSaver
@ WLNotify_NonInitialized
struct _TEST_ENTRY * PTEST_ENTRY
WLNOTIFY_HANDLER() WLEventStartScreenSaver(pInfo)
Invoked at screensaver start.
enum _WLNOTIFY_STATE WLNOTIFY_STATE
static BOOL GetUserAndDomainName(_In_ HANDLE hToken, _Out_ PWSTR *UserName, _Out_ PWSTR *DomainName)
Retrieves the user and domain names corresponding to the given token.
struct _SYSTEM_USER_INFO SYSTEM_USER_INFO
static const struct @1773 NotifyEvents[]
static DWORD DisplayWlxMessageA(_In_opt_ PFNMSGECALLBACK pStatusCallback, _In_ BOOL bVerbose, _In_ PCSTR pMessage)