Commit b6889370 authored by Alex Brainman's avatar Alex Brainman

windows/svc: align ctlHandler parameters

ctlHandler is passed to RegisterServiceCtrlHandlerEx as a callback
function. But all ctlHandler parameters have to be uintptr aligned
regardless of their type.

Adjust ctlHandler parameters, so they are aligned accordingly.

Also uncomment part of TestExample that verifies passing of
ChangeRequest.Context.

Fixes golang/go#25660

Change-Id: Ie96fa5c78b911ad9df6775f5c49e7f6d56464f6b
Reviewed-on: https://go-review.googlesource.com/c/158698Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 12036c15
......@@ -315,8 +315,8 @@ func Run(name string, handler Handler) error {
return err
}
ctlHandler := func(ctl uint32, evtype uint32, evdata uintptr, context uintptr) uintptr {
e := ctlEvent{cmd: Cmd(ctl), eventType: evtype, eventData: evdata, context: context}
ctlHandler := func(ctl, evtype, evdata, context uintptr) uintptr {
e := ctlEvent{cmd: Cmd(ctl), eventType: uint32(evtype), eventData: evdata, context: context}
// We assume that this callback function is running on
// the same thread as Run. Nowhere in MS documentation
// I could find statement to guarantee that. So putting
......
......@@ -127,8 +127,7 @@ func TestExample(t *testing.T) {
}
want := strings.Join(append([]string{name}, args...), "-")
// Test context passing (see servicemain in sys_386.s and sys_amd64.s).
// TODO(brainman): Uncomment next line once issue #25660 is fixed.
//want += "-123456"
want += "-123456"
if !strings.Contains(string(out), want) {
t.Errorf("%q string does not contain %q", string(out), want)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment