http://msdn.microsoft.com/en-us/library/windows/desktop/aa511495.aspx