[OLE #21] Make apartment access thread safe, rework OLE TLS management (take 2)

Robert Shearman rob at codeweavers.com
Tue Jan 4 15:27:39 CST 2005


Mike Hearn wrote:

>On Tue, 2005-01-04 at 12:21 -0600, Robert Shearman wrote:
>  
>
>>>HRESULT WINAPI CoGetState(IUnknown ** ppv)
>>>{
>>>-	APARTMENT * apt = COM_CurrentInfo();
>>>+    HRESULT    hr  = E_FAIL;
>>>
>>>-	FIXME("\n");
>>>+    FIXME("possible stub\n");
>>>
>>> 
>>>
>>>      
>>>
>>I believe the function does everything that is required of it - the only 
>>problem is that we don't currently do anything with the state. I'm not 
>>sure if we should though.
>>    
>>
>
>Do we actually have any docs on this function? I agree the "possible
>stub" fixme is annoying though so I'll remove it.
>  
>

No. All I know is that native oleaut32 uses it for some purpose.

>>This should be moved into the TLS struct, not removed entirely.
>>    
>>
>
>inits has been subsumed into the refcount, each CoInitialize adds a ref.
>Why is it still needed?
>  
>

Because inits should be thread-local, not apartment scoped. 
NtCurrentTeb()->ReservedForOle should be set to NULL when the matching 
CoUninitialize is called, not when the apartment is destroyed.


>Here's the updated patch.
>
>Mike Hearn <mh at codeweavers.com>
>- Make apartment access thread-safe by introducing refcounting and wider
>  usage of the apartment lock
>- Rework OLE TLS management to eliminate uninitialised apartments and
>  parent chaining
>  
>

Rob



More information about the wine-devel mailing list