The CryptGetOIDFunctionValue function queries a value associated with an OID. The query is made for a specific named value associated with an OID, function name, and encoding type. The function can return the type of queried value, the value, itself, or both.
BOOL CryptGetOIDFunctionValue( DWORD dwEncodingType, LPCSTR pszFuncName, LPCSTR pszOID, LPCWSTR pwszValueName, DWORD *pdwValueType, BYTE *pbValueData, DWORD *pcbValueData );
Specifies the encoding type to be matched. Currently, only X509_ASN_ENCODING and PKCS_7_ASN_ENCODING are being used; however, additional encoding types may be added in the future. To match both current encoding types, use X509_ASN_ENCODING | PKCS_7_ASN_ENCODING.
A pointer to the null-terminated string that contains the name of the OID function set.
If the high-order word of the OID is nonzero, pszOID is a pointer to either a null-terminated OID string such as "18.104.22.168" or a null-terminated ASCII string such as "file." If the high-order word of the OID is zero, the low-order word specifies the numeric identifier to be used as the object identifier.
A pointer to a null-terminated Unicode string that contains the name of the value to be queried.
A pointer to a variable to receive the value's type. The type returned through this parameter will be one of the following.
||A 32-bit number.|
||A Unicode string that contains unexpanded references to environment variables such as "%PATH%". Applications should ensure that the string has a terminating null character before using it. For details about when the string does not have a terminating null character, see RegQueryValueEx.|
||An array of null-terminated Unicode strings. Applications should ensure that the array is properly terminated by two null characters before using it. For details about when the array is not terminated by two null characters, see RegQueryValueEx.|
||A Unicode string. Applications should ensure that the string has a terminating null character before using it. For details about when the string does not have a terminating null character, see RegQueryValueEx.|
The pdwValueType parameter can be NULL if a returned type is not required.
A pointer to a buffer to receive the value associated with the pwszValueName parameter. The buffer must be big enough to contain the terminating NULL character. This parameter can be NULL if returned data is not required.
This parameter can also be NULL to find the size of the buffer for memory allocation purposes. For more information, see Retrieving Data of Unknown Length.
A pointer to a DWORD that specifies the size, in bytes, of the buffer pointed to by the pbValueData.
In most cases the value returned in *pcbValueData includes the size of the terminating NULL character in the string. For information about situations where the NULL character is not included, see the Remarks section of RegQueryValueEx.
If the function succeeds, the function returns nonzero (TRUE).
If the function fails, it returns zero (FALSE). For extended error information, call GetLastError.
This function has the following error code.
||If the buffer specified by the pbValueData parameter is not large enough to hold the returned data, the function sets the ERROR_MORE_DATA code and stores the required buffer size, in bytes, into the variable pointed to by pcbValueData.|
|Minimum supported client||Windows XP [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2003 [desktop apps | UWP apps]|