Commit c5feb317 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Implemented IsValidInterface16, CoMemAlloc.

Added debug to HGLOBALLockBytes16_QueryInterface.
parent ca260761
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
20 pascal CLSIDFromString(str ptr) CLSIDFromString16 20 pascal CLSIDFromString(str ptr) CLSIDFromString16
21 stub ISVALIDPTRIN 21 stub ISVALIDPTRIN
22 stub ISVALIDPTROUT 22 stub ISVALIDPTROUT
23 stub ISVALIDINTERFACE 23 pascal IsValidInterface(segptr) IsValidInterface16
24 stub ISVALIDIID 24 stub ISVALIDIID
25 stub RESULTFROMSCODE 25 stub RESULTFROMSCODE
26 stub GETSCODE 26 stub GETSCODE
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
148 stub MKVDEFAULTHASHKEY 148 stub MKVDEFAULTHASHKEY
149 stub DELETE16 149 stub DELETE16
150 stub COMEMCTXOF 150 stub COMEMCTXOF
151 stub COMEMALLOC 151 pascal CoMemAlloc(long long long)
152 stub COMEMFREE 152 stub COMEMFREE
153 stub SHRREALLOC 153 stub SHRREALLOC
154 stub ___EXPORTEDSTUB 154 stub ___EXPORTEDSTUB
......
...@@ -217,8 +217,10 @@ HRESULT HGLOBALLockBytesImpl16_QueryInterface( ...@@ -217,8 +217,10 @@ HRESULT HGLOBALLockBytesImpl16_QueryInterface(
/* /*
* Check that we obtained an interface. * Check that we obtained an interface.
*/ */
if ((*ppvObject)==0) if ((*ppvObject)==0) {
FIXME("Unknown IID %s\n", debugstr_guid(riid));
return E_NOINTERFACE; return E_NOINTERFACE;
}
/* /*
* Query Interface always increases the reference count by one when it is * Query Interface always increases the reference count by one when it is
......
...@@ -506,3 +506,18 @@ BOOL WINAPI COMPOBJ_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, WORD ds, WORD ...@@ -506,3 +506,18 @@ BOOL WINAPI COMPOBJ_DllEntryPoint(DWORD Reason, HINSTANCE16 hInst, WORD ds, WORD
TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n", Reason, hInst, ds, HeapSize, res1, res2); TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n", Reason, hInst, ds, HeapSize, res1, res2);
return TRUE; return TRUE;
} }
/***********************************************************************
* CoMemAlloc [COMPOBJ.151]
*/
SEGPTR WINAPI CoMemAlloc(DWORD size, DWORD dwMemContext, DWORD x) {
HRESULT hres;
SEGPTR segptr;
/* FIXME: check context handling */
TRACE("(%ld, 0x%08lx, 0x%08lx)\n", size, dwMemContext, x);
hres = _xmalloc16(size, &segptr);
if (hres != S_OK)
return (SEGPTR)0;
return segptr;
}
...@@ -163,6 +163,32 @@ HRESULT WINAPI OleSetMenuDescriptor16( ...@@ -163,6 +163,32 @@ HRESULT WINAPI OleSetMenuDescriptor16(
LPOLEINPLACEFRAME lpFrame, LPOLEINPLACEFRAME lpFrame,
LPOLEINPLACEACTIVEOBJECT lpActiveObject) LPOLEINPLACEACTIVEOBJECT lpActiveObject)
{ {
FIXME("(%lx, %x, %x, %p, %p), stub!\n", hOleMenu, hwndFrame, hwndActiveObject, lpFrame, lpActiveObject); FIXME("(%p, %x, %x, %p, %p), stub!\n", hOleMenu, hwndFrame, hwndActiveObject, lpFrame, lpActiveObject);
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;
}
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