In certain circumstances unmarshalling an object stream from the RunningObjectTable can cause the unmarshalling routines to interrogate the same table (maybe to resolve a dependant object?) in a different thread causing a deadlock while getting the critical section lock. Leaving the Critical Section before unmarshalling the object stream solve this problem. Visual Studio 2019 deadlock on start without this.
I'm not sure how to test this properly. Also add debug info for this critical section so it show a significant name in the log.
Signed-off-by: Lorenzo Ferrillo lorenzofersteam@live.it
-- v2: ole32: Add debug info to RunningObjectTable critical section ole32: Leave the RunningObjectTable Critical Section before umarshalling object