Partager via


VTableProvStruc (Compact 2013)

3/28/2014

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
    DWORD value indicating the version of the structure. For Windows Embedded Compact, 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 CryptSetProvParam function.
  • dwProvType
    DWORD value 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 pbContextInfo and cbContextInfo members together determine the information set used when a CPSetProvParam function is called with PP_CONTEXT_INFO set.
  • cbContextInfo
    DWORD value indicating the number of elements in the pbContextInfo array.
  • pszProvName
    String containing the name of the provider.

Remarks

The pointers in the VTableProvStruc structure are only available within the CPAcquireContext function. If members of the structure are needed after a call to CPAcquireContext is 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 LoadLibrary function. But before Load

Library is called, the signature of the DLL must be verified. The CSP does this verification by calling the FuncVerifyImage function, as illustrated in the following code fragment.

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

See Also

Reference

Cryptography Structures
CPAcquireContext
CryptSetProvParam
CryptSetProvParam
LoadLibrary