Implemented IsValidInterface16, CoMemAlloc.
Added debug to HGLOBALLockBytes16_QueryInterface.
This commit is contained in:
parent
ca26076164
commit
c5feb317b3
|
@ -20,7 +20,7 @@
|
|||
20 pascal CLSIDFromString(str ptr) CLSIDFromString16
|
||||
21 stub ISVALIDPTRIN
|
||||
22 stub ISVALIDPTROUT
|
||||
23 stub ISVALIDINTERFACE
|
||||
23 pascal IsValidInterface(segptr) IsValidInterface16
|
||||
24 stub ISVALIDIID
|
||||
25 stub RESULTFROMSCODE
|
||||
26 stub GETSCODE
|
||||
|
@ -147,7 +147,7 @@
|
|||
148 stub MKVDEFAULTHASHKEY
|
||||
149 stub DELETE16
|
||||
150 stub COMEMCTXOF
|
||||
151 stub COMEMALLOC
|
||||
151 pascal CoMemAlloc(long long long)
|
||||
152 stub COMEMFREE
|
||||
153 stub SHRREALLOC
|
||||
154 stub ___EXPORTEDSTUB
|
||||
|
|
|
@ -217,8 +217,10 @@ HRESULT HGLOBALLockBytesImpl16_QueryInterface(
|
|||
/*
|
||||
* Check that we obtained an interface.
|
||||
*/
|
||||
if ((*ppvObject)==0)
|
||||
if ((*ppvObject)==0) {
|
||||
FIXME("Unknown IID %s\n", debugstr_guid(riid));
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
|||
TRACE("(%08lx, %04x, %04x, %04x, %08lx, %04x)\n", Reason, hInst, ds, HeapSize, res1, res2);
|
||||
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(
|
|||
LPOLEINPLACEFRAME lpFrame,
|
||||
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;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* 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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue