static const WCHAR MY[] = {'M','Y',0};
static const WCHAR CA[] = {'C','A',0};
static const WCHAR ADDRESSBOOK[] = {'A','D','D','R','E','S','S','B','O','O','K',0};
-static const LPCWSTR LocalizedKeys[] = {ROOT,MY,CA,ADDRESSBOOK};
-static WCHAR LocalizedNames[4][256];
+static const WCHAR TRUSTEDPUBLISHER[] = {'T','r','u','s','t','e','d','P','u','b','l','i','s','h','e','r',0};
+static const WCHAR DISALLOWED[] = {'D','i','s','a','l','l','o','w','e','d',0};
+static const LPCWSTR LocalizedKeys[] = {ROOT,MY,CA,ADDRESSBOOK,TRUSTEDPUBLISHER,DISALLOWED};
+static WCHAR LocalizedNames[sizeof(LocalizedKeys)/sizeof(LocalizedKeys[0])][256];
static void free_function_sets(void)
{
{
if (!strcasecmp(pszFuncName, cursor->name))
{
- ret = (HCRYPTOIDFUNCSET)cursor;
+ ret = cursor;
break;
}
}
}
LeaveCriticalSection(&funcSetCS);
- return (HCRYPTOIDFUNCSET)ret;
+ return ret;
}
static char *CRYPT_GetKeyName(DWORD dwEncodingType, LPCSTR pszFuncName,
DWORD dwEncodingType, LPWSTR pwszDllList, DWORD *pcchDllList)
{
BOOL ret = TRUE;
- struct OIDFunctionSet *set = (struct OIDFunctionSet *)hFuncSet;
+ struct OIDFunctionSet *set = hFuncSet;
char *keyName;
HKEY key;
- long rc;
+ LSTATUS rc;
TRACE("(%p, %d, %p, %p)\n", hFuncSet, dwEncodingType, pwszDllList,
pcchDllList);
TRACE("(%p, %d, %s, %d, %p, %08x)\n", hModule, dwEncodingType,
debugstr_a(pszFuncName), cFuncEntry, rgFuncEntry, dwFlags);
- set = (struct OIDFunctionSet *)CryptInitOIDFunctionSet(pszFuncName, 0);
+ set = CryptInitOIDFunctionSet(pszFuncName, 0);
if (set)
{
DWORD i;
char *keyName;
const char *funcName;
HKEY key;
- long rc;
+ LSTATUS rc;
keyName = CRYPT_GetKeyName(dwEncodingType, szFuncName, pszOID);
rc = RegOpenKeyExA(HKEY_LOCAL_MACHINE, keyName, 0, KEY_READ, &key);
HCRYPTOIDFUNCADDR *phFuncAddr)
{
BOOL ret = FALSE;
- struct OIDFunctionSet *set = (struct OIDFunctionSet *)hFuncSet;
+ struct OIDFunctionSet *set = hFuncSet;
TRACE("(%p, %d, %s, %08x, %p, %p)\n", hFuncSet, dwEncodingType,
debugstr_a(pszOID), dwFlags, ppvFuncAddr, phFuncAddr);
*/
if (hFuncAddr)
{
- struct FuncAddr *addr = (struct FuncAddr *)hFuncAddr;
+ struct FuncAddr *addr = hFuncAddr;
CryptMemFree(addr->dllList);
FreeLibrary(addr->lib);
DWORD dwEncodingType, LPCWSTR pwszDll, DWORD dwFlags, void **ppvFuncAddr,
HCRYPTOIDFUNCADDR *phFuncAddr)
{
- struct OIDFunctionSet *set = (struct OIDFunctionSet *)hFuncSet;
+ struct OIDFunctionSet *set = hFuncSet;
BOOL ret = FALSE;
TRACE("(%p, %d, %s, %08x, %p, %p)\n", hFuncSet, dwEncodingType,
}
else
{
- struct FuncAddr *addr = (struct FuncAddr *)*phFuncAddr;
+ struct FuncAddr *addr = *phFuncAddr;
if (!addr)
{
return TRUE;
}
+/***********************************************************************
+ * CryptRegisterOIDInfo (CRYPT32.@)
+ */
+BOOL WINAPI CryptRegisterOIDInfo(PCCRYPT_OID_INFO pInfo, DWORD dwFlags)
+{
+ FIXME("(%p, %x): stub\n", pInfo, dwFlags );
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
+}
+
/***********************************************************************
* CryptUnregisterOIDFunction (CRYPT32.@)
*/
{
DWORD len = CRYPT_GetMultiStringCharacterLen(multi);
+ if (spotToRemove + lstrlenW(toRemove) + 2 >= multi + len)
+ {
+ /* Removing last string in list, terminate multi string directly */
+ *spotToRemove = 0;
+ *(spotToRemove + 1) = 0;
+ }
+ else
+ {
/* Copy remainder of string "left" */
memmove(spotToRemove, spotToRemove + lstrlenW(toRemove) + 1,
(len - (spotToRemove - multi)) * sizeof(WCHAR));
+ }
ret = TRUE;
}
else
{
struct OIDInfo *info;
- TRACE("CRYPT_OID_INFO_NAME_KEY: %s\n", debugstr_w((LPWSTR)pvKey));
+ TRACE("CRYPT_OID_INFO_NAME_KEY: %s\n", debugstr_w(pvKey));
EnterCriticalSection(&oidInfoCS);
LIST_FOR_EACH_ENTRY(info, &oidInfo, struct OIDInfo, entry)
{
- if (!lstrcmpW(info->info.pwszName, (LPWSTR)pvKey) &&
+ if (!lstrcmpW(info->info.pwszName, pvKey) &&
(!dwGroupId || info->info.dwGroupId == dwGroupId))
{
ret = &info->info;
case CRYPT_OID_INFO_OID_KEY:
{
struct OIDInfo *info;
- LPSTR oid = (LPSTR)pvKey;
+ LPSTR oid = pvKey;
TRACE("CRYPT_OID_INFO_OID_KEY: %s\n", debugstr_a(oid));
EnterCriticalSection(&oidInfoCS);