docs: def elevate_token(th):
      '''
      Set all token priviledges to enabled
      '''
      # Get list of privileges this token contains
      privileges = win32security.GetTokenInformation(
          th, win32security.TokenPrivileges)
  
      # Create a set of all privileges to be enabled
      enable_privs = set()
      for luid, flags in privileges:
          enable_privs.add((luid, win32con.SE_PRIVILEGE_ENABLED))
  
      # Enable the privileges
      if win32security.AdjustTokenPrivileges(th, 0, enable_privs) == 0:
          raise WindowsError(win32api.FormatMessage(win32api.GetLastError()))