These interfaces get and set the user ID of a window. Refer to the XTSOLgetResUID(3) and XTSOLsetResUID(3) man pages.
Status XTSOLgetResUID(Display *display, XID object, ResourceType resourceFlag, uid_t *uidp); void XTSOLsetResUID(Display *display, XID object, ResourceType resourceFlag, uid_t *uidp);