Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

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 VerifyUserwithout displaying the UI. When using this value, the function will return TRUEonly 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.

Note:
The VU_HANDLE_MASTER_KEY option is valid only when it is set by a privileged application.

VU_UNTIL_SUCCESS

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

Note:
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 TRUEif the user is verified, and FALSEotherwise. To get extended error information, the application should call GetLastError. If the user cancelled the verification request, GetLastErrorreturns ERROR_CANCELLED. If the user failed authentication, GetLastErrorreturns ERROR_WRONG_PASSWORD, or a more applicable code set by the LAP.

Remarks

VerifyUsercan be called by any application, whether it is privileged or normal.

Note:
The PromptForPasswdfunction is deprecated. Use the VerifyUserfunction instead.

Example

The following example shows how the application can use VerifyUserto authenticate the user before calling any secure function. CallSecureFunctionand TellUserVerificationFailedin this example are user-defined functions.

Copy Code
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
Windows Embedded CE Windows CE 5.0 and later
Windows Mobile Pocket PC for Windows Mobile Version 5.0 and later, Smartphone for Windows Mobile Version 5.0 and later

See Also