Author: hbelusca
Date: Tue Jan 17 15:09:18 2017
New Revision: 73565
URL:
http://svn.reactos.org/svn/reactos?rev=73565&view=rev
Log:
[SHLWAPI]
- Fix SHAddDataBlock function signature & return value.
- Back this up by updating the corresponding wine test.
Send upstream, I will remove the __REACTOS__ markups once this is merged in Wine.
Modified:
trunk/reactos/dll/win32/shlwapi/clist.c
trunk/rostests/winetests/shlwapi/clist.c
Modified: trunk/reactos/dll/win32/shlwapi/clist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/clist.c?…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/clist.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/clist.c [iso-8859-1] Tue Jan 17 15:09:18 2017
@@ -54,7 +54,12 @@
* the call returns S_OK but does not actually add the element.
* See SHWriteDataBlockList.
*/
-HRESULT WINAPI SHAddDataBlock(LPDBLIST* lppList, const DATABLOCK_HEADER *lpNewItem)
+#ifndef __REACTOS__
+HRESULT
+#else
+BOOL
+#endif
+WINAPI SHAddDataBlock(LPDBLIST* lppList, const DATABLOCK_HEADER *lpNewItem)
{
LPDATABLOCK_HEADER lpInsertAt = NULL;
ULONG ulSize;
@@ -62,11 +67,19 @@
TRACE("(%p,%p)\n", lppList, lpNewItem);
if(!lppList || !lpNewItem )
+#ifndef __REACTOS__
return E_INVALIDARG;
+#else
+ return FALSE;
+#endif
if (lpNewItem->cbSize < sizeof(DATABLOCK_HEADER) ||
lpNewItem->dwSignature == CLIST_ID_CONTAINER)
+#ifndef __REACTOS__
return S_OK;
+#else
+ return FALSE;
+#endif
ulSize = lpNewItem->cbSize;
@@ -123,9 +136,15 @@
lpInsertAt = NextItem(lpInsertAt);
lpInsertAt->cbSize = 0;
- return lpNewItem->cbSize;
- }
+#ifdef __REACTOS__
+ return TRUE;
+#endif
+ }
+#ifndef __REACTOS__
return S_OK;
+#else
+ return FALSE;
+#endif
}
/*************************************************************************
@@ -343,7 +362,11 @@
*/
BOOL WINAPI SHRemoveDataBlock(LPDBLIST* lppList, DWORD dwSignature)
{
+#ifndef __REACTOS__
LPDATABLOCK_HEADER lpList = 0;
+#else
+ LPDATABLOCK_HEADER lpList = NULL;
+#endif
LPDATABLOCK_HEADER lpItem = NULL;
LPDATABLOCK_HEADER lpNext;
ULONG ulNewSize;
Modified: trunk/rostests/winetests/shlwapi/clist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/shlwapi/clist.c…
==============================================================================
--- trunk/rostests/winetests/shlwapi/clist.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/shlwapi/clist.c [iso-8859-1] Tue Jan 17 15:09:18 2017
@@ -223,7 +223,7 @@
static HMODULE SHLWAPI_hshlwapi = 0;
static VOID (WINAPI *pSHLWAPI_19)(LPSHLWAPI_CLIST);
-static HRESULT (WINAPI *pSHLWAPI_20)(LPSHLWAPI_CLIST*,LPCSHLWAPI_CLIST);
+static BOOL (WINAPI *pSHLWAPI_20)(LPSHLWAPI_CLIST*,LPCSHLWAPI_CLIST);
static BOOL (WINAPI *pSHLWAPI_21)(LPSHLWAPI_CLIST*,ULONG);
static LPSHLWAPI_CLIST (WINAPI *pSHLWAPI_22)(LPSHLWAPI_CLIST,ULONG);
static HRESULT (WINAPI *pSHLWAPI_17)(IStream*, SHLWAPI_CLIST*);
@@ -297,6 +297,7 @@
struct dummystream streamobj;
LPSHLWAPI_CLIST list = NULL;
LPCSHLWAPI_CLIST item = SHLWAPI_CLIST_items;
+ BOOL bRet;
HRESULT hRet;
LPSHLWAPI_CLIST inserted;
BYTE buff[64];
@@ -317,10 +318,10 @@
buff[sizeof(SHLWAPI_CLIST)+i] = i*2;
/* Add it */
- hRet = pSHLWAPI_20(&list, inserted);
- ok(hRet > S_OK, "failed list add\n");
-
- if (hRet > S_OK)
+ bRet = pSHLWAPI_20(&list, inserted);
+ ok(bRet == TRUE, "failed list add\n");
+
+ if (bRet == TRUE)
{
ok(list && list->ulSize, "item not added\n");
@@ -395,11 +396,8 @@
inserted = (LPSHLWAPI_CLIST)buff;
inserted->ulSize = sizeof(SHLWAPI_CLIST) -1;
inserted->ulId = 33;
-
- /* The call succeeds but the item is not inserted, except on some early
- * versions which return failure. Wine behaves like later versions.
- */
- pSHLWAPI_20(&list, inserted);
+ bRet = pSHLWAPI_20(&list, inserted);
+ ok(bRet == FALSE, "Expected failure\n");
inserted = pSHLWAPI_22(list, 33);
ok(inserted == NULL, "inserted bad element size\n");
@@ -407,9 +405,8 @@
inserted = (LPSHLWAPI_CLIST)buff;
inserted->ulSize = 44;
inserted->ulId = ~0U;
-
- /* See comment above, some early versions fail this call */
- pSHLWAPI_20(&list, inserted);
+ bRet = pSHLWAPI_20(&list, inserted);
+ ok(bRet == FALSE, "Expected failure\n");
item = SHLWAPI_CLIST_items;