This spectacular MSDN article details how to do it in C++. And it vaguely mentions some utilities that don't appear to be on my system at all, and gives no ideas how to do this from a regular Windows Server 2003 R2 or Windows Server 2003 domain controller.
The need to detect an active directory schema master occurs because (even though I can't figure out how this happened) I am trying to run adprep
as a step in upgrading from 2003 to 2008R2 or 2012 server level domains, but its first command that you run (adprep /domainPrep and adprep /forestPrep) should be run on something called the "Schema Master".