André Hentschel : atl: Reuse code of AtlModuleRegisterWndClassInfoW for AtlModuleRegisterWndClassInfoA .

Alexandre Julliard julliard at winehq.org
Tue May 25 12:06:11 CDT 2010


Module: wine
Branch: master
Commit: 2d658e656f95070c410db3719ce5d03a4e609daf
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2d658e656f95070c410db3719ce5d03a4e609daf

Author: André Hentschel <nerv at dawncrow.de>
Date:   Tue May 25 16:51:00 2010 +0200

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 27fb171..73d6ae6 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 75f9a11..788e4de 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 4bd1359..386177b 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);




More information about the wine-cvs mailing list