最近需要做个加密的东西,需要读取硬件物理地址,我和很多人一样,也找的diskid32.h(但是我一般找到的都是diskid32.cpp,没见过.h的),他用了各种方法给提出来了。
第一次用,没注意到还有版本,结果用差了,vista、win7有的提不出来。给大家分享下我的痛苦吧。
里面没有明显的版本号,只开头有更新说明
// 06/11/00 Lynn McGuire written with many contributions from others,
// IDE drives only under Windows NT/2K and 9X,
// maybe SCSI drives later
// 11/20/03 Lynn McGuire added ReadPhysicalDriveInNTWithZeroRights
第一次用的只有上面两个说明,vista、win7会有问题
// 10/26/05 Lynn McGuire fix the flipAndCodeBytes function
// 01/22/08 Lynn McGuire incorporate changes from Gonzalo Diethelm,
// remove media serial number code since does
// not work on USB hard drives or thumb drives
// 01/29/08 Lynn McGuire add