VerifyUser (Compact 2013)

3/28/2014

This function authenticates the user. An application calls this function.

Syntax

BOOL VerifyUser(
  const GUID* AEKey,
  LPCWSTR wszAEDisplayText,
  HWND hWndParent,
  DWORD dwOptions,
  PVOID pExtended
);

Parameters

  • AEKey
    [in] Pointer to the authentication event identifier. The identifier corresponds to the type of authentication required.
  • wszAEDisplayText
    [in] Pointer to the text for the LAP to display. If this value is NULL, the function uses the value set in the registry.
  • hWndParent
    [in] Handle to the parent window.
  • dwOptions
    [in] A bitmask of options. The following table shows the possible values.

    Value

    Description

    VU_NO_UI

    Returns from VerifyUser without displaying the UI. When using this value, the function will return TRUE only if the user can be verified without displaying the UI. Otherwise, it will return FALSE.

    VU_HANDLE_MASTER_KEY

    Handle master key encryption and decryption if master key encryption and decryption are supported.

    VU_UNTIL_SUCCESS

    Keep calling into the LAP until the user cancels, or until the user successfully verifies.

    Ee498587.note(en-us,WinEmbedded.80).gifNote:
    If the VU_NO_UI flag is passed to the function, VU_UNTIL_SUCCESS is ignored.
  • pExtended
    Reserved. Must be set to NULL.

Return Value

Returns TRUE if the user is verified, and FALSE otherwise. To get extended error information, the application should call GetLastError. If the user cancelled the verification request, GetLastError returns ERROR_CANCELLED. If the user failed authentication, GetLastError returns ERROR_WRONG_PASSWORD, or a more applicable code set by the LAP.

Remarks

Note

The PromptForPasswd function is deprecated. Use the VerifyUser function instead.

Example

The following example shows how the application can use VerifyUser to authenticate the user before calling any secure function. CallSecureFunction and TellUserVerificationFailed in this example are user-defined functions.

APP A;
HWND hMyWindow;
VerifyAndCallSecureFunction() 
{
    DWORD LastError;
    GUID AEKeyForFoo = ...;
    if (VerifyUser(&AEKeyForFoo,"App A",hMyWindow,VU_UNTIL_SUCCESS,0))  //  Call into LASS; This will  
       CallSecureFunction()  // call into active LAP and show LAP-specific UI
    else 
       TellUserVerificationFailed(GetLastError()));  // display your own UI
}

Requirements

Header

lap.h

Library

coredll.lib

See Also

Reference

LASS Functions
VerifyUser (LAP)