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

This commit is contained in:
Alexandre Julliard 2009-03-11 17:05:20 +01:00
parent f7fe2edadd
commit 2e1b309fba
12 changed files with 136 additions and 86 deletions

1
.gitignore vendored
View File

@ -59,7 +59,6 @@ dlls/mstask/mstask_local.h
dlls/mstask/mstask_local_i.c dlls/mstask/mstask_local_i.c
dlls/msvideo.dll16 dlls/msvideo.dll16
dlls/msxml3/msxml3_v1.tlb dlls/msxml3/msxml3_v1.tlb
dlls/ole2.dll16
dlls/ole2disp.dll16 dlls/ole2disp.dll16
dlls/ole32/dcom.h dlls/ole32/dcom.h
dlls/ole32/dcom_p.c dlls/ole32/dcom_p.c

10
configure vendored
View File

@ -3911,6 +3911,7 @@ then
enable_monodebg_vxd=${enable_monodebg_vxd:-no} enable_monodebg_vxd=${enable_monodebg_vxd:-no}
enable_mouse_drv16=${enable_mouse_drv16:-no} enable_mouse_drv16=${enable_mouse_drv16:-no}
enable_msacm_dll16=${enable_msacm_dll16:-no} enable_msacm_dll16=${enable_msacm_dll16:-no}
enable_ole2_dll16=${enable_ole2_dll16:-no}
enable_ole2conv_dll16=${enable_ole2conv_dll16:-no} enable_ole2conv_dll16=${enable_ole2conv_dll16:-no}
enable_ole2nls_dll16=${enable_ole2nls_dll16:-no} enable_ole2nls_dll16=${enable_ole2nls_dll16:-no}
enable_ole2prox_dll16=${enable_ole2prox_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" dlls/odbccp32/tests/Makefile: dlls/odbccp32/tests/Makefile.in dlls/Maketest.rules"
ac_config_files="$ac_config_files dlls/odbccp32/tests/Makefile" 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 \\ ALL_MAKEFILES="$ALL_MAKEFILES \\
dlls/ole2conv.dll16/Makefile" dlls/ole2conv.dll16/Makefile"
test "x$enable_ole2conv_dll16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ 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/odbc32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/odbc32/Makefile" ;;
"dlls/odbccp32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/odbccp32/Makefile" ;; "dlls/odbccp32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/odbccp32/Makefile" ;;
"dlls/odbccp32/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/odbccp32/tests/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/ole2conv.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ole2conv.dll16/Makefile" ;;
"dlls/ole2nls.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ole2nls.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" ;; "dlls/ole2prox.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ole2prox.dll16/Makefile" ;;

View File

@ -148,6 +148,7 @@ then
enable_monodebg_vxd=${enable_monodebg_vxd:-no} enable_monodebg_vxd=${enable_monodebg_vxd:-no}
enable_mouse_drv16=${enable_mouse_drv16:-no} enable_mouse_drv16=${enable_mouse_drv16:-no}
enable_msacm_dll16=${enable_msacm_dll16:-no} enable_msacm_dll16=${enable_msacm_dll16:-no}
enable_ole2_dll16=${enable_ole2_dll16:-no}
enable_ole2conv_dll16=${enable_ole2conv_dll16:-no} enable_ole2conv_dll16=${enable_ole2conv_dll16:-no}
enable_ole2nls_dll16=${enable_ole2nls_dll16:-no} enable_ole2nls_dll16=${enable_ole2nls_dll16:-no}
enable_ole2prox_dll16=${enable_ole2prox_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/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/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/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/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/ole2nls.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/ole2prox.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/ole2prox.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])

View File

@ -29,7 +29,6 @@ WIN16_FILES = \
krnl386.exe16 \ krnl386.exe16 \
mmsystem.dll16 \ mmsystem.dll16 \
msvideo.dll16 \ msvideo.dll16 \
ole2.dll16 \
ole2disp.dll16 \ ole2disp.dll16 \
rasapi16.dll16 \ rasapi16.dll16 \
setupx.dll16 \ setupx.dll16 \
@ -80,7 +79,7 @@ krnl386.exe16 system.drv16 toolhelp.dll16:
msvideo.dll16: msvideo.dll16:
echo "msvfw32.dll" >$@ echo "msvfw32.dll" >$@
compobj.dll16 ole2.dll16: compobj.dll16:
echo "ole32.dll" >$@ echo "ole32.dll" >$@
ole2disp.dll16 typelib.dll16: ole2disp.dll16 typelib.dll16:

View File

@ -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

View File

