precomp.h

来自「PGP8.0源码 请认真阅读您的文件包然后写出其具体功能」· C头文件 代码 · 共 280 行

H
280
字号
/*__________________________________________________________________________
 Copyright (C) 2002 PGP Corporation
 All rights reserved.
 
 $Id: precomp.h,v 1.16 2002/11/13 19:12:55 wjb Exp $
__________________________________________________________________________*/
#ifndef _PGPICQ
#define _PGPICQ

// System headers
#include <windows.h>
#include <windowsx.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h> 
#include <string.h>
#include <ShellAPI.h>
#include <Direct.h>
#include <CommDlg.h>
#include <OLE2.h>
#include <commctrl.h>
#include <process.h>
#include <io.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <RICHEDIT.H>
#include "resource.h"                

// PGPlib headers
#include "pgpVersionHeader.h"
#include "pgpBuild.h"
#include "pgpClientPrefs.h"
#include "pgpKeys.h"
#include "pgpConfig.h"
#include "pgpErrors.h"
#include "pgpEncode.h"
#include "pgpUtilities.h"
#include "pflPrefTypes.h"
#include "pgpPubTypes.h"
#include "pgpClientLib.h"
#include "pgpLnLib.h"
#include "pgpSC.h"
#include "transbmp.h"

//#include "conerror.h"

#define PLUGIN_INFO_PROP "PGPICQ Plugin"

typedef struct _USERSTATE
{
	char *szICQnum;
	BOOL bEncrypt;
	struct _USERSTATE *next;
} USERSTATE;

typedef struct _PLUGININFO
{
	char szICQ[256];
	HWND hwndCurrent;

	HWND hwndRichEdit;
	HWND hwndICQ;
	HWND hwndNick;
	HWND hwndSend;
	HWND hwndSKMark;

	HWND hwndTool;
	HWND hwndBack;

	HWND hwndToolbar;
	HWND hwndSendKey;
	HWND hwndMain;

	BOOL bEncrypt;
	BOOL bSendKey;

	HFONT hFont;

	void *pDoc;

	int	SendID;

	BOOL bInitDone;

	HHOOK hMsgHook;
	BOOL b2001b;
} PLUGININFO, *PPLUGININFO;

