| 70 | } |
| 71 | |
| 72 | int __cdecl _tmain(int argc, TCHAR* argv[]) |
| 73 | { |
| 74 | const SERVICE_TABLE_ENTRY dispatchTable[] = { |
| 75 | {serviceName, static_cast<LPSERVICE_MAIN_FUNCTION>(ServiceMainCallback)}, |
| 76 | {NULL, NULL} |
| 77 | }; |
| 78 | |
| 79 | if (!StartServiceCtrlDispatcher(dispatchTable)) { |
| 80 | // if registration fails with ERROR_FAILED_SERVICE_CONTROLLER_CONNECT |
| 81 | // this usually means we're running as console application |
| 82 | if (GetLastError() == ERROR_FAILED_SERVICE_CONTROLLER_CONNECT) { |
| 83 | return CommonEntry(argc, argv, true); |
| 84 | } |
| 85 | return -1; |
| 86 | } |
| 87 | |
| 88 | return 0; |
| 89 | } |
nothing calls this directly
no test coverage detected