6 modified files
reactos/include/csrss
diff -u -r1.41 -r1.42
--- csrss.h 6 Jan 2004 16:03:41 -0000 1.41
+++ csrss.h 14 Mar 2004 17:53:26 -0000 1.42
@@ -499,6 +499,12 @@
typedef struct
{
+ HANDLE ConsoleHandle;
+ HICON WindowIcon;
+} CSRSS_CONSOLE_SET_WINDOW_ICON, *PCSRSS_CONSOLE_SET_WINDOW_ICON;
+
+typedef struct
+{
WCHAR DesktopName[1];
} CSRSS_CREATE_DESKTOP_REQUEST, *PCSRSS_CREATE_DESKTOP_REQUEST;
@@ -590,6 +596,7 @@
#define CSRSS_CREATE_DESKTOP (0x2B)
#define CSRSS_SHOW_DESKTOP (0x2C)
#define CSRSS_HIDE_DESKTOP (0x2D)
+#define CSRSS_SET_CONSOLE_ICON (0x2E)
/* Keep in sync with definition below. */
#define CSRSS_REQUEST_HEADER_SIZE (sizeof(LPC_MESSAGE) + sizeof(ULONG))
@@ -643,6 +650,7 @@
CSRSS_CREATE_DESKTOP_REQUEST CreateDesktopRequest;
CSRSS_SHOW_DESKTOP_REQUEST ShowDesktopRequest;
CSRSS_HIDE_DESKTOP_REQUEST HideDesktopRequest;
+ CSRSS_CONSOLE_SET_WINDOW_ICON ConsoleSetWindowIconRequest;
} Data;
} CSRSS_API_REQUEST, *PCSRSS_API_REQUEST;
@@ -682,6 +690,7 @@
CSRSS_CREATE_DESKTOP_REPLY CreateDesktopReply;
CSRSS_SHOW_DESKTOP_REPLY ShowDesktopReply;
CSRSS_HIDE_DESKTOP_REPLY HideDesktopReply;
+ CSRSS_CONSOLE_SET_WINDOW_ICON ConsoleSetWindowIconReply;
} Data;
} CSRSS_API_REPLY, *PCSRSS_API_REPLY;
reactos/lib/kernel32/misc
diff -u -r1.73 -r1.74
--- console.c 23 Jan 2004 21:16:03 -0000 1.73
+++ console.c 14 Mar 2004 17:53:26 -0000 1.74
@@ -1,4 +1,4 @@
-/* $Id: console.c,v 1.73 2004/01/23 21:16:03 ekohl Exp $
+/* $Id: console.c,v 1.74 2004/03/14 17:53:26 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -3169,7 +3169,7 @@
}
/*--------------------------------------------------------------
- * GetConsoleWindow/0
+ * GetConsoleWindow
*
* @implemented
*/
@@ -3196,4 +3196,32 @@
return Reply.Data.ConsoleWindowReply.WindowHandle;
}
+
+/*--------------------------------------------------------------
+ * GetConsoleWindow
+ * @implemented
+ */
+BOOL STDCALL SetConsoleIcon(HICON hicon)
+{
+ CSRSS_API_REQUEST Request;
+ CSRSS_API_REPLY Reply;
+ NTSTATUS Status;
+
+ Request.Data.ConsoleSetWindowIconRequest.ConsoleHandle =
+ OpenConsoleW (L"CONOUT$", (GENERIC_READ|GENERIC_WRITE), FALSE, OPEN_EXISTING);
+ if (INVALID_HANDLE_VALUE == Request.Data.ConsoleSetWindowIconRequest.ConsoleHandle)
+ {
+ return FALSE;
+ }
+ Request.Type = CSRSS_SET_CONSOLE_ICON;
+ Request.Data.ConsoleSetWindowIconRequest.WindowIcon = hicon;
+ Status = CsrClientCallServer( &Request, &Reply, sizeof( CSRSS_API_REQUEST ), sizeof( CSRSS_API_REPLY ) );
+ if (!NT_SUCCESS(Status) || !NT_SUCCESS(Status = Reply.Status))
+ {
+ SetLastErrorByStatus (Status);
+ return FALSE;
+ }
+ return NT_SUCCESS(Status);
+}
+
/* EOF */
reactos/lib/kernel32/misc
diff -u -r1.66 -r1.67
--- stubs.c 14 Mar 2004 13:20:10 -0000 1.66
+++ stubs.c 14 Mar 2004 17:53:26 -0000 1.67
@@ -1,4 +1,4 @@
-/* $Id: stubs.c,v 1.66 2004/03/14 13:20:10 weiden Exp $
+/* $Id: stubs.c,v 1.67 2004/03/14 17:53:26 weiden Exp $
*
* KERNEL32.DLL stubs (unimplemented functions)
* Remove from this file, if you implement them.
@@ -2391,15 +2391,6 @@
/*
* @unimplemented
*/
-BOOL STDCALL SetConsoleIcon(HICON hicon)
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 0;
-}
-
-/*
- * @unimplemented
- */
DWORD STDCALL GetHandleContext(HANDLE hnd)
{
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
reactos/subsys/csrss/include
diff -u -r1.2 -r1.3
--- conio.h 11 Jan 2004 17:31:15 -0000 1.2
+++ conio.h 14 Mar 2004 17:53:27 -0000 1.3
@@ -1,4 +1,4 @@
-/* $Id: conio.h,v 1.2 2004/01/11 17:31:15 gvg Exp $
+/* $Id: conio.h,v 1.3 2004/03/14 17:53:27 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -58,6 +58,7 @@
UINT OldCursorX, UINT OldCursorY);
BOOL (STDCALL *ChangeTitle)(PCSRSS_CONSOLE Console);
VOID (STDCALL *CleanupConsole)(PCSRSS_CONSOLE Console);
+ BOOL (STDCALL *ChangeIcon)(PCSRSS_CONSOLE Console);
} CSRSS_CONSOLE_VTBL, *PCSRSS_CONSOLE_VTBL;
typedef struct tagCSRSS_CONSOLE
@@ -80,6 +81,7 @@
BOOL EarlyReturn; /* wake client and return data, even if we are in line buffered mode, and we don't have a complete line */
DWORD HardwareState; /* _GDI_MANAGED, _DIRECT */
HWND hWindow;
+ HICON hWindowIcon;
COORD Size;
PVOID PrivateData;
PCSRSS_CONSOLE_VTBL Vtbl;
@@ -129,6 +131,7 @@
CSR_API(CsrWriteConsoleInput);
CSR_API(CsrHardwareStateProperty);
CSR_API(CsrGetConsoleWindow);
+CSR_API(CsrSetConsoleIcon);
#define ConioInitScreenBuffer(Console, Buff) (Console)->Vtbl->InitScreenBuffer((Console), (Buff))
#define ConioDrawRegion(Console, Region) (Console)->Vtbl->DrawRegion((Console), (Region))
@@ -154,6 +157,7 @@
Win32CsrLockObject((ProcessData), (Handle), (Object_t **)(Ptr), CONIO_SCREEN_BUFFER_MAGIC)
#define ConioUnlockScreenBuffer(Buff) \
Win32CsrUnlockObject((Object_t *) Buff)
+#define ConioChangeIcon(Console) (Console)->Vtbl->ChangeIcon(Console)
#endif /* CONIO_H_INCLUDED */
reactos/subsys/csrss/win32csr
diff -u -r1.8 -r1.9
--- conio.c 7 Mar 2004 20:03:43 -0000 1.8
+++ conio.c 14 Mar 2004 17:53:27 -0000 1.9
@@ -1,4 +1,4 @@
-/* $Id: conio.c,v 1.8 2004/03/07 20:03:43 hbirr Exp $
+/* $Id: conio.c,v 1.9 2004/03/14 17:53:27 weiden Exp $
*
* reactos/subsys/csrss/win32csr/conio.c
*
@@ -2873,4 +2873,31 @@
return Reply->Status = STATUS_SUCCESS;
}
+CSR_API(CsrSetConsoleIcon)
+{
+ PCSRSS_CONSOLE Console;
+ NTSTATUS Status;
+
+ DPRINT("CsrSetConsoleIcon\n");
+
+ Reply->Header.MessageSize = sizeof(CSRSS_API_REPLY);
+ Reply->Header.DataSize = sizeof(CSRSS_API_REPLY) - sizeof(LPC_MESSAGE);
+
+ Status = ConioLockConsole(ProcessData,
+ Request->Data.ConsoleSetWindowIconRequest.ConsoleHandle,
+ &Console);
+ if (! NT_SUCCESS(Status))
+ {
+ return Reply->Status = Status;
+ }
+
+ Console->hWindowIcon = Request->Data.ConsoleSetWindowIconRequest.WindowIcon;
+ Reply->Status = (ConioChangeIcon(Console) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
+ Reply->Data.ConsoleSetWindowIconReply.WindowIcon = Console->hWindow;
+
+ ConioUnlockConsole(Console);
+
+ return Reply->Status;
+}
+
/* EOF */
reactos/subsys/csrss/win32csr
diff -u -r1.11 -r1.12
--- guiconsole.c 7 Mar 2004 21:00:11 -0000 1.11
+++ guiconsole.c 14 Mar 2004 17:53:27 -0000 1.12
@@ -1,4 +1,4 @@
-/* $Id: guiconsole.c,v 1.11 2004/03/07 21:00:11 hbirr Exp $
+/* $Id: guiconsole.c,v 1.12 2004/03/14 17:53:27 weiden Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -717,6 +717,15 @@
return TRUE;
}
+STATIC BOOL STDCALL
+GuiChangeIcon(PCSRSS_CONSOLE Console)
+{
+ SendMessageW(Console->hWindow, WM_SETICON, ICON_BIG, (LPARAM)Console->hWindowIcon);
+ SendMessageW(Console->hWindow, WM_SETICON, ICON_SMALL, (LPARAM)Console->hWindowIcon);
+
+ return TRUE;
+}
+
static VOID STDCALL
GuiCleanupConsole(PCSRSS_CONSOLE Console)
{
@@ -731,7 +740,8 @@
GuiSetCursorInfo,
GuiSetScreenInfo,
GuiChangeTitle,
- GuiCleanupConsole
+ GuiCleanupConsole,
+ GuiChangeIcon
};
NTSTATUS FASTCALL
CVSspam 0.2.8