Skip to content

Latest commit

 

History

History
127 lines (101 loc) · 4.3 KB

nf-ncryptprotect-ncryptqueryprotectiondescriptorname.md

File metadata and controls

127 lines (101 loc) · 4.3 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:ncryptprotect.NCryptQueryProtectionDescriptorName
NCryptQueryProtectionDescriptorName function (ncryptprotect.h)
Retrieves the protection descriptor rule string associated with a registered descriptor display name.
NCryptQueryProtectionDescriptorName
NCryptQueryProtectionDescriptorName function [Security]
ncryptprotect/NCryptQueryProtectionDescriptorName
security.ncryptqueryprotectiondescriptorname
security\ncryptqueryprotectiondescriptorname.htm
security
32953AEC-01EE-4ED1-80F3-29963F43004F
12/05/2018
NCryptQueryProtectionDescriptorName, NCryptQueryProtectionDescriptorName function [Security], ncryptprotect/NCryptQueryProtectionDescriptorName, security.ncryptqueryprotectiondescriptorname
ncryptprotect.h
Windows
Windows 8 [desktop apps only]
Windows Server 2012 [desktop apps only]
NCrypt.lib
NCrypt.dll
Windows
19H1
NCryptQueryProtectionDescriptorName
ncryptprotect/NCryptQueryProtectionDescriptorName
c++
APIRef
kbSyntax
DllExport
NCrypt.dll
NCryptQueryProtectionDescriptorName

NCryptQueryProtectionDescriptorName function

-description

The NCryptQueryProtectionDescriptorName function retrieves the protection descriptor rule string associated with a registered descriptor display name.

-parameters

-param pwszName [in]

The registered display name for the protection descriptor. Register a name by calling the NCryptRegisterProtectionDescriptorName function.

-param pwszDescriptorString [out]

A null-terminated Unicode string that contains the protection descriptor rule. Set this value to NULL and set the size of the descriptor string pointed to by pcDescriptorString argument to zero on your initial call to this function. For more information, see Remarks.

-param pcDescriptorString [in, out]

Pointer to a variable that contains the number of characters in the string retrieved in the pwszDescriptorString parameter. Set the variable to zero on your initial call to this function. For more information, see Remarks.

-param dwFlags

Flag that specifies which registry hive to query for the registered name. This can be zero to look in the HKEY_CURRENT_USER hive or you can specify NCRYPT_MACHINE_KEY_FLAG to query the HKEY_LOCAL_MACHINE hive.

-returns

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 code Description
ERROR_SUCCESS
The function was successful.
NTE_INVALID_PARAMETER
The pwszName parameter cannot be NULL, and the value pointed to by the parameter cannot be an empty string.
NTE_BAD_FLAGS
The dwFlags parameter must be zero or NCRYPT_MACHINE_KEY_FLAG.

-remarks

To retrieve a protection descriptor rule string, you must call this function twice. The first time you call, set the pwszDescriptorString argument to NULL and the value pointed to by the pcDescriptorString argument to zero. Your first call retrieves the number of characters in the descriptor string. Use this number to allocate memory for the string and retrieve a pointer to the allocated buffer. To retrieve the string, call the function again using the pointer.

-see-also

CNG DPAPI Functions

NCryptRegisterProtectionDescriptorName