[SHLWAPI] Sync with Wine Staging 3.3. CORE-14434
[reactos.git] / dll / win32 / shlwapi / clist.c
index 763a40e..77917b3 100644 (file)
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
+#include <stdarg.h>
+#include <string.h>
 
-#include "precomp.h"
+#define COBJMACROS
+
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "objbase.h"
+#include "shlobj.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 /* dwSignature for contained DATABLOCK_HEADER items */
 #define CLIST_ID_CONTAINER (~0U)
@@ -54,19 +65,19 @@ static inline LPDATABLOCK_HEADER NextItem(LPDBLIST lpList)
  *  the call returns S_OK but does not actually add the element.
  *  See SHWriteDataBlockList.
  */
-HRESULT WINAPI SHAddDataBlock(LPDBLIST* lppList, const DATABLOCK_HEADER *lpNewItem)
+BOOL WINAPI SHAddDataBlock(LPDBLIST* lppList, const DATABLOCK_HEADER *lpNewItem)
 {
   LPDATABLOCK_HEADER lpInsertAt = NULL;
   ULONG ulSize;
 
   TRACE("(%p,%p)\n", lppList, lpNewItem);
 
-  if(!lppList || !lpNewItem )
-    return E_INVALIDARG;
+  if(!lppList || !lpNewItem)
+    return FALSE;
 
   if (lpNewItem->cbSize < sizeof(DATABLOCK_HEADER) ||
       lpNewItem->dwSignature == CLIST_ID_CONTAINER)
-    return S_OK;
+    return FALSE;
 
   ulSize = lpNewItem->cbSize;
 
@@ -123,9 +134,9 @@ HRESULT WINAPI SHAddDataBlock(LPDBLIST* lppList, const DATABLOCK_HEADER *lpNewIt
     lpInsertAt = NextItem(lpInsertAt);
     lpInsertAt->cbSize = 0;
 
-    return lpNewItem->cbSize;
+    return TRUE;
   }
-  return S_OK;
+  return FALSE;
 }
 
 /*************************************************************************
@@ -343,7 +354,7 @@ VOID WINAPI SHFreeDataBlockList(LPDBLIST lpList)
  */
 BOOL WINAPI SHRemoveDataBlock(LPDBLIST* lppList, DWORD dwSignature)
 {
-  LPDATABLOCK_HEADER lpList = 0;
+  LPDATABLOCK_HEADER lpList = NULL;
   LPDATABLOCK_HEADER lpItem = NULL;
   LPDATABLOCK_HEADER lpNext;
   ULONG ulNewSize;