Creates a new client instance and connect it to the Endpoint Security system.


es_new_client_result_t es_new_client(es_client_t * _Nullable *client, es_handler_block_t handler);



A pointer to receive the new client instance.


The handler to run on all messages sent to this client.

Return Value

A result value indicating that indicates either success or the reason why client initialization failed.


The handler block receives messages serially, and in the order the system delivers them. Returning control from the handler causes Endpoint Security to dequeue the next available message.

You can respond to a message out of order by returning control before calling one of the es_respond-prefixed functions. For out-of-order responding, your handler must copy the message with es_copy_message.

To create a client, your app must have the entitlement. The user also needs to approve your app with Transparency, Consent, and Control (TCC) mechanisms. The user does this in the Security and Privacy pane of System Preferences, by adding the app to Full Disk Access.

When you no longer need to receive Endpoint Security messages, destroy the client with es_delete_client to free resources.

See Also

Creating a Client


An opaque type that stores the Endpoint Security client state.


A block that handles a message received from Endpoint Security.


The result of an attempt to create a new client.