@ -33,30 +33,6 @@ typedef LPCSTR LPCOLESTR16;
#define STDMETHOD16(m) HRESULT (STDMETHOD16CALLTYPE *m) #define STDMETHOD16(m) HRESULT (STDMETHOD16CALLTYPE *m)
#define STDMETHOD16_(t,m) t (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; typedef struct ILockBytes16 *LPLOCKBYTES16;

View File

@ -497,7 +497,7 @@ HRESULT CDECL HGLOBALLockBytesImpl16_Stat(
/****************************************************************************** /******************************************************************************
* CreateILockBytesOnHGlobal [OLE2.54] * CreateILockBytesOnHGlobal [OLE2.54]
* *
* Creates an ILockBytes interface for a HGLOBAL handle. * Creates an ILockBytes interface for a HGLOBAL handle.
* *
* PARAMS * PARAMS

View File

@ -52,6 +52,48 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole);
#define HICON_32(h16) ((HICON)(ULONG_PTR)(h16)) #define HICON_32(h16) ((HICON)(ULONG_PTR)(h16))
#define HINSTANCE_32(h16) ((HINSTANCE)(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) * RegisterDragDrop (OLE2.35)
*/ */
@ -105,7 +147,7 @@ HGLOBAL16 WINAPI OleMetaFilePictFromIconAndLabel16(
return 0; 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); hIcon, lpszLabel, lpszSourceFile, iIconIndex);
hdc = CreateMetaFileW(NULL); hdc = CreateMetaFileW(NULL);
@ -166,32 +208,6 @@ HRESULT WINAPI OleSetMenuDescriptor16(
return E_NOTIMPL; 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] * OleLoad [OLE2.12]
* *

View File

@ -1,6 +1,6 @@
1 pascal OleBuildVersion() OleBuildVersion 1 pascal OleBuildVersion() OleBuildVersion16
2 pascal OleInitialize(ptr) OleInitialize 2 pascal OleInitialize(ptr) OleInitialize16
3 pascal OleUninitialize() OleUninitialize 3 pascal OleUninitialize() OleUninitialize16
4 pascal DllGetClassObject(ptr ptr ptr) DllGetClassObject16 4 pascal DllGetClassObject(ptr ptr ptr) DllGetClassObject16
#5 WEP #5 WEP
6 stub OLEQUERYLINKFROMDATA 6 stub OLEQUERYLINKFROMDATA

View File

@ -47,13 +47,10 @@ C_SRCS = \
usrmarshal.c usrmarshal.c
C_SRCS16 = \ C_SRCS16 = \
memlockbytes16.c \ ole16.c
ole16.c \
ole2_16.c
SPEC_SRCS16 = \ SPEC_SRCS16 = \
compobj.spec \ compobj.spec
ole2.spec
RC_SRCS = ole32res.rc RC_SRCS = ole32res.rc

View File

@ -43,12 +43,42 @@
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "compobj_private.h" #include "compobj_private.h"
#include "ifs.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole); 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 HTASK16 hETask = 0;
static WORD Table_ETask[62]; static WORD Table_ETask[62];
@ -498,6 +528,32 @@ HRESULT WINAPI CoRevokeClassObject16(DWORD dwRegister) /* [in] token on class ob
return 0; 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] * CoFileTimeToDosDateTime [COMPOBJ.30]
*/ */
@ -654,22 +710,3 @@ HRESULT WINAPI CoDisconnectObject16( LPUNKNOWN lpUnk, DWORD reserved )
FIXME("(%p, 0x%08x): stub!\n", lpUnk, reserved); FIXME("(%p, 0x%08x): stub!\n", lpUnk, reserved);
return E_NOTIMPL; 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;
}

View File

@ -161,7 +161,6 @@ static DWORD OLEDD_GetButtonState(void);
/****************************************************************************** /******************************************************************************
* OleBuildVersion [OLE2.1]
* OleBuildVersion [OLE32.@] * OleBuildVersion [OLE32.@]
*/ */
DWORD WINAPI OleBuildVersion(void) DWORD WINAPI OleBuildVersion(void)
@ -171,7 +170,6 @@ DWORD WINAPI OleBuildVersion(void)
} }
/*********************************************************************** /***********************************************************************
* OleInitialize (OLE2.2)
* OleInitialize (OLE32.@) * OleInitialize (OLE32.@)
*/ */
HRESULT WINAPI OleInitialize(LPVOID reserved) HRESULT WINAPI OleInitialize(LPVOID reserved)
@ -228,7 +226,6 @@ HRESULT WINAPI OleInitialize(LPVOID reserved)
} }
/****************************************************************************** /******************************************************************************
* OleUninitialize [OLE2.3]
* OleUninitialize [OLE32.@] * OleUninitialize [OLE32.@]
*/ */
void WINAPI OleUninitialize(void) void WINAPI OleUninitialize(void)