summaryrefslogtreecommitdiff
path: root/plugins/CryptoPP/src/cpp_pgpw.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-11 17:48:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-11 17:48:18 +0000
commit2fbe1d2262383b272ef887d712f308f787cf33f1 (patch)
tree772a78df1caf0be843d8778344e02ac750ba7a03 /plugins/CryptoPP/src/cpp_pgpw.cpp
parent48fc03aa394f4506c6053323386c040fede13a29 (diff)
64-bit compatible version of CryptoPP
git-svn-id: http://svn.miranda-ng.org/main/trunk@4917 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/CryptoPP/src/cpp_pgpw.cpp')
-rw-r--r--plugins/CryptoPP/src/cpp_pgpw.cpp52
1 files changed, 1 insertions, 51 deletions
diff --git a/plugins/CryptoPP/src/cpp_pgpw.cpp b/plugins/CryptoPP/src/cpp_pgpw.cpp
index 7a70a99607..84349583c7 100644
--- a/plugins/CryptoPP/src/cpp_pgpw.cpp
+++ b/plugins/CryptoPP/src/cpp_pgpw.cpp
@@ -92,46 +92,8 @@ int load_pgpsdk_mem(HMODULE mod) {
#undef GPA
-BOOL load_pgp_sdk(int type, int id)
-{
- int r; char t[MAX_PATH];
- pgpVer = 0;
-
- if ( isVista ) {
- sprintf(t,"%s\\pgpsdkw.dll",TEMP);
- ExtractFile(t,type,id);
- hpgpsdk = LoadLibraryA(t);
- }
- else {
- hRS_pgp = FindResource( g_hInst, MAKEINTRESOURCE(id), MAKEINTRESOURCE(type) );
- pRS_pgp = (PBYTE) LoadResource( g_hInst, hRS_pgp ); LockResource( pRS_pgp );
- hpgpsdk = MemLoadLibrary( pRS_pgp );
- }
- if (hpgpsdk) {
- if ( isVista ) load_pgpsdk_dll(hpgpsdk);
- else load_pgpsdk_mem(hpgpsdk);
- r = p_pgp_init();
- if (r) {
- pgpVer = p_pgp_get_version();
- return r;
- }
- if ( isVista ) {
- FreeLibrary(hpgpsdk);
- }
- else {
- MemFreeLibrary(hpgpsdk);
- UnlockResource( pRS_pgp );
- FreeResource( pRS_pgp );
- }
- }
- return 0;
-}
-
-
int __cdecl pgp_init()
{
- int r;
-
if ( !hPGPPRIV ) {
// create context for private pgp keys
hPGPPRIV = (HANDLE) cpp_create_context(MODE_PGP|MODE_PRIV_KEY);
@@ -140,11 +102,7 @@ int __cdecl pgp_init()
memset(tmp->pdata,0,sizeof(PGPDATA));
}
- if ( r = load_pgp_sdk(666,6) ) return r;
- if ( r = load_pgp_sdk(666,8) ) return r;
-
- hpgpsdk = 0;
-
+ hpgpsdk = g_hInst;
return 0;
}
@@ -155,14 +113,6 @@ int __cdecl pgp_done()
pgpVer = 0;
if (hpgpsdk) {
r = p_pgp_done();
- if ( isVista ) {
- FreeLibrary(hpgpsdk);
- }
- else {
- MemFreeLibrary(hpgpsdk);
- UnlockResource( pRS_pgp );
- FreeResource( pRS_pgp );
- }
hpgpsdk = 0;
}
return r;