Commit 274e7267 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

ole2nls.c is a 16bit only.

No need to define ICOM macros for 16bit iface IMalloc16. Define and implement HGLOBAL_LockBytes16. Started on StgOpenStorageOnILockBytes.
parent 7e89b7a6
......@@ -32,7 +32,6 @@ C_SRCS = \
ole2.c \
ole2stubs.c \
ole2impl.c \
ole2nls.c \
ole32_main.c \
oleobj.c \
oleproxy.c \
......@@ -42,6 +41,8 @@ C_SRCS = \
storage.c \
storage32.c
C_SRCS16 = ole2nls.c
RC_SRCS = ole32res.rc
@MAKE_DLL_RULES@
......
......@@ -41,20 +41,30 @@ typedef struct IMalloc16 IMalloc16, *LPMALLOC16;
ICOM_DEFINE(IMalloc16,IUnknown)
#undef ICOM_INTERFACE
/*** IUnknown methods ***/
#define IMalloc16_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
#define IMalloc16_AddRef(p) ICOM_CALL (AddRef,p)
#define IMalloc16_Release(p) ICOM_CALL (Release,p)
/*** IMalloc16 methods ***/
#define IMalloc16_Alloc(p,a) ICOM_CALL1(Alloc,p,a)
#define IMalloc16_Realloc(p,a,b) ICOM_CALL2(Realloc,p,a,b)
#define IMalloc16_Free(p,a) ICOM_CALL1(Free,p,a)
#define IMalloc16_GetSize(p,a) ICOM_CALL1(GetSize,p,a)
#define IMalloc16_DidAlloc(p,a) ICOM_CALL1(DidAlloc,p,a)
#define IMalloc16_HeapMinimize(p) ICOM_CALL (HeapMinimize,p)
/**********************************************************************/
extern LPMALLOC16 IMalloc16_Constructor();
/**********************************************************************/
typedef struct ILockBytes16 *LPLOCKBYTES16, ILockBytes16;
#define ICOM_INTERFACE ILockBytes
#define ILockBytes16_METHODS \
ICOM_METHOD4(HRESULT,ReadAt, ULARGE_INTEGER,ulOffset, void*,pv, ULONG, cb, ULONG*,pcbRead) \
ICOM_METHOD4(HRESULT,WriteAt, ULARGE_INTEGER,ulOffset, const void*,pv, ULONG,cb, ULONG*,pcbWritten) \
ICOM_METHOD (HRESULT,Flush) \
ICOM_METHOD1(HRESULT,SetSize, ULARGE_INTEGER,cb) \
ICOM_METHOD3(HRESULT,LockRegion, ULARGE_INTEGER,libOffset, ULARGE_INTEGER, cb, DWORD,dwLockType) \
ICOM_METHOD3(HRESULT,UnlockRegion, ULARGE_INTEGER,libOffset, ULARGE_INTEGER, cb, DWORD,dwLockType) \
ICOM_METHOD2(HRESULT,Stat, STATSTG*,pstatstg, DWORD,grfStatFlag)
#define ILockBytes16_IMETHODS \
IUnknown_IMETHODS \
ILockBytes16_METHODS
ICOM_DEFINE(ILockBytes16,IUnknown)
#undef ICOM_INTERFACE
#endif /* __WINE_OLE_IFS_H */
......@@ -51,7 +51,7 @@
51 stub OLEDUPLICATEDATA
52 stub OLEGETICONOFFILE
53 stub OLEGETICONOFCLASS
54 stub CREATEILOCKBYTESONHGLOBAL
54 pascal CreateILockBytesOnHGLOBAL(word word ptr) CreateILockBytesOnHGlobal16
55 stub GETHGLOBALFROMILOCKBYTES
56 pascal16 OleMetaFilePictFromIconAndLabel(word str str word) OleMetaFilePictFromIconAndLabel16
57 stub GETCLASSFILE
......@@ -144,3 +144,15 @@
159 stub _IID_IOLECACHE2
160 stub _IID_IOLECACHECONTROL
161 stub _IID_IRUNNABLEOBJECT
# WINE MemLockBytes implementation.
500 cdecl HGLOBALLockBytesImpl16_QueryInterface(segptr ptr ptr) HGLOBALLockBytesImpl16_QueryInterface
501 cdecl HGLOBALLockBytesImpl16_AddRef(ptr) HGLOBALLockBytesImpl16_AddRef
502 cdecl HGLOBALLockBytesImpl16_Release(ptr) HGLOBALLockBytesImpl16_Release
503 cdecl HGLOBALLockBytesImpl16_ReadAt(ptr long long ptr ptr) HGLOBALLockBytesImpl16_ReadAt
504 cdecl HGLOBALLockBytesImpl16_WriteAt(ptr long long ptr long ptr) HGLOBALLockBytesImpl16_WriteAt
505 cdecl HGLOBALLockBytesImpl16_Flush(ptr) HGLOBALLockBytesImpl16_Flush
506 cdecl HGLOBALLockBytesImpl16_SetSize(ptr long long) HGLOBALLockBytesImpl16_SetSize
507 cdecl HGLOBALLockBytesImpl16_LockRegion(ptr long long long long long) HGLOBALLockBytesImpl16_LockRegion
508 cdecl HGLOBALLockBytesImpl16_UnlockRegion(ptr long long long long long) HGLOBALLockBytesImpl16_UnlockRegion
509 cdecl HGLOBALLockBytesImpl16_Stat(ptr ptr long) HGLOBALLockBytesImpl16_Stat
......@@ -34,10 +34,13 @@
#include "winternl.h"
#include "winerror.h"
#include "wine/winbase16.h"
#include "wownt32.h"
#include "wine/unicode.h"
#include "objbase.h"
#include "wine/debug.h"
#include "ifs.h"
WINE_DEFAULT_DEBUG_CHANNEL(ole);
WINE_DECLARE_DEBUG_CHANNEL(relay);
......@@ -1691,3 +1694,66 @@ HRESULT WINAPI StgOpenStorage16(
return S_OK;
}
/******************************************************************************
* StgIsStorageILockBytes [STORAGE.6]
*
* Determines if the ILockBytes contains a storage object.
*/
HRESULT WINAPI StgIsStorageILockBytes16(SEGPTR plkbyt)
{
DWORD args[6];
HRESULT hres;
HANDLE16 hsig;
args[0] = (DWORD)plkbyt; /* iface */
args[1] = args[2] = 0; /* ULARGE_INTEGER offset */
args[3] = (DWORD)K32WOWGlobalAllocLock16( 0, 8, &hsig ); /* sig */
args[4] = 8;
args[5] = 0;
if (!K32WOWCallback16Ex(
(DWORD)((ICOM_VTABLE(ILockBytes16)*)MapSL(
(SEGPTR)ICOM_VTBL(((LPLOCKBYTES16)MapSL(plkbyt))))
)->ReadAt,
WCB16_PASCAL,
6*sizeof(DWORD),
(LPVOID)args,
(LPDWORD)&hres
)) {
ERR("CallTo16 ILockBytes16::ReadAt() failed, hres %lx\n",hres);
return hres;
}
if (memcmp(MapSL(args[3]), STORAGE_magic, sizeof(STORAGE_magic)) == 0) {
K32WOWGlobalUnlockFree16(args[3]);
return S_OK;
}
K32WOWGlobalUnlockFree16(args[3]);
return S_FALSE;
}
/******************************************************************************
* StgOpenStorageOnILockBytes [STORAGE.4]
*/
HRESULT WINAPI StgOpenStorageOnILockBytes16(
ILockBytes16 *plkbyt,
IStorage16 *pstgPriority,
DWORD grfMode,
SNB16 snbExclude,
DWORD reserved,
IStorage16 **ppstgOpen)
{
IStorage16Impl* lpstg;
if ((plkbyt == 0) || (ppstgOpen == 0))
return STG_E_INVALIDPOINTER;
*ppstgOpen = 0;
_create_istorage16(ppstgOpen);
lpstg = MapSL((SEGPTR)*ppstgOpen);
/* just teach it to use HANDLE instead of ilockbytes :/ */
return S_OK;
}
......@@ -4,10 +4,11 @@
1 pascal StgCreateDocFileA(str long long ptr) StgCreateDocFile16
2 stub StgCreateDocFileOnILockBytes
# 2 pascal StgCreateDocFileOnILockBytes(ptr long long ptr) StgCreateDocFileOnILockBytes16
3 pascal StgOpenStorage(str ptr long ptr long ptr) StgOpenStorage16
4 stub StgOpenStorageOnILockBytes
4 pascal StgOpenStorageOnILockBytes(ptr ptr long long long ptr) StgOpenStorageOnILockBytes16
5 pascal StgIsStorageFile(str) StgIsStorageFile16
6 stub StgIsStorageILockBytes
6 pascal StgIsStorageILockBytes(segptr) StgIsStorageILockBytes16
7 stub StgSetTimes
#8 WEP
#9 ___EXPORTEDSTUB
......
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