66 CHAR szFuncBuffer[128];
68 dwSize =
sizeof(szFuncBuffer);
96 HKEY hNotifyKey, hDllKey;
101 if (NotificationDll->bSfcNotification)
105 L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Notify",
111 ERR(
"RegOpenKeyExW(Winlogon\\Notify) failed, Error %lu\n", lError);
116 NotificationDll->pszKeyName,
124 ERR(
"RegOpenKeyExW(%S) failed, Error %lu\n", NotificationDll->pszKeyName, lError);
131 ERR(
"LoadLibraryW(%S) failed, Error %lu\n", NotificationDll->pszDllName,
GetLastError());
135 NotificationDll->hModule =
hModule;
187 sizeof(*NotificationDll));
188 if (!NotificationDll)
207 ERR(
"LoadLibraryW(%S) failed, Error %lu\n", szSfcPath, dwError);
217 ERR(
"Couldn't snap SfcWLEventLogon/SfcWLEventLogoff\n");
243 TRACE(
"AddNotificationDll(0x%p, %S)\n", hNotifyKey, pszKeyName);
266 bSafeMode = !!dwValue;
281 sizeof(*NotificationDll));
282 if (!NotificationDll)
383 L"SmartCardLogonNotify",
425 TRACE(
"InitNotifications()\n");
432 L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\Notify",
438 TRACE(
"RegOpenKeyExW()\n");
442 for (dwIndex = 0; ; ++dwIndex)
456 TRACE(
"Notification DLL: %S\n", szKeyName);
462 TRACE(
"InitNotifications() done\n");
479 if (!NotificationDll->hModule)
484 NotificationDll->bEnabled =
FALSE;
487 ASSERT(NotificationDll->hModule);
491 pNotifyHandler = NotificationDll->Handler[
Type];
500 UserToken = (NotificationDll->bImpersonate ?
Info.hToken :
NULL);
503 ERR(
"WL: ImpersonateLoggedOnUser() failed with error %lu\n",
GetLastError());
514 #if defined(__GNUC__)
518 "movl %%esp, %[StackPtr]\n\t"
521 "call *%[pNotifyHandler]\n\t"
522 "cmpl %%esp, %[StackPtr]\n\t"
524 "movl %[StackPtr], %%esp\n\t"
530 [pNotifyHandler]
"m"(pNotifyHandler), [
Info]
"r"(&
Info)
534 #elif defined(_MSC_VER)
540 call [pNotifyHandler]
548 #error Unsupported compiler
552 ERR(
"WL: The notification DLL '%ws' uses a wrong calling convention or number of parameters. "
553 "Please contact your software vendor for a fixed DLL!\n",
554 NotificationDll->pszDllName);
557 pNotifyHandler(&
Info);
562 ERR(
"WL: Exception 0x%08lx hit by notification DLL %ws while executing %s notify function\n",
625 ListEntry = ListEntry->
Flink)
static LIST_ENTRY NotificationDllListHead
static VOID CallNotificationDll(_In_ PNOTIFICATION_ITEM NotificationDll, _In_ NOTIFICATION_TYPE Type, _In_ PWLX_NOTIFICATION_INFO pInfo)
static VOID AddNotificationDll(_In_ HKEY hNotifyKey, _In_ PCWSTR pszKeyName)
static VOID DeleteNotification(_In_ PNOTIFICATION_ITEM Notification)
Frees the resources associated to a notification.
static PSTR FuncNames[LastHandler]
struct _NOTIFICATION_ITEM NOTIFICATION_ITEM
VOID(WINAPI * PWLX_NOTIFY_HANDLER)(PWLX_NOTIFICATION_INFO pInfo)
BOOL InitNotifications(VOID)
VOID CallNotificationDlls(PWLSESSION pSession, NOTIFICATION_TYPE Type)
struct _NOTIFICATION_ITEM * PNOTIFICATION_ITEM
static BOOL LoadNotifyDll(_Inout_ PNOTIFICATION_ITEM NotificationDll)
Loads the notification DLL and retrieves its exported notification handlers.
static PWLX_NOTIFY_HANDLER GetNotificationHandler(_In_ HKEY hDllKey, _In_ HMODULE hModule, _In_ PCSTR pNotification)
Retrieves the address of the exported notification handler, specified in the registry entry for the n...
VOID CleanupNotifications(VOID)
static VOID AddSfcNotification(VOID)
Initializes the internal SFC notifications.
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI ImpersonateLoggedOnUser(HANDLE hToken)
#define GetProcAddress(x, y)
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
BOOL WINAPI RevertToSelf(void)
#define InsertHeadList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
#define EXCEPTION_EXECUTE_HANDLER
#define ERROR_FILE_NOT_FOUND
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define cmp(status, error)
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
static void push(calc_node_t *op)
struct _LIST_ENTRY * Flink
PWLX_NOTIFY_HANDLER Handler[LastHandler]
PWSTR InteractiveWindowStationName
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl eax
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl edx movl TEMP incl eax andl eax ecx incl ebx testl eax jnz xchgl ecx incl TEMP esi
#define CONTAINING_RECORD(address, type, field)
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
_In_ PWDFDEVICE_INIT _In_ PFN_WDF_DEVICE_SHUTDOWN_NOTIFICATION Notification
DWORD WINAPI GetLastError(void)
#define ERROR_PROC_NOT_FOUND
PWSTR WlStrDup(_In_opt_ PCWSTR String)
Duplicates the given string, allocating a buffer on the heap.
@ StartScreenSaverHandler
#define HKEY_LOCAL_MACHINE
int WINAPI GetSystemMetrics(_In_ int)