aboutsummaryrefslogtreecommitdiff
path: root/hardware_functions.cpp
blob: ce6e35a659f7ea12e7f114100f2ee76ba4d1e37d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "hardware_functions.h"

#if (defined (_WIN32) || defined (_WIN64))
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 "invalid_windows_hd"; //what could possibly go wrong

}

#elif (defined (LINUX) || defined (__linux__))

QString get_hdid()
{
  //T0D0: add linux implementation
  return "linux_os_hdid";
}

#else

QString get_hdid()
{
  //T0D0: find a sane way to handle this
  return "unknown_os_hdid";
}

#endif