return(object); is correct, but this line is wrong:
DOBJECT* object;
This just defines a pointer and I think normally is should crash at the line object.x = position.x;

You have to allocate your object:
DOBJECT* object = malloc(sizeof(DOBJECT));