[ATL][ATL80][ATL100]
authorAmine Khaldi <amine.khaldi@reactos.org>
Fri, 26 Sep 2014 11:39:07 +0000 (11:39 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Fri, 26 Sep 2014 11:39:07 +0000 (11:39 +0000)
* Sync with Wine 1.7.27.
CORE-8540

svn path=/trunk/; revision=64310

12 files changed:
reactos/dll/win32/atl/CMakeLists.txt
reactos/dll/win32/atl/atl.c
reactos/dll/win32/atl/atl30.c
reactos/dll/win32/atl/atl_ax.c
reactos/dll/win32/atl/atl_lib.idl [new file with mode: 0644]
reactos/dll/win32/atl/atl_lib_r.rgs [new file with mode: 0644]
reactos/dll/win32/atl/atl_lib_t.rgs [new file with mode: 0644]
reactos/dll/win32/atl/rsrc.rc
reactos/dll/win32/atl100/atl100.spec
reactos/dll/win32/atl80/atl80.spec
reactos/include/reactos/wine/atlcom.h [new file with mode: 0644]
reactos/media/doc/README.WINE

index fbc3632..1a0200f 100644 (file)
@@ -16,7 +16,17 @@ list(APPEND SOURCE
     ${CMAKE_CURRENT_BINARY_DIR}/atl_stubs.c
     ${CMAKE_CURRENT_BINARY_DIR}/atl.def)
 
     ${CMAKE_CURRENT_BINARY_DIR}/atl_stubs.c
     ${CMAKE_CURRENT_BINARY_DIR}/atl.def)
 
+list(APPEND atl_rc_deps
+    ${CMAKE_CURRENT_SOURCE_DIR}/atl.rgs
+    ${CMAKE_CURRENT_SOURCE_DIR}/atl_lib_r.rgs
+    ${CMAKE_CURRENT_SOURCE_DIR}/atl_lib_t.rgs
+    ${CMAKE_CURRENT_BINARY_DIR}/atl_lib.tlb)
+
+set_source_files_properties(rsrc.rc PROPERTIES OBJECT_DEPENDS "${atl_rc_deps}")
+
 add_library(atl SHARED ${SOURCE} rsrc.rc)
 add_library(atl SHARED ${SOURCE} rsrc.rc)
+add_typelib(atl_lib.idl)
+add_dependencies(atl stdole2)
 set_module_type(atl win32dll)
 target_link_libraries(atl uuid wine)
 add_importlibs(atl oleaut32 ole32 user32 gdi32 advapi32 shlwapi msvcrt kernel32 ntdll)
 set_module_type(atl win32dll)
 target_link_libraries(atl uuid wine)
 add_importlibs(atl oleaut32 ole32 user32 gdi32 advapi32 shlwapi msvcrt kernel32 ntdll)
index 8cc8eda..b92911d 100644 (file)
@@ -19,6 +19,7 @@
 
 #include <precomp.h>
 
 
 #include <precomp.h>
 
+#include <wine/atlcom.h>
 #include <wingdi.h>
 
 #define ATLVer1Size FIELD_OFFSET(_ATL_MODULEW, dwAtlBuildVer)
 #include <wingdi.h>
 
 #define ATLVer1Size FIELD_OFFSET(_ATL_MODULEW, dwAtlBuildVer)
@@ -244,18 +245,6 @@ HRESULT WINAPI AtlInternalQueryInterface(void* this, const _ATL_INTMAP_ENTRY* pE
     return rc;
 }
 
     return rc;
 }
 
-/* FIXME: should be in a header file */
-typedef struct ATL_PROPMAP_ENTRY
-{
-    LPCOLESTR szDesc;
-    DISPID dispid;
-    const CLSID* pclsidPropPage;
-    const IID* piidDispatch;
-    DWORD dwOffsetData;
-    DWORD dwSizeData;
-    VARTYPE vt;
-} ATL_PROPMAP_ENTRY;
-
 /***********************************************************************
  *           AtlIPersistStreamInit_Load      [atl100.@]
  */
 /***********************************************************************
  *           AtlIPersistStreamInit_Load      [atl100.@]
  */
index 536f2b0..340ed65 100644 (file)
@@ -508,6 +508,7 @@ static const IClassFactoryVtbl IRegistrarCFVtbl = {
 
 static IClassFactory RegistrarCF = { &IRegistrarCFVtbl };
 
 
 static IClassFactory RegistrarCF = { &IRegistrarCFVtbl };
 
+#ifdef __REACTOS__
 static HRESULT do_register_dll_server(IRegistrar *pRegistrar, LPCOLESTR wszDll,
                                       LPCOLESTR wszId, BOOL do_register,
                                       const struct _ATL_REGMAP_ENTRY* pMapEntries)
 static HRESULT do_register_dll_server(IRegistrar *pRegistrar, LPCOLESTR wszDll,
                                       LPCOLESTR wszId, BOOL do_register,
                                       const struct _ATL_REGMAP_ENTRY* pMapEntries)
@@ -554,7 +555,7 @@ static HRESULT do_register_server(BOOL do_register)
     StringFromGUID2(&CLSID_Registrar, clsid_str, sizeof(clsid_str)/sizeof(WCHAR));
     return do_register_dll_server(NULL, atl_dllW, MAKEINTRESOURCEW(101), do_register, reg_map);
 }
     StringFromGUID2(&CLSID_Registrar, clsid_str, sizeof(clsid_str)/sizeof(WCHAR));
     return do_register_dll_server(NULL, atl_dllW, MAKEINTRESOURCEW(101), do_register, reg_map);
 }
-
+#endif
 
 /**************************************************************
  * DllGetClassObject (ATL.2)
 
 /**************************************************************
  * DllGetClassObject (ATL.2)
index 6743885..543d661 100644 (file)
@@ -123,55 +123,88 @@ BOOL WINAPI AtlAxWinInit(void)
  *  Atl container component implementation
  */
 
  *  Atl container component implementation
  */
 
-
-static ULONG IOCS_AddRef(IOCS *This)
+/******      IOleClientSite    *****/
+static inline IOCS *impl_from_IOleClientSite(IOleClientSite *iface)
 {
 {
-    ULONG ref = InterlockedIncrement(&This->ref);
+    return CONTAINING_RECORD(iface, IOCS, IOleClientSite_iface);
+}
 
 
-    TRACE( "(%p) : AddRef from %d\n", This, ref - 1 );
+static HRESULT IOCS_Detach( IOCS *This ) /* remove subclassing */
+{
+    if ( This->hWnd )
+    {
+        SetWindowLongPtrW( This->hWnd, GWLP_WNDPROC, (ULONG_PTR) This->OrigWndProc );
+        SetWindowLongPtrW( This->hWnd, GWLP_USERDATA, 0 );
+        This->hWnd = NULL;
+    }
+    if ( This->control )
+    {
+        IOleObject *control = This->control;
 
 
-    return ref;
+        This->control = NULL;
+        IOleObject_Close( control, OLECLOSE_NOSAVE );
+        IOleObject_SetClientSite( control, NULL );
+        IOleObject_Release( control );
+    }
+    return S_OK;
 }
 
 }
 
-static HRESULT IOCS_QueryInterface(IOCS *This, REFIID riid, void **ppv)
+static HRESULT WINAPI OleClientSite_QueryInterface(IOleClientSite *iface, REFIID riid, void **ppv)
 {
 {
+    IOCS *This = impl_from_IOleClientSite(iface);
+
+    TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
+
     *ppv = NULL;
 
     *ppv = NULL;
 
-    if ( IsEqualIID( &IID_IUnknown, riid )
-      || IsEqualIID( &IID_IOleClientSite, riid ) )
+    if (IsEqualIID(&IID_IUnknown, riid) ||
+        IsEqualIID(&IID_IOleClientSite, riid))
     {
     {
-        *ppv = &This->IOleClientSite_iface;
-    } else if ( IsEqualIID( &IID_IOleContainer, riid ) )
+        *ppv = iface;
+    }
+    else if (IsEqualIID(&IID_IOleContainer, riid))
     {
         *ppv = &This->IOleContainer_iface;
     {
         *ppv = &This->IOleContainer_iface;
-    } else if ( IsEqualIID( &IID_IOleInPlaceSite, riid ) || IsEqualIID( &IID_IOleInPlaceSiteEx, riid ) || IsEqualIID( &IID_IOleInPlaceSiteWindowless, riid ) )
+    }
+    else if (IsEqualIID(&IID_IOleInPlaceSite, riid) ||
+             IsEqualIID(&IID_IOleInPlaceSiteEx, riid) ||
+             IsEqualIID(&IID_IOleInPlaceSiteWindowless, riid))
     {
         *ppv = &This->IOleInPlaceSiteWindowless_iface;
     {
         *ppv = &This->IOleInPlaceSiteWindowless_iface;
-    } else if ( IsEqualIID( &IID_IOleInPlaceFrame, riid ) )
+    }
+    else if (IsEqualIID(&IID_IOleInPlaceFrame, riid))
     {
         *ppv = &This->IOleInPlaceFrame_iface;
     {
         *ppv = &This->IOleInPlaceFrame_iface;
-    } else if ( IsEqualIID( &IID_IOleControlSite, riid ) )
+    }
+    else if (IsEqualIID(&IID_IOleControlSite, riid))
     {
         *ppv = &This->IOleControlSite_iface;
     }
 
     if (*ppv)
     {
     {
         *ppv = &This->IOleControlSite_iface;
     }
 
     if (*ppv)
     {
-        IOCS_AddRef( This );
+        IOleClientSite_AddRef(iface);
         return S_OK;
     }
 
         return S_OK;
     }
 
-    WARN("unsupported interface %s\n", debugstr_guid( riid ) );
-    *ppv = NULL;
+    WARN("unsupported interface %s\n", debugstr_guid(riid));
     return E_NOINTERFACE;
 }
 
     return E_NOINTERFACE;
 }
 
