Sep
20
Use of Microsoft Windows SDK headers as FOSS reference – OK!
Filed Under (Coding, Direct2D API, Linux, Open source, VLC) by 2of1 on 20-09-2010
Some fantastic news to report!
Remember this issue?
Well, today I received an email from Mark Lawrence at Microsoft in regard to the issue of using the Windows SDK headers in FOSS.
Here’s an excerpt of the relevant bit:
"Creating a derivative of the d2d1.h header file would be a problem, but merely looking at it for referential purposes in order to develop your own header and software for the Windows platform should be within the scope of the SDK license."
So it seems we have the go-ahead for ‘peeking’ in the original headers and using them as a base reference for our own!




Supposition like that won’t hold any water once the Microsoft lawyers come knocking at your door. This is why people preface everything with “IANAL”, and tell you to go seek legal advice.
I think that there’s just no way MS lawyers would ever come knocking at a door over someone peaking inside a header for code that enables one to write software for THEIR O/S after all! They’d have to be crazy to do that.
But still, for those more paranoid – and for those who do not wish to be in breach of the EULA at all, the above statement should help put their mind at ease.
Yes IANAL, but in this case I don’t really see that I have to be.
So did you peek at them after all?
https://github.com/2of1/d2d1headers/blob/master/d2d1.h says that “No original Microsoft headers were used in the creation of this file.”
If you did not peek at MS headers I am curious to know how figured the interface (DLL disassembly?)
The ’sneak peek’ was because of function ordering. The generation was done through a script that constructed the interfaces from data on MSDN.
The problem with that is that the functions were listed in alphabetical order on MSDN whilst they are in a different order entirely in the interface.
The ordering requires a look at the original headers (I couldn’t think of any other way to do it).
The reason that file on GitHub says what it does is because the order has been left alphabetical. This will likely cause anything that uses those functions to crash.
The reason my Direct2D vlc vout module works is because I just ordered the functions that it calls correctly. I did this through trial and error.
If you wish to call other functions, you’ll need to work out their orders; either by peaking or trial & error.