[LIBXML2] Update to version 2.9.12. CORE-17766
[reactos.git] / win32ss / user / ntuser / ntstubs.c
index 87d2c3e..6a1b3c4 100644 (file)
@@ -11,10 +11,7 @@ DBG_DEFAULT_CHANNEL(UserMisc);
 
 DWORD
 APIENTRY
-NtUserAssociateInputContext(
-    DWORD dwUnknown1,
-    DWORD dwUnknown2,
-    DWORD dwUnknown3)
+NtUserAssociateInputContext(HWND hWnd, HIMC hIMC, DWORD dwFlags)
 {
     STUB
     return 0;
@@ -54,16 +51,12 @@ NtUserBitBltSysBmp(
    return Ret;
 }
 
-DWORD
+NTSTATUS
 APIENTRY
-NtUserBuildHimcList(
-    DWORD dwUnknown1,
-    DWORD dwUnknown2,
-    DWORD dwUnknown3,
-    DWORD dwUnknown4)
+NtUserBuildHimcList(DWORD dwThreadId, DWORD dwCount, HIMC *phList, LPDWORD pdwCount)
 {
     STUB;
-    return 0;
+    return STATUS_NOT_IMPLEMENTED;
 }
 
 DWORD
@@ -423,22 +416,20 @@ NtUserYieldTask(VOID)
    return 0;
 }
 
-DWORD
+HIMC
 APIENTRY
-NtUserCreateInputContext(
-    DWORD dwUnknown1)
+NtUserCreateInputContext(PCLIENTIMC pClientImc)
 {
     STUB;
-    return 0;
+    return NULL;
 }
 
-DWORD
+BOOL
 APIENTRY
-NtUserDestroyInputContext(
-    DWORD dwUnknown1)
+NtUserDestroyInputContext(HIMC hIMC)
 {
     STUB;
-    return 0;
+    return FALSE;
 }
 
 DWORD
@@ -537,8 +528,8 @@ NtUserProcessConnect(
 
     TRACE("NtUserProcessConnect\n");
 
-    if ( pUserConnect == NULL ||
-         Size         != sizeof(*pUserConnect) )
+    if (pUserConnect == NULL ||
+        Size != sizeof(*pUserConnect))
     {
         return STATUS_UNSUCCESSFUL;
     }
@@ -559,14 +550,51 @@ NtUserProcessConnect(
 
     _SEH2_TRY
     {
+        UINT i;
+
         // FIXME: Check that pUserConnect->ulVersion == USER_VERSION;
+        // FIXME: Check the value of pUserConnect->dwDispatchCount.
 
         ProbeForWrite(pUserConnect, sizeof(*pUserConnect), sizeof(PVOID));
-        pUserConnect->siClient.psi = gpsi;
-        pUserConnect->siClient.aheList = gHandleTable;
+
+        // FIXME: Instead of assuming that the mapping of the heap desktop
+        // also holds there, we **MUST** create and map instead the shared
+        // section! Its client base must be stored in W32Process->pClientBase.
+        // What is currently done (ReactOS-specific only), is that within the
+        // IntUserHeapCommitRoutine()/MapGlobalUserHeap() routines we assume
+        // it's going to be also called early, so that we manually add a very
+        // first memory mapping that corresponds to the "global user heap",
+        // and that we use instead of a actual win32 "shared USER section"
+        // (see slide 29 of https://paper.bobylive.com/Meeting_Papers/BlackHat/USA-2011/BH_US_11_Mandt_win32k_Slides.pdf )
+
         pUserConnect->siClient.ulSharedDelta =
             (ULONG_PTR)W32Process->HeapMappings.KernelMapping -
             (ULONG_PTR)W32Process->HeapMappings.UserMapping;
+
+#define SERVER_TO_CLIENT(ptr) \
+    ((PVOID)((ULONG_PTR)ptr - pUserConnect->siClient.ulSharedDelta))
+
+        ASSERT(gpsi);
+        ASSERT(gHandleTable);
+
+        pUserConnect->siClient.psi       = SERVER_TO_CLIENT(gpsi);
+        pUserConnect->siClient.aheList   = SERVER_TO_CLIENT(gHandleTable);
+        pUserConnect->siClient.pDispInfo = NULL;
+
+        // NOTE: kernel server should also have a SHAREDINFO gSharedInfo;
+        // FIXME: These USER window-proc data should be used somehow!
+
+        pUserConnect->siClient.DefWindowMsgs.maxMsgs     = 0;
+        pUserConnect->siClient.DefWindowMsgs.abMsgs      = NULL;
+        pUserConnect->siClient.DefWindowSpecMsgs.maxMsgs = 0;
+        pUserConnect->siClient.DefWindowSpecMsgs.abMsgs  = NULL;
+
+        for (i = 0; i < ARRAYSIZE(pUserConnect->siClient.awmControl); ++i)
+        {
+            pUserConnect->siClient.awmControl[i].maxMsgs = 0;
+            pUserConnect->siClient.awmControl[i].abMsgs  = NULL;
+        }
+#undef SERVER_TO_CLIENT
     }
     _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
     {
@@ -630,10 +658,10 @@ Quit:
 DWORD
 APIENTRY
 NtUserQueryInputContext(
-    DWORD dwUnknown1,
+    HIMC hIMC,
     DWORD dwUnknown2)
 {
-    STUB;
+    TRACE("NtUserQueryInputContext(%p, 0x%lX)\n", hIMC, dwUnknown2);
     return 0;
 }