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

This commit is contained in:
Alexandre Julliard 2009-03-11 17:03:10 +01:00
parent 7511d67447
commit f7fe2edadd
10 changed files with 271 additions and 114 deletions

1
.gitignore vendored
View File

@ -96,7 +96,6 @@ dlls/shell.dll16
dlls/sound.drv16
dlls/stdole2.tlb/std_ole_v2.tlb
dlls/stdole32.tlb/std_ole_v1.tlb
dlls/storage.dll16
dlls/system.drv16
dlls/toolhelp.dll16
dlls/twain.dll16

10
configure vendored
View File

@ -3917,6 +3917,7 @@ then
enable_ole2thk_dll16=${enable_ole2thk_dll16:-no}
enable_olecli_dll16=${enable_olecli_dll16:-no}
enable_olesvr_dll16=${enable_olesvr_dll16:-no}
enable_storage_dll16=${enable_storage_dll16:-no}
enable_stress_dll16=${enable_stress_dll16:-no}
enable_vdhcp_vxd=${enable_vdhcp_vxd:-no}
enable_vmm_vxd=${enable_vmm_vxd:-no}
@ -27134,6 +27135,14 @@ ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
dlls/sti/Makefile: dlls/sti/Makefile.in dlls/Makedll.rules"
ac_config_files="$ac_config_files dlls/sti/Makefile"
ALL_MAKEFILES="$ALL_MAKEFILES \\
dlls/storage.dll16/Makefile"
test "x$enable_storage_dll16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
storage.dll16"
ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
dlls/storage.dll16/Makefile: dlls/storage.dll16/Makefile.in dlls/Makedll.rules"
ac_config_files="$ac_config_files dlls/storage.dll16/Makefile"
ALL_MAKEFILES="$ALL_MAKEFILES \\
dlls/stress.dll16/Makefile"
test "x$enable_stress_dll16" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\
@ -29299,6 +29308,7 @@ do
"dlls/stdole2.tlb/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/stdole2.tlb/Makefile" ;;
"dlls/stdole32.tlb/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/stdole32.tlb/Makefile" ;;
"dlls/sti/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/sti/Makefile" ;;
"dlls/storage.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/storage.dll16/Makefile" ;;
"dlls/stress.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/stress.dll16/Makefile" ;;
"dlls/strmiids/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/strmiids/Makefile" ;;
"dlls/svrapi/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/svrapi/Makefile" ;;

View File

@ -154,6 +154,7 @@ then
enable_ole2thk_dll16=${enable_ole2thk_dll16:-no}
enable_olecli_dll16=${enable_olecli_dll16:-no}
enable_olesvr_dll16=${enable_olesvr_dll16:-no}
enable_storage_dll16=${enable_storage_dll16:-no}
enable_stress_dll16=${enable_stress_dll16:-no}
enable_vdhcp_vxd=${enable_vdhcp_vxd:-no}
enable_vmm_vxd=${enable_vmm_vxd:-no}
@ -2228,6 +2229,7 @@ WINE_CONFIG_MAKEFILE([dlls/spoolss/tests/Makefile],[dlls/Maketest.rules],[dlls],
WINE_CONFIG_MAKEFILE([dlls/stdole2.tlb/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/stdole32.tlb/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/sti/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/storage.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/stress.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])
WINE_CONFIG_MAKEFILE([dlls/strmiids/Makefile],[dlls/Makeimplib.rules],[dlls],[ALL_IMPLIB_DIRS])
WINE_CONFIG_MAKEFILE([dlls/svrapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS])

View File

@ -35,7 +35,6 @@ WIN16_FILES = \
setupx.dll16 \
shell.dll16 \
sound.drv16 \
storage.dll16 \
system.drv16 \
toolhelp.dll16 \
twain.dll16 \
@ -81,7 +80,7 @@ krnl386.exe16 system.drv16 toolhelp.dll16:
msvideo.dll16:
echo "msvfw32.dll" >$@
compobj.dll16 ole2.dll16 storage.dll16:
compobj.dll16 ole2.dll16:
echo "ole32.dll" >$@
ole2disp.dll16 typelib.dll16:

View File

@ -49,13 +49,11 @@ C_SRCS = \
C_SRCS16 = \
memlockbytes16.c \
ole16.c \
ole2_16.c \
storage.c
ole2_16.c
SPEC_SRCS16 = \
compobj.spec \
ole2.spec \
storage.spec
ole2.spec
RC_SRCS = ole32res.rc

View File

@ -35,6 +35,7 @@
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wownt32.h"
#include "ole2.h"
#include "winerror.h"
@ -243,3 +244,66 @@ HRESULT WINAPI OleFlushClipboard16(void)
{
return OleFlushClipboard();
}
/***********************************************************************
* ReadClassStg (OLE2.18)
*
* This method reads the CLSID previously written to a storage object with
* the WriteClassStg.
*
* PARAMS
* pstg [I] Segmented LPSTORAGE pointer.
* pclsid [O] Pointer to where the CLSID is written
*
* RETURNS
* Success: S_OK.
* Failure: HRESULT code.
*/
HRESULT WINAPI ReadClassStg16(SEGPTR pstg, CLSID *pclsid)
{
STATSTG16 statstg;
HANDLE16 hstatstg;
HRESULT hres;
DWORD args[3];
TRACE("(%x, %p)\n", pstg, pclsid);
if(pclsid==NULL)
return E_POINTER;
/*
* read a STATSTG structure (contains the clsid) from the storage
*/
args[0] = (DWORD)pstg; /* iface */
args[1] = WOWGlobalAllocLock16( 0, sizeof(STATSTG16), &hstatstg );
args[2] = STATFLAG_DEFAULT;
if (!WOWCallback16Ex(
(DWORD)((const IStorage16Vtbl*)MapSL(
(SEGPTR)((LPSTORAGE16)MapSL(pstg))->lpVtbl)
)->Stat,
WCB16_PASCAL,
3*sizeof(DWORD),
(LPVOID)args,
(LPDWORD)&hres
)) {
WOWGlobalUnlockFree16(args[1]);
ERR("CallTo16 IStorage16::Stat() failed, hres %x\n",hres);
return hres;
}
memcpy(&statstg, MapSL(args[1]), sizeof(STATSTG16));
WOWGlobalUnlockFree16(args[1]);
if(SUCCEEDED(hres)) {
*pclsid=statstg.clsid;
TRACE("clsid is %s\n", debugstr_guid(&statstg.clsid));
}
return hres;
}
/***********************************************************************
* GetConvertStg (OLE2.82)
*/
HRESULT WINAPI GetConvertStg16(LPSTORAGE stg) {
FIXME("unimplemented stub!\n");
return E_FAIL;
}

View File

@ -0,0 +1,15 @@
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = storage.dll16
IMPORTS = uuid ole32 kernel32 ntdll
EXTRADLLFLAGS = -Wb,--subsystem,win16,--main-module,ole32.dll
SPEC_SRCS = storage.dll16.spec
C_SRCS = storage.c
@MAKE_DLL_RULES@
@DEPENDENCIES@ # everything below this line is overwritten by make depend

133
dlls/storage.dll16/ifs.h Normal file
View File

@ -0,0 +1,133 @@
/*
* Copyright 1997 Marcus Meissner
*
* 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_OLE_IFS_H
#define __WINE_OLE_IFS_H
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
typedef CHAR OLECHAR16;
typedef LPSTR LPOLESTR16;
typedef LPCSTR LPCOLESTR16;
#define STDMETHOD16CALLTYPE __cdecl
#define STDMETHOD16(m) HRESULT (STDMETHOD16CALLTYPE *m)
#define STDMETHOD16_(t,m) t (STDMETHOD16CALLTYPE *m)
/**********************************************************************/
typedef struct ILockBytes16 *LPLOCKBYTES16;
#define INTERFACE ILockBytes16
DECLARE_INTERFACE_(ILockBytes16,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD16_(ULONG,AddRef)(THIS) PURE;
STDMETHOD16_(ULONG,Release)(THIS) PURE;
/*** ILockBytes16 methods ***/
STDMETHOD16(ReadAt)(THIS_ ULARGE_INTEGER ulOffset, void *pv, ULONG cb, ULONG *pcbRead) PURE;
STDMETHOD16(WriteAt)(THIS_ ULARGE_INTEGER ulOffset, const void *pv, ULONG cb, ULONG *pcbWritten) PURE;
STDMETHOD16(Flush)(THIS) PURE;
STDMETHOD16(SetSize)(THIS_ ULARGE_INTEGER cb) PURE;
STDMETHOD16(LockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) PURE;
STDMETHOD16(UnlockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) PURE;
STDMETHOD16(Stat)(THIS_ STATSTG *pstatstg, DWORD grfStatFlag) PURE;
};
#undef INTERFACE
/**********************************************************************/
typedef struct tagSTATSTG16
{
LPOLESTR16 pwcsName;
DWORD type;
ULARGE_INTEGER cbSize;
FILETIME mtime;
FILETIME ctime;
FILETIME atime;
DWORD grfMode;
DWORD grfLocksSupported;
CLSID clsid;
DWORD grfStateBits;
DWORD reserved;
} STATSTG16;
typedef struct IStream16 *LPSTREAM16;
#define INTERFACE IStream16
DECLARE_INTERFACE_(IStream16,ISequentialStream)
{
/*** IUnknown methods ***/
STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD16_(ULONG,AddRef)(THIS) PURE;
STDMETHOD16_(ULONG,Release)(THIS) PURE;
/*** ISequentialStream methods ***/
STDMETHOD16_(HRESULT,Read)(THIS_ void* pv, ULONG cb, ULONG* pcbRead) PURE;
STDMETHOD16_(HRESULT,Write)(THIS_ const void* pv, ULONG cb, ULONG* pcbWritten) PURE;
/*** IStream16 methods ***/
STDMETHOD16(Seek)(THIS_ LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition) PURE;
STDMETHOD16(SetSize)(THIS_ ULARGE_INTEGER libNewSize) PURE;
STDMETHOD16(CopyTo)(THIS_ IStream16* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten) PURE;
STDMETHOD16(Commit)(THIS_ DWORD grfCommitFlags) PURE;
STDMETHOD16(Revert)(THIS) PURE;
STDMETHOD16(LockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) PURE;
STDMETHOD16(UnlockRegion)(THIS_ ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) PURE;
STDMETHOD16(Stat)(THIS_ STATSTG* pstatstg, DWORD grfStatFlag) PURE;
STDMETHOD16(Clone)(THIS_ IStream16** ppstm) PURE;
};
#undef INTERFACE
/**********************************************************************/
typedef OLECHAR16 **SNB16;
typedef struct IStorage16 *LPSTORAGE16;
#define INTERFACE IStorage16
DECLARE_INTERFACE_(IStorage16,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD16_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
STDMETHOD16_(ULONG,AddRef)(THIS) PURE;
STDMETHOD16_(ULONG,Release)(THIS) PURE;
/*** IStorage16 methods ***/
STDMETHOD16_(HRESULT,CreateStream)(THIS_ LPCOLESTR16 pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream16** ppstm) PURE;
STDMETHOD16_(HRESULT,OpenStream)(THIS_ LPCOLESTR16 pwcsName, void* reserved1, DWORD grfMode, DWORD reserved2, IStream16** ppstm) PURE;
STDMETHOD16_(HRESULT,CreateStorage)(THIS_ LPCOLESTR16 pwcsName, DWORD grfMode, DWORD dwStgFmt, DWORD reserved2, IStorage16** ppstg) PURE;
STDMETHOD16_(HRESULT,OpenStorage)(THIS_ LPCOLESTR16 pwcsName, IStorage16* pstgPriority, DWORD grfMode, SNB16 snbExclude, DWORD reserved, IStorage16** ppstg) PURE;
STDMETHOD16_(HRESULT,CopyTo)(THIS_ DWORD ciidExclude, const IID* rgiidExclude, SNB16 snbExclude, IStorage16* pstgDest) PURE;
STDMETHOD16_(HRESULT,MoveElementTo)(THIS_ LPCOLESTR16 pwcsName, IStorage16* pstgDest, LPCOLESTR16 pwcsNewName, DWORD grfFlags) PURE;
STDMETHOD16_(HRESULT,Commit)(THIS_ DWORD grfCommitFlags) PURE;
STDMETHOD16_(HRESULT,Revert)(THIS) PURE;
STDMETHOD16_(HRESULT,EnumElements)(THIS_ DWORD reserved1, void* reserved2, DWORD reserved3, IEnumSTATSTG** ppenum) PURE;
STDMETHOD16_(HRESULT,DestroyElement)(THIS_ LPCOLESTR16 pwcsName) PURE;
STDMETHOD16_(HRESULT,RenameElement)(THIS_ LPCOLESTR16 pwcsOldName, LPCOLESTR16 pwcsNewName) PURE;
STDMETHOD16_(HRESULT,SetElementTimes)(THIS_ LPCOLESTR16 pwcsName, const FILETIME* pctime, const FILETIME* patime, const FILETIME* pmtime) PURE;
STDMETHOD16_(HRESULT,SetClass)(THIS_ REFCLSID clsid) PURE;
STDMETHOD16_(HRESULT,SetStateBits)(THIS_ DWORD grfStateBits, DWORD grfMask) PURE;
STDMETHOD16_(HRESULT,Stat)(THIS_ STATSTG* pstatstg, DWORD grfStatFlag) PURE;
};
#undef INTERFACE
#endif /* __WINE_OLE_IFS_H */

View File

@ -2180,66 +2180,3 @@ HRESULT WINAPI StgOpenStorageOnILockBytes16(
}
return S_OK;
}
/***********************************************************************
* ReadClassStg (OLE2.18)
*
* This method reads the CLSID previously written to a storage object with
* the WriteClassStg.
*
* PARAMS
* pstg [I] Segmented LPSTORAGE pointer.
* pclsid [O] Pointer to where the CLSID is written
*
* RETURNS
* Success: S_OK.
* Failure: HRESULT code.
*/
HRESULT WINAPI ReadClassStg16(SEGPTR pstg, CLSID *pclsid)
{
STATSTG16 statstg;
HANDLE16 hstatstg;
HRESULT hres;
DWORD args[3];
TRACE("(%x, %p)\n", pstg, pclsid);
if(pclsid==NULL)
return E_POINTER;
/*
* read a STATSTG structure (contains the clsid) from the storage
*/
args[0] = (DWORD)pstg; /* iface */
args[1] = WOWGlobalAllocLock16( 0, sizeof(STATSTG16), &hstatstg );
args[2] = STATFLAG_DEFAULT;
if (!WOWCallback16Ex(
(DWORD)((const IStorage16Vtbl*)MapSL(
(SEGPTR)((LPSTORAGE16)MapSL(pstg))->lpVtbl)
)->Stat,
WCB16_PASCAL,
3*sizeof(DWORD),
(LPVOID)args,
(LPDWORD)&hres
)) {
WOWGlobalUnlockFree16(args[1]);
ERR("CallTo16 IStorage16::Stat() failed, hres %x\n",hres);
return hres;
}
memcpy(&statstg, MapSL(args[1]), sizeof(STATSTG16));
WOWGlobalUnlockFree16(args[1]);
if(SUCCEEDED(hres)) {
*pclsid=statstg.clsid;
TRACE("clsid is %s\n", debugstr_guid(&statstg.clsid));
}
return hres;
}
/***********************************************************************
* GetConvertStg (OLE2.82)
*/
HRESULT WINAPI GetConvertStg16(LPSTORAGE stg) {
FIXME("unimplemented stub!\n");
return E_FAIL;
}