⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cevent.h

📁 PGP8.0源码 请认真阅读您的文件包然后写出其具体功能
💻 H
字号:
/*____________________________________________________________________________
		Copyright (C) 2002 PGP Corporation
        All rights reserved.

        $Id: CEvent.h,v 1.3 2002/08/06 20:10:50 dallen Exp $
____________________________________________________________________________*/

#ifndef Included_CEvent_h	// [
#define Included_CEvent_h

#include "pgpClassesConfig.h"

_PGP_BEGIN

// Class CEvent

class CEvent
{
	NOT_COPYABLE(CEvent)

public:
	CEvent(EVENT_TYPE type = NotificationEvent, PGPBoolean state = FALSE);

	operator KEVENT&() {return mEvent;}
	operator const KEVENT&() const {return mEvent;}

	operator PKEVENT() {return &mEvent;}

	void	Wait(PGPBoolean alertable = FALSE);
	void	Wait(PGPBoolean alertable, LARGE_INTEGER timeout);
	void	Signal(KPRIORITY increment = IO_NO_INCREMENT, 
		PGPBoolean wait = FALSE);

private:
	KEVENT	mEvent;
};


// Class CEvent member functions

inline 
CEvent::CEvent(EVENT_TYPE type, PGPBoolean state)
{
	KeInitializeEvent(&mEvent, type, state);
}

inline 
void 
CEvent::Wait(PGPBoolean alertable)
{
	KeWaitForSingleObject(&mEvent, Executive, KernelMode, alertable, NULL);
}

inline 
void 
CEvent::Wait(PGPBoolean alertable, LARGE_INTEGER timeout)
{
	KeWaitForSingleObject(&mEvent, Executive, KernelMode, alertable, 
		&timeout);
}

inline 
void 
CEvent::Signal(KPRIORITY increment, PGPBoolean wait)
{
	KeSetEvent(&mEvent, increment, wait);
}

_PGP_END

#endif	// ] Included_CEvent_h

⌨️ 快捷键说明

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