How to recognize a WOL (Wake On Lan) request while the PC is running
Asked Answered
M

1

10

I wonder if its possible to check if a WOL-request has been
received during the computer is already turned on. (pInvoke, c#?)

If the computer receives a magic paket and boots, Windows writes an corresponding event-log entry to the System-Log.

The way i'm looking for is not to listen to my UDP-Traffic by my own - if its possible i want to know how to receive a kind of system event (IRQ?) or something.. And thats all when receiving PC is already turned on.

Mettle answered 18/6, 2015 at 20:50 Comment(4)
Wake-on-LAN is really a MAC-level thing, (although some implementations use UDP) so you'd really have to listen to the raw packets as they come across...assuming the NIC passes that packet along to the NIC drivers. It isn't the software that turns on the computer when the packet is received, it's a signal from the NIC to the motherboard that does. In short, I don't think you're going to find an easy answer.Sneaker
@Sneaker ..from what i have read i expected something that, there was just at least a dim light i belived in ;) - maybe someone has a revolutionary approach ;) - I also believe this could be a individual thing between different manufacturers - maybe some of them are supporting such an "event" in their specific drivers... but i'm looking for a generic solution - thxMettle
Well, remember, WOL isn't a driver-level event, it's handled at the hardware level. To the driver, it's just broadcast chatter on the network.Sneaker
@Sneaker - yes i meant they may implemented something (Someone has to debug such events ;) ) - But i thought its "may" possible because other PowerEvents are possible to listen to (.net Microsoft.Win32.SystemEvents.PowerModeChanged") - yea.. right.. these are all ACPI-Events... ;) & only shutdown & suspend events...Mettle
C
1

I agree with Duston that WOL is a Layer 2 combined with hardware thing. On a normal working PC, there is little chance that the NIC hardware will pass this on to the drivers, as it is exactly the task of this hardware to only disturb your CPU if really needed. You best chance to see a magic packet on a working PC would be : install and run sniffer (packet analyzer) software. That will force a supportive NIC into a special mode that transfers every packet to the CPU. If you can now see the magic packet in the output, next step would be to configure the sniffer to alert you in case it sees a magic packet. Done. All this will be quite CPU-intensive. You could write software that performs all this, but that would essentially be rewriting the complete sniffer with fixed query instead of a configurable one.

Corrales answered 23/6, 2015 at 20:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.