Replacing HalGetBusData
来源:互联网 发布:西门子200编程软件 编辑:程序博客网 时间:2024/06/06 14:20
NTSTATUS
HtsReadWriteConfig(
PDEVICE_OBJECT DeviceObject,
ULONG WhichSpace,
PVOID Buffer,
ULONG Offset,
ULONG Length,
BOOLEAN ReadConfig)
{
ASSERT(DeviceObject);
ASSERT(Buffer);
ASSERT(Length);
PIRP Irp = IoAllocateIrp(DeviceObject->StackSize, FALSE);
if (!Irp) {
return STATUS_INSUFFICIENT_RESOURCES;
}
Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
KEVENT Event;
KeInitializeEvent(&Event, NotificationEvent, FALSE);
IoSetCompletionRoutine(Irp,HtsGenericCompletion,
&Event, TRUE, TRUE, TRUE);
PIO_STACK_LOCATION IoStack = IoGetNextIrpStackLocation(Irp);
IoStack->MajorFunction= IRP_MJ_PNP;
IoStack->MinorFunction= ReadConfig ? IRP_MN_READ_CONFIG : IRP_MN_WRITE_CONFIG;
IoStack->Parameters.ReadWriteConfig.WhichSpace = WhichSpace;
IoStack->Parameters.ReadWriteConfig.Buffer = Buffer;
IoStack->Parameters.ReadWriteConfig.Offset = Offset;
IoStack->Parameters.ReadWriteConfig.Length = Length;
if (ReadConfig) {
RtlZeroMemory(Buffer, Length);
}
NTSTATUS Status = IoCallDriver(DeviceObject, Irp);
if (Status == STATUS_PENDING) {
KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL);
Status = Irp->IoStatus.Status;
}
IoFreeIrp(Irp);
return Status;
}
NTSTATUS
HtsGenericCompletion (
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp,
IN PVOID Context
)
{
UNREFERENCED_PARAMETER (DeviceObject);
KeSetEvent ((PKEVENT) Context, IO_NO_INCREMENT, FALSE);
return STATUS_MORE_PROCESSING_REQUIRED; // Keep this IRP
}
- Replacing HalGetBusData
- 替换字符串Replacing Characters
- 10.1. Replacing printk
- Replacing text macros: #define, ##
- replacing the letter
- Replacing Dropbear by openssh-server
- 恢复SVN的Replacing操作
- Security Metrics: Replacing Fear, Uncertainty, and Doubt
- Replacing Multiple Patterns in a Single Pass
- Replacing JSON Libraries in Delphi REST Servers
- Java context replacing with BufferedReader & PrintWriter
- Replacing container/vector in Go programs
- Replacing Objective-C Methods at Runtime
- Replacing a brick on GlusterFS 3.4.0
- Design patterns for replacing modal windows
- Replacing SQLite database while accessing it
- Replacing input type=file, "Browse" button,is Possible?
- Replacing Windows Notepad with Notepad2 4.1.24 (or newer)
- wap1.2开发中用到的跳转页面
- 留住此刻你闪过的思绪
- netsh命令的详解
- css和javascript在IE和Firefox中二十三个不同点
- C++和C#编写调用COM组件
- Replacing HalGetBusData
- MySQL中的bit类型知道多少呢?(转)
- MiniUtilityFramework(一):框架概述
- VC中屏蔽F1
- Netstat命令详解
- wap游戏的一些理解
- Linking a DLL (adapted from MSDN)
- 漂浮,鼠标拖动,自动变图,手动变图———史上最牛的四合一广告图片
- C# 实现鼠标选择矩形截图