From 2d658e656f95070c410db3719ce5d03a4e609daf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Hentschel?= Date: Tue, 25 May 2010 16:51:00 +0200 Subject: [PATCH] atl: Reuse code of AtlModuleRegisterWndClassInfoW for AtlModuleRegisterWndClassInfoA. --- dlls/atl/atl.spec | 2 +- dlls/atl/atl_main.c | 39 +++++++++++++++++++++++++++++++++++++++ dlls/atl/atlwin.h | 2 +- 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/dlls/atl/atl.spec b/dlls/atl/atl.spec index 27fb1710314..73d6ae616e5 100644 --- a/dlls/atl/atl.spec +++ b/dlls/atl/atl.spec @@ -37,7 +37,7 @@ 43 stdcall AtlModuleAddCreateWndData(ptr ptr ptr) 44 stdcall AtlModuleExtractCreateWndData(ptr) 45 stdcall AtlModuleRegisterWndClassInfoW(ptr ptr ptr) -46 stub AtlModuleRegisterWndClassInfoA +46 stdcall AtlModuleRegisterWndClassInfoA(ptr ptr ptr) 47 stdcall AtlAxGetControl(long ptr) 48 stdcall AtlAxGetHost(long ptr) 49 stub AtlRegisterClassCategoriesHelper diff --git a/dlls/atl/atl_main.c b/dlls/atl/atl_main.c index 75f9a11116c..788e4deff2d 100644 --- a/dlls/atl/atl_main.c +++ b/dlls/atl/atl_main.c @@ -439,6 +439,45 @@ HRESULT WINAPI AtlModuleUnregisterServer(_ATL_MODULEW *pm, const CLSID *clsid) } /*********************************************************************** + * AtlModuleRegisterWndClassInfoA [ATL.@] + * + * See AtlModuleRegisterWndClassInfoW. + */ +ATOM WINAPI AtlModuleRegisterWndClassInfoA(_ATL_MODULEA *pm, _ATL_WNDCLASSINFOA *wci, WNDPROC *pProc) +{ + ATOM atom; + + FIXME("%p %p %p semi-stub\n", pm, wci, pProc); + + atom = wci->m_atom; + if (!atom) + { + WNDCLASSEXA wc; + + TRACE("wci->m_wc.lpszClassName = %s\n", wci->m_wc.lpszClassName); + + if (!wci->m_wc.lpszClassName) + { + static const CHAR szFormat[] = "ATL%08x"; + sprintf(wci->m_szAutoName, szFormat, (UINT)(UINT_PTR)wci); + TRACE("auto-generated class name %s\n", wci->m_szAutoName); + wci->m_wc.lpszClassName = wci->m_szAutoName; + } + + atom = GetClassInfoExA(pm->m_hInst, wci->m_wc.lpszClassName, &wc); + if (!atom) + atom = RegisterClassExA(&wci->m_wc); + + wci->pWndProc = wci->m_wc.lpfnWndProc; + wci->m_atom = atom; + } + *pProc = wci->pWndProc; + + TRACE("returning 0x%04x\n", atom); + return atom; +} + +/*********************************************************************** * AtlModuleRegisterWndClassInfoW [ATL.@] * * PARAMS diff --git a/dlls/atl/atlwin.h b/dlls/atl/atlwin.h index 4bd13599667..386177ba610 100644 --- a/dlls/atl/atlwin.h +++ b/dlls/atl/atlwin.h @@ -43,7 +43,7 @@ typedef struct _ATL_WNDCLASSINFOW_TAG WCHAR m_szAutoName[14]; } _ATL_WNDCLASSINFOW; -ATOM WINAPI AtlModuleRegisterWndClassInfoA(_ATL_MODULEW *pm, _ATL_WNDCLASSINFOA *wci, WNDPROC *pProc); +ATOM WINAPI AtlModuleRegisterWndClassInfoA(_ATL_MODULEA *pm, _ATL_WNDCLASSINFOA *wci, WNDPROC *pProc); ATOM WINAPI AtlModuleRegisterWndClassInfoW(_ATL_MODULEW *pm, _ATL_WNDCLASSINFOW *wci, WNDPROC *pProc); HDC WINAPI AtlCreateTargetDC(HDC hdc, DVTARGETDEVICE *ptd); -- 2.11.4.GIT