DPRINT("GuiConsoleShowConsoleProperties entered\n");
+ if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return;
+
/*
* Create a memory section to share with the applet, and map it.
*/
if (!NT_SUCCESS(Status))
{
DPRINT1("Error: Impossible to create a shared section ; Status = %lu\n", Status);
- return;
+ goto Quit;
}
Status = NtMapViewOfSection(hSection,
if (!NT_SUCCESS(Status))
{
DPRINT1("Error: Impossible to map the shared section ; Status = %lu\n", Status);
- NtClose(hSection);
- return;
+ goto Quit;
}
Quit:
/* We have finished, close the section handle */
- NtClose(hSection);
+ if (hSection) NtClose(hSection);
+
+ LeaveCriticalSection(&Console->Lock);
return;
}
-NTSTATUS
+VOID
GuiApplyUserSettings(PGUI_CONSOLE_DATA GuiData,
HANDLE hClientSection,
BOOL SaveSettings)
PTERMINAL_INFO TermInfo = NULL;
PGUI_CONSOLE_INFO GuiInfo = NULL;
+ if (!ConDrvValidateConsoleUnsafe(Console, CONSOLE_RUNNING, TRUE)) return;
+
/* Get the console leader process, our client */
ProcessData = ConDrvGetConsoleLeaderProcess(Console);
if (!NT_SUCCESS(Status))
{
DPRINT1("Error when mapping client handle, Status = %lu\n", Status);
- return Status;
+ goto Quit;
}
/* Get a view of the shared section */
if (!NT_SUCCESS(Status))
{
DPRINT1("Error when mapping view of file, Status = %lu\n", Status);
- NtClose(hSection);
- return Status;
+ goto Quit;
}
_SEH2_TRY
Quit:
/* Finally, close the section and return */
- NtUnmapViewOfSection(NtCurrentProcess(), pConInfo);
- NtClose(hSection);
- return Status;
+ if (hSection)
+ {
+ NtUnmapViewOfSection(NtCurrentProcess(), pConInfo);
+ NtClose(hSection);
+ }
+
+ LeaveCriticalSection(&Console->Lock);
+ return;
}
/* EOF */