Vytvorenie NT Služieb
 

 

 
Priklad spustenia z main.cpp:



#define implicit_Services_main
#include "Convert.h" //https://www.netbot.sk/sk/14-blog-headers/84-convert-h #include "WinApi.h" //https://www.netbot.sk/sk/14-blog-headers/31-winapi #include "Services.h" //https://www.netbot.sk/sk/14-blog-headers/83-services-h using namespace std;
void ::WinNTServices::StructServiceStorageInformation::ServiceIsStarting(void) { ::Diall_WinApi::WinApi::GetInstance()->CreateFileW("c:\\Service.txt", "starting\n", 10); }
void ::WinNTServices::StructServiceStorageInformation::ServiceIsRunning(void) { ::Diall_WinApi::WinApi::GetInstance()->CreateFileW("c:\\Service.txt", "running\n ", 10); }
void ::WinNTServices::StructServiceStorageInformation::ServiceIsStopping(void) { ::Diall_WinApi::WinApi::GetInstance()->CreateFileW("c:\\Service.txt", "stopping\n", 10); }
int _cdecl main (void) { ::Diall_WinApi::WinApi::GetInstance()->SystemIntegrity(::Diall_WinApi::Privilege::ENABLE);
::WinNTServices::ServiceStorageInformation.CallServiceEntryPointFromMain("C:\\test.exe","Diallix Service","Diallix"); return 0; }