x/sys/windows/svc: wrong handling of evdata parameter #65832
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Go version
go1.21.4 windows/amd64
Output of
go env
in your module/workspace:What did you do?
I was trying to handle
svc.SessionChange
when the event type iswindows.WTS_SESSION_LOGON
orwindows.WTS_SESSION_LOGOFF
.The problem is
c.EventData
points to awindows.WTSSESSION_NOTIFICATION
structure but, by the time the Handler is called,svc
'sctlHandler
already returned and the data may be invalid.What did you see happen?
It is hard to reproduce a problem because the memory, usually, is still valid.
What did you expect to see?
I expect the data pointed by the
EventData
field to be captured and copied locally into thectlEvent
object before being sent through the channel to the main loop.The text was updated successfully, but these errors were encountered: