非常感谢!
问题解决了,原因应该是这个:
SERVICE_ALL_ACCESS (0xF01FF) 和SC_MANAGER_ALL_ACCESS (0xF003F)
的Access right虽然都是:
Includes STANDARD_RIGHTS_REQUIRED, in addition to all access rights in this table.
但是SC_MANAGER_ALL_ACCESS 是 Access Rights for the Service Control Manager
而SERVICE_ALL_ACCESS 是 Access Rights for a Service
却别在于Service Control Manager,因为OpenSCManager作用是Establishes a connection to the service control manager on the specified computer and opens the specified service control manager database.
^ ^