https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bc534efbc5bd7417e24b6…
commit bc534efbc5bd7417e24b6e642b3438c5e47a0131
Author: jimtabor <james.tabor(a)reactos.org>
AuthorDate: Wed Mar 13 12:16:52 2019 -0500
Commit: jimtabor <james.tabor(a)reactos.org>
CommitDate: Wed Mar 13 12:16:52 2019 -0500
[User32] Support WM_COPYGLOBALDATA
Implement support for WM_COPYGLOBALDATA. Needs more tests.
Tested DropTest from CORE-15836.
---
win32ss/user/user32/windows/defwnd.c | 6 ++++++
win32ss/user/user32/windows/message.c | 31 ++++++++++++++++++++++++++++++-
2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/win32ss/user/user32/windows/defwnd.c b/win32ss/user/user32/windows/defwnd.c
index ad2bbbbe5d5..baa31e7af0a 100644
--- a/win32ss/user/user32/windows/defwnd.c
+++ b/win32ss/user/user32/windows/defwnd.c
@@ -748,6 +748,12 @@ User32DefWindowProc(HWND hWnd,
break;
}
+ case WM_COPYGLOBALDATA:
+ {
+ TRACE("WM_COPYGLOBALDATA hGlobal %p Size %d Flags
0x%x\n",lParam,wParam,GlobalFlags((HGLOBAL)lParam));
+ return lParam;
+ }
+
/* Move to Win32k !*/
case WM_SHOWWINDOW:
if (!lParam) break; // Call when it is necessary.
diff --git a/win32ss/user/user32/windows/message.c
b/win32ss/user/user32/windows/message.c
index 57f15d85b3f..a96b799456c 100644
--- a/win32ss/user/user32/windows/message.c
+++ b/win32ss/user/user32/windows/message.c
@@ -392,6 +392,13 @@ MsgiUMToKMMessage(PMSG UMMsg, PMSG KMMsg, BOOL Posted)
}
break;
+ case WM_COPYGLOBALDATA:
+ {
+ KMMsg->lParam = (LPARAM)GlobalLock((HGLOBAL)UMMsg->lParam);;
+ TRACE("WM_COPYGLOBALDATA get data ptr %p\n",KMMsg->lParam);
+ }
+ break;
+
default:
break;
}
@@ -408,6 +415,11 @@ MsgiUMToKMCleanup(PMSG UMMsg, PMSG KMMsg)
case WM_COPYDATA:
HeapFree(GetProcessHeap(), 0, (LPVOID) KMMsg->lParam);
break;
+ case WM_COPYGLOBALDATA:
+ TRACE("WM_COPYGLOBALDATA cleanup return\n");
+ GlobalUnlock((HGLOBAL)UMMsg->lParam);
+ GlobalFree((HGLOBAL)UMMsg->lParam);
+ break;
default:
break;
}
@@ -452,6 +464,18 @@ MsgiKMToUMMessage(PMSG KMMsg, PMSG UMMsg)
}
break;
+ case WM_COPYGLOBALDATA:
+ {
+ PVOID Data;
+ HGLOBAL hGlobal = GlobalAlloc(GHND | GMEM_SHARE, KMMsg->wParam);
+ Data = GlobalLock(hGlobal);
+ if (Data) RtlCopyMemory(Data, (PVOID)KMMsg->lParam, KMMsg->wParam);
+ GlobalUnlock(hGlobal);
+ TRACE("WM_COPYGLOBALDATA to User hGlobal %p\n",hGlobal);
+ UMMsg->lParam = (LPARAM)hGlobal;
+ }
+ break;
+
default:
break;
}
@@ -465,7 +489,7 @@ MsgiKMToUMCleanup(PMSG KMMsg, PMSG UMMsg)
switch (KMMsg->message)
{
case WM_DDE_EXECUTE:
-#ifdef TODO
+#ifdef TODO // Kept as historic.
HeapFree(GetProcessHeap(), 0, (LPVOID) KMMsg->lParam);
GlobalUnlock((HGLOBAL) UMMsg->lParam);
#endif
@@ -2935,6 +2959,11 @@ User32CallWindowProcFromKernel(PVOID Arguments, ULONG
ArgumentLength)
TRACE("WM_CREATE CB %p lParam %p\n",CallbackArgs, KMMsg.lParam);
break;
}
+ case WM_NCCREATE:
+ {
+ TRACE("WM_NCCREATE CB %p lParam %p\n",CallbackArgs, KMMsg.lParam);
+ break;
+ }
case WM_SYSTIMER:
{
TRACE("WM_SYSTIMER %p\n",KMMsg.hwnd);