mirror of
https://github.com/reactos/reactos.git
synced 2024-11-27 13:33:32 +08:00
[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:
parent
1a231e1e70
commit
e410a12242
@ -313,7 +313,11 @@ ATOM WINAPI AtlModuleRegisterWndClassInfoA(_ATL_MODULEA *pm, _ATL_WNDCLASSINFOA
|
|||||||
|
|
||||||
if (!wci->m_wc.lpszClassName)
|
if (!wci->m_wc.lpszClassName)
|
||||||
{
|
{
|
||||||
|
#ifdef __REACTOS__
|
||||||
|
sprintf(wci->m_szAutoName, "ATL:%p", wci);
|
||||||
|
#else
|
||||||
sprintf(wci->m_szAutoName, "ATL%08lx", (UINT_PTR)wci);
|
sprintf(wci->m_szAutoName, "ATL%08lx", (UINT_PTR)wci);
|
||||||
|
#endif
|
||||||
TRACE("auto-generated class name %s\n", wci->m_szAutoName);
|
TRACE("auto-generated class name %s\n", wci->m_szAutoName);
|
||||||
wci->m_wc.lpszClassName = 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)
|
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};
|
static const WCHAR szFormat[] = {'A','T','L','%','0','8','l','x',0};
|
||||||
|
#endif
|
||||||
swprintf(wci->m_szAutoName, szFormat, (UINT_PTR)wci);
|
swprintf(wci->m_szAutoName, szFormat, (UINT_PTR)wci);
|
||||||
TRACE("auto-generated class name %s\n", debugstr_w(wci->m_szAutoName));
|
TRACE("auto-generated class name %s\n", debugstr_w(wci->m_szAutoName));
|
||||||
wci->m_wc.lpszClassName = wci->m_szAutoName;
|
wci->m_wc.lpszClassName = wci->m_szAutoName;
|
||||||
|
@ -29,7 +29,11 @@ typedef struct _ATL_WNDCLASSINFOA_TAG
|
|||||||
LPCSTR m_lpszCursorID;
|
LPCSTR m_lpszCursorID;
|
||||||
BOOL m_bSystemCursor;
|
BOOL m_bSystemCursor;
|
||||||
ATOM m_atom;
|
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];
|
CHAR m_szAutoName[14];
|
||||||
|
#endif
|
||||||
} _ATL_WNDCLASSINFOA;
|
} _ATL_WNDCLASSINFOA;
|
||||||
|
|
||||||
typedef struct _ATL_WNDCLASSINFOW_TAG
|
typedef struct _ATL_WNDCLASSINFOW_TAG
|
||||||
@ -40,7 +44,11 @@ typedef struct _ATL_WNDCLASSINFOW_TAG
|
|||||||
LPCWSTR m_lpszCursorID;
|
LPCWSTR m_lpszCursorID;
|
||||||
BOOL m_bSystemCursor;
|
BOOL m_bSystemCursor;
|
||||||
ATOM m_atom;
|
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];
|
WCHAR m_szAutoName[14];
|
||||||
|
#endif
|
||||||
} _ATL_WNDCLASSINFOW;
|
} _ATL_WNDCLASSINFOW;
|
||||||
|
|
||||||
ATOM WINAPI AtlModuleRegisterWndClassInfoA(_ATL_MODULEA *pm, _ATL_WNDCLASSINFOA *wci, WNDPROC *pProc);
|
ATOM WINAPI AtlModuleRegisterWndClassInfoA(_ATL_MODULEA *pm, _ATL_WNDCLASSINFOA *wci, WNDPROC *pProc);
|
||||||
|
Loading…
Reference in New Issue
Block a user