diff --git a/.gitignore b/.gitignore index 24584dc0ccc..298ec905092 100644 --- a/.gitignore +++ b/.gitignore @@ -59,7 +59,6 @@ dlls/mstask/mstask_local.h dlls/mstask/mstask_local_i.c dlls/msvideo.dll16 dlls/msxml3/msxml3_v1.tlb -dlls/ole2.dll16 dlls/ole2disp.dll16 dlls/ole32/dcom.h dlls/ole32/dcom_p.c diff --git a/configure b/configure index 5ab7e37f058..e453fee05bd 100755 --- a/configure +++ b/configure @@ -3911,6 +3911,7 @@ then enable_monodebg_vxd=${enable_monodebg_vxd:-no} enable_mouse_drv16=${enable_mouse_drv16:-no} enable_msacm_dll16=${enable_msacm_dll16:-no} + enable_ole2_dll16=${enable_ole2_dll16:-no} enable_ole2conv_dll16=${enable_ole2conv_dll16:-no} enable_ole2nls_dll16=${enable_ole2nls_dll16:-no} enable_ole2prox_dll16=${enable_ole2prox_dll16:-no} @@ -26479,6 +26480,14 @@ ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/odbccp32/tests/Makefile: dlls/odbccp32/tests/Makefile.in dlls/Maketest.rules" ac_config_files="$ac_config_files dlls/odbccp32/tests/Makefile" +ALL_MAKEFILES="$ALL_MAKEFILES \\ + dlls/ole2.dll16/Makefile" +test "x$enable_ole2_dll16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ + ole2.dll16" +ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS +dlls/ole2.dll16/Makefile: dlls/ole2.dll16/Makefile.in dlls/Makedll.rules" +ac_config_files="$ac_config_files dlls/ole2.dll16/Makefile" + ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/ole2conv.dll16/Makefile" test "x$enable_ole2conv_dll16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ @@ -29226,6 +29235,7 @@ do "dlls/odbc32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/odbc32/Makefile" ;; "dlls/odbccp32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/odbccp32/Makefile" ;; "dlls/odbccp32/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/odbccp32/tests/Makefile" ;; + "dlls/ole2.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ole2.dll16/Makefile" ;; "dlls/ole2conv.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ole2conv.dll16/Makefile" ;; "dlls/ole2nls.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ole2nls.dll16/Makefile" ;; "dlls/ole2prox.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ole2prox.dll16/Makefile" ;; diff --git a/configure.ac b/configure.ac index eb0b49bccf0..887497da0b4 100644 --- a/configure.ac +++ b/configure.ac @@ -148,6 +148,7 @@ then enable_monodebg_vxd=${enable_monodebg_vxd:-no} enable_mouse_drv16=${enable_mouse_drv16:-no} enable_msacm_dll16=${enable_msacm_dll16:-no} + enable_ole2_dll16=${enable_ole2_dll16:-no} enable_ole2conv_dll16=${enable_ole2conv_dll16:-no} enable_ole2nls_dll16=${enable_ole2nls_dll16:-no} enable_ole2prox_dll16=${enable_ole2prox_dll16:-no} @@ -2147,6 +2148,7 @@ WINE_CONFIG_MAKEFILE([dlls/objsel/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL WINE_CONFIG_MAKEFILE([dlls/odbc32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/odbccp32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/odbccp32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) +WINE_CONFIG_MAKEFILE([dlls/ole2.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/ole2conv.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/ole2nls.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/ole2prox.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) diff --git a/dlls/Makefile.in b/dlls/Makefile.in index a77ffb95941..f6557dbaa47 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -29,7 +29,6 @@ WIN16_FILES = \ krnl386.exe16 \ mmsystem.dll16 \ msvideo.dll16 \ - ole2.dll16 \ ole2disp.dll16 \ rasapi16.dll16 \ setupx.dll16 \ @@ -80,7 +79,7 @@ krnl386.exe16 system.drv16 toolhelp.dll16: msvideo.dll16: echo "msvfw32.dll" >$@ -compobj.dll16 ole2.dll16: +compobj.dll16: echo "ole32.dll" >$@ ole2disp.dll16 typelib.dll16: diff --git a/dlls/ole2.dll16/Makefile.in b/dlls/ole2.dll16/Makefile.in new file mode 100644 index 00000000000..0a5460d3f0a --- /dev/null +++ b/dlls/ole2.dll16/Makefile.in @@ -0,0 +1,17 @@ +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +MODULE = ole2.dll16 +IMPORTS = uuid ole32 user32 gdi32 kernel32 +EXTRADLLFLAGS = -Wb,--subsystem,win16,--main-module,ole32.dll + +SPEC_SRCS = ole2.dll16.spec + +C_SRCS = \ + memlockbytes.c \ + ole2.c + +@MAKE_DLL_RULES@ + +@DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/ole32/ifs.h b/dlls/ole2.dll16/ifs.h similarity index 88% rename from dlls/ole32/ifs.h rename to dlls/ole2.dll16/ifs.h index 4c4287f319e..11775521955 100644 --- a/dlls/ole32/ifs.h +++ b/dlls/ole2.dll16/ifs.h @@ -33,30 +33,6 @@ typedef LPCSTR LPCOLESTR16; #define STDMETHOD16(m) HRESULT (STDMETHOD16CALLTYPE *m) #define STDMETHOD16_(t,m) t (STDMETHOD16CALLTYPE *m) - -/*********************************************************************** - * IMalloc16 interface - */ - -typedef struct IMalloc16 *LPMALLOC16; - -#define INTERFACE IMalloc16 -DECLARE_INTERFACE_(IMalloc16,IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; - STDMETHOD16_(ULONG,AddRef)(THIS) PURE; - STDMETHOD16_(ULONG,Release)(THIS) PURE; - /*** IMalloc16 methods ***/ - STDMETHOD16_(LPVOID,Alloc)(THIS_ DWORD cb) PURE; - STDMETHOD16_(LPVOID,Realloc)(THIS_ LPVOID pv, DWORD cb) PURE; - STDMETHOD16_(void,Free)(THIS_ LPVOID pv) PURE; - STDMETHOD16_(DWORD,GetSize)(THIS_ LPVOID pv) PURE; - STDMETHOD16_(INT16,DidAlloc)(THIS_ LPVOID pv) PURE; - STDMETHOD16_(LPVOID,HeapMinimize)(THIS) PURE; -}; -#undef INTERFACE - /**********************************************************************/ typedef struct ILockBytes16 *LPLOCKBYTES16; diff --git a/dlls/ole32/memlockbytes16.c b/dlls/ole2.dll16/memlockbytes.c similarity index 99% rename from dlls/ole32/memlockbytes16.c rename to dlls/ole2.dll16/memlockbytes.c index bca7aa103ab..538f388c24a 100644 --- a/dlls/ole32/memlockbytes16.c +++ b/dlls/ole2.dll16/memlockbytes.c @@ -497,7 +497,7 @@ HRESULT CDECL HGLOBALLockBytesImpl16_Stat( /****************************************************************************** * CreateILockBytesOnHGlobal [OLE2.54] - * + * * Creates an ILockBytes interface for a HGLOBAL handle. * * PARAMS diff --git a/dlls/ole32/ole2_16.c b/dlls/ole2.dll16/ole2.c similarity index 87% rename from dlls/ole32/ole2_16.c rename to dlls/ole2.dll16/ole2.c index 11cf1ae9339..ab0439032d8 100644 --- a/dlls/ole32/ole2_16.c +++ b/dlls/ole2.dll16/ole2.c @@ -52,6 +52,48 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); #define HICON_32(h16) ((HICON)(ULONG_PTR)(h16)) #define HINSTANCE_32(h16) ((HINSTANCE)(ULONG_PTR)(h16)) +/****************************************************************************** + * OleBuildVersion (OLE2.1) + */ +DWORD WINAPI OleBuildVersion16(void) +{ + return OleBuildVersion(); +} + +/*********************************************************************** + * OleInitialize (OLE2.2) + */ +HRESULT WINAPI OleInitialize16(LPVOID reserved) +{ + return OleInitialize( reserved ); +} + +/****************************************************************************** + * OleUninitialize (OLE2.3) + */ +void WINAPI OleUninitialize16(void) +{ + return OleUninitialize(); +} + +/*********************************************************************** + * DllGetClassObject (OLE2.4) + */ +HRESULT WINAPI DllGetClassObject16(REFCLSID rclsid, REFIID iid, LPVOID *ppv) +{ + FIXME("(%s, %s, %p): stub\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv); + return E_NOTIMPL; +} + +/****************************************************************************** + * GetRunningObjectTable (OLE2.30) + */ +HRESULT WINAPI GetRunningObjectTable16(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot) +{ + FIXME("(%d,%p),stub!\n",reserved,pprot); + return E_NOTIMPL; +} + /*********************************************************************** * RegisterDragDrop (OLE2.35) */ @@ -105,7 +147,7 @@ HGLOBAL16 WINAPI OleMetaFilePictFromIconAndLabel16( return 0; } - FIXME("(%04x, '%s', '%s', %d): incorrect metrics, please try to correct them !\n", + FIXME("(%04x, '%s', '%s', %d): incorrect metrics, please try to correct them !\n", hIcon, lpszLabel, lpszSourceFile, iIconIndex); hdc = CreateMetaFileW(NULL); @@ -166,32 +208,6 @@ HRESULT WINAPI OleSetMenuDescriptor16( return E_NOTIMPL; } -/****************************************************************************** - * IsValidInterface [COMPOBJ.23] - * - * Determines whether a pointer is a valid interface. - * - * PARAMS - * punk [I] Interface to be tested. - * - * RETURNS - * TRUE, if the passed pointer is a valid interface, or FALSE otherwise. - */ -BOOL WINAPI IsValidInterface16(SEGPTR punk) -{ - DWORD **ptr; - - if (IsBadReadPtr16(punk,4)) - return FALSE; - ptr = MapSL(punk); - if (IsBadReadPtr16((SEGPTR)ptr[0],4)) /* check vtable ptr */ - return FALSE; - ptr = MapSL((SEGPTR)ptr[0]); /* ptr to first method */ - if (IsBadReadPtr16((SEGPTR)ptr[0],2)) - return FALSE; - return TRUE; -} - /****************************************************************************** * OleLoad [OLE2.12] * diff --git a/dlls/ole32/ole2.spec b/dlls/ole2.dll16/ole2.dll16.spec similarity index 97% rename from dlls/ole32/ole2.spec rename to dlls/ole2.dll16/ole2.dll16.spec index 1c337376231..6f088518042 100644 --- a/dlls/ole32/ole2.spec +++ b/dlls/ole2.dll16/ole2.dll16.spec @@ -1,6 +1,6 @@ -1 pascal OleBuildVersion() OleBuildVersion -2 pascal OleInitialize(ptr) OleInitialize -3 pascal OleUninitialize() OleUninitialize +1 pascal OleBuildVersion() OleBuildVersion16 +2 pascal OleInitialize(ptr) OleInitialize16 +3 pascal OleUninitialize() OleUninitialize16 4 pascal DllGetClassObject(ptr ptr ptr) DllGetClassObject16 #5 WEP 6 stub OLEQUERYLINKFROMDATA diff --git a/dlls/ole32/Makefile.in b/dlls/ole32/Makefile.in index 5ad33ad0d91..bd05b43e3ae 100644 --- a/dlls/ole32/Makefile.in +++ b/dlls/ole32/Makefile.in @@ -47,13 +47,10 @@ C_SRCS = \ usrmarshal.c C_SRCS16 = \ - memlockbytes16.c \ - ole16.c \ - ole2_16.c + ole16.c SPEC_SRCS16 = \ - compobj.spec \ - ole2.spec + compobj.spec RC_SRCS = ole32res.rc diff --git a/dlls/ole32/ole16.c b/dlls/ole32/ole16.c index 1e1cf452f79..514a91251a8 100644 --- a/dlls/ole32/ole16.c +++ b/dlls/ole32/ole16.c @@ -43,12 +43,42 @@ #include "wine/unicode.h" #include "wine/winbase16.h" #include "compobj_private.h" -#include "ifs.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(ole); +typedef LPSTR LPOLESTR16; +typedef LPCSTR LPCOLESTR16; + +#define STDMETHOD16CALLTYPE __cdecl +#define STDMETHOD16(m) HRESULT (STDMETHOD16CALLTYPE *m) +#define STDMETHOD16_(t,m) t (STDMETHOD16CALLTYPE *m) + + +/*********************************************************************** + * IMalloc16 interface + */ + +typedef struct IMalloc16 *LPMALLOC16; + +#define INTERFACE IMalloc16 +DECLARE_INTERFACE_(IMalloc16,IUnknown) +{ + /*** IUnknown methods ***/ + STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE; + STDMETHOD16_(ULONG,AddRef)(THIS) PURE; + STDMETHOD16_(ULONG,Release)(THIS) PURE; + /*** IMalloc16 methods ***/ + STDMETHOD16_(LPVOID,Alloc)(THIS_ DWORD cb) PURE; + STDMETHOD16_(LPVOID,Realloc)(THIS_ LPVOID pv, DWORD cb) PURE; + STDMETHOD16_(void,Free)(THIS_ LPVOID pv) PURE; + STDMETHOD16_(DWORD,GetSize)(THIS_ LPVOID pv) PURE; + STDMETHOD16_(INT16,DidAlloc)(THIS_ LPVOID pv) PURE; + STDMETHOD16_(LPVOID,HeapMinimize)(THIS) PURE; +}; +#undef INTERFACE + static HTASK16 hETask = 0; static WORD Table_ETask[62]; @@ -498,6 +528,32 @@ HRESULT WINAPI CoRevokeClassObject16(DWORD dwRegister) /* [in] token on class ob return 0; } +/****************************************************************************** + * IsValidInterface [COMPOBJ.23] + * + * Determines whether a pointer is a valid interface. + * + * PARAMS + * punk [I] Interface to be tested. + * + * RETURNS + * TRUE, if the passed pointer is a valid interface, or FALSE otherwise. + */ +BOOL WINAPI IsValidInterface16(SEGPTR punk) +{ + DWORD **ptr; + + if (IsBadReadPtr16(punk,4)) + return FALSE; + ptr = MapSL(punk); + if (IsBadReadPtr16((SEGPTR)ptr[0],4)) /* check vtable ptr */ + return FALSE; + ptr = MapSL((SEGPTR)ptr[0]); /* ptr to first method */ + if (IsBadReadPtr16((SEGPTR)ptr[0],2)) + return FALSE; + return TRUE; +} + /****************************************************************************** * CoFileTimeToDosDateTime [COMPOBJ.30] */ @@ -654,22 +710,3 @@ HRESULT WINAPI CoDisconnectObject16( LPUNKNOWN lpUnk, DWORD reserved ) FIXME("(%p, 0x%08x): stub!\n", lpUnk, reserved); return E_NOTIMPL; } - -/*********************************************************************** - * DllGetClassObject [OLE2.4] - */ -HRESULT WINAPI DllGetClassObject16(REFCLSID rclsid, REFIID iid, LPVOID *ppv) -{ - FIXME("(%s, %s, %p): stub\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv); - return E_NOTIMPL; -} - -/****************************************************************************** - * GetRunningObjectTable (OLE2.30) - */ -HRESULT WINAPI -GetRunningObjectTable16(DWORD reserved, LPRUNNINGOBJECTTABLE *pprot) -{ - FIXME("(%d,%p),stub!\n",reserved,pprot); - return E_NOTIMPL; -} diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c index ae225dc1b4c..fe00066921e 100644 --- a/dlls/ole32/ole2.c +++ b/dlls/ole32/ole2.c @@ -161,7 +161,6 @@ static DWORD OLEDD_GetButtonState(void); /****************************************************************************** - * OleBuildVersion [OLE2.1] * OleBuildVersion [OLE32.@] */ DWORD WINAPI OleBuildVersion(void) @@ -171,7 +170,6 @@ DWORD WINAPI OleBuildVersion(void) } /*********************************************************************** - * OleInitialize (OLE2.2) * OleInitialize (OLE32.@) */ HRESULT WINAPI OleInitialize(LPVOID reserved) @@ -228,7 +226,6 @@ HRESULT WINAPI OleInitialize(LPVOID reserved) } /****************************************************************************** - * OleUninitialize [OLE2.3] * OleUninitialize [OLE32.@] */ void WINAPI OleUninitialize(void)