📄 pgpdiskuidyn.c
字号:
/*____________________________________________________________________________
Copyright (C) 2002 PGP Corporation
All rights reserved.
$Id: pgpDiskUIDyn.c,v 1.10 2002/08/06 20:10:28 dallen Exp $
____________________________________________________________________________*/
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "pgpMem.h"
#include "pgpPflErrors.h"
#ifndef PGPDISK_DYNLINK
#define PGPDISK_DYNLINK
#endif // !PGPDISK_DYNLINK
#include "pgpDiskUI.h"
/*
Stubs for dynamic linking to the PGPdiskUI.dll. Include this file
and #define PGPDISK_DYNLINK before you #include pgpDiskUI.h.
*/
/* Types */
typedef int (_cdecl *DISKPROC)();
/* Static variables */
static HINSTANCE PGPdiskUIDll;
/* Function stubs */
PGPError
PGPdiskUIInitLibrary()
{
PGPError error = kPGPError_NoErr;
if (IsNull(PGPdiskUIDll))
{
PGPdiskUIDll = LoadLibrary("PGPdiskUI.dll");
if (IsNull(PGPdiskUIDll))
error = kPGPError_Win32DllOpFailed;
}
if (IsntPGPError(error))
{
DISKPROC diskFunc = (DISKPROC) GetProcAddress(PGPdiskUIDll,
"PGPdiskUIInitLibrary");
if (IsNull(diskFunc))
error = kPGPError_Win32DllOpFailed;
if (IsntPGPError(error))
error = diskFunc();
}
return error;
}
void
PGPdiskUICleanupLibrary()
{
if (IsntNull(PGPdiskUIDll))
{
DISKPROC diskFunc = (DISKPROC) GetProcAddress(PGPdiskUIDll,
"PGPdiskUICleanupLibrary");
if (IsntNull(diskFunc))
diskFunc();
FreeLibrary(PGPdiskUIDll);
PGPdiskUIDll = NULL;
}
}
// Exported function definitions
PGPError
PGPdiskAskChooseDisk(
PGPdiskContextRef context,
const char *defaultPath,
const char *title,
void *parentWnd,
char *chosenPath,
PGPSize availSize)
{
DISKPROC diskFunc = (DISKPROC) GetProcAddress(PGPdiskUIDll,
"PGPdiskAskChooseDisk");
return diskFunc(context, defaultPath, title, parentWnd, chosenPath,
availSize);
}
PGPError
PGPdiskAskMountDisk(
PGPdiskContextRef context,
const char *path,
void *parentWnd)
{
DISKPROC diskFunc = (DISKPROC) GetProcAddress(PGPdiskUIDll,
"PGPdiskAskMountDisk");
return diskFunc(context, path, parentWnd);
}
PGPError
PGPdiskAskEditDisk(
PGPdiskContextRef context,
const char *path,
void *parentWnd)
{
DISKPROC diskFunc = (DISKPROC) GetProcAddress(PGPdiskUIDll,
"PGPdiskAskEditDisk");
return diskFunc(context, path, parentWnd);
}
PGPError
PGPdiskAskCreateNewDisk(
PGPdiskContextRef context,
const char *defaultPath,
void *parentWnd)
{
DISKPROC diskFunc = (DISKPROC) GetProcAddress(PGPdiskUIDll,
"PGPdiskAskCreateNewDisk");
return diskFunc(context, defaultPath, parentWnd);
}
PGPError
PGPdiskFormatNewDisk(
PGPdiskContextRef context,
const char *root,
const char *volName,
int fsType,
NewDiskStatusFuncType userCallback,
void *userValue)
{
DISKPROC diskFunc = (DISKPROC) GetProcAddress(PGPdiskUIDll,
"PGPdiskFormatNewDisk");
return diskFunc(context, root, volName, fsType, userCallback, userValue);
}
PGPError
PGPdiskUIExport
PGPdiskAskUnmountDisk(
PGPdiskContextRef context,
const char *pathOrRoot,
void *parentWnd,
PGPUInt32 flags)
{
DISKPROC diskFunc = (DISKPROC) GetProcAddress(PGPdiskUIDll,
"PGPdiskAskUnmountDisk");
return diskFunc(context, pathOrRoot, parentWnd, flags);
}
PGPError
PGPdiskUIExport
PGPdiskAskUnmountAllDisks(
PGPdiskContextRef context,
void *parentWnd,
PGPUInt32 flags)
{
DISKPROC diskFunc = (DISKPROC) GetProcAddress(PGPdiskUIDll,
"PGPdiskAskUnmountAllDisks");
return diskFunc(context, parentWnd, flags);
}
PGPError
PGPdiskUIExport
PGPdiskMountStartupDisks(PGPdiskContextRef context, void *parentWnd)
{
DISKPROC diskFunc = (DISKPROC) GetProcAddress(PGPdiskUIDll,
"PGPdiskMountStartupDisks");
return diskFunc(context, parentWnd);
}
PGPError
PGPdiskUIDiskDeleteHook(
PGPdiskContextRef context,
const char *path,
void *parentWnd,
PGPBoolean *pProceedWithDelete)
{
DISKPROC diskFunc = (DISKPROC) GetProcAddress(PGPdiskUIDll,
"PGPdiskUIDiskDeleteHook");
return diskFunc(context, path, parentWnd, pProceedWithDelete);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -