Hi all,
I am afraid that I am having a crash because I am calling ObUnRegisterCallbacks while some of the callbacks are still executing.
Is it guaranteed that ObUnRegisterCallbacks returns only after the last executing callback? I could not find a reference to this…
Thanks
Maxim
The same question is also relevant for PsSetCreateProcessNotifyRoutineEx…
Hi there,
I have to say that this must be a bug in your code. The way you handle your objects, synchronization, etc…
You must understand how those callbacks are invoked. It is not documented, but it must be something like the Ob Manager has a vector of callbacks it must call before processing itself the request so it must have something like:
PVOID Callbacks[MAX_CALLBACKS_ALLOWED];
Then for each callback do: Callback[i](Param1, Param2, etc… );
This list of callbacks if for sure synchronized so you cannot add/remove a callback while it is iterating through it or something like that.
So if your callback is Callback5 for example, and you unregister, the Ob pbably removes it using its own internal sync mechanism from the list so next time you will not get called.
There is no such thing as interrupting in the middle of the execution.
You either get called or you don’t. As long as you are in the callback, the parameters you have there are valid in the context of the call.