📄 pgpscint.h
字号:
/*__________________________________________________________________________
Copyright (C) 2002 PGP Corporation
All rights reserved.
$Id: PGPscInt.h,v 1.24 2002/11/16 08:55:23 wjb Exp $
__________________________________________________________________________*/
#ifndef Included_PGPSCINT_h /* [ */
#define Included_PGPSCINT_h
DWORD g_uAddedKeysMessage;
#define MS_ENCRYPTFILELIST 1
#define MS_ENCRYPTCLIPBOARD 2
#define MS_DECRYPTFILELIST 3
#define MS_DECRYPTCLIPBOARD 4
#define MS_ADDKEYFILELIST 5
#define MS_ADDKEYCLIPBOARD 6
#define MS_WIPEFILELIST 7
#define MS_CREATESDAFILELIST 8
#define WIPE_OK 1
#define WIPE_NOTOPEN 2
#define WIPE_USERABORT 3
#define WIPE_NOSTATS 4
#define WIPE_NOREMOVE 5
#define WIPE_NOFLUSH 6
#define WIPE_NOFILEMAP 7
#define WIPE_NOMEMMAP 8
#define WIPE_ALREADYOPEN 9
#define WIPE_WRITEPROTECT 10
#define FS_NOFS 0
#define FS_FAT 1 // Could be FAT12 or FAT16...
#define FS_FAT12 2 // If clusters <= 4079
#define FS_FAT16 3 // If clusters >= 4079
#define FS_FAT32 4 // New for OSR2
#define FS_NTFS 5 // WindowsNT
#define WFE_NOERROR 0
#define WFE_FSNOTSUPPORTED 1
#define WFE_DRIVENOTSUPPORTED 2
#define WFE_FATFAILED 3
#define WFE_COULDNOTLOCK 4
#define WFE_NODRIVESELECTED 5
#define WFE_USERCANCEL 6
#define WFE_DISKMODIFIED 7
#define WFE_COULDNOTWRITE 8
#define WFE_COULDNOTREAD 9
#define WFE_OUTOFMEMORY 10
#define WFE_CLUSTERERROR 11
#define WFE_NTNOTSUPPORTED 12
#define WFE_NTFSGREATER4K 13
#define WFE_INVALPARAM 14 // temp error
#define WFE_ALREADYCOMMIT 15 // temp error
#define WFE_ACCESSDENIED 16
typedef struct _DIRSTACK
{
DWORD dwStartCluster;
struct _DIRSTACK *next;
} DIRSTACK;
typedef struct
{
char *name;
ULONGLONG Vcn;
ULONGLONG Orig;
ULONG Size;
} SLACKMOVE;
typedef struct _SMQUEUE
{
SLACKMOVE *sm;
int smqmax;
int start;
int end;
int length;
int delay;
} SMQUEUE;
#define SLACKBUFFER 1000
typedef struct _VOLINFO
{
// Wizard data
HFONT hfontIntro;
HPALETTE hpaletteDone;
HPALETTE hpaletteIntro;
HFONT hfontInterior;
int passes;
HBITMAP hbitmapDone;
HBITMAP hbitmapIntro;
BOOL bFinishSelected;
BOOL bCmdLine;
char drive[5];
int restarts;
BOOL bWiping;
PGPContextRef context;
HFONT boldfont;
HFONT defaultfont;
BOOL bCancel;
// Wipe data
char *OldName;
ULONGLONG OldVcn;
ULONGLONG OldOrig;
char PGPwipepattern[MAX_PATH];
char drivestr[50];
SMQUEUE *MoveBackQueue;
SMQUEUE *OverwriteQueue;
PGPBoolean WinNT;
FILELIST *FileList;
SLACKMOVE *SlackMove;
DWORD SlackMoveIndex;
DWORD SlackMoveCount;
ULONGLONG SlackBuffer[SLACKBUFFER+1];
DWORD SlackBufferIndex;
HWND hwnd;
HANDLE hVWin32;
HANDLE VolHandle;
DWORD vol0;
DWORD vol1;
DWORD dwFS;
DWORD dwStartSector;
unsigned short sectors_per_clus;
unsigned short sector_size;
unsigned short sectors_per_fat;
int fat_count;
DWORD dwReservedSectors;
DWORD sectors_total;
DWORD dwClusterSize;
DWORD no_of_clusters;
DWORD no_of_freeclusters;
DWORD FAT32_DirCluster;
DWORD FAT_DirSector;
DWORD dwClustersWritten;
DWORD dwOldWritten;
unsigned short FAT_DirSectorCount;
unsigned char *pFatBuf;
unsigned char *pClusterBuf;
float fTotalCapacity;
DIRSTACK *ds;
BOOL bCountClusters;
DWORD dwClusterCount;
DWORD pattern_buffer[256];
int RestartDelay;
int extracount;
HANDLE hWipe;
BOOL bNTFSInternal;
} VOLINFO;
typedef struct _MYSTATE {
PGPBoolean bVerEncrypted;
// HPRGDLG hPrgDlg;
BOOL bDoingSDA;
PGPContextRef context;
PGPtlsContextRef tlsContext;
PGPKeyDBRef KeyDB;
char *OperationTarget;
BOOL FirstOperation;
FILELIST *ListHead;
HANDLE hSemaphore;
DWORD dwThreadID;
DWORD numDone;
DWORD Operation;
char *pInput;
DWORD dwInputSize;
OUTBUFFLIST *obl; // For decryption
char *pOutput; // For encryption
DWORD dwOutputSize; // ...
PGPError err;
BOOL dwWipeFlags;
char *szAppName;
BOOL bStartingCR;
// SDA
SDAHEADER *SDAHeader;
// encrypt
PGPKeyDBRef keydbLookup;
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;
PGPKeyID *RecipientKeyIDArray;
DWORD dwKeyIDCount;
PGPKeyDBObjRef SignKey;
unsigned short PassCount;
char *ConvPassPhrase;
char *PassPhrase;
PGPKeySetRef RecipientKeySet;
BOOL FoundPGPData;
PGPByte *PassKey;
PGPUInt32 PassKeyLen;
PGPKeyDBRef AddedKeyDB;
DWORD dwPasses;
PGPBoolean bMutable;
} MYSTATE;
#ifdef __cplusplus
extern "C" {
#endif
SMQUEUE *InitSMQueue(int delay);
void DestroySMQueue(
SMQUEUE *smq);
BOOL PutSMOnQueue(
SMQUEUE *smq,SLACKMOVE *sm);
BOOL GetSMOffQueue(SMQUEUE *smq,
SLACKMOVE *sm,BOOL bCleanup);
BOOL WipeFreeAddFileCallback(
FILELIST *fl,void *pUserValue);
DWORD BiggieWipeFreeClusters(
VOLINFO *vi);
BOOL FreeBiggie( VOLINFO *vi);
BOOL DisplayDiskStats(
VOLINFO *vi);
void StatusMessage(
VOLINFO *vi,char *msg, BOOL bold);
void WipeProgress(
VOLINFO *vi,int pos);
void PassProgress(
VOLINFO *vi,int pass, int total);
DWORD WipeFree(
VOLINFO *vi,char *szRoot,
DWORD* pattern, BOOL StartWipe);
void *RetrieveClipboardData(
HWND hwnd, UINT* pClipboardFormat,
DWORD* pDataSize);
void StoreClipboardData(
HWND hwnd, void* pData, DWORD dwDataSize);
UINT EnclyptorViewClipboard(
HWND hwnd,void* pInput,DWORD dwInSize,
void** ppOutput,DWORD* pOutSize);
void TextViewer(
HWND hwnd,char *pClipboardData,DWORD dwDataSize);
PGPError myEvents(
PGPContextRef context,
PGPEvent *event,
PGPUserValue userValue);
void FreePhrases(
MYSTATE *myState);
BOOL AlterEncryptedFileName(
char *FileName,DWORD Actions);
BOOL AlterDecryptedFileName(
char *FileName,char *SuggestedName);
BOOL SaveOutputFile(
PGPContextRef Context,
HWND hwnd,
char *Title,
char *InputFile,
PGPFileSpecRef *pOutputFileRef,
BOOL Force);
BOOL GetOriginalFileRef(
HWND hwnd,PGPContextRef context,
char *InputFile,
char *OutputFile,
PGPFileSpecRef *OriginalFileRef,
HWND hwndWorking);
HRESULT SchedulePGPwipe(
HWND hwnd,PGPContextRef context,char *Drive,int Passes);
HRESULT SchedulePGPdirwipe(
HWND hwnd,PGPContextRef context,
char *Directory,int Passes);
// Stubs for work thread
PGPError DecryptFileListStub (MYSTATE *ms) ;
PGPError DecryptClipboardStub (MYSTATE *ms) ;
PGPError EncryptFileListStub (MYSTATE *ms) ;
PGPError CreateSDAFileListStub (MYSTATE *ms) ;
PGPError EncryptClipboardStub (MYSTATE *ms) ;
PGPError AddKeyFileListStub (MYSTATE *ms) ;
PGPError AddKeyClipboardStub (MYSTATE *ms) ;
PGPError WipeFileListStub (MYSTATE *ms) ;
UINT DoWorkThread(
HWND hwnd,void *pUserValue);
typedef struct _CWF
{
ULONGLONG Lcn;
ULONG Size;
struct _CWF *next;
} CWF, *PCWF;
PGPError PGPscClusterFileGather(char *fileName,PCWF *cwflist);
PGPError PGPscClusterFileWipe(char *fileName,PCWF cwflist);
PGPError SDA(
MYSTATE *ms);
BOOL WipeError(
HWND hwnd,FILELIST *FileEntry,UINT error);
UINT InternalFileWipe(
PGPContextRef context,HWND hwnd,
char *FileName,DWORD dwWipeFlags,DWORD dwPasses,PGPUInt64 dwSizeADS);
BOOL OpenRings(HWND hwnd,
PGPContextRef context,PGPKeyDBRef *pkeydb,
PGPBoolean *bMutable);
BOOL FileHasThisExtension(
char *filename,char *extension);
LRESULT PGPscMessageBox (
HWND hWnd,
INT iCaption,
INT iMessage,
ULONG ulFlags) ;
void AddKeys(HWND hwnd,
PGPKeyDBRef AddKeyDB,MYSTATE *ms);
BOOL ReadWipePref(PGPContextRef context,
PGPBoolean *pbWarnOnWipe);
DWORD WipeStreams(PGPContextRef context,HWND hwnd,
char *szFile,DWORD dwWipeFlags,DWORD dwPasses);
#ifdef __cplusplus
}
#endif
#endif /* ] Included_PGPSCINT_h */
/*__Editor_settings____
Local Variables:
tab-width: 4
End:
vi: ts=4 sw=4
vim: si
_____________________*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -