int __cdecl _pgp_open_keyrings(LPSTR PubRingPath, LPSTR SecRingPath) { #if defined(_WIN64) return 0; #else _pgp_close_keyrings(); if ((!PubRingPath || !*PubRingPath) && !ShowSelectKeyringsDlg(0,PubRingPath,SecRingPath)) return 0; PGPFileSpecRef PubKeyRing, SecKeyRing; PGPNewFileSpecFromFullPath(pgpContext, PubRingPath, &PubKeyRing); PGPNewFileSpecFromFullPath(pgpContext, SecRingPath, &SecKeyRing); PGPError err = PGPOpenKeyDBFile(pgpContext, kPGPOpenKeyDBFileOptions_None, PubKeyRing, SecKeyRing, &pgpKeyDB); PGPFreeFileSpec(SecKeyRing); PGPFreeFileSpec(PubKeyRing); if (CheckPGPError(err)) return 0; return 1; #endif }
int __cdecl _pgp_open_keyrings(LPSTR PubRingPath, LPSTR SecRingPath) { _pgp_close_keyrings(); #if (PGP_WIN32 < 0x700) PGPError err = PGPOpenDefaultKeyRings(pgpContext, kPGPKeyRingOpenFlags_None, &pgpKeyDB); #else if ((!PubRingPath || !*PubRingPath) && !ShowSelectKeyringsDlg(0,PubRingPath,SecRingPath)) { return 0; } PGPFileSpecRef PubKeyRing, SecKeyRing; PGPNewFileSpecFromFullPath(pgpContext, PubRingPath, &PubKeyRing); PGPNewFileSpecFromFullPath(pgpContext, SecRingPath, &SecKeyRing); PGPError err = PGPOpenKeyDBFile(pgpContext, kPGPOpenKeyDBFileOptions_None, PubKeyRing, SecKeyRing, &pgpKeyDB); PGPFreeFileSpec(SecKeyRing); PGPFreeFileSpec(PubKeyRing); #endif if (CheckPGPError(err)) { return 0; } return 1; }