If the 'ent' pointer is filled, it should work. There is nothing wrong. Did Superkus example work for you?