-static HRESULT IOCS_Detach( IOCS *This );
-static ULONG IOCS_Release(IOCS *This)
+static ULONG WINAPI OleClientSite_AddRef(IOleClientSite *iface)
+{
+    IOCS *This = impl_from_IOleClientSite(iface);
+    ULONG ref = InterlockedIncrement(&This->ref);
+    TRACE("(%p)->(%d)\n", This, ref);
+    return ref;
+}
+
+static ULONG WINAPI OleClientSite_Release(IOleClientSite *iface)
 {
 {
+    IOCS *This = impl_from_IOleClientSite(iface);
     ULONG ref = InterlockedDecrement(&This->ref);
 
     ULONG ref = InterlockedDecrement(&This->ref);
 
-    TRACE( "(%p) : ReleaseRef to %d\n", This, ref );
+    TRACE("(%p)->(%d)\n", This, ref);
 
     if (!ref)
     {
 
     if (!ref)
     {
@@ -182,30 +215,6 @@ static ULONG IOCS_Release(IOCS *This)
     return ref;
 }
 
     return ref;
 }
 
-/******      IOleClientSite    *****/
-static inline IOCS *impl_from_IOleClientSite(IOleClientSite *iface)
-{
-    return CONTAINING_RECORD(iface, IOCS, IOleClientSite_iface);
-}
-
-static HRESULT WINAPI OleClientSite_QueryInterface(IOleClientSite *iface, REFIID riid, void **ppv)
-{
-    IOCS *This = impl_from_IOleClientSite(iface);
-    return IOCS_QueryInterface(This, riid, ppv);
-}
-
-static ULONG WINAPI OleClientSite_AddRef(IOleClientSite *iface)
-{
-    IOCS *This = impl_from_IOleClientSite(iface);
-    return IOCS_AddRef(This);
-}
-
-static ULONG WINAPI OleClientSite_Release(IOleClientSite *iface)
-{
-    IOCS *This = impl_from_IOleClientSite(iface);
-    return IOCS_Release(This);
-}
-
 static HRESULT WINAPI OleClientSite_SaveObject(IOleClientSite *iface)
 {
     IOCS *This = impl_from_IOleClientSite(iface);
 static HRESULT WINAPI OleClientSite_SaveObject(IOleClientSite *iface)
 {
     IOCS *This = impl_from_IOleClientSite(iface);
@@ -221,11 +230,11 @@ static HRESULT WINAPI OleClientSite_GetMoniker(IOleClientSite *iface, DWORD dwAs
     return E_NOTIMPL;
 }
 
     return E_NOTIMPL;
 }
 
-static HRESULT WINAPI OleClientSite_GetContainer(IOleClientSite *iface, IOleContainer **ppContainer)
+static HRESULT WINAPI OleClientSite_GetContainer(IOleClientSite *iface, IOleContainer **container)
 {
     IOCS *This = impl_from_IOleClientSite(iface);
 {
     IOCS *This = impl_from_IOleClientSite(iface);
-    TRACE( "(%p, %p)\n", This, ppContainer );
-    return OleClientSite_QueryInterface( iface, &IID_IOleContainer, (void**)ppContainer );
+    TRACE("(%p, %p)\n", This, container);
+    return IOleClientSite_QueryInterface(iface, &IID_IOleContainer, (void**)container);
 }
 
 static HRESULT WINAPI OleClientSite_ShowObject(IOleClientSite *iface)
 }
 
 static HRESULT WINAPI OleClientSite_ShowObject(IOleClientSite *iface)
@@ -259,19 +268,19 @@ static inline IOCS *impl_from_IOleContainer(IOleContainer *iface)
 static HRESULT WINAPI OleContainer_QueryInterface( IOleContainer* iface, REFIID riid, void** ppv)
 {
     IOCS *This = impl_from_IOleContainer(iface);
 static HRESULT WINAPI OleContainer_QueryInterface( IOleContainer* iface, REFIID riid, void** ppv)
 {
     IOCS *This = impl_from_IOleContainer(iface);
-    return IOCS_QueryInterface( This, riid, ppv );
+    return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
 }
 
 static ULONG WINAPI OleContainer_AddRef(IOleContainer* iface)
 {
     IOCS *This = impl_from_IOleContainer(iface);
 }
 
 static ULONG WINAPI OleContainer_AddRef(IOleContainer* iface)
 {
     IOCS *This = impl_from_IOleContainer(iface);
-    return IOCS_AddRef(This);
+    return IOleClientSite_AddRef(&This->IOleClientSite_iface);
 }
 
 static ULONG WINAPI OleContainer_Release(IOleContainer* iface)
 {
     IOCS *This = impl_from_IOleContainer(iface);
 }
 
 static ULONG WINAPI OleContainer_Release(IOleContainer* iface)
 {
     IOCS *This = impl_from_IOleContainer(iface);
-    return IOCS_Release(This);
+    return IOleClientSite_Release(&This->IOleClientSite_iface);
 }
 
 static HRESULT WINAPI OleContainer_ParseDisplayName(IOleContainer* iface, IBindCtx* pbc,
 }
 
 static HRESULT WINAPI OleContainer_ParseDisplayName(IOleContainer* iface, IBindCtx* pbc,
@@ -306,19 +315,19 @@ static inline IOCS *impl_from_IOleInPlaceSiteWindowless(IOleInPlaceSiteWindowles
 static HRESULT WINAPI OleInPlaceSiteWindowless_QueryInterface(IOleInPlaceSiteWindowless *iface, REFIID riid, void **ppv)
 {
     IOCS *This = impl_from_IOleInPlaceSiteWindowless(iface);
 static HRESULT WINAPI OleInPlaceSiteWindowless_QueryInterface(IOleInPlaceSiteWindowless *iface, REFIID riid, void **ppv)
 {
     IOCS *This = impl_from_IOleInPlaceSiteWindowless(iface);
-    return IOCS_QueryInterface(This, riid, ppv);
+    return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
 }
 
 static ULONG WINAPI OleInPlaceSiteWindowless_AddRef(IOleInPlaceSiteWindowless *iface)
 {
     IOCS *This = impl_from_IOleInPlaceSiteWindowless(iface);
 }
 
 static ULONG WINAPI OleInPlaceSiteWindowless_AddRef(IOleInPlaceSiteWindowless *iface)
 {
     IOCS *This = impl_from_IOleInPlaceSiteWindowless(iface);
-    return IOCS_AddRef(This);
+    return IOleClientSite_AddRef(&This->IOleClientSite_iface);
 }
 
 static ULONG WINAPI OleInPlaceSiteWindowless_Release(IOleInPlaceSiteWindowless *iface)
 {
     IOCS *This = impl_from_IOleInPlaceSiteWindowless(iface);
 }
 
 static ULONG WINAPI OleInPlaceSiteWindowless_Release(IOleInPlaceSiteWindowless *iface)
 {
     IOCS *This = impl_from_IOleInPlaceSiteWindowless(iface);
-    return IOCS_Release(This);
+    return IOleClientSite_Release(&This->IOleClientSite_iface);
 }
 
 static HRESULT WINAPI OleInPlaceSiteWindowless_GetWindow(IOleInPlaceSiteWindowless* iface, HWND* phwnd)
 }
 
 static HRESULT WINAPI OleInPlaceSiteWindowless_GetWindow(IOleInPlaceSiteWindowless* iface, HWND* phwnd)
@@ -363,21 +372,22 @@ static HRESULT WINAPI OleInPlaceSiteWindowless_OnUIActivate(IOleInPlaceSiteWindo
     return S_OK;
 }
 static HRESULT WINAPI OleInPlaceSiteWindowless_GetWindowContext(IOleInPlaceSiteWindowless *iface,
     return S_OK;
 }
 static HRESULT WINAPI OleInPlaceSiteWindowless_GetWindowContext(IOleInPlaceSiteWindowless *iface,
-        IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect,
+        IOleInPlaceFrame **frame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect,
         LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
 {
     IOCS *This = impl_from_IOleInPlaceSiteWindowless(iface);
 
         LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
 {
     IOCS *This = impl_from_IOleInPlaceSiteWindowless(iface);
 
-    TRACE("(%p,%p,%p,%p,%p,%p)\n", This, ppFrame, ppDoc, lprcPosRect, lprcClipRect, lpFrameInfo);
+    TRACE("(%p,%p,%p,%p,%p,%p)\n", This, frame, ppDoc, lprcPosRect, lprcClipRect, lpFrameInfo);
 
     if ( lprcClipRect )
         *lprcClipRect = This->size;
     if ( lprcPosRect )
         *lprcPosRect = This->size;
 
 
     if ( lprcClipRect )
         *lprcClipRect = This->size;
     if ( lprcPosRect )
         *lprcPosRect = This->size;
 
-    if ( ppFrame )
+    if ( frame )
     {
     {
-        IOCS_QueryInterface( This, &IID_IOleInPlaceFrame, (void**) ppFrame );
+        *frame = &This->IOleInPlaceFrame_iface;
+        IOleInPlaceFrame_AddRef(*frame);
     }
 
     if ( ppDoc )
     }
 
     if ( ppDoc )
@@ -536,19 +546,19 @@ static inline IOCS *impl_from_IOleInPlaceFrame(IOleInPlaceFrame *iface)
 static HRESULT WINAPI OleInPlaceFrame_QueryInterface(IOleInPlaceFrame *iface, REFIID riid, void **ppv)
 {
     IOCS *This = impl_from_IOleInPlaceFrame(iface);
 static HRESULT WINAPI OleInPlaceFrame_QueryInterface(IOleInPlaceFrame *iface, REFIID riid, void **ppv)
 {
     IOCS *This = impl_from_IOleInPlaceFrame(iface);
-    return IOCS_QueryInterface(This, riid, ppv);
+    return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
 }
 
 static ULONG WINAPI OleInPlaceFrame_AddRef(IOleInPlaceFrame *iface)
 {
     IOCS *This = impl_from_IOleInPlaceFrame(iface);
 }
 
 static ULONG WINAPI OleInPlaceFrame_AddRef(IOleInPlaceFrame *iface)
 {
     IOCS *This = impl_from_IOleInPlaceFrame(iface);
-    return IOCS_AddRef(This);
+    return IOleClientSite_AddRef(&This->IOleClientSite_iface);
 }
 
 static ULONG WINAPI OleInPlaceFrame_Release(IOleInPlaceFrame *iface)
 {
     IOCS *This = impl_from_IOleInPlaceFrame(iface);
 }
 
 static ULONG WINAPI OleInPlaceFrame_Release(IOleInPlaceFrame *iface)
 {
     IOCS *This = impl_from_IOleInPlaceFrame(iface);
-    return IOCS_Release(This);
+    return IOleClientSite_Release(&This->IOleClientSite_iface);
 }
 
 static HRESULT WINAPI OleInPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phWnd)
 }
 
 static HRESULT WINAPI OleInPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phWnd)
@@ -659,19 +669,19 @@ static inline IOCS *impl_from_IOleControlSite(IOleControlSite *iface)
 static HRESULT WINAPI OleControlSite_QueryInterface(IOleControlSite *iface, REFIID riid, void **ppv)
 {
     IOCS *This = impl_from_IOleControlSite(iface);
 static HRESULT WINAPI OleControlSite_QueryInterface(IOleControlSite *iface, REFIID riid, void **ppv)
 {
     IOCS *This = impl_from_IOleControlSite(iface);
-    return IOCS_QueryInterface(This, riid, ppv);
+    return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
 }
 
 static ULONG WINAPI OleControlSite_AddRef(IOleControlSite *iface)
 {
     IOCS *This = impl_from_IOleControlSite(iface);
 }
 
 static ULONG WINAPI OleControlSite_AddRef(IOleControlSite *iface)
 {
     IOCS *This = impl_from_IOleControlSite(iface);
-    return IOCS_AddRef(This);
+    return IOleClientSite_AddRef(&This->IOleClientSite_iface);
 }
 
 static ULONG WINAPI OleControlSite_Release(IOleControlSite *iface)
 {
     IOCS *This = impl_from_IOleControlSite(iface);
 }
 
 static ULONG WINAPI OleControlSite_Release(IOleControlSite *iface)
 {
     IOCS *This = impl_from_IOleControlSite(iface);
-    return IOCS_Release(This);
+    return IOleClientSite_Release(&This->IOleClientSite_iface);
 }
 
 static HRESULT WINAPI OleControlSite_OnControlInfoChanged( IOleControlSite* This)
 }
 
 static HRESULT WINAPI OleControlSite_OnControlInfoChanged( IOleControlSite* This)
@@ -794,26 +804,6 @@ static const IOleControlSiteVtbl OleControlSite_vtbl =
     OleControlSite_ShowPropertyFrame
 };
 
     OleControlSite_ShowPropertyFrame
 };
 
-static HRESULT IOCS_Detach( IOCS *This ) /* remove subclassing */
-{
-    if ( This->hWnd )
-    {
-        SetWindowLongPtrW( This->hWnd, GWLP_WNDPROC, (ULONG_PTR) This->OrigWndProc );
-        SetWindowLongPtrW( This->hWnd, GWLP_USERDATA, 0 );
-        This->hWnd = NULL;
-    }
-    if ( This->control )
-    {
-        IOleObject *control = This->control;
-
-        This->control = NULL;
-        IOleObject_Close( control, OLECLOSE_NOSAVE );
-        IOleObject_SetClientSite( control, NULL );
-        IOleObject_Release( control );
-    }
-    return S_OK;
-}
-
 static void IOCS_OnSize( IOCS* This, LPCRECT rect )
 {
     SIZEL inPix, inHi;
 static void IOCS_OnSize( IOCS* This, LPCRECT rect )
 {
     SIZEL inPix, inHi;
@@ -933,12 +923,15 @@ static HRESULT IOCS_Init( IOCS *This )
 /**********************************************************************
  * Create new instance of Atl host component and attach it to window  *
  */
 /**********************************************************************
  * Create new instance of Atl host component and attach it to window  *
  */
-static HRESULT IOCS_Create( HWND hWnd, IUnknown *pUnkControl, IOCS **ppSite )
+static HRESULT IOCS_Create( HWND hWnd, IUnknown *pUnkControl, IUnknown **container )
 {
     HRESULT hr;
     IOCS *This;
 
 {
     HRESULT hr;
     IOCS *This;
 
-    *ppSite = NULL;
+    if (!container)
+        return S_OK;
+
+    *container = NULL;
     This = HeapAlloc(GetProcessHeap(), 0, sizeof(IOCS));
 
     if (!This)
     This = HeapAlloc(GetProcessHeap(), 0, sizeof(IOCS));
 
     if (!This)
@@ -959,9 +952,12 @@ static HRESULT IOCS_Create( HWND hWnd, IUnknown *pUnkControl, IOCS **ppSite )
     if ( SUCCEEDED( hr ) )
         hr = IOCS_Init( This );
     if ( SUCCEEDED( hr ) )
     if ( SUCCEEDED( hr ) )
         hr = IOCS_Init( This );
     if ( SUCCEEDED( hr ) )
-        *ppSite = This;
+        *container = (IUnknown*)&This->IOleClientSite_iface;
     else
     else
-        IOCS_Release( This );
+    {
+        IOCS_Detach( This );
+        HeapFree(GetProcessHeap(), 0, This);
+    }
 
     return hr;
 }
 
     return hr;
 }
@@ -1086,26 +1082,17 @@ HRESULT WINAPI AtlAxCreateControlEx(LPCOLESTR lpszName, HWND hWnd,
 /***********************************************************************
  *           AtlAxAttachControl           [atl100.@]
  */
 /***********************************************************************
  *           AtlAxAttachControl           [atl100.@]
  */
-HRESULT WINAPI AtlAxAttachControl(IUnknown* pControl, HWND hWnd, IUnknown** ppUnkContainer)
+HRESULT WINAPI AtlAxAttachControl(IUnknown *control, HWND hWnd, IUnknown **container)
 {
 {
-    IOCS *pUnkContainer;
     HRESULT hr;
 
     HRESULT hr;
 
-    TRACE( "%p %p %p\n", pControl, hWnd, ppUnkContainer );
+    TRACE("(%p %p %p)\n", control, hWnd, container);
 
 
-    if (!pControl)
+    if (!control)
         return E_INVALIDARG;
 
         return E_INVALIDARG;
 
-    hr = IOCS_Create( hWnd, pControl, &pUnkContainer );
-    if ( SUCCEEDED( hr ) && ppUnkContainer)
-    {
-        *ppUnkContainer = (IUnknown*) pUnkContainer;
-    }
-
-    if(!hWnd)
-        return S_FALSE;
-
-    return hr;
+    hr = IOCS_Create( hWnd, control, container );
+    return hWnd ? hr : S_FALSE;
 }
 
 /**********************************************************************
 }
 
 /**********************************************************************
@@ -1318,13 +1305,13 @@ HWND WINAPI AtlAxCreateDialogW(HINSTANCE hInst, LPCWSTR name, HWND owner, DLGPRO
  *           AtlAxGetHost                 [atl100.@]
  *
  */
  *           AtlAxGetHost                 [atl100.@]
  *
  */
-HRESULT WINAPI AtlAxGetHost(HWND hWnd, IUnknown **pUnk)
+HRESULT WINAPI AtlAxGetHost(HWND hWnd, IUnknown **host)
 {
     IOCS *This;
 
 {
     IOCS *This;
 
-    TRACE( "(%p, %p)\n", hWnd, pUnk );
+    TRACE("(%p, %p)\n", hWnd, host);
 
 
-    *pUnk = NULL;
+    *host = NULL;
 
     This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA );
     if ( !This )
 
     This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA );
     if ( !This )
@@ -1333,7 +1320,7 @@ HRESULT WINAPI AtlAxGetHost(HWND hWnd, IUnknown **pUnk)
         return E_FAIL;
     }
 
         return E_FAIL;
     }
 
-    return IOCS_QueryInterface( This, &IID_IUnknown, (void**) pUnk );
+    return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, &IID_IUnknown, (void**)host);
 }
 
 /***********************************************************************
 }
 
 /***********************************************************************
@@ -1379,3 +1366,29 @@ INT_PTR WINAPI AtlAxDialogBoxA(HINSTANCE hInstance, LPCSTR lpTemplateName, HWND
     FIXME("(%p %s %p %p %lx)\n", hInstance, debugstr_a(lpTemplateName), hWndParent, lpDialogProc, dwInitParam);
     return 0;
 }
     FIXME("(%p %s %p %p %lx)\n", hInstance, debugstr_a(lpTemplateName), hWndParent, lpDialogProc, dwInitParam);
     return 0;
 }
+
+#if _ATL_VER >= _ATL_VER_80
+
+/***********************************************************************
+ *           AtlAxCreateControlLic        [atl100.59]
+ *
+ */
+HRESULT WINAPI AtlAxCreateControlLic(const WCHAR *lpTricsData, HWND hwnd, IStream *stream, IUnknown **container, BSTR lic)
+{
+    FIXME("(%s %p %p %p %s)\n", debugstr_w(lpTricsData), hwnd, stream, container, debugstr_w(lic));
+    return E_NOTIMPL;
+}
+
+/***********************************************************************
+ *           AtlAxCreateControlLicEx      [atl100.60]
+ *
+ */
+HRESULT WINAPI AtlAxCreateControlLicEx(const WCHAR *lpTricsData, HWND hwnd, IStream *stream,
+        IUnknown **container, IUnknown **control, REFIID iidSink, IUnknown *punkSink, BSTR lic)
+{
+    FIXME("(%s %p %p %p %p %s %p %s)\n", debugstr_w(lpTricsData), hwnd, stream, container, control,
+          debugstr_guid(iidSink), punkSink, debugstr_w(lic));
+    return E_NOTIMPL;
+}
+
+#endif
diff --git a/reactos/dll/win32/atl/atl_lib.idl b/reactos/dll/win32/atl/atl_lib.idl
new file mode 100644 (file)
index 0000000..918416c
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2014 Jacek Caban 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
+ */
+
+#pragma makedep regtypelib
+#pragma makedep register
+
+import "atliface.idl";
+
+[
+    uuid(44ec0535-400f-11d0-9dcd-00a0c90391d3),
+    version(1.0),
+    helpstring("ATL 2.0 Type Library")
+]
+library ATLLib
+{
+    importlib("stdole2.tlb");
+
+    interface IDocHostUIHandlerDispatch;
+    interface IAxWinAmbientDispatch;
+    interface IAxWinAmbientDispatchEx;
+}
diff --git a/reactos/dll/win32/atl/atl_lib_r.rgs b/reactos/dll/win32/atl/atl_lib_r.rgs
new file mode 100644 (file)
index 0000000..30cbdd4
--- /dev/null
@@ -0,0 +1,9 @@
+HKCR
+{
+    NoRemove Interface
+    {
+    }
+    NoRemove CLSID
+    {
+    }
+}
diff --git a/reactos/dll/win32/atl/atl_lib_t.rgs b/reactos/dll/win32/atl/atl_lib_t.rgs
new file mode 100644 (file)
index 0000000..563dda9
--- /dev/null
@@ -0,0 +1,20 @@
+HKCR
+{
+    NoRemove Typelib
+    {
+        NoRemove '{44EC0535-400F-11D0-9DCD-00A0C90391D3}'
+        {
+            '1.0' = s 'ATL 2.0 Type Library'
+            {
+                '0' { win32 = s '%MODULE%' }
+                FLAGS = s '0'
+            }
+        }
+    }
+    NoRemove Interface
+    {
+    }
+    NoRemove CLSID
+    {
+    }
+}
index 6e4fe4d..1294aa4 100644 (file)
@@ -1 +1,4 @@
 101 REGISTRY "atl.rgs"
 101 REGISTRY "atl.rgs"
+1 TYPELIB atl_lib.tlb
+1 WINE_REGISTRY "atl_lib_r.rgs"
+2 WINE_REGISTRY "atl_lib_t.rgs"
index 0d41c1e..25fad3d 100644 (file)
@@ -40,8 +40,8 @@
 54 stdcall AtlGetObjectSourceInterface(ptr ptr ptr ptr ptr)
 56 stdcall AtlLoadTypeLib(long wstr ptr ptr)
 58 stdcall AtlModuleAddTermFunc(ptr ptr long)
 54 stdcall AtlGetObjectSourceInterface(ptr ptr ptr ptr ptr)
 56 stdcall AtlLoadTypeLib(long wstr ptr ptr)
 58 stdcall AtlModuleAddTermFunc(ptr ptr long)
-59 stub AtlAxCreateControlLic
-60 stub AtlAxCreateControlLicEx
+59 stdcall AtlAxCreateControlLic(wstr long ptr ptr wstr)
+60 stdcall AtlAxCreateControlLicEx(wstr long ptr ptr ptr ptr ptr wstr)
 61 stdcall AtlCreateRegistrar(ptr)
 62 stub AtlWinModuleRegisterClassExW
 63 stub AtlWinModuleRegisterClassExA
 61 stdcall AtlCreateRegistrar(ptr)
 62 stub AtlWinModuleRegisterClassExW
 63 stub AtlWinModuleRegisterClassExA
index fb5fae8..f313944 100644 (file)
@@ -43,8 +43,8 @@
 55 stub AtlUnRegisterTypeLib
 56 stdcall AtlLoadTypeLib(long wstr ptr ptr)
 58 stdcall AtlModuleAddTermFunc(ptr ptr long)
 55 stub AtlUnRegisterTypeLib
 56 stdcall AtlLoadTypeLib(long wstr ptr ptr)
 58 stdcall AtlModuleAddTermFunc(ptr ptr long)
-59 stub AtlAxCreateControlLic
-60 stub AtlAxCreateControlLicEx
+59 stdcall AtlAxCreateControlLic(wstr long ptr ptr wstr)
+60 stdcall AtlAxCreateControlLicEx(wstr long ptr ptr ptr ptr ptr wstr)
 61 stdcall AtlCreateRegistrar(ptr)
 62 stub AtlWinModuleRegisterClassExW
 63 stub AtlWinModuleRegisterClassExA
 61 stdcall AtlCreateRegistrar(ptr)
 62 stub AtlWinModuleRegisterClassExW
 63 stub AtlWinModuleRegisterClassExA
diff --git a/reactos/include/reactos/wine/atlcom.h b/reactos/include/reactos/wine/atlcom.h
new file mode 100644 (file)
index 0000000..c141fbe
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2014 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
+ */
+
+#ifndef __WINE_ATLCOM_H__
+#define __WINE_ATLCOM_H__
+
+#ifndef __WINE_ATLBASE_H__
+# error You must include atlbase.h to use this header
+#endif
+
+typedef struct ATL_PROPMAP_ENTRY
+{
+    LPCOLESTR szDesc;
+#if _ATL_VER < _ATL_VER_100
+    DISPID dispid;
+    const CLSID *pclsidPropPage;
+    const IID *piidDispatch;
+#else
+    const CLSID *pclsidPropPage;
+    const IID *piidDispatch;
+    void *rgclsidAllowed;
+    DWORD cclsidAllowed;
+    DISPID dispid;
+#endif
+    DWORD dwOffsetData;
+    DWORD dwSizeData;
+    VARTYPE vt;
+} ATL_PROPMAP_ENTRY;
+
+HRESULT WINAPI AtlIPersistStreamInit_Load(IStream*, ATL_PROPMAP_ENTRY*, void*, IUnknown*);
+HRESULT WINAPI AtlIPersistStreamInit_Save(IStream*, BOOL, ATL_PROPMAP_ENTRY*, void*, IUnknown*);
+HRESULT WINAPI AtlIPersistPropertyBag_Load(IPropertyBag*, IErrorLog*, ATL_PROPMAP_ENTRY*, void*, IUnknown*);
+HRESULT WINAPI AtlIPersistPropertyBag_Save(IPropertyBag*, BOOL, BOOL, ATL_PROPMAP_ENTRY*, void*, IUnknown*);
+
+#endif /* __WINE_ATLCOM_H__ */
index 4f7f2a6..d7f651b 100644 (file)
@@ -51,9 +51,9 @@ reactos/dll/directx/wine/wined3d        # Synced to Wine-1.7.27
 reactos/dll/win32/activeds            # Synced to Wine-1.7.17
 reactos/dll/win32/actxprxy            # Synced to Wine-1.7.17
 reactos/dll/win32/advpack             # Synced to Wine-1.7.27
 reactos/dll/win32/activeds            # Synced to Wine-1.7.17
 reactos/dll/win32/actxprxy            # Synced to Wine-1.7.17
 reactos/dll/win32/advpack             # Synced to Wine-1.7.27
-reactos/dll/win32/atl                 # Synced to Wine-1.7.17
-reactos/dll/win32/atl100              # Synced to Wine-1.7.17
-reactos/dll/win32/atl80               # Synced to Wine-1.7.17
+reactos/dll/win32/atl                 # Synced to Wine-1.7.27
+reactos/dll/win32/atl80               # Synced to Wine-1.7.27
+reactos/dll/win32/atl100              # Synced to Wine-1.7.27
 reactos/dll/win32/avifil32            # Synced to Wine-1.7.17
 reactos/dll/win32/bcrypt              # Synced to Wine-1.7.17
 reactos/dll/win32/browseui            # Out of sync
 reactos/dll/win32/avifil32            # Synced to Wine-1.7.17
 reactos/dll/win32/bcrypt              # Synced to Wine-1.7.17
 reactos/dll/win32/browseui            # Out of sync