Commit 2e1b309f authored by Alexandre Julliard's avatar Alexandre Julliard

ole32: Make ole2.dll into a stand-alone 16-bit module.

parent f7fe2eda
......@@ -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
......
......@@ -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}
......@@ -26480,6 +26481,14 @@ dlls/odbccp32/tests/Makefile: dlls/odbccp32/tests/Makefile.in dlls/Maketest.rule
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 \\
ole2conv.dll16"
......@@ -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" ;;
......
......@@ -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])
......
......@@ -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:
......
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
......@@ -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;
......
......@@ -497,7 +497,7 @@ HRESULT CDECL HGLOBALLockBytesImpl16_Stat(
/******************************************************************************
* CreateILockBytesOnHGlobal [OLE2.54]
*
*
* Creates an ILockBytes interface for a HGLOBAL handle.
*
* PARAMS
......
......@@ -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);
......@@ -167,32 +209,6 @@ HRESULT WINAPI OleSetMenuDescriptor16(
}
/******************************************************************************
* 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]
*
* PARAMS
......
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
......
......@@ -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
......
......@@ -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];
......@@ -499,6 +529,32 @@ HRESULT WINAPI CoRevokeClassObject16(DWORD dwRegister) /* [in] token on class ob
}
/******************************************************************************
* 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]
*/
BOOL16 WINAPI CoFileTimeToDosDateTime16(const FILETIME *ft, LPWORD lpDosDate, LPWORD lpDosTime)
......@@ -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;
}
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment