I do believe the code in that thread returns the partition serial number as assigned by Windows, not the physical hard drive serial number. This page mentions the difference:
This function returns the volume serial number that the operating system assigns when a hard disk is formatted. To programmatically obtain the hard disk's serial number that the manufacturer assigns, use the Windows Management Instrumentation (WMI) Win32_PhysicalMedia property SerialNumber.
subject: how to get hard disk serial number using java