Dark matter (DM) decays and annihilations might heat and partially reionize the Universe at high redshift. Although this effect is not important for the cosmic reionization, the gas heating due to DM particles might affect the structure formation. In particular, the critical halo mass for collapse is increased up to a factor of ~2. Also the fraction of gas which collapses inside the smallest halos is substantially reduced with respect to the cosmological value. These effects imply that DM decays and annihilations might delay the formation of the first structures and reduce the total star mass in the smallest halos.