2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Win32k subsystem
4 * PURPOSE: Callback to usermode support
5 * FILE: subsystems/win32/win32k/ntuser/callback.c
6 * PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
7 * Thomas Weidenmueller (w3seek@users.sourceforge.net)
8 * NOTES: Please use the Callback Memory Management functions for
9 * callbacks to make sure, the memory is freed on thread
14 DBG_DEFAULT_CHANNEL(UserCallback
);
17 /* CALLBACK MEMORY MANAGEMENT ************************************************/
19 typedef struct _INT_CALLBACK_HEADER
21 /* List entry in the THREADINFO structure */
24 INT_CALLBACK_HEADER
, *PINT_CALLBACK_HEADER
;
27 IntCbAllocateMemory(ULONG Size
)
29 PINT_CALLBACK_HEADER Mem
;
30 PTHREADINFO W32Thread
;
32 if(!(Mem
= ExAllocatePoolWithTag(PagedPool
, Size
+ sizeof(INT_CALLBACK_HEADER
),
38 W32Thread
= PsGetCurrentThreadWin32Thread();
41 /* Insert the callback memory into the thread's callback list */
43 InsertTailList(&W32Thread
->W32CallbackListHead
, &Mem
->ListEntry
);
49 IntCbFreeMemory(PVOID Data
)
51 PINT_CALLBACK_HEADER Mem
;
52 PTHREADINFO W32Thread
;
56 Mem
= ((PINT_CALLBACK_HEADER
)Data
- 1);
58 W32Thread
= PsGetCurrentThreadWin32Thread();
61 /* Remove the memory block from the thread's callback list */
62 RemoveEntryList(&Mem
->ListEntry
);
65 ExFreePoolWithTag(Mem
, USERTAG_CALLBACK
);
69 IntCleanupThreadCallbacks(PTHREADINFO W32Thread
)
71 PLIST_ENTRY CurrentEntry
;
72 PINT_CALLBACK_HEADER Mem
;
74 while (!IsListEmpty(&W32Thread
->W32CallbackListHead
))
76 CurrentEntry
= RemoveHeadList(&W32Thread
->W32CallbackListHead
);
77 Mem
= CONTAINING_RECORD(CurrentEntry
, INT_CALLBACK_HEADER
,
86 // Pass the Current Window handle and pointer to the Client Callback.
87 // This will help user space programs speed up read access with the window object.
90 IntSetTebWndCallback (HWND
* hWnd
, PWND
* pWnd
, PVOID
* pActCtx
)
93 PWND Window
= UserGetWindowObject(*hWnd
);
94 PCLIENTINFO ClientInfo
= GetWin32ClientInfo();
96 *hWnd
= ClientInfo
->CallbackWnd
.hWnd
;
97 *pWnd
= ClientInfo
->CallbackWnd
.pWnd
;
98 *pActCtx
= ClientInfo
->CallbackWnd
.pActCtx
;
100 ClientInfo
->CallbackWnd
.hWnd
= hWndS
;
101 ClientInfo
->CallbackWnd
.pWnd
= DesktopHeapAddressToUser(Window
);
102 ClientInfo
->CallbackWnd
.pActCtx
= Window
->pActCtx
;
106 IntRestoreTebWndCallback (HWND hWnd
, PWND pWnd
, PVOID pActCtx
)
108 PCLIENTINFO ClientInfo
= GetWin32ClientInfo();
110 ClientInfo
->CallbackWnd
.hWnd
= hWnd
;
111 ClientInfo
->CallbackWnd
.pWnd
= pWnd
;
112 ClientInfo
->CallbackWnd
.pActCtx
= pActCtx
;
115 /* FUNCTIONS *****************************************************************/
117 /* Calls ClientLoadLibrary in user32 */
119 co_IntClientLoadLibrary(PUNICODE_STRING pstrLibName
,
120 PUNICODE_STRING pstrInitFunc
,
126 ULONG ArgumentLength
;
127 PCLIENT_LOAD_LIBRARY_ARGUMENTS pArguments
;
130 ULONG_PTR pLibNameBuffer
= 0, pInitFuncBuffer
= 0;
132 TRACE("co_IntClientLoadLibrary: %S, %S, %d, %d\n", pstrLibName
->Buffer
, pstrLibName
->Buffer
, Unload
, ApiHook
);
134 /* Calculate the size of the argument */
135 ArgumentLength
= sizeof(CLIENT_LOAD_LIBRARY_ARGUMENTS
);
138 pLibNameBuffer
= ArgumentLength
;
139 ArgumentLength
+= pstrLibName
->Length
+ sizeof(WCHAR
);
143 pInitFuncBuffer
= ArgumentLength
;
144 ArgumentLength
+= pstrInitFunc
->Length
+ sizeof(WCHAR
);
147 /* Allocate the argument */
148 pArguments
= IntCbAllocateMemory(ArgumentLength
);
149 if(pArguments
== NULL
)
154 /* Fill the argument */
155 pArguments
->Unload
= Unload
;
156 pArguments
->ApiHook
= ApiHook
;
159 /* Copy the string to the callback memory */
160 pLibNameBuffer
+= (ULONG_PTR
)pArguments
;
161 pArguments
->strLibraryName
.Buffer
= (PWCHAR
)pLibNameBuffer
;
162 pArguments
->strLibraryName
.MaximumLength
= pstrLibName
->Length
+ sizeof(WCHAR
);
163 RtlCopyUnicodeString(&pArguments
->strLibraryName
, pstrLibName
);
165 /* Fix argument pointer to be relative to the argument */
166 pLibNameBuffer
-= (ULONG_PTR
)pArguments
;
167 pArguments
->strLibraryName
.Buffer
= (PWCHAR
)(pLibNameBuffer
);
171 RtlZeroMemory(&pArguments
->strLibraryName
, sizeof(UNICODE_STRING
));
176 /* Copy the strings to the callback memory */
177 pInitFuncBuffer
+= (ULONG_PTR
)pArguments
;
178 pArguments
->strInitFuncName
.Buffer
= (PWCHAR
)pInitFuncBuffer
;
179 pArguments
->strInitFuncName
.MaximumLength
= pstrInitFunc
->Length
+ sizeof(WCHAR
);
180 RtlCopyUnicodeString(&pArguments
->strInitFuncName
, pstrInitFunc
);
182 /* Fix argument pointers to be relative to the argument */
183 pInitFuncBuffer
-= (ULONG_PTR
)pArguments
;
184 pArguments
->strInitFuncName
.Buffer
= (PWCHAR
)(pInitFuncBuffer
);
188 RtlZeroMemory(&pArguments
->strInitFuncName
, sizeof(UNICODE_STRING
));
191 /* Do the callback */
194 Status
= KeUserModeCallback(USER32_CALLBACK_CLIENTLOADLIBRARY
,
202 /* Free the argument */
203 IntCbFreeMemory(pArguments
);
205 if(!NT_SUCCESS(Status
))
212 ProbeForRead(ResultPointer
, sizeof(HMODULE
), 1);
213 /* Simulate old behaviour: copy into our local buffer */
214 Result
= *(HMODULE
*)ResultPointer
;
216 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
226 co_IntCallSentMessageCallback(SENDASYNCPROC CompletionCallback
,
229 ULONG_PTR CompletionCallbackContext
,
232 SENDASYNCPROC_CALLBACK_ARGUMENTS Arguments
;
233 PVOID ResultPointer
, pActCtx
;
238 Arguments
.Callback
= CompletionCallback
;
239 Arguments
.Wnd
= hWnd
;
241 Arguments
.Context
= CompletionCallbackContext
;
242 Arguments
.Result
= Result
;
244 IntSetTebWndCallback (&hWnd
, &pWnd
, &pActCtx
);
248 Status
= KeUserModeCallback(USER32_CALLBACK_SENDASYNCPROC
,
250 sizeof(SENDASYNCPROC_CALLBACK_ARGUMENTS
),
256 IntRestoreTebWndCallback (hWnd
, pWnd
, pActCtx
);
258 if (!NT_SUCCESS(Status
))
266 co_IntCallWindowProc(WNDPROC Proc
,
272 INT lParamBufferSize
)
274 WINDOWPROC_CALLBACK_ARGUMENTS StackArguments
;
275 PWINDOWPROC_CALLBACK_ARGUMENTS Arguments
;
277 PVOID ResultPointer
, pActCtx
;
280 ULONG ArgumentLength
;
283 if (0 < lParamBufferSize
)
285 ArgumentLength
= sizeof(WINDOWPROC_CALLBACK_ARGUMENTS
) + lParamBufferSize
;
286 Arguments
= IntCbAllocateMemory(ArgumentLength
);
287 if (NULL
== Arguments
)
289 ERR("Unable to allocate buffer for window proc callback\n");
292 RtlMoveMemory((PVOID
) ((char *) Arguments
+ sizeof(WINDOWPROC_CALLBACK_ARGUMENTS
)),
293 (PVOID
) lParam
, lParamBufferSize
);
297 Arguments
= &StackArguments
;
298 ArgumentLength
= sizeof(WINDOWPROC_CALLBACK_ARGUMENTS
);
300 Arguments
->Proc
= Proc
;
301 Arguments
->IsAnsiProc
= IsAnsiProc
;
302 Arguments
->Wnd
= Wnd
;
303 Arguments
->Msg
= Message
;
304 Arguments
->wParam
= wParam
;
305 Arguments
->lParam
= lParam
;
306 Arguments
->lParamBufferSize
= lParamBufferSize
;
307 ResultPointer
= NULL
;
308 ResultLength
= ArgumentLength
;
310 IntSetTebWndCallback (&Wnd
, &pWnd
, &pActCtx
);
314 Status
= KeUserModeCallback(USER32_CALLBACK_WINDOWPROC
,
322 /* Simulate old behaviour: copy into our local buffer */
323 RtlMoveMemory(Arguments
, ResultPointer
, ArgumentLength
);
325 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
327 ERR("Failed to copy result from user mode!\n");
328 Status
= _SEH2_GetExceptionCode();
334 IntRestoreTebWndCallback (Wnd
, pWnd
, pActCtx
);
336 if (!NT_SUCCESS(Status
))
338 ERR("Call to user mode failed!\n");
339 if (0 < lParamBufferSize
)
341 IntCbFreeMemory(Arguments
);
345 Result
= Arguments
->Result
;
347 if (0 < lParamBufferSize
)
349 RtlMoveMemory((PVOID
) lParam
,
350 (PVOID
) ((char *) Arguments
+ sizeof(WINDOWPROC_CALLBACK_ARGUMENTS
)),
352 IntCbFreeMemory(Arguments
);
359 co_IntLoadSysMenuTemplate()
366 ResultPointer
= NULL
;
367 ResultLength
= sizeof(LRESULT
);
371 Status
= KeUserModeCallback(USER32_CALLBACK_LOADSYSMENUTEMPLATE
,
376 if (NT_SUCCESS(Status
))
378 /* Simulate old behaviour: copy into our local buffer */
381 ProbeForRead(ResultPointer
, sizeof(LRESULT
), 1);
382 Result
= *(LRESULT
*)ResultPointer
;
384 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
393 return (HMENU
)Result
;
397 co_IntLoadDefaultCursors(VOID
)
402 BOOL DefaultCursor
= TRUE
;
404 ResultPointer
= NULL
;
405 ResultLength
= sizeof(LRESULT
);
409 Status
= KeUserModeCallback(USER32_CALLBACK_LOADDEFAULTCURSORS
,
417 if (!NT_SUCCESS(Status
))
425 co_IntCallHookProc(INT HookId
,
431 PUNICODE_STRING ModuleName
)
433 ULONG ArgumentLength
;
434 PVOID Argument
= NULL
;
439 PHOOKPROC_CALLBACK_ARGUMENTS Common
;
440 CBT_CREATEWNDW
*CbtCreateWnd
= NULL
;
442 PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS CbtCreatewndExtra
= NULL
;
451 pti
= PsGetCurrentThreadWin32Thread();
452 if (pti
->TIF_flags
& TIF_INCLEANUP
)
454 ERR("Thread is in cleanup and trying to call hook %d\n", Code
);
458 ArgumentLength
= sizeof(HOOKPROC_CALLBACK_ARGUMENTS
);
463 TRACE("WH_CBT: Code %d\n", Code
);
467 pWnd
= UserGetWindowObject((HWND
) wParam
);
470 ERR("WH_CBT HCBT_CREATEWND wParam bad hWnd!\n");
473 TRACE("HCBT_CREATEWND AnsiCreator %s, AnsiHook %s\n", pWnd
->state
& WNDS_ANSICREATOR
? "True" : "False", Ansi
? "True" : "False");
474 // Due to KsStudio.exe, just pass the callers original pointers
475 // except class which point to kernel space if not an atom.
476 // Found by, Olaf Siejka
477 CbtCreateWnd
= (CBT_CREATEWNDW
*) lParam
;
478 ArgumentLength
+= sizeof(HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS
);
482 ArgumentLength
+= sizeof(RECTL
);
485 ArgumentLength
+= sizeof(CBTACTIVATESTRUCT
);
487 case HCBT_CLICKSKIPPED
:
488 ArgumentLength
+= sizeof(MOUSEHOOKSTRUCT
);
491 case HCBT_KEYSKIPPED
:
494 case HCBT_SYSCOMMAND
:
495 /* These types pass through. */
496 case HCBT_DESTROYWND
:
500 ERR("Trying to call unsupported CBT hook %d\n", Code
);
505 ArgumentLength
+= sizeof(KBDLLHOOKSTRUCT
);
508 ArgumentLength
+= sizeof(MSLLHOOKSTRUCT
);
511 ArgumentLength
+= sizeof(MOUSEHOOKSTRUCT
);
515 CWPSTRUCT
* pCWP
= (CWPSTRUCT
*) lParam
;
516 ArgumentLength
+= sizeof(CWPSTRUCT
);
517 lParamSize
= lParamMemorySize(pCWP
->message
, pCWP
->wParam
, pCWP
->lParam
);
518 ArgumentLength
+= lParamSize
;
521 case WH_CALLWNDPROCRET
:
523 CWPRETSTRUCT
* pCWPR
= (CWPRETSTRUCT
*) lParam
;
524 ArgumentLength
+= sizeof(CWPRETSTRUCT
);
525 lParamSize
= lParamMemorySize(pCWPR
->message
, pCWPR
->wParam
, pCWPR
->lParam
);
526 ArgumentLength
+= lParamSize
;
530 case WH_SYSMSGFILTER
:
532 ArgumentLength
+= sizeof(MSG
);
534 case WH_FOREGROUNDIDLE
:
539 ERR("Trying to call unsupported window hook %d\n", HookId
);
543 Argument
= IntCbAllocateMemory(ArgumentLength
);
544 if (NULL
== Argument
)
546 ERR("HookProc callback failed: out of memory\n");
549 Common
= (PHOOKPROC_CALLBACK_ARGUMENTS
) Argument
;
550 Common
->HookId
= HookId
;
552 Common
->wParam
= wParam
;
553 Common
->lParam
= lParam
;
556 Extra
= (PCHAR
) Common
+ sizeof(HOOKPROC_CALLBACK_ARGUMENTS
);
562 { // Need to remember this is not the first time through! Call Next Hook?
564 CbtCreatewndExtra
= (PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS
) Extra
;
565 RtlCopyMemory( &CbtCreatewndExtra
->Cs
, CbtCreateWnd
->lpcs
, sizeof(CREATESTRUCTW
) );
566 CbtCreatewndExtra
->WndInsertAfter
= CbtCreateWnd
->hwndInsertAfter
;
567 CbtCreatewndExtra
->Cs
.lpszClass
= CbtCreateWnd
->lpcs
->lpszClass
;
568 CbtCreatewndExtra
->Cs
.lpszName
= CbtCreateWnd
->lpcs
->lpszName
;
569 Common
->lParam
= (LPARAM
) (Extra
- (PCHAR
) Common
);
571 case HCBT_CLICKSKIPPED
:
572 RtlCopyMemory(Extra
, (PVOID
) lParam
, sizeof(MOUSEHOOKSTRUCT
));
573 Common
->lParam
= (LPARAM
) (Extra
- (PCHAR
) Common
);
576 RtlCopyMemory(Extra
, (PVOID
) lParam
, sizeof(RECTL
));
577 Common
->lParam
= (LPARAM
) (Extra
- (PCHAR
) Common
);
580 RtlCopyMemory(Extra
, (PVOID
) lParam
, sizeof(CBTACTIVATESTRUCT
));
581 Common
->lParam
= (LPARAM
) (Extra
- (PCHAR
) Common
);
586 RtlCopyMemory(Extra
, (PVOID
) lParam
, sizeof(KBDLLHOOKSTRUCT
));
587 Common
->lParam
= (LPARAM
) (Extra
- (PCHAR
) Common
);
590 RtlCopyMemory(Extra
, (PVOID
) lParam
, sizeof(MSLLHOOKSTRUCT
));
591 Common
->lParam
= (LPARAM
) (Extra
- (PCHAR
) Common
);
594 RtlCopyMemory(Extra
, (PVOID
) lParam
, sizeof(MOUSEHOOKSTRUCT
));
595 Common
->lParam
= (LPARAM
) (Extra
- (PCHAR
) Common
);
598 /* For CALLWNDPROC and CALLWNDPROCRET, we must be wary of the fact that
599 * lParam could be a pointer to a buffer. This buffer must be exported
600 * to user space too */
601 RtlCopyMemory(Extra
, (PVOID
) lParam
, sizeof(CWPSTRUCT
));
602 Common
->lParam
= (LPARAM
) (Extra
- (PCHAR
) Common
);
605 RtlCopyMemory(Extra
+ sizeof(CWPSTRUCT
), (PVOID
)((CWPSTRUCT
*)lParam
)->lParam
, lParamSize
);
606 ((CWPSTRUCT
*)Extra
)->lParam
= (LPARAM
)lParamSize
;
609 case WH_CALLWNDPROCRET
:
610 RtlCopyMemory(Extra
, (PVOID
) lParam
, sizeof(CWPRETSTRUCT
));
611 Common
->lParam
= (LPARAM
) (Extra
- (PCHAR
) Common
);
614 RtlCopyMemory(Extra
+ sizeof(CWPRETSTRUCT
), (PVOID
)((CWPRETSTRUCT
*)lParam
)->lParam
, lParamSize
);
615 ((CWPRETSTRUCT
*)Extra
)->lParam
= (LPARAM
)lParamSize
;
619 case WH_SYSMSGFILTER
:
622 RtlCopyMemory(Extra
, (PVOID
) pMsg
, sizeof(MSG
));
623 Common
->lParam
= (LPARAM
) (Extra
- (PCHAR
) Common
);
625 case WH_FOREGROUNDIDLE
:
631 ResultPointer
= NULL
;
632 ResultLength
= sizeof(LRESULT
);
636 Status
= KeUserModeCallback(USER32_CALLBACK_HOOKPROC
,
648 ProbeForRead(ResultPointer
, sizeof(LRESULT
), 1);
649 /* Simulate old behaviour: copy into our local buffer */
650 Result
= *(LRESULT
*)ResultPointer
;
652 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
661 ERR("ERROR: Hook ResultPointer 0x%x ResultLength %d\n",ResultPointer
,ResultLength
);
664 if (!NT_SUCCESS(Status
))
666 ERR("Failure to make Callback! Status 0x%x",Status
);
669 /* Support write backs... SEH is in UserCallNextHookEx. */
673 if (Code
== HCBT_CREATEWND
)
675 if (CbtCreatewndExtra
)
677 The parameters could have been changed, include the coordinates
678 and dimensions of the window. We copy it back.
680 CbtCreateWnd
->hwndInsertAfter
= CbtCreatewndExtra
->WndInsertAfter
;
681 CbtCreateWnd
->lpcs
->x
= CbtCreatewndExtra
->Cs
.x
;
682 CbtCreateWnd
->lpcs
->y
= CbtCreatewndExtra
->Cs
.y
;
683 CbtCreateWnd
->lpcs
->cx
= CbtCreatewndExtra
->Cs
.cx
;
684 CbtCreateWnd
->lpcs
->cy
= CbtCreatewndExtra
->Cs
.cy
;
688 // "The GetMsgProc hook procedure can examine or modify the message."
692 RtlCopyMemory((PVOID
) pMsg
, Extra
, sizeof(MSG
));
700 ERR("Exception CallHookProc HookId %d Code %d\n",HookId
,Code
);
702 if (Argument
) IntCbFreeMemory(Argument
);
708 // Events are notifications w/o results.
712 co_IntCallEventProc(HWINEVENTHOOK hook
,
723 PEVENTPROC_CALLBACK_ARGUMENTS Common
;
724 ULONG ArgumentLength
, ResultLength
;
725 PVOID Argument
, ResultPointer
;
727 ArgumentLength
= sizeof(EVENTPROC_CALLBACK_ARGUMENTS
);
729 Argument
= IntCbAllocateMemory(ArgumentLength
);
730 if (NULL
== Argument
)
732 ERR("EventProc callback failed: out of memory\n");
735 Common
= (PEVENTPROC_CALLBACK_ARGUMENTS
) Argument
;
737 Common
->event
= event
;
739 Common
->idObject
= idObject
;
740 Common
->idChild
= idChild
;
741 Common
->dwEventThread
= dwEventThread
;
742 Common
->dwmsEventTime
= dwmsEventTime
;
745 ResultPointer
= NULL
;
746 ResultLength
= sizeof(LRESULT
);
750 Status
= KeUserModeCallback(USER32_CALLBACK_EVENTPROC
,
758 IntCbFreeMemory(Argument
);
760 if (!NT_SUCCESS(Status
))
769 // Callback Load Menu and results.
773 co_IntCallLoadMenu( HINSTANCE hModule
,
774 PUNICODE_STRING pMenuName
)
778 PLOADMENU_CALLBACK_ARGUMENTS Common
;
779 ULONG ArgumentLength
, ResultLength
;
780 PVOID Argument
, ResultPointer
;
782 ArgumentLength
= sizeof(LOADMENU_CALLBACK_ARGUMENTS
);
784 ArgumentLength
+= pMenuName
->Length
+ sizeof(WCHAR
);
786 Argument
= IntCbAllocateMemory(ArgumentLength
);
787 if (NULL
== Argument
)
789 ERR("LoadMenu callback failed: out of memory\n");
792 Common
= (PLOADMENU_CALLBACK_ARGUMENTS
) Argument
;
794 // Help Intersource check and MenuName is now 4 bytes + so zero it.
795 RtlZeroMemory(Common
, ArgumentLength
);
797 Common
->hModule
= hModule
;
798 if (pMenuName
->Length
)
799 RtlCopyMemory(&Common
->MenuName
, pMenuName
->Buffer
, pMenuName
->Length
);
801 RtlCopyMemory(&Common
->MenuName
, &pMenuName
->Buffer
, sizeof(WCHAR
));
803 ResultPointer
= NULL
;
804 ResultLength
= sizeof(LRESULT
);
808 Status
= KeUserModeCallback(USER32_CALLBACK_LOADMENU
,
816 Result
= *(LRESULT
*)ResultPointer
;
818 IntCbFreeMemory(Argument
);
820 if (!NT_SUCCESS(Status
))
825 return (HMENU
)Result
;
830 co_IntClientThreadSetup(VOID
)
833 ULONG ArgumentLength
, ResultLength
;
834 PVOID Argument
, ResultPointer
;
836 ArgumentLength
= ResultLength
= 0;
837 Argument
= ResultPointer
= NULL
;
841 Status
= KeUserModeCallback(USER32_CALLBACK_CLIENTTHREADSTARTUP
,
854 co_IntGetCharsetInfo(LCID Locale
, PCHARSETINFO pCs
)
857 ULONG ArgumentLength
, ResultLength
;
858 PVOID Argument
, ResultPointer
;
859 PGET_CHARSET_INFO Common
;
861 ArgumentLength
= sizeof(GET_CHARSET_INFO
);
863 Argument
= IntCbAllocateMemory(ArgumentLength
);
864 if (NULL
== Argument
)
866 ERR("GetCharsetInfo callback failed: out of memory\n");
869 Common
= (PGET_CHARSET_INFO
) Argument
;
871 Common
->Locale
= Locale
;
873 ResultPointer
= NULL
;
874 ResultLength
= ArgumentLength
;
878 Status
= KeUserModeCallback(USER32_CALLBACK_GETCHARSETINFO
,
886 /* Need to copy into our local buffer */
887 RtlMoveMemory(Argument
, ResultPointer
, ArgumentLength
);
889 _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER
)
891 ERR("Failed to copy result from user mode!\n");
892 Status
= _SEH2_GetExceptionCode();
898 RtlCopyMemory(pCs
, &Common
->Cs
, sizeof(CHARSETINFO
));
900 IntCbFreeMemory(Argument
);
902 if (!NT_SUCCESS(Status
))
904 ERR("GetCharsetInfo Failed!!\n");