in reply to Re: WIN32: How to power-up a device?
in thread WIN32: How to power-up a device?

My software doesn't change the apparent MAC address, it wants to simply record the permanent MAC address of the machine it is running on when first started up.

The current problem is if a laptop user first runs the software when their power management has shut down the ethernet hardware, it cannot go ahead and record it.

Once it gets the address, it stores it in a file, similar to what you suggest.

One easy solution would be to popup "Please connect your laptop to the network", but even I would get uncomfortable thinking it was going to transmit data somewhere, or something sneaky like that.

Replies are listed 'Best First'.
Re^3: WIN32: How to power-up a device?
by mr_mischief (Monsignor) on Sep 26, 2007 at 19:20 UTC
    Well if you have access to change the hardware profile that's being used, that's a good bet.

    You could also ask for a power connection instead of a network connection if you're worried about people thinking something is being submitted somewhere.

    You can also get MAC addresses from the registry (at least if it's been changed by the system admin -- I'm not sure if there's any record of it there when deaulting to the physical MAC).

    In short, I'm not sure you have a Perl problem so much as a Windows problem.

      Asking for power could be a gamble, if they've reset the default power profile to go ahead and power down unused devices even when off of battery power. Connecting to the network is a sure thing.

      I explored getting the MAC addresses from the registry, but that can be easily spoofed. Getting the permanent MAC address via IOCTL directly from the driver is harder to mess with. At least I think...

      I kind-of agree with you. It's more of a windows problem that I'm trying to solve via some perl code. I'm hoping I can de-select the "allow power saving" in the device driver for the user temporarily, get the MAC address, then set it back again.