mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
It doesn't hurt to try to start Blue service before accessing it
svn path=/trunk/; revision=40990
This commit is contained in:
@@ -31,6 +31,35 @@ TuiConsoleWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
return DefWindowProcW(hWnd, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
static BOOL FASTCALL
|
||||
TuiStartService(LPCWSTR lpServiceName)
|
||||
{
|
||||
SC_HANDLE hSCManager = NULL;
|
||||
SC_HANDLE hService = NULL;
|
||||
BOOL ret = FALSE;
|
||||
|
||||
hSCManager = OpenSCManagerW(NULL, NULL, 0);
|
||||
if (hSCManager == NULL)
|
||||
goto cleanup;
|
||||
|
||||
hService = OpenServiceW(hSCManager, lpServiceName, SERVICE_START);
|
||||
if (hService == NULL)
|
||||
goto cleanup;
|
||||
|
||||
ret = StartServiceW(hService, 0, NULL);
|
||||
if (!ret)
|
||||
goto cleanup;
|
||||
|
||||
ret = TRUE;
|
||||
|
||||
cleanup:
|
||||
if (hSCManager != NULL)
|
||||
CloseServiceHandle(hSCManager);
|
||||
if (hService != NULL)
|
||||
CloseServiceHandle(hService);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static BOOL FASTCALL
|
||||
TuiInit(DWORD OemCP)
|
||||
{
|
||||
@@ -38,6 +67,8 @@ TuiInit(DWORD OemCP)
|
||||
DWORD BytesReturned;
|
||||
WNDCLASSEXW wc;
|
||||
|
||||
TuiStartService(L"Blue");
|
||||
|
||||
ConsoleDeviceHandle = CreateFileW(L"\\\\.\\BlueScreen", FILE_ALL_ACCESS, 0, NULL,
|
||||
OPEN_EXISTING, 0, NULL);
|
||||
if (INVALID_HANDLE_VALUE == ConsoleDeviceHandle)
|
||||
|
||||
Reference in New Issue
Block a user