zvisofer
zvisofer

Reputation: 1368

Show Service permissions programmatically

It is possible to get service permissions via command line:

C:\Users\myname>sc sdshow EventSystem

D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCR
RC;;;IU)(A;;CCLCSWLOCRRC;;;SU)

How can I get this value via C++ code and winapi?

Upvotes: 0

Views: 201

Answers (1)

David Heffernan
David Heffernan

Reputation: 612963

From Service Security and Access Rights on MSDN:

To get or set the security descriptor for a service object, use the QueryServiceObjectSecurity and SetServiceObjectSecurity functions. For more information, see Modifying the DACL for a Service.

So there's the answer. You call QueryServiceObjectSecurity.

Upvotes: 1

Related Questions