Author: hbelusca
Date: Mon Aug 12 16:12:58 2013
New Revision: 59711
URL:
http://svn.reactos.org/svn/reactos?rev=59711&view=rev
Log:
[KERNEL32][CONSRV]
Half-plement SetConsolePalette.
Modified:
trunk/reactos/dll/win32/kernel32/client/console/console.c
trunk/reactos/win32ss/user/winsrv/consrv/api.h
trunk/reactos/win32ss/user/winsrv/consrv/condrv/conoutput.c
trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c
trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c
trunk/reactos/win32ss/user/winsrv/consrv/init.c
Modified: trunk/reactos/dll/win32/kernel32/client/console/console.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/console/console.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/console/console.c [iso-8859-1] Mon Aug 12
16:12:58 2013
@@ -711,7 +711,7 @@
/*
- * @unimplemented (Undocumented)
+ * @implemented (Undocumented)
* @note See
http://comments.gmane.org/gmane.comp.lang.harbour.devel/27844
* Usage example:
https://github.com/harbour/core/commit/d79a1b7b812cbde6ddf718ebfd6939a24f63…
*/
@@ -721,9 +721,24 @@
HPALETTE hPalette,
UINT dwUsage)
{
- DPRINT1("SetConsolePalette(0x%x, 0x%x, %d) UNIMPLEMENTED!\n",
hConsoleOutput, hPalette, dwUsage);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- // Return TRUE so that we don't fail when being used by NTVDM even if not
implemented.
+ NTSTATUS Status;
+ CONSOLE_API_MESSAGE ApiMessage;
+ PCONSOLE_SETPALETTE SetPaletteRequest = &ApiMessage.Data.SetPaletteRequest;
+
+ SetPaletteRequest->OutputHandle = hConsoleOutput;
+ SetPaletteRequest->PaletteHandle = hPalette;
+ SetPaletteRequest->Usage = dwUsage;
+
+ Status = CsrClientCallServer((PCSR_API_MESSAGE)&ApiMessage,
+ NULL,
+ CSR_CREATE_API_NUMBER(CONSRV_SERVERDLL_INDEX,
ConsolepSetPalette),
+ sizeof(CONSOLE_SETPALETTE));
+ if (!NT_SUCCESS(Status))
+ {
+ BaseSetLastNTError(Status);
+ return FALSE;
+ }
+
return TRUE;
}
Modified: trunk/reactos/win32ss/user/winsrv/consrv/api.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/api.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/api.h [iso-8859-1] Mon Aug 12 16:12:58 2013
@@ -25,6 +25,7 @@
/* conoutput.c */
CSR_API(SrvInvalidateBitMapRect);
+CSR_API(SrvSetConsolePalette);
CSR_API(SrvReadConsoleOutput);
CSR_API(SrvWriteConsole);
CSR_API(SrvWriteConsoleOutput);
Modified: trunk/reactos/win32ss/user/winsrv/consrv/condrv/conoutput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/condrv/conoutput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/condrv/conoutput.c [iso-8859-1] Mon Aug 12
16:12:58 2013
@@ -204,6 +204,16 @@
}
NTSTATUS NTAPI
+ConDrvSetConsolePalette(IN PCONSOLE Console,
+ IN PGRAPHICS_SCREEN_BUFFER Buffer,
+ IN HPALETTE PaletteHandle,
+ IN UINT Usage)
+{
+ DPRINT1("ConDrvSetConsolePalette is UNIMPLEMENTED but returns
STATUS_SUCCESS\n");
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS NTAPI
ConDrvGetConsoleCursorInfo(IN PCONSOLE Console,
IN PTEXTMODE_SCREEN_BUFFER Buffer,
OUT PCONSOLE_CURSOR_INFO CursorInfo)
Modified: trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/conoutput.c [iso-8859-1] Mon Aug 12 16:12:58
2013
@@ -45,6 +45,36 @@
Status = ConDrvInvalidateBitMapRect(Buffer->Header.Console,
Buffer,
&InvalidateDIBitsRequest->Region);
+
+ ConSrvReleaseScreenBuffer(Buffer, TRUE);
+ return Status;
+}
+
+NTSTATUS NTAPI
+ConDrvSetConsolePalette(IN PCONSOLE Console,
+ IN PGRAPHICS_SCREEN_BUFFER Buffer,
+ IN HPALETTE PaletteHandle,
+ IN UINT Usage);
+CSR_API(SrvSetConsolePalette)
+{
+ NTSTATUS Status;
+ PCONSOLE_SETPALETTE SetPaletteRequest =
&((PCONSOLE_API_MESSAGE)ApiMessage)->Data.SetPaletteRequest;
+ // PCONSOLE_SCREEN_BUFFER Buffer;
+ PGRAPHICS_SCREEN_BUFFER Buffer;
+
+ DPRINT("SrvSetConsolePalette\n");
+
+ // NOTE: Tests show that this function is used only for graphics screen buffers
+ // and otherwise it returns false + sets last error to invalid handle.
+ Status =
ConSrvGetGraphicsBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
+ SetPaletteRequest->OutputHandle,
+ &Buffer, GENERIC_WRITE, TRUE);
+ if (!NT_SUCCESS(Status)) return Status;
+
+ Status = ConDrvSetConsolePalette(Buffer->Header.Console,
+ Buffer,
+ SetPaletteRequest->PaletteHandle,
+ SetPaletteRequest->Usage);
ConSrvReleaseScreenBuffer(Buffer, TRUE);
return Status;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontendctl.c [iso-8859-1] Mon Aug 12
16:12:58 2013
@@ -220,7 +220,7 @@
PCONSOLE_SCREEN_BUFFER Buff;
// FIXME: Tests show that this function is used only for graphics screen buffers
- // and otherwise it returns false + set last error to invalid handle.
+ // and otherwise it returns false + sets last error to invalid handle.
// NOTE: I find that behaviour is ridiculous but ok, let's accept that at the
moment...
Status =
ConSrvGetGraphicsBuffer(ConsoleGetPerProcessData(CsrGetClientThread()->Process),
SetCursorRequest->OutputHandle,
Modified: trunk/reactos/win32ss/user/winsrv/consrv/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/init.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/init.c [iso-8859-1] Mon Aug 12 16:12:58 2013
@@ -75,7 +75,7 @@
SrvSetConsoleCursor,
SrvShowConsoleCursor,
SrvConsoleMenuControl,
- // SrvSetConsolePalette,
+ SrvSetConsolePalette,
SrvSetConsoleDisplayMode,
// SrvRegisterConsoleVDM,
SrvGetConsoleHardwareState,
@@ -166,7 +166,7 @@
FALSE, // SrvSetConsoleCursor,
FALSE, // SrvShowConsoleCursor,
FALSE, // SrvConsoleMenuControl,
- // FALSE, // SrvSetConsolePalette,
+ FALSE, // SrvSetConsolePalette,
FALSE, // SrvSetConsoleDisplayMode,
// FALSE, // SrvRegisterConsoleVDM,
FALSE, // SrvGetConsoleHardwareState,
@@ -257,7 +257,7 @@
"SetConsoleCursor",
"ShowConsoleCursor",
"ConsoleMenuControl",
- // "SetConsolePalette",
+ "SetConsolePalette",
"SetConsoleDisplayMode",
// "RegisterConsoleVDM",
"GetConsoleHardwareState",