Windows API PlaySound error / silence

Today stumbled at strange behavior of Windows API function PlaySound in combination with SND_FILENAME flag. There are two scenarios: No sound is played, and PlaySound returns success (TRUE) in combination with SND_ASYNC; No sound is played, and PlaySound returns failure (FALSE) when using the same wav file, but without asynchronous flag. The cause is, that …

Windows API Function SetFileAttributes silently ignores compressed and encrypted attributes

When you call Windows API function SetFileAttributes, it ignores FILE_ATTRIBUTE_COMPRESSED (0x800) and FILE_ATTRIBUTE_ENCRYPTED (0x4000) values passed as parameters. Most likely it is implemented in this way, because you can pass value from GetFileAttributes, FindFirstFile and FindNextFile without modifications to SetFileAttributes. This applies to Windows XP, Windows Server 2003 / 2008, Windows Vista.