Platform SDK: Cryptography |
The CPSetProvParam function customizes the operations of a cryptographic service provider (CSP).
BOOL CPSetProvParam( HCRYPTPROV hProv, // in DWORD dwParam, // in BYTE *pbData, // in DWORD dwFlags // in );
Windows 95 does not support this flag.
Customizable parameters can be added as needed. General-purpose parameters can be defined in coordination with Microsoft Corporation to promote cross-vendor standardization and allow the new parameter numbers to be added to the standard Microsoft® Win32® header files.
Value | Meaning |
---|---|
OWNER_SECURITY_INFORMATION | Indicates the owner identifier of the object being referenced. |
GROUP_SECURITY_INFORMATION | Indicates the primary group identifier of the object being referenced. |
DACL_SECURITY_INFORMATION | Indicates the discretionary ACL of the object being referenced. |
SACL_SECURITY_INFORMATION | Indicates the system ACL of the object being referenced. |
If the function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE, and the appropriate error code from the following table must be set using SetLastError.
Error | Description |
---|---|
NTE_BAD_FLAGS | The value of the dwFlags parameter is invalid. |
NTE_BAD_TYPE | The dwParam parameter specifies an unknown parameter number. |
NTE_BAD_UID | The context specified by hProv is invalid. |
NTE_FAIL | The function failed in an unexpected way. |
Applications can call CryptSetProvParam with the dwParam parameter set to PP_CLIENT_HWND to specify the window handle the CSP is to use when interacting with the user. The call to CryptSetProvParam passes in the window handle as a DWORD value in the pbData buffer.
Applications call CryptSetProvParam before calling CryptAcquireContext; therefore, calls to CPSetProvParam with the PP_CLIENT_HWND parameter are not made. The CSP obtains this window handle using a virtual function pointer obtained from the CPAcquireContext function call.
Windows NT/2000: Requires Windows NT 4.0 or later.
Windows 95/98: Requires Windows 95 OSR2 or later (or Windows 95 with Internet Explorer 3.02 or later).
Header: Declared in Wincrypt.h.