MatthewKing / DeviceId

A simple library providing functionality to generate a 'device ID' that can be used to uniquely identify a computer.
MIT License
794 stars 118 forks source link

AddWindowsDeviceId() and AddWindowsProductId() in 32 bit processes #79

Closed IsThatUniqueEnough closed 1 year ago

IsThatUniqueEnough commented 1 year ago

Components created with AddWindowsDeviceId() and AddWindowsProductId() return null when run in 32 bit processes (target "x86" or "Any CPU") on 64 bit Windows:

var builder = new DeviceIdBuilder()
    .OnWindows(windows => windows
    .AddWindowsDeviceId()
    .AddWindowsProductId());

foreach (var component in builder.Components)
    Console.WriteLine($"{component.Key}: {component.Value.GetValue() ?? "null"}");

gives:

WindowsDeviceId: null
WindowsProductId: null

Expected behaviour: Return the requested ids.

MatthewKing commented 1 year ago

Thanks for the report. This will be fixed in the next minor release over the next couple of days.