📄 queuecontainer.h
字号:
//---------------------------------------------------------------------------
//
// QueueContainer.h
//
// SUBSYSTEM:
// Monitoring process creation and termination
//
// MODULE:
// Implement a multithreaded thread safe queue
//
// DESCRIPTION:
//
// AUTHOR: Ivo Ivanov
//
//---------------------------------------------------------------------------
#if !defined(_QUEUECONTAINER_H_)
#define _QUEUECONTAINER_H_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//---------------------------------------------------------------------------
//
// Includes
//
//---------------------------------------------------------------------------
#include "common.h"
#include "CallbackHandler.h"
#include "RetrievalThread.h"
#include "ThreadMonitor.h"
#include <assert.h>
#include <deque>
using namespace std;
//---------------------------------------------------------------------------
//
// class CQueueContainer
//
//---------------------------------------------------------------------------
class CQueueContainer
{
public:
CQueueContainer(CCallbackHandler* pHandler);
virtual ~CQueueContainer();
// Insert data into the queue
BOOL Append(const QUEUED_ITEM& element);
// Set an external parameter, thus we could take the advantage
// of it later on in the callback routine
void SetExternalParam(PVOID pvParam);
private:
// Thread that gets all queued event items
CQueueReadThread* m_pQueueReadThread;
// A thread for receiving notification from the kernel-mode driver
CDrvEventThread* m_pMonitorThread;
// Underlying STL container
deque<QUEUED_ITEM> m_Queue;
// Monitor mutex
HANDLE m_mtxMonitor;
// Callback handler
CCallbackHandler* m_pHandler;
// Pointer to anything
PVOID m_pvParam;
public:
// Implement specific behavior when kernel mode driver notifies the user-mode app
void DoOnProcessCreatedTerminated();
BOOL StartMonitor(void);
void StopMonitor(void);
};
#endif // !defined(_QUEUECONTAINER_H_)
//----------------------------End of the file -------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -