diff options
Diffstat (limited to 'external/plyer/platforms/win/uniqueid.py')
-rw-r--r-- | external/plyer/platforms/win/uniqueid.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/external/plyer/platforms/win/uniqueid.py b/external/plyer/platforms/win/uniqueid.py new file mode 100644 index 0000000..bfcf996 --- /dev/null +++ b/external/plyer/platforms/win/uniqueid.py @@ -0,0 +1,21 @@ +try: + import _winreg as regedit +except: + try: + import winreg as regedit + except: + raise NotImplemented() + +from plyer.facades import UniqueID + + +class WinUniqueID(UniqueID): + def _get_uid(self): + hKey = regedit.OpenKey(regedit.HKEY_LOCAL_MACHINE, + r"SOFTWARE\\Microsoft\\Cryptography") + value, _ = regedit.QueryValueEx(hKey, "MachineGuid") + return value + + +def instance(): + return WinUniqueID() |