📄 querymng.cpp
字号:
#include "QueryMng.h"
QueryMng::~QueryMng()
{
mStorage.Clear();
}
bool QueryMng::AddRoutine(ULONG ControleCode,PFUNCTION_ROUTINE pFunctionPtr)
{
return mStorage.Add(ControleCode,pFunctionPtr);
}
bool QueryMng::ProcessIrp(PIRP pIrp)
{
ULONG BytesTxd =0; // Number of transmitted,received bytes
NTSTATUS status = STATUS_SUCCESS;
PIO_STACK_LOCATION IrpStack = IoGetCurrentIrpStackLocation(pIrp);
// Getting the IOCTL code
ULONG ControlCode = IrpStack->Parameters.DeviceIoControl.IoControlCode;
PVOID pFunc = mStorage.Get(ControlCode);
if(pFunc != NULL)
{
// Function that process IRP will call CompleteIrp()
return ((PFUNCTION_ROUTINE)pFunc)(pIrp);
}
// If no one subscribed for this IOCTL, return bad request.
return CompleteIrp(pIrp,STATUS_INVALID_DEVICE_REQUEST,BytesTxd);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -