wintrust(1/5): Implement SoftpubCleanup (take 2)
Juan Lang
juan.lang at gmail.com
Wed Sep 12 11:03:18 CDT 2007
Resynced after Francois's patch. The remaining patches are unchanged,
but I'll resend them too.
--Juan
-------------- next part --------------
From c5cbf59da42546dd50e81936e043e59acb679b92 Mon Sep 17 00:00:00 2001
From: Juan Lang <juan.lang at gmail.com>
Date: Wed, 12 Sep 2007 08:58:45 -0700
Subject: [PATCH] Implement SoftpubCleanup
---
dlls/wintrust/softpub.c | 35 +++++++++++++++++++++++++++++++++++
dlls/wintrust/wintrust.spec | 2 +-
2 files changed, 36 insertions(+), 1 deletions(-)
diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c
index 48632d5..2d892b5 100644
--- a/dlls/wintrust/softpub.c
+++ b/dlls/wintrust/softpub.c
@@ -569,3 +569,38 @@ HRESULT WINAPI WintrustCertificateTrust(
GetLastError();
return ret ? S_OK : S_FALSE;
}
+
+HRESULT WINAPI SoftpubCleanup(CRYPT_PROVIDER_DATA *data)
+{
+ DWORD i, j;
+
+ for (i = 0; i < data->csSigners; i++)
+ {
+ for (j = 0; j < data->pasSigners[i].csCertChain; j++)
+ CertFreeCertificateContext(data->pasSigners[i].pasCertChain[j].pCert);
+ data->psPfns->pfnFree(data->pasSigners[i].pasCertChain);
+ data->psPfns->pfnFree(data->pasSigners[i].psSigner);
+ CertFreeCertificateChain(data->pasSigners[i].pChainContext);
+ }
+ data->psPfns->pfnFree(data->pasSigners);
+
+ for (i = 0; i < data->chStores; i++)
+ CertCloseStore(data->pahStores[i], 0);
+ data->psPfns->pfnFree(data->pahStores);
+
+ if (data->u.pPDSip)
+ {
+ data->psPfns->pfnFree(data->u.pPDSip->pSip);
+ data->psPfns->pfnFree(data->u.pPDSip->pCATSip);
+ data->psPfns->pfnFree(data->u.pPDSip->psSipSubjectInfo);
+ data->psPfns->pfnFree(data->u.pPDSip->psSipCATSubjectInfo);
+ data->psPfns->pfnFree(data->u.pPDSip->psIndirectData);
+ }
+
+ CryptMsgClose(data->hMsg);
+
+ if (data->fOpenedFile)
+ CloseHandle(data->pWintrustData->u.pFile->hFile);
+
+ return S_OK;
+}
diff --git a/dlls/wintrust/wintrust.spec b/dlls/wintrust/wintrust.spec
index c7ae993..f260193 100644
--- a/dlls/wintrust/wintrust.spec
+++ b/dlls/wintrust/wintrust.spec
@@ -58,7 +58,7 @@
@ stub OpenPersonalTrustDBDialog
@ stub SoftpubAuthenticode
@ stdcall SoftpubCheckCert(ptr long long long)
-@ stub SoftpubCleanup
+@ stdcall SoftpubCleanup(ptr)
@ stub SoftpubDefCertInit
@ stdcall SoftpubDllRegisterServer()
@ stdcall SoftpubDllUnregisterServer()
--
1.4.1
More information about the wine-patches
mailing list