changed detection length from void_p to ulong