Prompt effects of solar wind variations on the inner magnetosphere and midlatitude ionosphere