# xxxAttachServiceManager

Called when a service manager is attached to a Natural Access queue.

#### Prototype

DWORD xxxAttachServiceManager (CTAQUEUEHD ctaqueuehd, unsigned mode, void **queuecontext)

Argument | Description
ctaqueuehd | Handle created by dispatcher on call to ctaCreateQueue.
mode | Reserved for future use.
queuecontext | Pointer to a queue context returned by the service manager. A queuecontext is a device level data structure.

#### Return values

SUCCESS or any Natural Access or service-specific error code.

#### Details

The dispatcher invokes xxxAttachServiceManager when a Natural Access queue is created and the service manager is listed in the arguments to ctaCreateQueue. Only service managers in this list are attached and are available to be opened on the queue.

queuecontext provides a way for the service manager to allocate a device object that it will associate with the queue. If the queuecontext is not needed, queuecontext can have NULL assigned as its value.

Wait objects should be registered with the dispatcher if the managed resource is multiplexed with this function.

For more information about this function, refer to Initializing managed resource event handling.

#### See also

dispRegisterWaitObject, xxxDetachServiceManager