You can buy developer contracts, under NDA of course, where the Windows source code is included. They will also give out pieces of their source code, as necessary, to lower level contracts. Microsoft has their problems, but they do work with their developer community decently. They are usually easier to work with than Apple and Sun are, in my experience. Of course, the open source model is not in place, so the average user does not have access to Microsoft's "intellectual property" like they would with Linux.