# dispSendCommand

Used by the service SPI to send commands to the API service implementation function.

#### Prototype

DWORD dispSendCommand (DISP_COMMAND *ctacmd)

Argument | Description
ctacmd | Pointer to command structure to send containing the following fields: typedef struct { DWORD id; /* Command ID (and dest. service ID) */ CTAHD ctahd; /* Natural Accesso context handle */ DWORD size1; /* If dataptr1 !=NULL => size1 is buffer */ /* size - else message specific data */ void *dataptr1; /* Data pointer */ DWORD size2; /* If dataptr2 !=NULL => size2 is buffer */ /* size - else message specific data */ void *dataptr2; /* Data pointer */ DWORD size3; /* If dataptr3 !=NULL => size3 is buffer */ /* size - else message specific data */ void *dataptr3; /* Data pointer */ unsigned objHd; /*Service object handle (formerly "reserved")*/ MESSAGE_ADDR addr;/* Source/Destination service ID */ } DISP_COMMAND; typedef struct { WORD source /* source service ID */ WORD destination /* destination service ID */ } MESSAGE_ADDR

#### Return values

Return value | Description
SUCCESS |
CTAERR_BAD_ARGUMENT | ctacmd is NULL.
CTAERR_INVALID_ADDRESS | Specified command address is invalid.
CTAERR_INVALID_CTAHD | Specified ctahd is invalid.
CTAERR_LOCK_TIMEOUT | Thread lock timed out.
CTAERR_NOT_INITIALIZED | Natural Access is not initialized.
CTAERR_SERVICE_NOT_AVAILABLE | Specified service is not available.

#### Details

dispSendCommand can be used by the service SPI module to synchronously send commands to the associated API service implementation function. Upon return, the service SPI can dispose of buffers or structures as needed.

Note: You cannot invoke this command from within the service implementation of another service. Services must call other service's SPI functions.

For details on marshaling information in and out of the DISP_COMMAND structure, refer to DISP_COMMAND structure.

#### See also

xxxProcessCommand