_UpdateServiceStatus(SERVICE_START_PENDING, 0);
// Create a thread for serving RPC requests
- hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)RpcThreadProc, NULL, 0, NULL);
-
- if (hThread)
+ hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)LrpcThreadProc, NULL, 0, NULL);
+ if (!hThread)
{
- // We don't need the thread handle. Keeping it open blocks the thread from terminating.
- CloseHandle(hThread);
- _UpdateServiceStatus(SERVICE_RUNNING, 0);
+ ERR("CreateThread failed with error %u!\n", GetLastError());
+ _UpdateServiceStatus(SERVICE_STOPPED, 0);
+ return;
}
- else
+
+ // We don't need the thread handle. Keeping it open blocks the thread from terminating.
+ CloseHandle(hThread);
+
+ // Initialize the routing layer in spoolss.dll
+ if (!InitializeRouter(hServiceStatus))
{
- ERR("CreateThread failed with error %u!\n", GetLastError());
+ ERR("InitializeRouter failed with error %lu!\n", GetLastError());
_UpdateServiceStatus(SERVICE_STOPPED, 0);
+ return;
}
+
+ // We're alive!
+ _UpdateServiceStatus(SERVICE_RUNNING, 0);
}
int