cdiskinactivityimp.cpp

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

CPP
64 行
字号
/*____________________________________________________________________________
		Copyright (C) 2002 PGP Corporation
        All rights reserved.

        $Id: CDiskInactivityImp.cpp,v 1.2 2002/08/06 20:09:34 dallen Exp $
____________________________________________________________________________*/

#include "pgpClassesConfig.h"
#include "CDiskInactivityImp.h"

_USING_PGP

// Class CDiskInactivityImp member functions

CComboError 
CDiskInactivityImp::CreateInactivityTimer(
	PGPUInt32	seconds, 
	PGPBoolean	repeating, 
	CDiskInactivity::InactivityCallbackFunc	pfnCallback, 
	ULONG		userVal, 
	PGPUInt32&	timerID)
{
	CComboError	error;

	error = AttachToDriver();

	if (error.IsntError())
	{
		PGPINACTIVITYSTRUCT	pgpIS;
		pgpClearMemory(&pgpIS, sizeof(pgpIS));

		pgpIS.ulOperation	= kPGPUDOperation_CreateInactivityTimer;
		pgpIS.ulSeconds		= seconds;
		pgpIS.callback		= pfnCallback;
		pgpIS.ulUserValue	= userVal;

		if (repeating)
			pgpIS.ulFlags |= kPGPUDFlag_RepeatingInactivityTimer;

		error = SendInactivityCommand(pgpIS);

		if (error.IsntError())
			timerID = pgpIS.ulTimerHandle;
	}

	return error;
}

CComboError 
CDiskInactivityImp::DestroyInactivityTimer(PGPUInt32 timerID)
{
	CComboError	error;

	PGPINACTIVITYSTRUCT	pgpIS;
	pgpClearMemory(&pgpIS, sizeof(pgpIS));

	pgpIS.ulOperation	= kPGPUDOperation_DestroyInactivityTimer;
	pgpIS.ulTimerHandle	= timerID;

	error = SendInactivityCommand(pgpIS);

	return error;
}

⌨️ 快捷键说明

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