admin管理员组文章数量:1391969
#include <ntddk.h>
void UnloadDriver(PDRIVER_OBJECT DriverObject);
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) {
DbgPrint("Driver initialized\n");
UNREFERENCED_PARAMETER(RegistryPath);
DriverObject->DriverUnload = UnloadDriver;
HANDLE hEvent;
UNICODE_STRING EventName;
RtlInitUnicodeString(&EventName, L"\\KernelObjects\\LowNonPagedPoolCondition");
PKEVENT event = IoCreateNotificationEvent(&EventName,&hEvent);
if (!event) {
DbgPrint("Error creating event: %lx\n", GetLastError());
return STATUS_UNSUCCESSFUL;
}
DbgPrint("Event status [%d]", KeReadStateEvent(event));
NTSTATUS status = KeWaitForSingleObject(event, Executive, KernelMode, FALSE, NULL);
if (!NT_SUCCESS(status)) {
DbgPrint("Error waiting for event: %lx\n", status);
}
ZwClose(hEvent);
ZwClose(event); //Close the event object itself
return STATUS_SUCCESS;
}
void UnloadDriver(PDRIVER_OBJECT DriverObject) {
UNREFERENCED_PARAMETER(DriverObject);
DbgPrint("Driver Unloaded\n");
}
I'll go straight to the problem I don't think here the code gets a handle or pointer to the event object, (.png).
I am new to this so I would appreciate your insights, I copied this from a book teaching Windows kernel programming, while I have zero experience in this type of things I managed to do some progress .
本文标签: windowswhy doesn39t it get a handle for the eventStack Overflow
版权声明:本文标题:windows - why doesn't it get a handle for the event? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744676110a2619120.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论