阅读:1427回复:0
在HOOK中如何同步
比如我HOOK了某个driver的IRP_MJ_CREATE,在我的例程中如何做到象下列一样的同步:
KeInitializeEvent(&Event, NotificationEvent, FALSE); IoCopyCurrentIrpStackLocationToNext(Irp); IoSetCompletionRoutine(Irp, SyncronouslyCompletion, &Event, TRUE, TRUE, TRUE); Status = IoCallDriver(DeviceObject, Irp); if (STATUS_PENDING == Status) { KeWaitForSingleObject(&Event, Executive, KernelMode, FALSE, NULL); Status = Irp->IoStatus.Status; } return Status; |
|