---
title: es_handler_block_t
framework: endpointsecurity
role: symbol
role_heading: Type Alias
path: endpointsecurity/es_handler_block_t
---

# es_handler_block_t

A block that handles a message received from Endpoint Security.

## Declaration

```swift
typealias es_handler_block_t = (OpaquePointer, UnsafePointer<es_message_t>) -> Void
```

## Discussion

Discussion The block receives two parameters: The client that receives the event, as an es_client_t pointer. You pass this client to any es_respond-prefixed functions that you call in the handler. The message to handle, as an es_message_t pointer. You implement the handler by inspecting the message and deciding how to respond to it. For example, your handler might receive a message with event_type ES_EVENT_TYPE_AUTH_RENAME, indicating that the system wants authorization before renaming a file. Your handler would call es_respond_auth_result(_:_:_:_:) to permit or deny the renaming.

## See Also

### Creating a Client

- [es_new_client(_:_:)](endpointsecurity/es_new_client(_:_:).md)
- [es_new_client_result_t](endpointsecurity/es_new_client_result_t.md)
