Piotr Caban : msvcrt: Factor out wenv_get_index helper.