Author: jimtabor
Date: Thu Aug 6 00:56:01 2015
New Revision: 68603
URL:
http://svn.reactos.org/svn/reactos?rev=68603&view=rev
Log:
[Win32SS]
- Implement OEM bitmaps sizes for server information. If more is need, it will be added.
This will be plugged in later.
Modified:
trunk/reactos/win32ss/include/callback.h
trunk/reactos/win32ss/include/ntuser.h
trunk/reactos/win32ss/user/ntuser/callback.c
trunk/reactos/win32ss/user/ntuser/callback.h
trunk/reactos/win32ss/user/user32/misc/dllmain.c
Modified: trunk/reactos/win32ss/include/callback.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/callback.h…
==============================================================================
--- trunk/reactos/win32ss/include/callback.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/include/callback.h [iso-8859-1] Thu Aug 6 00:56:01 2015
@@ -16,7 +16,8 @@
#define USER32_CALLBACK_DELIVERUSERAPC (12)
#define USER32_CALLBACK_DDEPOST (13)
#define USER32_CALLBACK_DDEGET (14)
-#define USER32_CALLBACK_MAXIMUM (14)
+#define USER32_CALLBACK_SETOBM (15)
+#define USER32_CALLBACK_MAXIMUM (15)
typedef struct _WINDOWPROC_CALLBACK_ARGUMENTS
{
@@ -133,6 +134,11 @@
BYTE buffer[1];
} DDEPOSTGET_CALLBACK_ARGUMENTS, *PDDEPOSTGET_CALLBACK_ARGUMENTS;
+typedef struct _SETOBM_CALLBACK_ARGUMENTS
+{
+ struct tagOEMBITMAPINFO oembmi[93];
+} SETOBM_CALLBACK_ARGUMENTS, *PSETOBM_CALLBACK_ARGUMENTS;
+
NTSTATUS WINAPI
User32CallCopyImageFromKernel(PVOID Arguments, ULONG ArgumentLength);
NTSTATUS WINAPI
@@ -163,4 +169,6 @@
User32CallDDEPostFromKernel(PVOID Arguments, ULONG ArgumentLength);
NTSTATUS WINAPI
User32CallDDEGetFromKernel(PVOID Arguments, ULONG ArgumentLength);
+NTSTATUS WINAPI
+User32CallOBMFromKernel(PVOID Arguments, ULONG ArgumentLength);
#endif /* __INCLUDE_USER32_CALLBACK_H */
Modified: trunk/reactos/win32ss/include/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/include/ntuser.h?r…
==============================================================================
--- trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/include/ntuser.h [iso-8859-1] Thu Aug 6 00:56:01 2015
@@ -902,6 +902,17 @@
INT cy;
} OEMBITMAPINFO, *POEMBITMAPINFO;
+typedef enum _OBI_TYPES
+{
+ OBI_CLOSE = 0,
+ OBI_UPARROW = 46,
+ OBI_UPARROWI = 49,
+ OBI_DNARROW = 50,
+ OBI_DNARROWI = 53,
+ OBI_MNARROW = 62,
+ OBI_CTYPES = 93
+} OBI_TYPES;
+
typedef struct tagMBSTRING
{
WCHAR szName[16];
@@ -953,7 +964,7 @@
DWORD dwKeyCache;
DWORD dwAsyncKeyCache;
ULONG cCaptures;
- OEMBITMAPINFO oembmi[93];
+ OEMBITMAPINFO oembmi[OBI_CTYPES];
RECT rcScreenReal;
USHORT BitCount;
USHORT dmLogPixels;
Modified: trunk/reactos/win32ss/user/ntuser/callback.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/callba…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/callback.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/callback.c [iso-8859-1] Thu Aug 6 00:56:01 2015
@@ -1148,4 +1148,49 @@
ERR("Delivering User APC callback failed!\n");
}
}
+
+VOID FASTCALL
+co_IntSetupOBM(VOID)
+{
+ NTSTATUS Status;
+ ULONG ArgumentLength, ResultLength;
+ PVOID Argument, ResultPointer;
+ PSETOBM_CALLBACK_ARGUMENTS Common;
+
+ ResultPointer = NULL;
+ ResultLength = ArgumentLength = sizeof(SETOBM_CALLBACK_ARGUMENTS);
+
+ Argument = IntCbAllocateMemory(ArgumentLength);
+ if (NULL == Argument)
+ {
+ ERR("Set Window Icons callback failed: out of memory\n");
+ return;
+ }
+ Common = (PSETOBM_CALLBACK_ARGUMENTS) Argument;
+
+ UserLeaveCo();
+
+ Status = KeUserModeCallback(USER32_CALLBACK_SETOBM,
+ Argument,
+ ArgumentLength,
+ &ResultPointer,
+ &ResultLength);
+
+
+ UserEnterCo();
+
+ if (!NT_SUCCESS(Status))
+ {
+ ERR("Set Window Icons callback failed!\n");
+ IntCbFreeMemory(Argument);
+ return;
+ }
+
+ RtlMoveMemory(Common, ResultPointer, ArgumentLength);
+ RtlCopyMemory(gpsi->oembmi, Common->oembmi, sizeof(gpsi->oembmi));
+
+ IntCbFreeMemory(Argument);
+}
+
+
/* EOF */
Modified: trunk/reactos/win32ss/user/ntuser/callback.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/callba…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/callback.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/callback.h [iso-8859-1] Thu Aug 6 00:56:01 2015
@@ -74,3 +74,4 @@
BOOL FASTCALL co_IntSetWndIcons(VOID);
VOID FASTCALL co_IntDeliverUserAPC(VOID);
+VOID FASTCALL co_IntSetupOBM(VOID);
Modified: trunk/reactos/win32ss/user/user32/misc/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/misc/d…
==============================================================================
--- trunk/reactos/win32ss/user/user32/misc/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/misc/dllmain.c [iso-8859-1] Thu Aug 6 00:56:01
2015
@@ -205,6 +205,7 @@
User32DeliverUserAPC,
User32CallDDEPostFromKernel,
User32CallDDEGetFromKernel,
+ User32CallOBMFromKernel,
};
@@ -602,3 +603,37 @@
{
return ZwCallbackReturn(0, 0, STATUS_SUCCESS);
}
+
+NTSTATUS
+WINAPI
+User32CallOBMFromKernel(PVOID Arguments, ULONG ArgumentLength)
+{
+ BITMAP bmp;
+ PSETOBM_CALLBACK_ARGUMENTS Common = Arguments;
+
+ GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_CLOSE)), sizeof(bmp), &bmp);
+ Common->oembmi[OBI_CLOSE].cx = bmp.bmWidth;
+ Common->oembmi[OBI_CLOSE].cy = bmp.bmHeight;
+
+ GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_MNARROW)), sizeof(bmp), &bmp);
+ Common->oembmi[OBI_MNARROW].cx = bmp.bmWidth;
+ Common->oembmi[OBI_MNARROW].cy = bmp.bmHeight;
+
+ GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_DNARROW)), sizeof(bmp), &bmp);
+ Common->oembmi[OBI_DNARROW].cx = bmp.bmWidth;
+ Common->oembmi[OBI_DNARROW].cy = bmp.bmHeight;
+
+ GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_DNARROWI)), sizeof(bmp), &bmp);
+ Common->oembmi[OBI_DNARROWI].cx = bmp.bmWidth;
+ Common->oembmi[OBI_DNARROWI].cy = bmp.bmHeight;
+
+ GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_UPARROW)), sizeof(bmp), &bmp);
+ Common->oembmi[OBI_UPARROW].cx = bmp.bmWidth;
+ Common->oembmi[OBI_UPARROW].cy = bmp.bmHeight;
+
+ GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_UPARROWI)), sizeof(bmp), &bmp);
+ Common->oembmi[OBI_UPARROWI].cx = bmp.bmWidth;
+ Common->oembmi[OBI_UPARROWI].cy = bmp.bmHeight;
+
+ return ZwCallbackReturn(Arguments, ArgumentLength, STATUS_SUCCESS);
+}