https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e410a12242a50e8508460…
commit e410a12242a50e850846058ef5c53652340c1724
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Wed Jan 15 01:14:30 2020 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Jan 15 01:21:25 2020 +0100
[ATL30] Fix m_szAutoName definition and construction in Wine's ATL30 dll.
- Make the format actually MS-compatible: "ATL" followed by colon,
followed by hexadecimal digits of pointer.
- The MS counterpart of this DLL was delivered with Visual C++ 6.0 and
Windows 98+, so obviously it always was 32-bit and they never had a
64-bit version for it. But we do. So make the size of the m_szAutoName
buffer cross-compatible.
- See previous commit dbddd878 and the discussion in PR #2010.
---
dll/win32/atl/atl30.c | 8 ++++++++
sdk/include/reactos/wine/atlwin.h | 8 ++++++++
2 files changed, 16 insertions(+)
diff --git a/dll/win32/atl/atl30.c b/dll/win32/atl/atl30.c
index 06504d09940..254dbadb084 100644
--- a/dll/win32/atl/atl30.c
+++ b/dll/win32/atl/atl30.c
@@ -313,7 +313,11 @@ ATOM WINAPI AtlModuleRegisterWndClassInfoA(_ATL_MODULEA *pm, _ATL_WNDCLASSINFOA
if (!wci->m_wc.lpszClassName)
{
+#ifdef __REACTOS__
+ sprintf(wci->m_szAutoName, "ATL:%p", wci);
+#else
sprintf(wci->m_szAutoName, "ATL%08lx", (UINT_PTR)wci);
+#endif
TRACE("auto-generated class name %s\n", wci->m_szAutoName);
wci->m_wc.lpszClassName = wci->m_szAutoName;
}
@@ -372,7 +376,11 @@ ATOM WINAPI AtlModuleRegisterWndClassInfoW(_ATL_MODULEW *pm, _ATL_WNDCLASSINFOW
if (!wci->m_wc.lpszClassName)
{
+#ifdef __REACTOS__
+ static const WCHAR szFormat[] = {'A','T','L',':','%','p',0};
+#else
static const WCHAR szFormat[] = {'A','T','L','%','0','8','l','x',0};
+#endif
swprintf(wci->m_szAutoName, szFormat, (UINT_PTR)wci);
TRACE("auto-generated class name %s\n", debugstr_w(wci->m_szAutoName));
wci->m_wc.lpszClassName = wci->m_szAutoName;
diff --git a/sdk/include/reactos/wine/atlwin.h b/sdk/include/reactos/wine/atlwin.h
index 386177ba610..099f48bcb52 100644
--- a/sdk/include/reactos/wine/atlwin.h
+++ b/sdk/include/reactos/wine/atlwin.h
@@ -29,7 +29,11 @@ typedef struct _ATL_WNDCLASSINFOA_TAG
LPCSTR m_lpszCursorID;
BOOL m_bSystemCursor;
ATOM m_atom;
+#ifdef __REACTOS__
+ CHAR m_szAutoName[sizeof("ATL:") + sizeof(void *) * 2]; // == 4 characters + NULL + number of hexadecimal digits describing a pointer.
+#else
CHAR m_szAutoName[14];
+#endif
} _ATL_WNDCLASSINFOA;
typedef struct _ATL_WNDCLASSINFOW_TAG
@@ -40,7 +44,11 @@ typedef struct _ATL_WNDCLASSINFOW_TAG
LPCWSTR m_lpszCursorID;
BOOL m_bSystemCursor;
ATOM m_atom;
+#ifdef __REACTOS__
+ WCHAR m_szAutoName[sizeof("ATL:") + sizeof(void *) * 2]; // == 4 characters + NULL + number of hexadecimal digits describing a pointer.
+#else
WCHAR m_szAutoName[14];
+#endif
} _ATL_WNDCLASSINFOW;
ATOM WINAPI AtlModuleRegisterWndClassInfoA(_ATL_MODULEA *pm, _ATL_WNDCLASSINFOA *wci, WNDPROC *pProc);
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1a231e1e70472d7f1a3e1…
commit 1a231e1e70472d7f1a3e1d1b498dedaedf864a54
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Wed Jan 15 01:10:28 2020 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Wed Jan 15 01:14:03 2020 +0100
[SDK:ATL] Fix the size of the ATL_WNDCLASSINFOW::m_szAutoName member according to the actual MS-compatible auto-generated window class name.
The autogenerated name has the format:
"ATL:<hexadecimal_digits_of_pointer><NULL-terminator>"
and the number of hex digits in 0xABCD1234 (for 32-bit == 4-byte)
pointers (without the '0x') is 8 == 4*2, and for 64-bit == 8-byte
pointers (e.g. 0xABCDEF0123456789) is 16 == 8*2.
---
sdk/lib/atl/atlwin.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sdk/lib/atl/atlwin.h b/sdk/lib/atl/atlwin.h
index 3539c13afaf..c35c936acab 100644
--- a/sdk/lib/atl/atlwin.h
+++ b/sdk/lib/atl/atlwin.h
@@ -1893,7 +1893,7 @@ struct _ATL_WNDCLASSINFOW
LPCWSTR m_lpszCursorID;
BOOL m_bSystemCursor;
ATOM m_atom;
- WCHAR m_szAutoName[5 + sizeof(void *)];
+ WCHAR m_szAutoName[sizeof("ATL:") + sizeof(void *) * 2]; // == 4 characters + NULL + number of hexadecimal digits describing a pointer.
ATOM Register(WNDPROC *p)
{