| Previous | Next |
| ERROR_BAD_DLL_ENTRYPOINT | ERROR_IP_ADDRESS_CONFLICT1 |
ERROR_BAD_SERVICE_ENTRYPOINT
The service entry point does not match the SCM callback contract
A Win32 service process connects to the Service Control Manager through StartServiceCtrlDispatcher and supplies a dispatch table containing service names and ServiceMain callback pointers. The ServiceMain callback has a defined signature and is called by the service control dispatcher on a newly created thread. A bad callback declaration can leave the stack in an inconsistent state when the dispatcher returns from the function.
This is a service-binary defect, not a service-account or dependency failure. Compare the actual function declaration with LPSERVICE_MAIN_FUNCTION and the compiler ABI in use. In C or C++, avoid casting an arbitrary function pointer merely to satisfy SERVICE_TABLE_ENTRY; a cast can hide a mismatched parameter list or calling convention. Also verify that the dispatch table points to the intended function in the loaded module and that an old binary was not left behind during deployment.
What to inspect
- Compare ServiceMain parameters and calling convention with the winsvc.h callback type.
- Remove function-pointer casts that hide a signature mismatch.
- Verify the deployed executable and dispatch table correspond to the same build.
References
- Microsoft: LPSERVICE_MAIN_FUNCTION
- Microsoft: StartServiceCtrlDispatcherW
- Microsoft: Database of Installed Services
Looking for a different code? Search another status or error code.
