搜索"log on as a service programmatically"
https://msdn.microsoft.com/en-us/library/windows/desktop/ms721863.aspx
http://www.codeproject.com/Articles/4863/LSA-Functions-Privileges-and-Impersonation
http://*.com/questions/19868950/how-to-grant-a-user-log-on-as-a-service-rights-programmatically
例子:
http://www.numberworld.org/y-cruncher/guides/enable_permissions.cpp
https://support.microsoft.com/en-us/kb/132958
API:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms721786(v=vs.85).aspx
https://msdn.microsoft.com/en-us/library/windows/desktop/ms721603(v=vs.85).aspx#_security_privilege_gly