#ifdef __cplusplus
extern "C" {
#endif

extern HINSTANCE g_hinst;
extern void *PGPsc;
extern void *PGPtls;
extern PGPKeyDBRef g_KeyDB;
extern PGPKeyIterRef g_KeyIter;
extern HANDLE hGlobalMutex;

extern BOOL g_bDisable;
extern BOOL g_bChecked;
extern DWORD g_nPurgeCacheMsg;
extern USERSTATE *g_userstate;

void InitGetMessageHook(HHOOK* phhookGetMessage);
void UninitGetMessageHook(HHOOK hhookGetMessage);

void SizeToolbar(PPLUGININFO plugin);
void InitToolbar(PPLUGININFO plugin);

void SizeSendKey(PPLUGININFO plugin);
void InitSendKey(PPLUGININFO plugin);

//void SaveSettings(BOOL bEncryptAndSign,BOOL bSendKey);
//void GetSettings(BOOL *bEncryptAndSign,BOOL *bSendKey);
void SaveRetries(char *szVersion,DWORD dwRetries);
void GetRetries(char *szVersion,DWORD *pdwRetries);

PPLUGININFO GetPluginInfo(HWND hwnd);
void SavePluginInfo(HWND hwnd, PPLUGININFO plugin);
PPLUGININFO CreatePluginInfo(HWND hwnd);
void FreePluginInfo(PPLUGININFO plugin);

BOOL EncryptRichEdit(PPLUGININFO plugin);

void CreateBMFileFromResource(const char* file, HRSRC hres);

void GetVersionOfFile (char * pszAppName, // file
                       char * pszVerBuff, // receives version
                       int iVerBuffLen);

BOOL IsSendMessageWindow(HWND hwndRichEdit,
				 HWND *phwndMain,
				 HWND *phwndICQ,
				 HWND *phwndNick,
				 HWND *phwndSend,
				 HWND *phwndSKMark,
				 HWND *phwndTool,
				 HWND *phwndBack,
				 BOOL *b2001b);

BOOL IsSendMessageWindow2000a(HWND hwndRichEdit,
				 HWND *phwndMain,
				 HWND *phwndICQ,
				 HWND *phwndNick,
				 HWND *phwndSend,
				 HWND *phwndSKMark,
				 HWND *phwndTool,
				 HWND *phwndBack);

LRESULT CALLBACK SendMessageWndProc(HWND hDlg, 
				UINT msg,
				WPARAM wParam, 
				LPARAM lParam);

LRESULT CALLBACK ReceiveWndProc(HWND hDlg, 
				UINT msg,
				WPARAM wParam, 
				LPARAM lParam);

void SetRichOLE(PPLUGININFO plugin,HWND hwndEdit);
void InsertRichOLE(HWND hwndRichEdit,DWORD dwType,DWORD dwPos);
void DeleteRichOLE(PPLUGININFO plugin);

typedef struct _ICQWIZINFO
{
	// Wizard data
	HFONT hfontIntro;
	HPALETTE hpaletteDone;
	HPALETTE hpaletteIntro;
	HFONT hfontInterior;
	HBITMAP hbitmapDone;
	HBITMAP hbitmapIntro;
	BOOL bFinishSelected;
	HFONT boldfont;
	HFONT defaultfont;

	PGPContextRef Context;
	PGPtlsContextRef tlsContext;
	PGPKeyDBObjRef DefaultKey;
	PGPKeyDBRef KeyDB;

	char NumBuff[256];
	char NameBuff[256];
	BOOL bResult;
} ICQWIZINFO;

PGPError GetLocalUserKey(PGPKeyDBRef KeyDB,PGPKeyDBObjRef *pLocalKey);
DWORD ReadICQRegKey(void);
BOOL ICQUserIDWizard(HWND hwnd,PGPContextRef Context,
					 PGPtlsContextRef tlsContext,
					 PGPKeyDBObjRef DefaultKey,PGPKeyDBRef KeyDB);

PGPKeyDBObjRef MatchICQWithKey(char *szUserID,PGPKeyDBRef KeyDB,PGPBoolean bMustSign) ;
BOOL CheckForICQMatch(HWND hwnd,void *PGPsc,void *PGPtls,char *szUserID);
BOOL CheckForICQUserID(HWND hwnd,void *PGPsc,void *PGPtls);
void *ExportICQUserID(HWND hwnd,void *PGPsc,void *PGPtls);
BOOL CreateUserID(HWND hwnd,ICQWIZINFO *iwi);

BOOL UserHasState(USERSTATE *userstate,
				char *szICQnum,
				BOOL *bEncrypt);
void AddUserState(USERSTATE **userstate,
				char *szICQnum,
				BOOL bEncrypt);
BOOL ICQWizard(HWND hwnd,void *PGPsc,void *PGPtls);

#define IDC_ENCRYPT 555
#define IDC_SIGN 556
#define IDC_PGPKEYS 557

#define MS_ENCRYPTCLIPBOARD 10

typedef struct _MYSTATE {
	PGPContextRef	context;
	PGPtlsContextRef tlsContext;
	PGPKeyDBRef		KeyDB;
	char			*OperationTarget;
	HANDLE			hSemaphore;
	DWORD			dwThreadID;
	DWORD			numDone;
	DWORD			Operation;
	char			*pInput;
	DWORD			dwInputSize;
	char			*pOutput;     // For encryption
	DWORD			dwOutputSize; // ...
	PGPError		err;
	BOOL			dwWipeFlags;
	char			*szAppName;
// encrypt
	PPGPclRecipientDialogStruct prds;
	BOOL			Encrypt; 
	BOOL			Sign;
	char			*comment;
	PGPUInt32		PrefAlg;
	PGPCipherAlgorithm *allowedAlgs; 
	int				nNumAlgs;

	HWND			hwndWorking;
	PGPFileSpecRef	fileRef;
	char			*fileName;
	char			*verifyName[MAX_PATH+1];
	PGPUInt32		sectionCount;
	PGPKeyDBObjRef	SignKey;
	char			*PassPhrase;
	PGPByte			*PassKey;
	PGPUInt32		PassKeyLen;
} MYSTATE;

PGPError myEvents(
	PGPContextRef context,
	PGPEvent *event,
	PGPUserValue userValue
	);

BOOL ICQEncryptBuffer(HWND hwnd,char *szApp,void *PGPsc,void *PGPtls,
				   BOOL Encrypt,BOOL Sign,
				   char *pInput,DWORD dwInputSize,
				   char **pOutput,DWORD *pdwOutputSize,
				   char **szRecipientArray,DWORD dwNumRecipients,
				   BOOL bForce);

#ifdef __cplusplus
}
#endif

#endif // PGPICQ

/*__Editor_settings____

	Local Variables:
	tab-width: 4
	End:
	vi: ts=4 sw=4
	vim: si
_____________________*/


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?