- Timestamp:
- 09/19/08 06:48:41 (5 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2, stable
- Children:
- c09c225
- Parents:
- 371df23
- Location:
- include
- Files:
-
- 4 edited
-
EnumNtSrv.cpp (modified) (1 diff)
-
EnumNtSrv.h (modified) (1 diff)
-
checkHelpers.hpp (modified) (3 diffs)
-
config.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
include/EnumNtSrv.cpp
r846bbe4 rbb8b6d1 189 189 SC_HANDLE sh = ::OpenService(scman,name.c_str(),SERVICE_QUERY_STATUS); 190 190 if (!sh) { 191 std::wstring short_name; 191 192 DWORD bufLen = SC_BUF_LEN; 192 193 TCHAR *buf = new TCHAR[bufLen+1]; 193 194 if (GetServiceKeyName(scman, name.c_str(), buf, &bufLen) == 0) { 195 short_name = name; 196 } else { 197 short_name = buf; 198 } 199 delete [] buf; 200 sh = ::OpenService(scman,short_name.c_str(),SERVICE_QUERY_STATUS); 201 if (sh == NULL) { 202 DWORD dwErr = GetLastError(); 194 203 ::CloseServiceHandle(scman); 195 delete [] buf; 196 throw NTServiceException(name, _T("GetServiceKeyName: Could not translate service name: ") + error::lookup::last_error()); 197 } 198 /* 199 Why does this not work? (a bug in the API? says it should return the correct size?) 200 if (bufLen >= SC_BUF_LEN) { 201 ::CloseServiceHandle(scman); 202 throw NTServiceException(name, "Service name to long to handle", GetLastError()); 203 } 204 buf[bufLen] = 0; 205 */ 206 sh = ::OpenService(scman,buf,SERVICE_QUERY_STATUS); 207 delete [] buf; 208 if (sh == NULL) { 209 ::CloseServiceHandle(scman); 210 throw NTServiceException(name, _T("OpenService: Could not open Service: ") + error::lookup::last_error()); 204 if (dwErr == ERROR_SERVICE_DOES_NOT_EXIST) { 205 info.m_dwCurrentState = MY_SERVICE_NOT_FOUND; 206 info.m_dwServiceType = MY_SERVICE_NOT_FOUND; 207 return info; 208 } else { 209 throw NTServiceException(name, _T("OpenService: Could not open Service: ") + error::lookup::last_error(dwErr)); 210 } 211 211 } 212 212 } -
include/EnumNtSrv.h
r34e7428 rbb8b6d1 47 47 } 48 48 }; 49 #define MY_SERVICE_NOT_FOUND 0xffff0000 49 50 50 51 class TNtServiceInfo { -
include/checkHelpers.hpp
r7221dc8 rbb8b6d1 298 298 299 299 typedef unsigned long state_type; 300 const int state_none = 0x00; 301 const int state_started = 0x01; 302 const int state_stopped = 0x02; 300 const int state_none = 0x00; 301 const int state_started = 0x01; 302 const int state_stopped = 0x02; 303 const int state_not_found = 0x06; 303 304 304 305 class state_handler { … … 314 315 else if (*it == _T("ignored")) 315 316 ret |= state_none; 317 else if (*it == _T("not found")) 318 ret |= state_not_found; 316 319 } 317 320 return ret; … … 324 327 else if (value == state_none) 325 328 return _T("none"); 329 else if (value == state_not_found) 330 return _T("not found"); 326 331 return _T("unknown"); 327 332 } -
include/config.h
r371df23 rbb8b6d1 26 26 27 27 // Version 28 //#define SZBETATAG _T(" ")29 #define SZBETATAG _T(" RC ")28 #define SZBETATAG _T(" ") 29 //#define SZBETATAG _T(" RC ") 30 30 //#define SZBETATAG _T(" BETA ") 31 31 #define SZVERSION STRPRODUCTVER SZBETATAG STRPRODUCTDATE
Note: See TracChangeset
for help on using the changeset viewer.








