>That structure is only there so that the service can report it's status to the SCM. You shouldn't need to worry about it - all you should need to do is add the SERVICE_ACCEPT_PRESHUTDOWN flag to the commandsAccepted property (That's the value that will be reflected in the dwControlsAccepted field of the struct).
As per the example I have posted, you probably have seen that this not working in my case. The OnCustomCommand() event does not fire on shutdown. It seems SERVICE_ACCEPT_PRESHUTDOWN is not supported on Windows Server 2003. If that is the case, that would explain.