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.

David Heffernan
  • 572,264
  • 40
  • 974
  • 1,389
Cadburry
  • 1,824
  • 9
  • 21
  • 2
    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. – Duston Jun 18 '15 at 20:57
  • @Duston ..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 - thx – Cadburry Jun 18 '15 at 21:09
  • 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. – Duston Jun 18 '15 at 21:28
  • @Duston - 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... – Cadburry Jun 18 '15 at 21:39

1 Answers1

2

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.

OldFrank
  • 810
  • 6
  • 6