[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.
This commit is contained in:
Hermès Bélusca-Maïto 2020-01-15 01:14:30 +01:00
parent 1a231e1e70
commit e410a12242
No known key found for this signature in database
GPG Key ID: 3B2539C65E7B93D0
2 changed files with 16 additions and 0 deletions

View File

@ -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;

View File

@ -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);