I want to register callbacks
Code: Select all
Where I'm making mistake? OB_OPERATION_REGISTRATION operationRegistrstions = {0};
OB_CALLBACK_REGISTRATION regObject = { 0 };
operationRegistrstions.ObjectType = PsProcessType;
operationRegistrstions.Operations |= OB_OPERATION_HANDLE_CREATE;
operationRegistrstions.Operations |= OB_OPERATION_HANDLE_DUPLICATE;
operationRegistrstions.PreOperation = PobPreOperationCallback;
operationRegistrstions.PostOperation = PobPostOperationCallback;
regObject.Version = OB_FLT_REGISTRATION_VERSION; // 0x100
regObject.OperationRegistrationCount = 1;
RtlInitUnicodeString(®Object.Altitude, L"1000");
regObject.RegistrationContext = NULL;
regObject.OperationRegistration = &operationRegistrstions;
NTSTATUS status = ObRegisterCallbacks(®Object, ®Handle);
if (!NT_SUCCESS(status)) {
KdPrint(("ObCallback failed - 0x%p\n", status));
}