msctf: Context initialization happens before OnPushContext sink.
diff --git a/dlls/msctf/documentmgr.c b/dlls/msctf/documentmgr.c
index c7aa820..f5ea71f 100644
--- a/dlls/msctf/documentmgr.c
+++ b/dlls/msctf/documentmgr.c
@@ -145,8 +145,8 @@
     This->contextStack[1] = This->contextStack[0];
     This->contextStack[0] = check;
 
-    ITfThreadMgrEventSink_OnPushContext(This->ThreadMgrSink,check);
     Context_Initialize(check, iface);
+    ITfThreadMgrEventSink_OnPushContext(This->ThreadMgrSink,check);
 
     return S_OK;
 }
diff --git a/dlls/msctf/tests/inputprocessor.c b/dlls/msctf/tests/inputprocessor.c
index 61389cf..b9f2469 100644
--- a/dlls/msctf/tests/inputprocessor.c
+++ b/dlls/msctf/tests/inputprocessor.c
@@ -439,6 +439,20 @@
 static HRESULT WINAPI ThreadMgrEventSink_OnPushContext(ITfThreadMgrEventSink *iface,
 ITfContext *pic)
 {
+    HRESULT hr;
+    ITfDocumentMgr *docmgr;
+    ITfContext *test;
+
+    hr = ITfContext_GetDocumentMgr(pic,&docmgr);
+    ok(SUCCEEDED(hr),"GetDocumenMgr failed\n");
+    test = (ITfContext*)0xdeadbeef;
+    ITfDocumentMgr_Release(docmgr);
+    hr = ITfDocumentMgr_GetTop(docmgr,&test);
+    ok(SUCCEEDED(hr),"GetTop failed\n");
+    ok(test == pic, "Wrong context is on top\n");
+    if (test)
+        ITfContext_Release(test);
+
     ok(test_OnPushContext == SINK_EXPECTED, "Unexpected OnPushContext sink\n");
     test_OnPushContext = SINK_FIRED;
     return S_OK;