Qian Hong : atl80: Don't forward AtlAxWinInit to atl100.
Alexandre Julliard
julliard at winehq.org
Mon Mar 25 14:19:39 CDT 2013
Module: wine
Branch: master
Commit: cd321cbea80d37521a1c0b23042bda0784025a62
URL: http://source.winehq.org/git/wine.git/?a=commit;h=cd321cbea80d37521a1c0b23042bda0784025a62
Author: Qian Hong <qhong at codeweavers.com>
Date: Fri Mar 15 22:15:46 2013 +0800
atl80: Don't forward AtlAxWinInit to atl100.
---
configure | 1 +
configure.ac | 1 +
dlls/atl80/Makefile.in | 2 +-
dlls/atl80/atl80.c | 60 +++++++++++++++++++++++++++++++++++++
dlls/atl80/atl80.spec | 2 +-
dlls/atl80/tests/Makefile.in | 8 +++++
dlls/atl80/tests/atl.c | 67 ++++++++++++++++++++++++++++++++++++++++++
7 files changed, 139 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 5d292dd..5a45d6d 100755
--- a/configure
+++ b/configure
@@ -15682,6 +15682,7 @@ wine_fn_config_test dlls/atl/tests atl_test
wine_fn_config_dll atl100 enable_atl100 implib
wine_fn_config_test dlls/atl100/tests atl100_test
wine_fn_config_dll atl80 enable_atl80 implib
+wine_fn_config_test dlls/atl80/tests atl80_test
wine_fn_config_dll authz enable_authz
wine_fn_config_dll avicap32 enable_avicap32 implib
wine_fn_config_dll avifil32 enable_avifil32 implib,po
diff --git a/configure.ac b/configure.ac
index 895596a..34341c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2565,6 +2565,7 @@ WINE_CONFIG_TEST(dlls/atl/tests)
WINE_CONFIG_DLL(atl100,,[implib])
WINE_CONFIG_TEST(dlls/atl100/tests)
WINE_CONFIG_DLL(atl80,,[implib])
+WINE_CONFIG_TEST(dlls/atl80/tests)
WINE_CONFIG_DLL(authz)
WINE_CONFIG_DLL(avicap32,,[implib])
WINE_CONFIG_DLL(avifil32,,[implib,po])
diff --git a/dlls/atl80/Makefile.in b/dlls/atl80/Makefile.in
index 71cb651..5cf626e 100644
--- a/dlls/atl80/Makefile.in
+++ b/dlls/atl80/Makefile.in
@@ -1,6 +1,6 @@
MODULE = atl80.dll
IMPORTLIB = atl80
-IMPORTS = atl100 oleaut32
+IMPORTS = atl100 oleaut32 user32 ole32
EXTRADEFS = -D_ATL_VER=_ATL_VER_80
diff --git a/dlls/atl80/atl80.c b/dlls/atl80/atl80.c
index 2cee94c..b5d571b 100644
--- a/dlls/atl80/atl80.c
+++ b/dlls/atl80/atl80.c
@@ -16,8 +16,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <stdarg.h>
+#include <stdio.h>
+
#define COBJMACROS
+#include "windef.h"
+#include "winbase.h"
+#include "winerror.h"
+#include "winuser.h"
#include "atlbase.h"
#include "wine/debug.h"
@@ -90,3 +97,56 @@ DWORD WINAPI AtlGetVersion(void *pReserved)
{
return _ATL_VER;
}
+
+/**********************************************************************
+ * AtlAxWin class window procedure
+ */
+static LRESULT CALLBACK AtlAxWin_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam )
+{
+ if ( wMsg == WM_CREATE )
+ {
+ DWORD len = GetWindowTextLengthW( hWnd ) + 1;
+ WCHAR *ptr = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
+ if (!ptr)
+ return 1;
+ GetWindowTextW( hWnd, ptr, len );
+ AtlAxCreateControlEx( ptr, hWnd, NULL, NULL, NULL, NULL, NULL );
+ HeapFree( GetProcessHeap(), 0, ptr );
+ return 0;
+ }
+ return DefWindowProcW( hWnd, wMsg, wParam, lParam );
+}
+
+BOOL WINAPI AtlAxWinInit(void)
+{
+ WNDCLASSEXW wcex;
+ const WCHAR AtlAxWin80[] = {'A','t','l','A','x','W','i','n','8','0',0};
+ const WCHAR AtlAxWinLic80[] = {'A','t','l','A','x','W','i','n','L','i','c','8','0',0};
+
+ FIXME("semi-stub\n");
+
+ if ( FAILED( OleInitialize(NULL) ) )
+ return FALSE;
+
+ wcex.cbSize = sizeof(wcex);
+ wcex.style = CS_GLOBALCLASS | CS_DBLCLKS;
+ wcex.cbClsExtra = 0;
+ wcex.cbWndExtra = 0;
+ wcex.hInstance = GetModuleHandleW( NULL );
+ wcex.hIcon = NULL;
+ wcex.hCursor = NULL;
+ wcex.hbrBackground = NULL;
+ wcex.lpszMenuName = NULL;
+ wcex.hIconSm = 0;
+
+ wcex.lpfnWndProc = AtlAxWin_wndproc;
+ wcex.lpszClassName = AtlAxWin80;
+ if ( !RegisterClassExW( &wcex ) )
+ return FALSE;
+
+ wcex.lpszClassName = AtlAxWinLic80;
+ if ( !RegisterClassExW( &wcex ) )
+ return FALSE;
+
+ return TRUE;
+}
diff --git a/dlls/atl80/atl80.spec b/dlls/atl80/atl80.spec
index dbd38aa..f8d409c 100644
--- a/dlls/atl80/atl80.spec
+++ b/dlls/atl80/atl80.spec
@@ -27,7 +27,7 @@
39 stdcall AtlAxCreateControl(ptr ptr ptr ptr) atl100.AtlAxCreateControl
40 stdcall AtlAxCreateControlEx(ptr ptr ptr ptr ptr ptr ptr) atl100.AtlAxCreateControlEx
41 stdcall AtlAxAttachControl(ptr ptr ptr) atl100.AtlAxAttachControl
-42 stdcall AtlAxWinInit() atl100.AtlAxWinInit
+42 stdcall AtlAxWinInit()
43 stdcall AtlWinModuleAddCreateWndData(ptr ptr ptr) atl100.AtlWinModuleAddCreateWndData
44 stdcall AtlWinModuleExtractCreateWndData(ptr) atl100.AtlWinModuleExtractCreateWndData
45 stub AtlWinModuleRegisterWndClassInfoW
diff --git a/dlls/atl80/tests/Makefile.in b/dlls/atl80/tests/Makefile.in
new file mode 100644
index 0000000..c4d9222
--- /dev/null
+++ b/dlls/atl80/tests/Makefile.in
@@ -0,0 +1,8 @@
+TESTDLL = atl80.dll
+IMPORTS = uuid atl80 oleaut32 ole32 advapi32 user32
+EXTRADEFS = -D_ATL_VER=_ATL_VER_80
+
+C_SRCS = \
+ atl.c
+
+ at MAKE_TEST_RULES@
diff --git a/dlls/atl80/tests/atl.c b/dlls/atl80/tests/atl.c
new file mode 100644
index 0000000..b88177d
--- /dev/null
+++ b/dlls/atl80/tests/atl.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2013 Qian Hong for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include <stdarg.h>
+#include <stdio.h>
+
+#define COBJMACROS
+#define CONST_VTABLE
+
+#include <windef.h>
+#include <winbase.h>
+#include <winuser.h>
+
+#include <atlbase.h>
+#include <mshtml.h>
+
+#include <wine/test.h>
+
+static void test_ax_win(void)
+{
+ BOOL ret;
+ WNDCLASSEXW wcex;
+ static const WCHAR AtlAxWin80[] = {'A','t','l','A','x','W','i','n','8','0',0};
+ static const WCHAR AtlAxWinLic80[] = {'A','t','l','A','x','W','i','n','L','i','c','8','0',0};
+ static HMODULE hinstance = 0;
+
+ ret = AtlAxWinInit();
+ ok(ret, "AtlAxWinInit failed\n");
+
+ hinstance = GetModuleHandleA(NULL);
+
+ memset(&wcex, 0, sizeof(wcex));
+ wcex.cbSize = sizeof(wcex);
+ ret = GetClassInfoExW(hinstance, AtlAxWin80, &wcex);
+ ok(ret, "AtlAxWin80 has not registered\n");
+ ok(wcex.style == (CS_GLOBALCLASS | CS_DBLCLKS), "wcex.style %08x\n", wcex.style);
+
+ memset(&wcex, 0, sizeof(wcex));
+ wcex.cbSize = sizeof(wcex);
+ ret = GetClassInfoExW(hinstance, AtlAxWinLic80, &wcex);
+ ok(ret, "AtlAxWinLic80 has not registered\n");
+ ok(wcex.style == (CS_GLOBALCLASS | CS_DBLCLKS), "wcex.style %08x\n", wcex.style);
+}
+
+START_TEST(atl)
+{
+ CoInitialize(NULL);
+
+ test_ax_win();
+
+ CoUninitialize();
+}
More information about the wine-cvs
mailing list