It is not that simple. If you are not careful you may end up using more recent winapi functions and/or constants that do not exist in XP. For example Rust supports XP on a best-efforts basis and as a result has broken XP support from time to time (the "tier 3" support [1] explicitly allows this situation). Unless you can run an automated CI on XP (does that even exist?!) you'd better support only recent OSes.
[1] https://forge.rust-lang.org/platform-support.html#tier-3