Re: Can't call WlxSASNotify in a separate thread! Alternative ways?

From: MarkD (mark.davis_at_stsint.com)
Date: 01/28/05

  • Next message: Raj: "safe mode - how it affects virus"
    Date: 28 Jan 2005 13:12:19 -0800
    
    

    Mauro,

    I have found a relatively easy solution to this problem. I am working
    on a smartcard/fingerprint logon. Winlogon only seems to detect the
    smartcard insertion just once. I was going to start a thread and post
    a message, like other people have recommended, but there is one
    problem. There is no way to get the HWND of your WlxDisplaySASNotice
    dialog when calling WlxDialogBoxParam. You need the HWND for calling
    SendMessage.

    What I did is start a timer in my dialog procedure for
    WlxDisplaySASNotice:

    const int IDT_TIMER1 = 1;
    INT_PTR CALLBACK DisplaySASProc(
    HWND hwndDlg, // handle to dialog box
    UINT uMsg, // message
    WPARAM wParam, // first message parameter
    LPARAM lParam) // second message parameter
    {
    static PGINA_CONTEXT pgContext;
    BOOL retVal = FALSE; // must return false for all messages not
    handled here
    switch (uMsg)
    {
    case WM_INITDIALOG:
    CenterWindow(hwndDlg);
    pgContext = (PGINA_CONTEXT)lParam;
    SetTimer(hwndDlg, IDT_TIMER1, 1000, (TIMERPROC)NULL);
    retVal = TRUE;
    break;
    case WM_TIMER:
    if (IsCardInserted())
    {
    KillTimer(hwndDlg, IDT_TIMER1);
    pgContext->pWlxFuncs->WlxSasNotify(pgContext->hWlx,
    WLX_SAS_TYPE_SC_INSERT);
    }
    retVal = TRUE;
    break;
    }
    return retVal;
    }

    The timer runs in the same thread as Winlogon. The IsCardInserted()
    function checks to see if the card has been inserted or removed. Good
    luck with your GINA.


  • Next message: Raj: "safe mode - how it affects virus"