NCryptGetProperty function (ncrypt.h)
The NCryptGetProperty function retrieves the value of a named property for a key storage object.
SECURITY_STATUS NCryptGetProperty( [in] NCRYPT_HANDLE hObject, [in] LPCWSTR pszProperty, [out] PBYTE pbOutput, [in] DWORD cbOutput, [out] DWORD *pcbResult, [in] DWORD dwFlags );
The handle of the object to get the property for. This can be a provider handle (NCRYPT_PROV_HANDLE) or a key handle (NCRYPT_KEY_HANDLE).
A pointer to a null-terminated Unicode string that contains the name of the property to retrieve. This can be one of the predefined Key Storage Property Identifiers or a custom property identifier.
The address of a buffer that receives the property value. The cbOutput parameter contains the size of this buffer.
To calculate the size required for the buffer, set this parameter to NULL. The size, in bytes, required is returned in the location pointed to by the pcbResult parameter.
The size, in bytes, of the pbOutput buffer.
A pointer to a DWORD variable that receives the number of bytes that were copied to the pbOutput buffer.
If the pbOutput parameter is NULL, the size, in bytes, required for the buffer is placed in the location pointed to by this parameter.
Flags that modify function behavior. This can be zero or the following value.
For the NCRYPT_SECURITY_DESCR_PROPERTY property, this parameter must also contain one of the following values, which identifies the part of the security descriptor to retrieve.
||Retrieve the security identifier (SID) of the object's owner. Use the GetSecurityDescriptorOwner function to obtain the owner SID from the SECURITY_DESCRIPTOR structure.|
||Retrieve the SID of the object's primary group. Use the GetSecurityDescriptorGroup function to obtain the group SID from the SECURITY_DESCRIPTOR structure.|
||Retrieve the discretionary access control list (DACL). Use the GetSecurityDescriptorSacl function to obtain the DACL from the SECURITY_DESCRIPTOR structure.|
||Retrieve the system access control list (SACL). Use the GetSecurityDescriptorDacl function to obtain the SACL from the SECURITY_DESCRIPTOR structure.|
Returns a status code that indicates the success or failure of the function.
Possible return codes include, but are not limited to, the following.
||The function was successful.|
||The dwFlags parameter contains a value that is not valid.|
||The hObject parameter is not valid.|
||One or more parameters are not valid.|
||A memory allocation failure occurred.|
||The specified property is not supported for the object.|
A service must not call this function from its StartService Function. If a service calls this function from its StartService function, a deadlock can occur, and the service may stop responding.
|Minimum supported client||Windows Vista [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2008 [desktop apps | UWP apps]|