Need help with input devctl

I have a system which is currently configured to use the resource manager
interface to /dev/devi/mouse0. I am able to read all events correctly,
and I haven’t really had any input problems so far. But now I would like
to enable my system to use both a mouse and a touchscreen. I’ve
determined that I will need a mechanism for asking the given device for
its type and then handling any input based on this type. Here’s where I’m
stuck. I’ve tried using the _POINTERGETINFO dcmd in dcmd_input.h, but I
always seem to get an “Inappropriate I/O control operation” error. Is
this the correct way to get information from an input driver? I’m
assuming that Photon does something similar. I’ve placed a code snippet
at the bottom of this message.

thanks
Charlie

struct _pointer_info info;

memset(&info,0,sizeof(info));

rc = devctl(fd,_POINTERGETINFO,&info,sizeof(info),NULL);
if (rc != EOK) {
printf(“Could not get pointer info: %s\n”,strerror(rc));
return 1;
}