Funzione di callback della funzione del gestore eventi

[Le funzioni prototipo del gestore eventi non sono più disponibili per l'uso a partire da Windows Server 2008 e Windows Vista. ]

Le funzioni prototipo del gestore eventi vengono usate per tutte le funzioni che gestiscono gli eventi di notifica Winlogon . Il nome della funzione, rappresentato di seguito dal segnaposto Event_Handler_Function_Name, riflette in genere il nome dell'evento gestito dalla funzione. Ad esempio, la funzione che gestisce gli eventi di accesso potrebbe essere denominata: WLEventLogon.

Sintassi

void Event_Handler_Function_Name(
  _In_ PWLX_NOTIFICATION_INFO pInfo
);

Parametri

pInfo [in]

Puntatore a una struttura WLX_NOTIFICATION_INFO che contiene i dettagli dell'evento.

Valore restituito

Questa funzione di callback non restituisce un valore.

Commenti

Se il gestore eventi deve creare processi figlio, deve chiamare la funzione CreateProcessAsUser . In caso contrario, il nuovo processo verrà creato sul desktop Winlogon, non sul desktop dell'utente.

Esempio

L'esempio seguente illustra come implementare gestori eventi per gli eventi Winlogon. Per semplicità, vengono visualizzate solo le implementazioni dei gestori eventi Logon e Logoff. È possibile implementare gestori per il resto degli eventi esattamente allo stesso modo.

// Copyright (C) Microsoft. All rights reserved. 
#include <windows.h>

// Here is the entrance function for the DLL.
BOOL WINAPI LibMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
    switch (dwReason)
    {
        case DLL_PROCESS_ATTACH:
            {

             // Disable DLL_THREAD_ATTACH & DLL_THREAD_DETACH
             // notification calls. This is a performance optimization
             // for multithreaded applications that do not need 
             // thread-level notifications of attachment or
             // detachment.

            DisableThreadLibraryCalls (hInstance);
            }
            break;
    }

    return TRUE;
}

// Here is the event handler for the Winlogon Logon event.
void WLEventLogon (PWLX_NOTIFICATION_INFO pInfo)
{

    // Print the name of the handler to debug output.
    // You can replace this with more useful functionality.
    OutputDebugString (TEXT("NOTIFY:  Entering WLEventLogon.\r\n"));
}

// Here is the event handler for the Winlogon Logoff event.
void WLEventLogoff (PWLX_NOTIFICATION_INFO pInfo)
{

    // Print the name of the handler to debug output.
    // You can replace this with more useful functionality.
    OutputDebugString (TEXT("NOTIFY:  Entering WLEventLogff.\r\n"));
}

Requisiti

Requisito Valore
Client minimo supportato
Windows XP [solo app desktop]
Server minimo supportato
Windows Server 2003 [solo app desktop]
Fine del supporto client
Windows XP
Fine del supporto server
Windows Server 2003