MatthewKing / DeviceId

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

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

Closed IsThatUniqueEnough closed 11 months ago

IsThatUniqueEnough commented 11 months 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 11 months ago

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