* @return @c 0 on success,
* otherwise a negative error value
* @retval #RPC_PORT_ERROR_NONE Successful
+ * @retval #RPC_PORT_ERROR_INVALID_PARAMETER Invalid parameter
* @see rpc_port_parcel_destroy()
*/
int rpc_port_parcel_create(rpc_port_parcel_h *h);
int rpc_port_parcel_burst_read(rpc_port_parcel_h h, unsigned char *buf, unsigned int size);
/**
- * @brief Write bytes to rpc port parcel handle.
+ * @brief Writes bytes to rpc port parcel handle.
* @since_tizen @if MOBILE 4.0 @elseif WEARABLE 5.0 @endif
* @param[in] h The rpc port parcel handle
* @param[in] buf The array buffer to write
* @return @c 0 on success,
* otherwise a negative error value
* @retval #RPC_PORT_ERROR_NONE Successful
+ * @retval #RPC_PORT_ERROR_PERMISSION_DENIED Permission denied
* @retval #RPC_PORT_ERROR_INVALID_PARAMETER The specified @a h is NULL
* @retval #RPC_PORT_ERROR_IO_ERROR Internal I/O error
- * @retval #RPC_PORT_ERROR_PERMISSION_DENIED Permission denied
*/
int rpc_port_proxy_connect(rpc_port_proxy_h h, const char *appid,
const char *port);
using namespace rpc_port;
RPC_API int rpc_port_parcel_create(rpc_port_parcel_h* h) {
+ if (h == nullptr)
+ return RPC_PORT_ERROR_INVALID_PARAMETER;
+
Parcel* p = new Parcel();
*h = p;
int len;
unsigned char* buf;
- if (port == nullptr)
+ if (h == nullptr || port == nullptr)
return RPC_PORT_ERROR_INVALID_PARAMETER;
internal::Port* pt = static_cast<internal::Port*>(port);