I need to get HDD serial number to use it as a key for licensing a software. I used diskid32 code in this url: http://www.winsim.com/d
Seem you have to check for windows version through API and add if() branch to your code if version is high enough
My devs found other problem with this method - that kind of IOCtl code relies on program is being run with administrator rights on Win7\Win8+. In cause of our software, it's service that is run with system rights and clients software that is strictly run with user rights