From d0a345f914ff804b09df8072e2380a0852c73a6c Mon Sep 17 00:00:00 2001 From: Andrey Turkin Date: Sun, 18 Jan 2009 17:18:03 +0300 Subject: [PATCH] ole32: Add a few fields to OLE TLS area to match native memory layout. --- dlls/ole32/compobj.c | 5 ++++- dlls/ole32/compobj_private.h | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c index b291db4f7c..4e926ec84a 100644 --- a/dlls/ole32/compobj.c +++ b/dlls/ole32/compobj.c @@ -3951,9 +3951,12 @@ HRESULT WINAPI CoGetObjectContext(REFIID riid, void **ppv) */ HRESULT WINAPI CoGetContextToken( ULONG_PTR *token ) { + struct oletls *info = COM_CurrentInfo(); static int calls; if(!(calls++)) FIXME( "stub\n" ); - if (token) *token = 0; + if (!info) + return E_OUTOFMEMORY; + if (token) *token = info->context_token; return E_NOTIMPL; } diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h index 8f2cc2cb73..38a6475e94 100644 --- a/dlls/ole32/compobj_private.h +++ b/dlls/ole32/compobj_private.h @@ -175,13 +175,18 @@ struct oletls struct apartment *apt; IErrorInfo *errorinfo; /* see errorinfo.c */ IUnknown *state; /* see CoSetState */ + DWORD apt_mask; /* apartment mask (+0Ch on x86) */ IInitializeSpy *spy; /* The "SPY" from CoInitializeSpy */ DWORD inits; /* number of times CoInitializeEx called */ DWORD ole_inits; /* number of times OleInitialize called */ GUID causality_id; /* unique identifier for each COM call */ LONG pending_call_count_client; /* number of client calls pending */ LONG pending_call_count_server; /* number of server calls pending */ - IUnknown *call_state; /* current call context */ + DWORD unknown; + ULONG_PTR context_token; /* (+38h on x86) */ + IUnknown *call_state; /* current call context (+3Ch on x86) */ + DWORD unknown2[46]; + IUnknown *cancel_object; /* cancel object set by CoSetCancelObject (+F8h on x86) */ }; -- 2.32.0.93.g670b81a890