Creates a new client instance and connect it to the Endpoint Security system.
- macOS 10.15+
A pointer to receive the new client instance.
The handler to run on all messages sent to this client.
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-prefixed functions. For out-of-order responding, your handler must copy the message with
To create a client, your app must have the
com 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 to free resources.