Author: tkreuzer
Date: Tue Jan 5 18:38:03 2010
New Revision: 44950
URL:
http://svn.reactos.org/svn/reactos?rev=44950&view=rev
Log:
[ATL]
Merged from amd64 branch:
- add amd64 specific thunkCode
- get rid of a cast
Modified:
trunk/reactos/lib/atl/atlcom.h
trunk/reactos/lib/atl/atlwin.h
Modified: trunk/reactos/lib/atl/atlcom.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlcom.h?rev=44950…
==============================================================================
--- trunk/reactos/lib/atl/atlcom.h [iso-8859-1] (original)
+++ trunk/reactos/lib/atl/atlcom.h [iso-8859-1] Tue Jan 5 18:38:03 2010
@@ -33,7 +33,7 @@
class CComObjectRootBase
{
public:
- long m_dwRef;
+ LONG m_dwRef;
public:
CComObjectRootBase()
{
@@ -99,13 +99,13 @@
ULONG InternalAddRef()
{
ATLASSERT(m_dwRef >= 0);
- return ThreadModel::Increment(reinterpret_cast<int *>(&m_dwRef));
+ return ThreadModel::Increment(&m_dwRef);
}
ULONG InternalRelease()
{
ATLASSERT(m_dwRef > 0);
- return ThreadModel::Decrement(reinterpret_cast<int *>(&m_dwRef));
+ return ThreadModel::Decrement(&m_dwRef);
}
void Lock()
Modified: trunk/reactos/lib/atl/atlwin.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/atl/atlwin.h?rev=44950…
==============================================================================
--- trunk/reactos/lib/atl/atlwin.h [iso-8859-1] (original)
+++ trunk/reactos/lib/atl/atlwin.h [iso-8859-1] Tue Jan 5 18:38:03 2010
@@ -172,8 +172,39 @@
}
};
+#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<char *>(proc) -
(reinterpret_cast<char *>(this) + sizeof(thunkCode)));
+ return TRUE;
+ }
+
+ WNDPROC GetWNDPROC()
+ {
+ return reinterpret_cast<WNDPROC>(&m_thunk);
+ }
+};
#else
-#error Only X86 supported
+#error ARCH not supported
#endif
class CMessageMap