Skip to content
Tech News
← Back to articles

Windows XP's random default picture used tick-count-seeded RNG and one-pass selection

read original get Knuth: The Art of Computer Programming, Vol. 2 → more articles
GoKawiil Brief

A technical breakdown explains how Windows XP picked a user's initial account picture: it used the RtlRandomEx function seeded with GetTickCount(), scanning the default pictures folder once rather than twice. This single-pass method is a special case of reservoir sampling, selecting one item fairly as the folder is enumerated.

Why It Matters

GoKawiil's interpretation of the reporting above, not reported fact.

The explanation shows how Windows engineers optimized for filesystem I/O efficiency, avoiding a costly two-pass directory scan and sidestepping bugs if files changed mid-operation. It's a small but illustrative example of practical algorithm design tradeoffs baked into everyday OS features.

Key Takeaways
Worth a Look

Knuth: The Art of Computer Programming, Vol. 2 — If reservoir sampling and seeded random number generators pique your curiosity, Knuth's Volume 2 (Seminumerical Algorithms) is the classic deep dive into random number generation and sampling techniques. It's the reference that explains why one-pass tricks like the k=1 reservoir selection Windows XP used are so elegant. A handsome hardcover that earns its spot on any programmer's shelf.

See Knuth: The Art of Computer Programming, Vol. 2 on Amazon → Affiliate link — we may earn a commission on purchases, at no extra cost to you. Product picked by AI based on this article; it is not a tested recommendation.

Source: devblogs.microsoft.com — Raymond Chen, 2026-09-10

Published there as: “What algorithm did Windows XP use to choose your initial user picture?”

Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.