|
楼主 |
发表于 2022-12-5 21:34:27
|
显示全部楼层
英文原版
Disclaimer: I'm a Software Engineer at Microsoft, but I do not work on the OS team. I'm only here as a viewer who is subscribed to the channel. I decided to test out your guys hypothesis and I was able to reproduce it! I setup a test where I had a laptop running Windows Powershell listening on a port while connected to power. Every time a client connected, I would print the time at which the connection was made. From another PC, I would send a packet to that laptop and see the message being printed out. I then put the laptop to sleep, and after five seconds I would send another packet to the laptop. I then waited a minute and resumed the laptop from sleep.
The following behavior would change depending on whether or not the laptop was connected to power while going to the Sleep S0 state:
- If the laptop was connected to power when I hit "Sleep", after resuming from Sleep I would see the powershell window with the messages printed out with the time at which the laptop was asleep
- If the laptop was NOT connected to power when I hit "Sleep", after resuming from Sleep I would see the powershell window with NO messages printed out
- The above behavior would not change independently of what I did with the power cable DURING sleep - that is, even if I removed the power cable during sleep, then sent new packets, after resuming from sleep (with the power cable still disconnected) I would see the messages printed out, meaning the laptop was S0 Network Connected even on battery. Bug reproduced. Btw, the opposite happens if I connect the laptop to power during S0 sleep (no messages are printed).
I will try to contact the OS team with your findings and my test setup :)
Thanks guys! This is great investigative journalism!
For reference, my laptop is a Dell Latitude 7420 running Windows 11 22621.819, default UEFI settings.
Powershell code for reference:
On the server (laptop):
```
> $Listener = [System.Net.Sockets.TcpListener]52134;
> $Listener.Start();
> while($true)
> {
> $client = $Listener.AcceptTcpClient();
> Write-Host("Connected at " + $(Get-Date));
> $client.Close();
> }
On the client (another pc on the same network):
> $hostIp = "<machine network ip>"
> $port="52134"
> (new-object Net.Sockets.TcpClient).Connect($hostIp, $port)
``` |
|