From 7b7315005329266c26facb1885dc6483c081fabb Mon Sep 17 00:00:00 2001 From: Skoland Date: Sun, 22 Jan 2017 01:19:59 +0100 Subject: added hdid function(for win32) --- win32_functions.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 win32_functions.cpp (limited to 'win32_functions.cpp') diff --git a/win32_functions.cpp b/win32_functions.cpp new file mode 100644 index 0000000..76ca18a --- /dev/null +++ b/win32_functions.cpp @@ -0,0 +1,15 @@ +#include "win32_functions.h" + +DWORD dwVolSerial; +BOOL bIsRetrieved; + +QString get_hdid() +{ + bIsRetrieved = GetVolumeInformation(TEXT("C:\\"), NULL, NULL, &dwVolSerial, NULL, NULL, NULL, NULL); + + if (bIsRetrieved) + return QString::number(dwVolSerial, 16); + else + return "invalidhd"; //what could possibly go wrong + +} -- cgit