mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 07:28:47 +00:00
crypt32: Use public functions to get store access state.
This commit is contained in:
parent
4c6988e8f0
commit
79cd672c3d
|
@ -296,8 +296,11 @@ BOOL WINAPI CertGetCertificateContextProperty(PCCERT_CONTEXT pCertContext,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*(DWORD *)pvData =
|
if (pCertContext->hCertStore)
|
||||||
CertStore_GetAccessState(pCertContext->hCertStore);
|
ret = CertGetStoreProperty(pCertContext->hCertStore, dwPropId,
|
||||||
|
pvData, pcbData);
|
||||||
|
else
|
||||||
|
*(DWORD *)pvData = 0;
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -368,8 +368,11 @@ BOOL WINAPI CertGetCRLContextProperty(PCCRL_CONTEXT pCRLContext,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*(DWORD *)pvData =
|
if (pCRLContext->hCertStore)
|
||||||
CertStore_GetAccessState(pCRLContext->hCertStore);
|
ret = CertGetStoreProperty(pCRLContext->hCertStore, dwPropId,
|
||||||
|
pvData, pcbData);
|
||||||
|
else
|
||||||
|
*(DWORD *)pvData = 0;
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -120,8 +120,6 @@ BOOL CRYPT_ReadSerializedFile(HANDLE file, HCERTSTORE store);
|
||||||
*/
|
*/
|
||||||
void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info);
|
void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info);
|
||||||
|
|
||||||
DWORD CertStore_GetAccessState(HCERTSTORE hCertStore);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Context functions
|
* Context functions
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2098,21 +2098,6 @@ BOOL WINAPI CertSaveStore(HCERTSTORE hCertStore, DWORD dwMsgAndCertEncodingType,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD CertStore_GetAccessState(HCERTSTORE hCertStore)
|
|
||||||
{
|
|
||||||
DWORD state = 0;
|
|
||||||
|
|
||||||
if (hCertStore)
|
|
||||||
{
|
|
||||||
PWINECRYPT_CERTSTORE store = (PWINECRYPT_CERTSTORE)hCertStore;
|
|
||||||
|
|
||||||
if (store->type != StoreTypeMem &&
|
|
||||||
!(store->dwOpenFlags & CERT_STORE_READONLY_FLAG))
|
|
||||||
state |= CERT_ACCESS_STATE_WRITE_PERSIST_FLAG;
|
|
||||||
}
|
|
||||||
return state;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define CertContext_CopyProperties(to, from) \
|
#define CertContext_CopyProperties(to, from) \
|
||||||
Context_CopyProperties((to), (from), sizeof(CERT_CONTEXT))
|
Context_CopyProperties((to), (from), sizeof(CERT_CONTEXT))
|
||||||
|
|
||||||
|
@ -2508,7 +2493,12 @@ BOOL WINAPI CertGetStoreProperty(HCERTSTORE hCertStore, DWORD dwPropId,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*(DWORD *)pvData = CertStore_GetAccessState(hCertStore);
|
DWORD state = 0;
|
||||||
|
|
||||||
|
if (store->type != StoreTypeMem &&
|
||||||
|
!(store->dwOpenFlags & CERT_STORE_READONLY_FLAG))
|
||||||
|
state |= CERT_ACCESS_STATE_WRITE_PERSIST_FLAG;
|
||||||
|
*(DWORD *)pvData = state;
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue