diff --git a/reactos/lib/atl/atlcom.h b/reactos/lib/atl/atlcom.h index e7e6d34faf7..04a4521c2e7 100644 --- a/reactos/lib/atl/atlcom.h +++ b/reactos/lib/atl/atlcom.h @@ -33,7 +33,7 @@ class CComEnum; class CComObjectRootBase { public: - long m_dwRef; + LONG m_dwRef; public: CComObjectRootBase() { @@ -99,13 +99,13 @@ public: ULONG InternalAddRef() { ATLASSERT(m_dwRef >= 0); - return ThreadModel::Increment(reinterpret_cast(&m_dwRef)); + return ThreadModel::Increment(&m_dwRef); } ULONG InternalRelease() { ATLASSERT(m_dwRef > 0); - return ThreadModel::Decrement(reinterpret_cast(&m_dwRef)); + return ThreadModel::Decrement(&m_dwRef); } void Lock() diff --git a/reactos/lib/atl/atlwin.h b/reactos/lib/atl/atlwin.h index 08bdbddb67a..c1a212bf2bc 100644 --- a/reactos/lib/atl/atlwin.h +++ b/reactos/lib/atl/atlwin.h @@ -172,8 +172,39 @@ public: } }; +#elif _AMD64_ //WARNING: NOT VERIFIED +#pragma pack(push,1) +struct thunkCode +{ + DWORD_PTR m_mov; + DWORD_PTR m_this; + BYTE m_jmp; + DWORD_PTR m_relproc; +}; +#pragma pack(pop) + +class CWndProcThunk +{ +public: + thunkCode m_thunk; + _AtlCreateWndData cd; +public: + BOOL Init(WNDPROC proc, void *pThis) + { + m_thunk.m_mov = 0xffff8000042444C7LL; + m_thunk.m_this = (DWORD_PTR)pThis; + m_thunk.m_jmp = 0xe9; + m_thunk.m_relproc = DWORD_PTR(reinterpret_cast(proc) - (reinterpret_cast(this) + sizeof(thunkCode))); + return TRUE; + } + + WNDPROC GetWNDPROC() + { + return reinterpret_cast(&m_thunk); + } +}; #else -#error Only X86 supported +#error ARCH not supported #endif class CMessageMap