Author: cwittich
Date: Thu Mar 4 16:28:42 2010
New Revision: 45835
URL:
http://svn.reactos.org/svn/reactos?rev=45835&view=rev
Log:
[ATL]
sync atl to wine 1.1.39
Modified:
trunk/reactos/dll/win32/atl/atl_ax.c
trunk/reactos/dll/win32/atl/atl_main.c
trunk/reactos/dll/win32/atl/atlbase.h
Modified: trunk/reactos/dll/win32/atl/atl_ax.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/atl/atl_ax.c?rev…
==============================================================================
--- trunk/reactos/dll/win32/atl/atl_ax.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/atl/atl_ax.c [iso-8859-1] Thu Mar 4 16:28:42 2010
@@ -1208,7 +1208,7 @@
int length;
WCHAR *nameW;
- if ( HIWORD(name) == 0 )
+ if (IS_INTRESOURCE(name))
return AtlAxCreateDialogW( hInst, (LPCWSTR) name, owner, dlgProc, param );
length = MultiByteToWideChar( CP_ACP, 0, name, -1, NULL, 0 );
Modified: trunk/reactos/dll/win32/atl/atl_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/atl/atl_main.c?r…
==============================================================================
--- trunk/reactos/dll/win32/atl/atl_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/atl/atl_main.c [iso-8859-1] Thu Mar 4 16:28:42 2010
@@ -97,6 +97,19 @@
return S_OK;
}
+static _ATL_OBJMAP_ENTRYW_V1 *get_objmap_entry( _ATL_MODULEW *mod, unsigned int index )
+{
+ _ATL_OBJMAP_ENTRYW_V1 *ret;
+
+ if (mod->cbSize == ATLVer1Size)
+ ret = (_ATL_OBJMAP_ENTRYW_V1 *)mod->m_pObjMap + index;
+ else
+ ret = (_ATL_OBJMAP_ENTRYW_V1 *)(mod->m_pObjMap + index);
+
+ if (!ret->pclsid) ret = NULL;
+ return ret;
+}
+
HRESULT WINAPI AtlModuleLoadTypeLib(_ATL_MODULEW *pM, LPCOLESTR lpszIndex,
BSTR *pbstrPath, ITypeLib **ppTypeLib)
{
@@ -158,6 +171,7 @@
HRESULT WINAPI AtlModuleRegisterClassObjects(_ATL_MODULEW *pM, DWORD dwClsContext,
DWORD dwFlags)
{
+ _ATL_OBJMAP_ENTRYW_V1 *obj;
HRESULT hRes = S_OK;
int i=0;
@@ -166,10 +180,9 @@
if (pM == NULL)
return E_INVALIDARG;
- while(pM->m_pObjMap[i].pclsid != NULL)
+ while ((obj = get_objmap_entry( pM, i++ )))
{
IUnknown* pUnknown;
- _ATL_OBJMAP_ENTRYW *obj = &(pM->m_pObjMap[i]);
HRESULT rc;
TRACE("Registering object %i\n",i);
@@ -185,7 +198,6 @@
IUnknown_Release(pUnknown);
}
}
- i++;
}
return hRes;
@@ -269,6 +281,7 @@
*/
HRESULT WINAPI AtlModuleRegisterServer(_ATL_MODULEW* pM, BOOL bRegTypeLib, const CLSID*
clsid)
{
+ const _ATL_OBJMAP_ENTRYW_V1 *obj;
int i;
HRESULT hRes;
@@ -277,12 +290,10 @@
if (pM == NULL)
return E_INVALIDARG;
- for (i = 0; pM->m_pObjMap[i].pclsid != NULL; i++) /* register CLSIDs */
- {
- if (!clsid || IsEqualCLSID(pM->m_pObjMap[i].pclsid, clsid))
- {
- const _ATL_OBJMAP_ENTRYW *obj = &pM->m_pObjMap[i];
-
+ for (i = 0; (obj = get_objmap_entry( pM, i )) != NULL; i++) /* register CLSIDs */
+ {
+ if (!clsid || IsEqualCLSID(obj->pclsid, clsid))
+ {
TRACE("Registering clsid %s\n", debugstr_guid(obj->pclsid));
hRes = obj->pfnUpdateRegistry(TRUE); /* register */
if (FAILED(hRes))
@@ -351,6 +362,7 @@
HRESULT WINAPI AtlModuleGetClassObject(_ATL_MODULEW *pm, REFCLSID rclsid,
REFIID riid, LPVOID *ppv)
{
+ _ATL_OBJMAP_ENTRYW_V1 *obj;
int i;
HRESULT hres = CLASS_E_CLASSNOTAVAILABLE;
@@ -359,12 +371,10 @@
if (pm == NULL)
return E_INVALIDARG;
- for (i = 0; pm->m_pObjMap[i].pclsid != NULL; i++)
- {
- if (IsEqualCLSID(pm->m_pObjMap[i].pclsid, rclsid))
- {
- _ATL_OBJMAP_ENTRYW *obj = &pm->m_pObjMap[i];
-
+ for (i = 0; (obj = get_objmap_entry( pm, i )) != NULL; i++)
+ {
+ if (IsEqualCLSID(obj->pclsid, rclsid))
+ {
TRACE("found object %i\n", i);
if (obj->pfnGetClassObject)
{
Modified: trunk/reactos/dll/win32/atl/atlbase.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/atl/atlbase.h?re…
==============================================================================
--- trunk/reactos/dll/win32/atl/atlbase.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/atl/atlbase.h [iso-8859-1] Thu Mar 4 16:28:42 2010
@@ -32,6 +32,28 @@
typedef LPCWSTR (WINAPI _ATL_DESCRIPTIONFUNCW)(void);
typedef const struct _ATL_CATMAP_ENTRY* (_ATL_CATMAPFUNC)(void);
typedef void (WINAPI _ATL_TERMFUNC)(DWORD dw);
+
+typedef struct _ATL_OBJMAP_ENTRYA_V1_TAG
+{
+ const CLSID* pclsid;
+ HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
+ _ATL_CREATORFUNC* pfnGetClassObject;
+ _ATL_CREATORFUNC* pfnCreateInstance;
+ IUnknown* pCF;
+ DWORD dwRegister;
+ _ATL_DESCRIPTIONFUNCA* pfnGetObjectDescription;
+}_ATL_OBJMAP_ENTRYA_V1;
+
+typedef struct _ATL_OBJMAP_ENTRYW_V1_TAG
+{
+ const CLSID* pclsid;
+ HRESULT (WINAPI *pfnUpdateRegistry)(BOOL bRegister);
+ _ATL_CREATORFUNC* pfnGetClassObject;
+ _ATL_CREATORFUNC* pfnCreateInstance;
+ IUnknown* pCF;
+ DWORD dwRegister;
+ _ATL_DESCRIPTIONFUNCW* pfnGetObjectDescription;
+} _ATL_OBJMAP_ENTRYW_V1;
typedef struct _ATL_OBJMAP_ENTRYA_TAG
{