Today, my colleague wrote a program to get the Window service with Sigar, and found that several services could not get out anyway.
I looked at the code and got it using OpenService, so I wrote a Demo using VC, but I still couldn’t get it.
But the error code is this 5, check MSDN is access problem.
Take a look at the permission bits obtained by Sigar, compare MSDN, Sigar USES ALL_ACCESS, but in Windows Scardspace, how to report an error.
After searching a few articles, the question was not completely solved, but fortunately we just want to get the status, not start and stop service, so we changed the source code, add a read permission bit (see MSDN), so
Even the bypass solves the problem.
- Strong name validation failed solution
- Visual Studio Tips: error LNK2005: … already defined in LIBCMTD.lib(new.obj)
- fopen,fopen_ S, wfopen_ S and_ fsopen, _ The distinction of WFS open
- Net start command system error 5 and error 1058 solution
- What is cs0120 error
- error: Microsoft Visual C++ 9.0 is required
- How to use it RegAsm.exe Register C in a development / production environment#/ VB.NET Developed DLL
- What is cs1525 error
- SQL server error 15404 solution
- 12c Instant Client Throws System Error Code 126 or 193 or 106
- 0xc015000f: the activation context being deactivated is not recently activated
- Unable to find VBScript script engine or error 2738, could not access VBScript runtime
- Windows_ Win7 broadband connection prompt remote access connection manager error
- Failed to write output file ‘C:’ windows\ Microsoft.NET \Framework64\v4.0.30319\Temporary ASP.NET Files\root\106f9ae8\cc0e1
- Solution of VS2008 unable to open GL / glaux. H header file
- About the cause of the long-standing ADO error: unspecified error “(error code = 0x80004005) (excerpt from the Internet)
- Repair connection: an internal error has occurred in windowsserver2016
- HTTP Error 401.1 – Unauthorized:Access is denied due to invalid credentials
- windows update error 0x8024401c