Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extracting MAC addresses from UUIDs

Tags:

c++

uuid

windows

A program that I work on assumes that the UUID generated by the Windows RPC API call UuidCreateSequential() contains the MAC address of the primary ethernet adapter. Is this assumption correct or should I use a different method to get the MAC address?

like image 833
spry Avatar asked Dec 10 '22 22:12

spry


1 Answers

I wouldn't rely on this - the only reason that UuidCreateSequential has the MAC address is it's trying to guarantee that the UUID is unique across the network. Plus, why would you use such a weird way to get a MAC address? Use WMI and actually ask for the MAC address instead of a side-effect of a UUID creation function.

like image 131
Ana Betts Avatar answered Dec 30 '22 11:12

Ana Betts