atl80: Don't forward AtlAxWinInit to atl100.

This commit is contained in:
Qian Hong 2013-03-15 22:15:46 +08:00 committed by Alexandre Julliard
parent ed62fcb700
commit cd321cbea8
7 changed files with 139 additions and 2 deletions

1
configure vendored
View File

@ -15682,6 +15682,7 @@ wine_fn_config_test dlls/atl/tests atl_test
wine_fn_config_dll atl100 enable_atl100 implib wine_fn_config_dll atl100 enable_atl100 implib
wine_fn_config_test dlls/atl100/tests atl100_test wine_fn_config_test dlls/atl100/tests atl100_test
wine_fn_config_dll atl80 enable_atl80 implib 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 authz enable_authz
wine_fn_config_dll avicap32 enable_avicap32 implib wine_fn_config_dll avicap32 enable_avicap32 implib
wine_fn_config_dll avifil32 enable_avifil32 implib,po wine_fn_config_dll avifil32 enable_avifil32 implib,po

View File

@ -2565,6 +2565,7 @@ WINE_CONFIG_TEST(dlls/atl/tests)
WINE_CONFIG_DLL(atl100,,[implib]) WINE_CONFIG_DLL(atl100,,[implib])
WINE_CONFIG_TEST(dlls/atl100/tests) WINE_CONFIG_TEST(dlls/atl100/tests)
WINE_CONFIG_DLL(atl80,,[implib]) WINE_CONFIG_DLL(atl80,,[implib])
WINE_CONFIG_TEST(dlls/atl80/tests)
WINE_CONFIG_DLL(authz) WINE_CONFIG_DLL(authz)
WINE_CONFIG_DLL(avicap32,,[implib]) WINE_CONFIG_DLL(avicap32,,[implib])
WINE_CONFIG_DLL(avifil32,,[implib,po]) WINE_CONFIG_DLL(avifil32,,[implib,po])

View File

@ -1,6 +1,6 @@
MODULE = atl80.dll MODULE = atl80.dll
IMPORTLIB = atl80 IMPORTLIB = atl80
IMPORTS = atl100 oleaut32 IMPORTS = atl100 oleaut32 user32 ole32
EXTRADEFS = -D_ATL_VER=_ATL_VER_80 EXTRADEFS = -D_ATL_VER=_ATL_VER_80

View File

@ -16,8 +16,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <stdarg.h>
#include <stdio.h>
#define COBJMACROS #define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winuser.h"
#include "atlbase.h" #include "atlbase.h"
#include "wine/debug.h" #include "wine/debug.h"
@ -90,3 +97,56 @@ DWORD WINAPI AtlGetVersion(void *pReserved)
{ {
return _ATL_VER; 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;
}

View File

@ -27,7 +27,7 @@
39 stdcall AtlAxCreateControl(ptr ptr ptr ptr) atl100.AtlAxCreateControl 39 stdcall AtlAxCreateControl(ptr ptr ptr ptr) atl100.AtlAxCreateControl
40 stdcall AtlAxCreateControlEx(ptr ptr ptr ptr ptr ptr ptr) atl100.AtlAxCreateControlEx 40 stdcall AtlAxCreateControlEx(ptr ptr ptr ptr ptr ptr ptr) atl100.AtlAxCreateControlEx
41 stdcall AtlAxAttachControl(ptr ptr ptr) atl100.AtlAxAttachControl 41 stdcall AtlAxAttachControl(ptr ptr ptr) atl100.AtlAxAttachControl
42 stdcall AtlAxWinInit() atl100.AtlAxWinInit 42 stdcall AtlAxWinInit()
43 stdcall AtlWinModuleAddCreateWndData(ptr ptr ptr) atl100.AtlWinModuleAddCreateWndData 43 stdcall AtlWinModuleAddCreateWndData(ptr ptr ptr) atl100.AtlWinModuleAddCreateWndData
44 stdcall AtlWinModuleExtractCreateWndData(ptr) atl100.AtlWinModuleExtractCreateWndData 44 stdcall AtlWinModuleExtractCreateWndData(ptr) atl100.AtlWinModuleExtractCreateWndData
45 stub AtlWinModuleRegisterWndClassInfoW 45 stub AtlWinModuleRegisterWndClassInfoW

View File

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

67
dlls/atl80/tests/atl.c Normal file
View File

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