📄 pgphandling.h
字号:
/*______________________________________________________________________________
Copyright (C) 2002 PGP Corporation
All rights reserved.
$Id: PgpHandling.h,v 1.9 2002/11/21 22:59:34 sdas Exp $
______________________________________________________________________________*/
#ifndef Included_PgpHandling_h /* [ */
#define Included_PgpHandling_h
//system headers
#include <stdio.h> //for sprintf()
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#include <crtdbg.h>
//PGPsdk headers
#include <PGPsc.h>
#include <pgpErrors.h>
#include <pgpMem.h>
//shared headers
#include <pgpClientLib.h>
#include <DecryptVerify.h>
#include <EncryptSign.h>
#include <Working.h>
#include <WorkingResource.h>
#include <Prefs.h> //for utility procedures like ByDefaultSign
#include <pgpClientPrefs.h> //for prefs token definitions like
// kPGPPrefDecryptCacheEnable; also
// pgpBase.h definitions like INT_MAX
#include <SharedStrings.h>
#include <SigEvent.h>
#include <VerificationBlock.h>
#include <pgpVersionHeader.h>
#include <pgpPFLPriv.h> //for PGPValidateParam()
#include <pgpBuild.h> //for PGPVERSIONMAJOR, PGPVERSIONMINOR
#include <pgpWin32Errors.h> //for kPGPError_Win32_Expired
//local headers
#include "VbCallable.h"
#include "LibFileSystem.h" //for ei_FileAccess()
typedef struct {
HINSTANCE h_Instance;
HWND h_wndMain;
PGPContextRef pgpContext;
PGPtlsContextRef pgpTlsContext;
char * pc_AppNm;
const char * pc_ModuleNm;
} PgpBasicInput;
typedef enum {
mi_TEST_FOR_PGP_ASCII = 1,
mi_GET_PGP_BLOCK_COORDS,
mi_NO_TASK = 0
} SpecialPlugInTask;
typedef struct {
SpecialPlugInTask i_Task;
BOOL * pf_Successful;
void * pv_return;
} SpecialPlugInTaskInfo;
typedef struct {
DWORD ul_offsetBegin;
DWORD ul_offsetEnd;
} PgpBlockCoordInfo;
typedef struct {
BOOL f_Sign;
BOOL f_Encrypt;
PGPclRecipientDialogStruct t_recipients;
PGPOptionListRef pgpUserOptions;
} PgpEncodeContext;
//structure copied from shared-code PGP module DecryptVerify.c
typedef struct _VerificationBlock {
struct _VerificationBlock * next;
struct _VerificationBlock * previous;
char * szBlockBegin;
char * szBlockEnd;
void * pOutput;
PGPSize outSize;
PGPBoolean bEncrypted;
PGPBoolean FYEO;
} VerificationBlock;
//structure copied from shared-code PGP module DecryptVerify.c
typedef struct {
HINSTANCE h_Instance;
HWND h_wndMain;
HWND h_wndWorking;
PGPtlsContextRef pgpTlsContext;
char * pc_AppNm;
PGPKeyDBRef keyDB;
PGPKeyDBRef keydbNew;
PGPKeySetRef recipients;
PGPUInt32 ul_keyCount;
PGPKeyID * pt_keyIds;
VerificationBlock * pt_block;
PGPByte contents;
PGPFileSpecRef fsrFileRef;
} DecodeEventData;
typedef struct {
DecodeEventData t_normalData;
SpecialPlugInTaskInfo t_task;
} MyDecodeEventData;
typedef struct _NameFoundNode {
struct {
char * pc_nm;
BOOL f_found;
BYTE opaque[ sizeof( void *)];
} * pt_name;
struct _NameFoundNode * pt_next;
} NameFoundNode;
extern const char epc_CRLF[];
extern const int ei_NOT_FOUND, ei_LEN_CRLF, ei_SAME;
extern const UINT eus_ERR_INVLD_ARG;
extern HINSTANCE eh_Instance;
//prototype copied from DecryptVerify.c
PGPError DecodeEventHandler( PGPContextRef, PGPEvent *, PGPUserValue);
//prototype copied from EncryptSign.c
PGPError EncodeEventHandler( PGPContextRef, PGPEvent *, PGPUserValue);
static PGPError i_DecodeEventHandlerOverride( PGPContextRef, PGPEvent *,
PGPUserValue);
static void DisplayPgpError( const char *const, const int, const char *const,
int);
static PGPError i_DecryptVerify( const PgpBasicInput *const,
PGPOptionListRef, const BOOL,
const SpecialPlugInTaskInfo,
VerificationBlock *const,
const BOOL, BOOL *const);
static PGPError i_DecryptVerifyBuffer( const PgpBasicInput *const,
const char *const, const DWORD,
const BOOL, const BOOL, const BOOL,
SpecialPlugInTaskInfo, void * *const,
PGPSize *const, BOOL *const);
static PGPError i_GetPgpAsciiCoords( char * *const, const DWORD, DWORD *const,
DWORD *const);
static PGPError i_EncryptSignBuffer( const PgpBasicInput *const, void *,
DWORD, PGPclRecipientDialogStruct *const,
PGPOptionListRef, PGPOptionListRef *,
void * *, PGPSize *, BOOL, BOOL, BOOL);
static PGPError i_EncryptSign( const PgpBasicInput *const,
PGPclRecipientDialogStruct *,
PGPOptionListRef, PGPOptionListRef,
PGPOptionListRef *, BOOL, BOOL, BOOL);
#endif /* ] Included_PgpHandling_h */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -