*/
static inline BOOL is_droptarget(HWND hwnd)
{
- return get_droptarget_handle(hwnd) ? TRUE : FALSE;
+ return get_droptarget_handle(hwnd) != 0;
}
/*************************************************************
/*
* Open the class id Key
*/
- hres = RegOpenKeyW(HKEY_CLASSES_ROOT,
- keyName,
- &clsidKey);
-
+ hres = open_classes_key(HKEY_CLASSES_ROOT, keyName, MAXIMUM_ALLOWED, &clsidKey);
if (hres != ERROR_SUCCESS)
return REGDB_E_CLASSNOTREG;
/*
* Open the class id Key
*/
- result = RegOpenKeyW(HKEY_CLASSES_ROOT,
- keyName,
- &clsidKey);
-
+ result = open_classes_key(HKEY_CLASSES_ROOT, keyName, MAXIMUM_ALLOWED, &clsidKey);
if (result != ERROR_SUCCESS)
return REGDB_E_CLASSNOTREG;
/*
* Get the MiscStatus
*/
- result = RegOpenKeyW(clsidKey,
- miscstatusW,
- &miscStatusKey);
-
-
+ result = open_classes_key(clsidKey, miscstatusW, MAXIMUM_ALLOWED, &miscStatusKey);
if (result != ERROR_SUCCESS)
{
RegCloseKey(clsidKey);
*/
sprintfW(keyName, dfmtW, dwAspect);
- result = RegOpenKeyW(miscStatusKey,
- keyName,
- &aspectKey);
-
+ result = open_classes_key(miscStatusKey, keyName, MAXIMUM_ALLOWED, &aspectKey);
if (result == ERROR_SUCCESS)
{
OLEUTL_ReadRegistryDWORDValue(aspectKey, pdwStatus);
if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IEnumOLEVERB))
{
- IUnknown_AddRef(iface);
+ IEnumOLEVERB_AddRef(iface);
*ppv = iface;
return S_OK;
}
/*
* Initialize the object with its IPersistStorage interface.
*/
- hres = IOleObject_QueryInterface(pUnk,
- &IID_IPersistStorage,
- (void**)&persistStorage);
-
+ hres = IUnknown_QueryInterface(pUnk, &IID_IPersistStorage, (void**)&persistStorage);
if (SUCCEEDED(hres))
{
hres = IPersistStorage_Load(persistStorage, pStg);
if ( nPos < nWidth )
{
/* Odd elements are server menu widths */
- pOleMenuDescriptor->bIsServerItem = (i%2) ? TRUE : FALSE;
+ pOleMenuDescriptor->bIsServerItem = i%2;
break;
}
}
IUnknown *pUnk,
DWORD dwAspect,
HDC hdcDraw,
- LPCRECT lprcBounds)
+ LPCRECT rect)
{
HRESULT hres;
IViewObject *viewobject;
+ if (!pUnk) return E_INVALIDARG;
+
hres = IUnknown_QueryInterface(pUnk,
&IID_IViewObject,
(void**)&viewobject);
-
if (SUCCEEDED(hres))
{
- RECTL rectl;
-
- rectl.left = lprcBounds->left;
- rectl.right = lprcBounds->right;
- rectl.top = lprcBounds->top;
- rectl.bottom = lprcBounds->bottom;
- hres = IViewObject_Draw(viewobject, dwAspect, -1, 0, 0, 0, hdcDraw, &rectl, 0, 0, 0);
-
+ hres = IViewObject_Draw(viewobject, dwAspect, -1, 0, 0, 0, hdcDraw, (RECTL*)rect, 0, 0, 0);
IViewObject_Release(viewobject);
return hres;
}
else
- {
return DV_E_NOIVIEWOBJECT;
- }
}
/***********************************************************************
/***********************************************************************
* PropSysAllocString [OLE32.@]
- * NOTES:
- * Basically a copy of SysAllocStringLen.
+ * NOTES
+ * Forward to oleaut32.
*/
BSTR WINAPI PropSysAllocString(LPCOLESTR str)
{
- DWORD bufferSize;
- DWORD* newBuffer;
- WCHAR* stringBuffer;
- int len;
-
- if (!str) return 0;
-
- len = lstrlenW(str);
- /*
- * Find the length of the buffer passed-in, in bytes.
- */
- bufferSize = len * sizeof (WCHAR);
-
- /*
- * Allocate a new buffer to hold the string.
- * Don't forget to keep an empty spot at the beginning of the
- * buffer for the character count and an extra character at the
- * end for the NULL.
- */
- newBuffer = HeapAlloc(GetProcessHeap(), 0,
- bufferSize + sizeof(WCHAR) + sizeof(DWORD));
-
- /*
- * If the memory allocation failed, return a null pointer.
- */
- if (newBuffer==0)
- return 0;
-
- /*
- * Copy the length of the string in the placeholder.
- */
- *newBuffer = bufferSize;
-
- /*
- * Skip the byte count.
- */
- newBuffer++;
-
- memcpy(newBuffer, str, bufferSize);
-
- /*
- * Make sure that there is a nul character at the end of the
- * string.
- */
- stringBuffer = (WCHAR*)newBuffer;
- stringBuffer[len] = '\0';
-
- return stringBuffer;
+ return SysAllocString(str);
}
/***********************************************************************
* PropSysFreeString [OLE32.@]
* NOTES
- * Copy of SysFreeString.
+ * Forward to oleaut32.
*/
void WINAPI PropSysFreeString(LPOLESTR str)
{
- DWORD* bufferPointer;
-
- /* NULL is a valid parameter */
- if(!str) return;
-
- /*
- * We have to be careful when we free a BSTR pointer, it points to
- * the beginning of the string but it skips the byte count contained
- * before the string.
- */
- bufferPointer = (DWORD*)str;
-
- bufferPointer--;
-
- /*
- * Free the memory from its "real" origin.
- */
- HeapFree(GetProcessHeap(), 0, bufferPointer);
+ SysFreeString(str);
}
/******************************************************************************
{
case VT_EMPTY:
case VT_NULL:
+ case VT_I1:
case VT_I2:
case VT_I4:
+ case VT_I8:
case VT_R4:
case VT_R8:
case VT_CY:
case VT_UI1:
case VT_UI2:
case VT_UI4:
- case VT_I8:
case VT_UI8:
case VT_LPSTR:
case VT_LPWSTR:
case VT_BLOB_OBJECT:
case VT_CF:
case VT_CLSID:
+ case VT_I1|VT_VECTOR:
case VT_I2|VT_VECTOR:
case VT_I4|VT_VECTOR:
+ case VT_I8|VT_VECTOR:
case VT_R4|VT_VECTOR:
case VT_R8|VT_VECTOR:
case VT_CY|VT_VECTOR:
case VT_UI1|VT_VECTOR:
case VT_UI2|VT_VECTOR:
case VT_UI4|VT_VECTOR:
- case VT_I8|VT_VECTOR:
case VT_UI8|VT_VECTOR:
case VT_LPSTR|VT_VECTOR:
case VT_LPWSTR|VT_VECTOR:
{
case VT_EMPTY:
case VT_NULL:
+ case VT_I1:
case VT_I2:
case VT_I4:
+ case VT_I8:
case VT_R4:
case VT_R8:
case VT_CY:
case VT_UI1:
case VT_UI2:
case VT_UI4:
- case VT_I8:
case VT_UI8:
case VT_FILETIME:
break;
case VT_STORAGE:
case VT_STORED_OBJECT:
if (pvar->u.pStream)
- IUnknown_Release(pvar->u.pStream);
+ IStream_Release(pvar->u.pStream);
break;
case VT_CLSID:
case VT_LPSTR:
CoTaskMemFree(pvar->u.blob.pBlobData);
break;
case VT_BSTR:
- if (pvar->u.bstrVal)
- PropSysFreeString(pvar->u.bstrVal);
+ PropSysFreeString(pvar->u.bstrVal);
break;
case VT_CF:
if (pvar->u.pclipdata)