[ATL][ATL80][ATL100] Sync with Wine Staging 1.7.37. CORE-9246

svn path=/trunk/; revision=66785
This commit is contained in:
Amine Khaldi 2015-03-18 15:30:17 +00:00
parent 88e3a5126f
commit ee8633b1ce
3 changed files with 68 additions and 24 deletions

View file

@ -22,6 +22,7 @@
#include <ole2.h> #include <ole2.h>
#include <exdisp.h> #include <exdisp.h>
#include <shlwapi.h>
#include <wine/atlwin.h> #include <wine/atlwin.h>
typedef struct IOCS { typedef struct IOCS {
@ -39,6 +40,8 @@ typedef struct IOCS {
BOOL fActive, fInPlace, fWindowless; BOOL fActive, fInPlace, fWindowless;
} IOCS; } IOCS;
static const WCHAR wine_atl_iocsW[] = {'_','_','W','I','N','E','_','A','T','L','_','I','O','C','S','\0'};
/********************************************************************** /**********************************************************************
* AtlAxWin class window procedure * AtlAxWin class window procedure
*/ */
@ -134,7 +137,7 @@ static HRESULT IOCS_Detach( IOCS *This ) /* remove subclassing */
if ( This->hWnd ) if ( This->hWnd )
{ {
SetWindowLongPtrW( This->hWnd, GWLP_WNDPROC, (ULONG_PTR) This->OrigWndProc ); SetWindowLongPtrW( This->hWnd, GWLP_WNDPROC, (ULONG_PTR) This->OrigWndProc );
SetWindowLongPtrW( This->hWnd, GWLP_USERDATA, 0 ); RemovePropW( This->hWnd, wine_atl_iocsW);
This->hWnd = NULL; This->hWnd = NULL;
} }
if ( This->control ) if ( This->control )
@ -890,7 +893,7 @@ static LRESULT IOCS_OnWndProc( IOCS *This, HWND hWnd, UINT uMsg, WPARAM wParam,
static LRESULT CALLBACK AtlHost_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam ) static LRESULT CALLBACK AtlHost_wndproc( HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam )
{ {
IOCS *This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA ); IOCS *This = (IOCS*) GetPropW( hWnd, wine_atl_iocsW );
return IOCS_OnWndProc( This, hWnd, wMsg, wParam, lParam ); return IOCS_OnWndProc( This, hWnd, wMsg, wParam, lParam );
} }
@ -899,7 +902,7 @@ static HRESULT IOCS_Attach( IOCS *This, HWND hWnd, IUnknown *pUnkControl ) /* su
This->hWnd = hWnd; This->hWnd = hWnd;
IUnknown_QueryInterface( pUnkControl, &IID_IOleObject, (void**)&This->control ); IUnknown_QueryInterface( pUnkControl, &IID_IOleObject, (void**)&This->control );
IOleObject_SetClientSite( This->control, &This->IOleClientSite_iface ); IOleObject_SetClientSite( This->control, &This->IOleClientSite_iface );
SetWindowLongPtrW( hWnd, GWLP_USERDATA, (ULONG_PTR) This ); SetPropW( hWnd, wine_atl_iocsW, This );
This->OrigWndProc = (WNDPROC)SetWindowLongPtrW( hWnd, GWLP_WNDPROC, (ULONG_PTR) AtlHost_wndproc ); This->OrigWndProc = (WNDPROC)SetWindowLongPtrW( hWnd, GWLP_WNDPROC, (ULONG_PTR) AtlHost_wndproc );
return S_OK; return S_OK;
@ -973,6 +976,48 @@ HRESULT WINAPI AtlAxCreateControl(LPCOLESTR lpszName, HWND hWnd,
NULL, NULL, NULL ); NULL, NULL, NULL );
} }
enum content
{
IsEmpty = 0,
IsGUID = 1,
IsHTML = 2,
IsURL = 3,
IsUnknown = 4
};
static enum content get_content_type(LPCOLESTR name, CLSID *control_id)
{
WCHAR new_urlW[MAX_PATH];
DWORD size = MAX_PATH;
WCHAR mshtml_prefixW[] = {'m','s','h','t','m','l',':','\0'};
if (!name || !name[0])
{
WARN("name %s\n", wine_dbgstr_w(name));
return IsEmpty;
}
if (CLSIDFromString(name, control_id) == S_OK ||
CLSIDFromProgID(name, control_id) == S_OK)
return IsGUID;
if (PathIsURLW (name) ||
UrlApplySchemeW(name, new_urlW, &size, URL_APPLY_GUESSSCHEME|URL_APPLY_GUESSFILE) == S_OK)
{
*control_id = CLSID_WebBrowser;
return IsURL;
}
if (!strncmpiW(name, mshtml_prefixW, 7))
{
FIXME("mshtml prefix not implemented\n");
*control_id = CLSID_WebBrowser;
return IsHTML;
}
return IsUnknown;
}
/*********************************************************************** /***********************************************************************
* AtlAxCreateControlEx [atl100.@] * AtlAxCreateControlEx [atl100.@]
* *
@ -987,24 +1032,24 @@ HRESULT WINAPI AtlAxCreateControlEx(LPCOLESTR lpszName, HWND hWnd,
CLSID controlId; CLSID controlId;
HRESULT hRes; HRESULT hRes;
IOleObject *pControl; IOleObject *pControl;
IUnknown *pUnkControl; IUnknown *pUnkControl = NULL;
IPersistStreamInit *pPSInit; IPersistStreamInit *pPSInit;
IUnknown *pContainer; IUnknown *pContainer = NULL;
enum {IsGUID=0,IsHTML=1,IsURL=2} content; enum content content;
TRACE("(%s %p %p %p %p %p %p)\n", debugstr_w(lpszName), hWnd, pStream, TRACE("(%s %p %p %p %p %p %p)\n", debugstr_w(lpszName), hWnd, pStream,
ppUnkContainer, ppUnkControl, iidSink, punkSink); ppUnkContainer, ppUnkControl, iidSink, punkSink);
hRes = CLSIDFromString( lpszName, &controlId ); if (ppUnkContainer) *ppUnkContainer = NULL;
if ( FAILED(hRes) ) if (ppUnkControl) *ppUnkControl = NULL;
hRes = CLSIDFromProgID( lpszName, &controlId );
if ( SUCCEEDED( hRes ) ) content = get_content_type(lpszName, &controlId);
content = IsGUID;
else { if (content == IsEmpty)
/* FIXME - check for MSHTML: prefix! */ return S_OK;
content = IsURL;
controlId = CLSID_WebBrowser; if (content == IsUnknown)
} return CO_E_CLASSSTRING;
hRes = CoCreateInstance( &controlId, 0, CLSCTX_ALL, &IID_IOleObject, hRes = CoCreateInstance( &controlId, 0, CLSCTX_ALL, &IID_IOleObject,
(void**) &pControl ); (void**) &pControl );
@ -1121,7 +1166,6 @@ static LPDLGTEMPLATEW AX_ConvertDialogTemplate(LPCDLGTEMPLATEW src_tmpl)
#define GET_DWORD(x) (*(const DWORD *)(x)) #define GET_DWORD(x) (*(const DWORD *)(x))
#define PUT_BLOCK(x,y) do {if (!advance_array(&output, &allocated, &filled, (x), (y))) return NULL;} while (0) #define PUT_BLOCK(x,y) do {if (!advance_array(&output, &allocated, &filled, (x), (y))) return NULL;} while (0)
#define PUT_WORD(x) do {WORD w = (x);PUT_BLOCK(&w, 1);} while(0) #define PUT_WORD(x) do {WORD w = (x);PUT_BLOCK(&w, 1);} while(0)
#define PUT_DWORD(x) do {DWORD w = (x);PUT_BLOCK(&w, 2);} while(0)
const WORD *tmp, *src = (const WORD *)src_tmpl; const WORD *tmp, *src = (const WORD *)src_tmpl;
WORD *output; WORD *output;
DWORD allocated, filled; /* in WORDs */ DWORD allocated, filled; /* in WORDs */
@ -1313,7 +1357,7 @@ HRESULT WINAPI AtlAxGetHost(HWND hWnd, IUnknown **host)
*host = NULL; *host = NULL;
This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA ); This = (IOCS*) GetPropW( hWnd, wine_atl_iocsW );
if ( !This ) if ( !This )
{ {
WARN("No container attached to %p\n", hWnd ); WARN("No container attached to %p\n", hWnd );
@ -1335,7 +1379,7 @@ HRESULT WINAPI AtlAxGetControl(HWND hWnd, IUnknown **pUnk)
*pUnk = NULL; *pUnk = NULL;
This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA ); This = (IOCS*) GetPropW( hWnd, wine_atl_iocsW );
if ( !This || !This->control ) if ( !This || !This->control )
{ {
WARN("No control attached to %p\n", hWnd ); WARN("No control attached to %p\n", hWnd );

View file

@ -183,7 +183,7 @@ static HRESULT do_preprocess(const Registrar *This, LPCOLESTR data, strbuf *buf)
static HRESULT do_process_key(LPCOLESTR *pstr, HKEY parent_key, strbuf *buf, BOOL do_register) static HRESULT do_process_key(LPCOLESTR *pstr, HKEY parent_key, strbuf *buf, BOOL do_register)
{ {
LPCOLESTR iter = *pstr; LPCOLESTR iter;
HRESULT hres; HRESULT hres;
LONG lres; LONG lres;
HKEY hkey = 0; HKEY hkey = 0;
@ -379,7 +379,7 @@ static HRESULT do_process_root_key(LPCOLESTR data, BOOL do_register)
{ {
LPCOLESTR iter = data; LPCOLESTR iter = data;
strbuf buf; strbuf buf;
HRESULT hres = S_OK; HRESULT hres;
unsigned int i; unsigned int i;
strbuf_init(&buf); strbuf_init(&buf);

View file

@ -52,9 +52,9 @@ reactos/dll/directx/wine/wined3d # Synced to WineStaging-1.7.37
reactos/dll/win32/activeds # Synced to Wine-1.7.27 reactos/dll/win32/activeds # Synced to Wine-1.7.27
reactos/dll/win32/actxprxy # Synced to Wine-1.7.27 reactos/dll/win32/actxprxy # Synced to Wine-1.7.27
reactos/dll/win32/advpack # Synced to WineStaging-1.7.37 reactos/dll/win32/advpack # Synced to WineStaging-1.7.37
reactos/dll/win32/atl # Synced to Wine-1.7.27 reactos/dll/win32/atl # Synced to WineStaging-1.7.37
reactos/dll/win32/atl80 # Synced to Wine-1.7.27 reactos/dll/win32/atl80 # Synced to WineStaging-1.7.37
reactos/dll/win32/atl100 # Synced to Wine-1.7.27 reactos/dll/win32/atl100 # Synced to WineStaging-1.7.37
reactos/dll/win32/avifil32 # Synced to Wine-1.7.27 reactos/dll/win32/avifil32 # Synced to Wine-1.7.27
reactos/dll/win32/bcrypt # Synced to Wine-1.7.27 reactos/dll/win32/bcrypt # Synced to Wine-1.7.27
reactos/dll/win32/browseui # Out of sync reactos/dll/win32/browseui # Out of sync