From ebdaf368e137fc933e648ee88a08a4f83e796f87 Mon Sep 17 00:00:00 2001 From: ChrisTX Date: Sun, 14 Oct 2012 02:13:49 +0200 Subject: Replace printf(_c) with iostream --- win/win32service.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'win/win32service.cpp') diff --git a/win/win32service.cpp b/win/win32service.cpp index b677b6662..81f8e7516 100644 --- a/win/win32service.cpp +++ b/win/win32service.cpp @@ -24,6 +24,7 @@ #include #include #include +#include static SERVICE_STATUS_HANDLE serviceStatusHandle; static HANDLE hThreadEvent; @@ -244,7 +245,7 @@ void InstallService() scm = OpenSCManager(0,0,SC_MANAGER_CREATE_SERVICE); if (!scm) { - printf("Unable to open service control manager: %s\n", RetrieveLastError()); + std::cout << "Unable to open service control manager: " << RetrieveLastError() << std::endl; return; } @@ -253,7 +254,7 @@ void InstallService() if (!myService) { - printf("Unable to create service: %s\n", RetrieveLastError()); + std::cout << "Unable to create service: " << RetrieveLastError() << std::endl; CloseServiceHandle(scm); return; } @@ -274,7 +275,7 @@ void InstallService() BOOL success = ChangeServiceConf(myService,SERVICE_CONFIG_DESCRIPTION, &svDesc); if (!success) { - printf("Unable to set service description: %s\n", RetrieveLastError()); + std::cout << "Unable to set service description: " << RetrieveLastError() << std::endl; CloseServiceHandle(myService); CloseServiceHandle(scm); return; @@ -283,7 +284,7 @@ void InstallService() FreeLibrary(advapi32); } - printf("Service installed.\n"); + std::cout << "Service installed." << std::endl; CloseServiceHandle(myService); CloseServiceHandle(scm); } @@ -296,27 +297,27 @@ void RemoveService() scm = OpenSCManager(0,0,SC_MANAGER_CREATE_SERVICE); if (!scm) { - printf("Unable to open service control manager: %s\n", RetrieveLastError()); + std::cout << "Unable to open service control manager: " << RetrieveLastError() << std::endl; return; } myService = OpenService(scm,TEXT("InspIRCd"),SERVICE_ALL_ACCESS); if (!myService) { - printf("Unable to open service: %s\n", RetrieveLastError()); + std::cout << "Unable to open service: " << RetrieveLastError() << std::endl; CloseServiceHandle(scm); return; } if (!DeleteService(myService)) { - printf("Unable to delete service: %s\n", RetrieveLastError()); + std::cout << "Unable to delete service: " << RetrieveLastError() << std::endl; CloseServiceHandle(myService); CloseServiceHandle(scm); return; } - printf("Service removed.\n"); + std::cout << "Service removed." << std::endl; CloseServiceHandle(myService); CloseServiceHandle(scm); } -- cgit v1.2.3