ajout de log, modif du makefile
This commit is contained in:
@@ -2,4 +2,4 @@ NAME = svc
|
|||||||
|
|
||||||
|
|
||||||
$(NAME):
|
$(NAME):
|
||||||
cl main.c Advapi32.lib
|
cl /Fe"$(NAME)" main.c Advapi32.lib
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <winsvc.h>
|
#include <winsvc.h>
|
||||||
|
#include <stdio.h>
|
||||||
int main(void){
|
int main(void){
|
||||||
SC_HANDLE scHandle = OpenSCManagerA(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_ALL_ACCESS);
|
SC_HANDLE scHandle = OpenSCManagerA(NULL, SERVICES_ACTIVE_DATABASE, SC_MANAGER_ALL_ACCESS);
|
||||||
|
if (scHandle == NULL){
|
||||||
|
printf("OpenSCManagerA n'a pas fonctiionne. code d'erreur: %d\n", GetLastError());
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
printf("OpenSCManagerA est ouvert\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user