CryptFindLocalizedName

[This is preliminary documentation and subject to change.]

The CryptFindLocalizedName function finds the localized name for the specified name, such as the "Root" system store name.

#include <wincrypt.h>
LPCWSTR WINAPI CryptFindLocalizedName(
  LPCWSTR pwszCryptName        // in
);
 

Parameters

pwszCryptName
A pointer to a specified name. An internal table is searched to compare a predefined localized name to the specified name. The search matches the localized name using a case insensitive string comparison.

Note  Localized names for the predefined system stores ("Root", "My") and predefined physical stores (".Default", ".LocalMachine") are pre-installed as resource strings in crypt32.dll.

Return Values

If the specified name is found, a pointer to the localized name is returned. The returned pointer MUST NOT be freed.

If the specified name is not found, a NULL is returned.

Remarks

CryptSetOIDFunctionValue can be called as follows to register additional localized strings:

dwEncodingType = CRYPT_LOCALIZED_NAME_ENCODING_TYPE

pszFuncName = CRYPT_OID_FIND_LOCALIZED_NAME_FUNC

pszOID = CRYPT_LOCALIZED_NAME_OID

pwszValueName = Name to be localized, for example, L"ApplicationStore"

dwValueType = REG_SZ

pbValueData = pointer to the UNICODE localized string

cbValueData = (wcslen(UNICODE localized string) + 1) * sizeof(WCHAR)

CryptSetOIDFunctionValue can be called as follows to unregister the localized strings;

pbValueData = NULL

cbValueData = 0.

The registered names are searched before the pre-installed names

CRYPT_LOCALIZED_NAME_
ENCODING_TYPE
0
CRYPT_LOCALIZED_NAME_
OID
"LocalizedNames"
CRYPT_OID_FIND_LOCALIZED_
NAME_FUNC
"CryptDLLFindLocalizedName"

Example

// EXAMPLE CODE FOR USING CryptFindLocalizedName().
// Assume that the application has a pointer (pwszCryptName)
// to a specific name.
// Set up the variables.
LPCWSTR pwszCryptName;   // Pointer to a null terminated
                         //   string containing the
                         //   specified name
LPCWSTR lpResult;        // Return pointer to the found
                         //  localized name
// Function call to CryptFindLocalizedName.
lpResult= CryptFindLocalizedName(
        pwszCryptName);  // in - A pointer to a specified
                         //   name defined elsewhere
cout<< "CryptFindLocalizedName;"<< endl<< endl;
if (lpResult) {          // returned value is a Pointer
                         //   to a found localized name
   cout<< "localized name at "<< lpResult<< endl
       << "the localized name is "<< &lpResult<< endl;
}
else {                   // returned value is NULL
   cout<< "no localized name found"<< endl<< endl;
}
 

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later. Available also in IE 3.02 and later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in wincrypt.h.
  Import Library: Use crypt32.lib.

See Also

CryptSetOIDFunctionValue