mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 00:50:23 +00:00
[WINSRV] ConSrvConnect: Always store the control dispatcher routine
This shouldn't be used only for console applications but can potentially be used by any application to receive shutdown notifications. MSDN provides more information in the documentation for SetConsoleCtrlHandler. Our services.exe also expect to receive shutdown notifications in this way.
This commit is contained in:
parent
cb2dcc0a2f
commit
b3399c68e9
1 changed files with 4 additions and 2 deletions
|
@ -428,6 +428,9 @@ ConSrvConnect(IN PCSR_PROCESS CsrProcess,
|
|||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
|
||||
/* Set Control-Dispatcher handler */
|
||||
ProcessData->CtrlRoutine = ConnectInfo->CtrlRoutine;
|
||||
|
||||
/* If we don't need a console, then get out of here */
|
||||
DPRINT("ConnectInfo->IsConsoleApp = %s\n", ConnectInfo->IsConsoleApp ? "True" : "False");
|
||||
if (!ConnectInfo->IsConsoleApp) return STATUS_SUCCESS;
|
||||
|
@ -525,9 +528,8 @@ ConSrvConnect(IN PCSR_PROCESS CsrProcess,
|
|||
}
|
||||
}
|
||||
|
||||
/* Set the Property-Dialog and Control-Dispatcher handlers */
|
||||
/* Set the Property-Dialog handler */
|
||||
ProcessData->PropRoutine = ConnectInfo->PropRoutine;
|
||||
ProcessData->CtrlRoutine = ConnectInfo->CtrlRoutine;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue