Export (0) Print
Expand All
2 out of 2 rated this helpful - Rate this topic

BCryptGetProperty function

The BCryptGetProperty function retrieves the value of a named property for a CNG object.

Syntax


NTSTATUS WINAPI BCryptGetProperty(
  _In_   BCRYPT_HANDLE hObject,
  _In_   LPCWSTR pszProperty,
  _Out_  PUCHAR pbOutput,
  _In_   ULONG cbOutput,
  _Out_  ULONG *pcbResult,
  _In_   ULONG dwFlags
);

Parameters

hObject [in]

A handle that represents the CNG object to obtain the property value for.

pszProperty [in]

A pointer to a null-terminated Unicode string that contains the name of the property to retrieve. This can be one of the predefined Cryptography Primitive Property Identifiers or a custom property identifier.

pbOutput [out]

The address of a buffer that receives the property value. The cbOutput parameter contains the size of this buffer.

cbOutput [in]

The size, in bytes, of the pbOutput buffer.

pcbResult [out]

A pointer to a ULONG variable that receives the number of bytes that were copied to the pbOutput buffer. If the pbOutput parameter is NULL, this function will place the required size, in bytes, in the location pointed to by this parameter.

dwFlags [in]

A set of flags that modify the behavior of this function. No flags are defined for this function.

Return value

Returns a status code that indicates the success or failure of the function.

Possible return codes include, but are not limited to, the following.

Return codeDescription
STATUS_SUCCESS

The function was successful.

STATUS_BUFFER_TOO_SMALL

The buffer size specified by the cbOutput parameter is not large enough to hold the property value.

STATUS_INVALID_HANDLE

The handle in the hObject parameter is not valid.

STATUS_INVALID_PARAMETER

One or more parameters are not valid.

STATUS_NOT_SUPPORTED

The named property specified by the pszProperty parameter is not supported.

 

Remarks

To obtain the required size for a property, pass NULL for the pbOutput parameter. This function will place the required size, in bytes, in the value pointed to by the pcbResult parameter.

Depending on what processor modes a provider supports, BCryptGetProperty can be called either from user mode or kernel mode. Kernel mode callers can execute either at PASSIVE_LEVEL IRQL or DISPATCH_LEVEL IRQL. If the current IRQL level is DISPATCH_LEVEL, any pointers passed to the BCryptGetProperty function must refer to nonpaged (or locked) memory. If the object specified in the hObject parameter is a handle, it must have been opened by using the BCRYPT_PROV_DISPATCH flag.

To call this function in kernel mode, use Cng.lib, which is part of the Driver Development Kit (DDK). For more information, see WDK and Developer Tools.

Windows Server 2008 and Windows Vista:  To call this function in kernel mode, use Ksecdd.lib.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Bcrypt.h

Library

Bcrypt.lib

DLL

Bcrypt.dll

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.