# WBT_RegisterBlock

## C Specification

  `#include <nitro/wbt.h>`
  `BOOL WBT_RegisterBlock(WBTBlockInfoList *block_info_list, u32 block_id, const void *user_id, const void *data_ptr, int data_size, u16 permission_bmp);`

## Arguments

block_info_list | Pointer to the `WBTBlockInfoList` structure used for registration. This structure is used by the WBT library until it is released by the `WBT_UnregisterBlock` function.
block_id | A unique user-defined value allocated to the block to be registered The value must be greater than `WBT_BLOCK_ID_MIN`.
user_id | User-defined data given to a block. The size is `WBT_USER_ID_LEN` bytes.

data_ptr

A buffer that holds block data.
If this value is not `NULL`, the buffer is referenced by the WBT library until the buffer is released with the `WBT_UnregisterBlock` function. Therefore, until the buffer is released, the buffer must not be changed or destroyed.
If the value is `NULL`, as required, partial buffer preparation requests are notified to the `WBT_CMD_SYSTEM_CALLBACK` callback as `WBT_CMD_PREPARE_SEND_DATA` events.

data_size | The block data size.
permission_bmp | Reserved for a future extension. Always specify 0.

## Return Values

Registers the block and returns `TRUE` if the specified block `ID` is not currently registered and the total number of registered blocks is less than `WBT_NUM_MAX_BLOCK_INFO_ID`.
Otherwise, it does nothing and returns `FALSE`.

## Description

This function registers a data block in the WBT internal block list, based on the information specified. A communicating party can receive the registered block with the `WBT_GetBlock` function.

## See Also

`WBT_UnregisterBlock, WBT_GetBlockInfo, WBT_GetBlock, WBTBlockInfoList`

## Revision History

09/21/2004 Initial version

CONFIDENTIAL