Ask HN: What is the license for Windows header files?

38 points by ChrisSD ↗ HN
I understand that Windows.h et al are licensed for use in building Windows applications, etc. However I'm less clear on what the license is for the text of the headers.

Are you free to distribute them? What about distribute and modify? The copyright notice in Windows.h merely says "all rights reserved" which sounds meaningless in the context, as that's the default anyway and surely they allow some rights to the user.

I believe WINE and mingw have their own version of Windows headers but I'm unsure how those came to be.

18 comments

[ 4.0 ms ] story [ 53.9 ms ] thread
The headers are a part of the Windows SDK, its license is typically located at C:\Program Files (x86)\Windows Kits\10\Licenses\<version>\sdk_license.rtf

>Are you free to distribute them?

No.

>What about distribute and modify?

No.

>I believe WINE and mingw have their own version of Windows headers but I'm unsure how those came to be.

Yes, MinGW headers were developed independently and most of them are either in the public domain or were released under some permissive license.

Ah, it seems very restrictive beyond developing Windows programs internally.

Right to Use and Distribute. The code and test files listed below are “Distributable Code”.

* REDIST.TXT Files. You may copy and distribute the object code form of code listed in REDIST.TXT files plus the files listed on the REDIST.TXT list located at http://go.microsoft.com/fwlink/?LinkId=524842. Depending on the specific edition of the software, the number of REDIST files you receive with the software may not be equal to the number of REDIST files listed in the REDIST.TXT List. We may add additional files to the list from time to time.

* Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.

...

Distribution Restrictions. You may not

...

* Distribute Distributable Code to run on a platform other than the Microsoft operating system platform;

* Modified or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. And Excluded License is one that requires, as a condition of use, modification or distribution, that

   * The code be disclosed or distributed in source code form; or

   * Others have the right to modify it.
> Ah, it seems very restrictive beyond developing Windows programs internally.

Yes, Windows is proprietary code. Not sure what you expected?

I didn't know what to expect which is why I asked the question. Microsoft is much more friendly towards the open source community than in times past and the header files only define the API not the implementation of it. So it wouldn't have been so shocking to learn they allowed, for example, windows.h (and some related headers) to be included in a github project.
In practice header files include some things like inline functions, macros and data structures, so they're treated just like source code (which is really all they are - there's no technical difference between a header file and a source code file.)
Sure but surely the point of the windows headers is to define the public interface. This has been made more explicit with Microsoft's ApiSet Contracts, which defines a more minimal set of function definitions grouped into sets like "api-ms-win-core-console-l3".
I’m not sure what you’re trying to say here?

The headers are code that belongs to MS. The fact that they’re for a “public API” isn’t relevant.

If you want “specification of the API” have a look at the language spec for the CLR or JavaScript. Note that they generally don’t have code.

I'm trying to say it isn't beyond the bounds of possibility for Microsoft to allow a more permissive license for at least a subset of their headers. Even while maintaing Windows' proprietary nature.

This particular sub thread started with apparent incredulity that I could think the headers would have anything but a very restrictive license.

Fair enough, I think that there is no reason they could - but also no reason/value for them to change the licensing. It’s in their interest to encourage developers to write software for windows, but it’s not in their interest to help developers write software that replaces windows.
Correct. Which makes me think of various c++ template libraries MS has shipped alongside SDKs (ATL, WRL).

Actually the same reasoning could be said to apply to STL.

Or, relatedly, somehow it's possible to link statically to CRT.

It's interesting with these cases, because something can seem perfectly reasonable behavior in the mind of a developer (an app using platform headers or standard library) but you can wind up with a different answer trying to figure out for what if anything enables that behavior in a legal context.

The theory is that copyright applies to expressive content and not to the functionality. So if you take Microsofts header files and strip the comments and formatting, the resulting file would not be covered by copyright.
Has this theory been tested in similar cases at all or is it entirely untested ground? Is this perhaps what mingw and WINE did?
Please correct me if I'm wrong, but I was under the impression this was exactly what the Oracle vs Google copyright lawsuit was about.
No, that one is about reimplementing an api
Isn't that basically the same thing? Whether an API itself is expressive enough to be copyrighted.
I believe it was as well. It was considered to be copyright infringement, but the judge allowed fair use for the purpose that Google used it for. Which means, that it would be copyright infringement to do something similar, but you might be able to use the fair use defence if someone sued you. This means, however, that it will almost certainly go to court and you will have to retain a lawyer. So unless you have lots of money (and are willing to risk it), you shouldn't do something similar to what Google did.
This seems like the very definition of "derivative work" which would indeed be covered by the original copyright.
The headers themselves are under copyright, of course, but the definitions inside them can be copied/reused for interoperability reasons (something that is especially protected in EU but i think also in US). So while you cannot distribute the header files, you can write your own parser that generates new header files (for C or any other language) that are compatible with the Microsoft header files as long as they aren't the same.

Of course IANAL but AFAIK this is what several projects (especially compilers and interpreters) that need to hook with other APIs are already doing.