That UserDataPtr comes from your application. You can pass NULL if you don't need such a pointer.
That pointer points to your own data structure where you can have in it whatever you want/need.
For example you can initialize device, and add with the user data pointer your own data to the device handle.
Whenever you get callbacks, you can then get that data through that pointer.
Erich