mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +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:
parent
8d364d4574
commit
65ed2a4587
1 changed files with 31 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue