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 structure contains pointers to callback functions that can be used by CSP functions.

Syntax

typedef struct _VTableProvStruc {
  DWORD 
Version; 
  FARPROC 
FuncVerifyImage; 
  FARPROC 
FuncReturnhWnd; 
  DWORD 
dwProvType; 
  BYTE* 
pbContextInfo; 
  DWORD 
cbContextInfo; 
  LPWSTR 
pszProvName;
} VTableProvStruc, *PVTableProvStruc;
BOOL FuncVerifyImage(LPCSTR lpszImage, BYTE *pSigData);
BOOL FuncReturnhWnd(DWORD *phWnd);

Members

Version

DWORDvalue indicating the version of the structure. For Windows Embedded CE, the value is 3.

FuncVerifyImage

Pointer to a callback function to verify a signature. See the Remarks section for details.

FuncReturnhWnd

Pointer to a callback function that returns information on a window handle to use when interacting directly with the user using Microsoft® Win32®. CSPs that do not communicate directly with the user and CSPs that use dedicated hardware for this purpose can ignore this entry. This window handle is zero by default, but some applications will set it to a different value by using the CryptSetProvParamfunction.

dwProvType

DWORDvalue that specifies the type of provider to acquire. The following provider types are predefined:

  • PROV_RSA_FULL

  • PROV_RSA_SIG

  • PROV_DSS

  • PROV_FORTEZZA

  • PROV_MS_EXCHANGE

pbContextInfo

Pointer to an array of context information. The pbContextInfoand cbContextInfomembers together determine the information set used when a CPSetProvParamfunction is called with PP_CONTEXT_INFO set.

cbContextInfo

DWORDvalue indicating the number of elements in the pbContextInfoarray.

pszProvName

String containing the name of the provider.

Remarks

The pointers in the VTableProvStrucstructure are only available within the CPAcquireContextfunction. If members of the structure are needed after a call to CPAcquireContextis completed, copies of the needed structure elements must be made by the CSP. The function pointers in the structure can be copied and the function pointer can be used until the context is freed.

All auxiliary DLLs into which a CSP makes function calls must be signed in the same manner (and with the same key) as the primary CSP DLL. To make this work properly, the auxiliary DLLs must be loaded dynamically, using the LoadLibraryfunction. But before Load

Libraryis called, the signature of the DLL must be verified. The CSP does this verification by calling the FuncVerifyImagefunction, as illustrated in the following code fragment.

Copy Code
BOOL (FARPROC *ProvVerifyImage)(LPCSTR lpszImage, BYTE *pSigData);
BYTE bSignature[72];
// "ProvVerifyImage" has been set to "pVTable->FuncVerifyImage"
// within the CPAcquireContext function.
// Load the C:\Winnt40\System32\signature.sig file into the 
// bSignature buffer. During development, this file is created 
// with the Sign.exe utility.
...
// Verify the signature on the C:\Winnt40\System32\Signature.dll
file.
if(RCRYPT_FAILED(ProvVerifyImage("c:\\winnt40\\system32\\signature.dll",
								 bSignature)) {
	SetLastError(NTE_BAD_SIGNATURE);
	return CRYPT_FAILED;
}
// Load the DLL with the LoadLib function, then acquire pointers to

// the member functions with the GetProcAddress function.
...

Requirements

Header wincrypt.h
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also