---
name: "SHWriteDataBlockList"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/SHWriteDataBlockList"
---

# SHWriteDataBlockList(3w)

## NAME

**SHWriteDataBlockList** (SHLWAPI.17)

## SYNOPSIS

HRESULT SHWriteDataBlockList\
  (\
   IStream\* *lpStream*,\
   LPDBLIST *lpList*\
  )

## DESCRIPTION

Write a DataBlock list to an **IStream** object.

## PARAMS

*lpStream* **\[In\]**  **IStream** object to write the list to.

*lpList* **\[In\]**  List of items to write.

## RETURNS

**Success:** **S\_OK**. The object is written to the stream.

**Failure:** An **HRESULT** error code.

## NOTES

Ordinals **17**,18,19,20,21 and **22** are related and together provide a compact list structure (a **"DataBlock List"**), which may be stored and retrieved from an **IStream** object.

The exposed Api consists of:

**-** **[SHWriteDataBlockList(3w)](/SHWriteDataBlockList/3w.md)** **-** Write a DataBlock list to a stream,

**-** **[SHReadDataBlockList(3w)](/SHReadDataBlockList/3w.md)** **-** Read and create a list from a stream,

**-** **[SHFreeDataBlockList(3w)](/SHFreeDataBlockList/3w.md)** **-** Free a list,

**-** **[SHAddDataBlock(3w)](/SHAddDataBlock/3w.md)** **-** Insert a new item into a list,

**-** **[SHRemoveDataBlock(3w)](/SHRemoveDataBlock/3w.md)** **-** Remove an item from a list,

**-** **[SHFindDataBlock(3w)](/SHFindDataBlock/3w.md)** **-** Find an item in a list.

The DataBlock list is stored packed into a memory array. Each element has a size and an associated **ID**. Elements must be less than 64k if the list is to be subsequently read from a stream.

Elements are aligned on **DWORD** boundaries. If an elements data size is not a **DWORD** size multiple, the element is wrapped by inserting a surrounding element with an Id of 0xFFFFFFFF, and size sufficient to pad to a **DWORD** boundary.

These functions are slow for large objects and long lists.

## IMPLEMENTATION

Exported by ordinal only. Use **[GetProcAddress(3w)](/GetProcAddress/3w.md)** to obtain a pointer to the function.

Implemented in **"dlls/shlwapi/clist.c"**.

Debug channel **"shell"**.
