diff --git a/src/plugins/platforms/windows/qwindowsglcontext.cpp b/src/plugins/platforms/windows/qwindowsglcontext.cpp
index 8d33e2f..350569b 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowsglcontext.cpp
@@ -1171,24 +1171,9 @@ QWindowsGLContext::QWindowsGLContext(QOpenGLStaticContext *staticContext,
             qErrnoWarning("SetPixelFormat failed.");
             break;
         }
-        // Create context with sharing, again preferably using ARB.
-        HGLRC sharingRenderingContext = 0;
-        if (const QPlatformOpenGLContext *sc = context->shareHandle())
-            sharingRenderingContext = static_cast<const QWindowsGLContext *>(sc)->renderingContext();
 
-        if (m_extensionsUsed)
-            m_renderingContext =
-                ARB::createContext(*m_staticContext, hdc,
-                                   format,
-                                   requestedAdditional,
-                                   sharingRenderingContext);
-        if (!m_renderingContext)
-            m_renderingContext = GDI::createContext(hdc, sharingRenderingContext);
-
-        if (!m_renderingContext) {
-            qWarning("Unable to create a GL Context.");
+        if (!createContext(hdc))
             break;
-        }
 
         // Query obtained parameters and apply swap interval.
         if (!updateObtainedParams(hdc, &obtainedSwapInterval))
@@ -1262,6 +1247,30 @@ bool QWindowsGLContext::updateObtainedParams(HDC hdc, int *obtainedSwapInterval)
     return true;
 }
 
+bool QWindowsGLContext::createContext(HDC hdc)
+{
+    HGLRC sharingRenderingContext = 0;
+    if (const QPlatformOpenGLContext *sc = m_context->shareHandle())
+        sharingRenderingContext = static_cast<const QWindowsGLContext *>(sc)->renderingContext();
+
+    if (m_extensionsUsed)
+        m_renderingContext =
+                ARB::createContext(*m_staticContext, hdc,
+                                   m_context->format(),
+                                   QWindowsOpenGLAdditionalFormat(QWindowsGLDirectRendering),
+                                   sharingRenderingContext);
+
+    if (!m_renderingContext)
+        m_renderingContext = GDI::createContext(hdc, sharingRenderingContext);
+
+    if (!m_renderingContext) {
+        qWarning("Unable to create a GL Context.");
+        return false;
+    }
+
+    return true;
+}
+
 void QWindowsGLContext::releaseDCs()
 {
     const QOpenGLContextData *end = m_windowContexts.end();
@@ -1325,26 +1334,46 @@ bool QWindowsGLContext::makeCurrent(QPlatformSurface *surface)
         }
         return QOpenGLStaticContext::opengl32.wglMakeCurrent(contextData->hdc, contextData->renderingContext);
     }
-    // Create a new entry.
-    const QOpenGLContextData newContext(m_renderingContext, hwnd, GetDC(hwnd));
-    if (!newContext.hdc)
+
+    HDC hdc = GetDC(hwnd);
+    if (!hdc)
         return false;
+
     // Initialize pixel format first time. This will apply to
-    // the HWND as well and  must be done only once.
+    // the HWND as well and  must be done only once. Recreate
+    // the context to prevent crash on buggy old Intel drivers.
+    // We must set the pixel format before context is created.
     if (!window->testFlag(QWindowsWindow::OpenGlPixelFormatInitialized)) {
-        if (!QOpenGLStaticContext::opengl32.setPixelFormat(newContext.hdc, m_pixelFormat, &m_obtainedPixelFormatDescriptor)) {
+        if (!QOpenGLStaticContext::opengl32.setPixelFormat(hdc, m_pixelFormat, &m_obtainedPixelFormatDescriptor)) {
             qErrnoWarning("%s: SetPixelFormat() failed", __FUNCTION__);
-            ReleaseDC(newContext.hwnd, newContext.hdc);
+            ReleaseDC(hwnd, hdc);
             return false;
         }
+
+        // Delete the old context
+        QOpenGLStaticContext::opengl32.wglDeleteContext(m_renderingContext);
+        m_renderingContext = 0;
+
+        // Create the new context
+        if (!createContext(hdc) || !updateObtainedParams(hdc))
+            return false;
+        m_context->setNativeHandle(QVariant::fromValue<QWGLNativeContext>(QWGLNativeContext(m_renderingContext, 0)));
+
+        // Update context handle
+        const QOpenGLContextData *end = m_windowContexts.end();
+        for (QOpenGLContextData *p = m_windowContexts.begin(); p < end; ++p)
+            p->renderingContext = m_renderingContext;
+
         window->setFlag(QWindowsWindow::OpenGlPixelFormatInitialized);
         if (m_obtainedFormat.swapBehavior() == QSurfaceFormat::DoubleBuffer)
             window->setFlag(QWindowsWindow::OpenGLDoubleBuffered);
     }
-    m_windowContexts.append(newContext);
+
+    // Create a new entry.
+    m_windowContexts.append(QOpenGLContextData(m_renderingContext, hwnd, hdc));
 
     m_lost = false;
-    bool success = QOpenGLStaticContext::opengl32.wglMakeCurrent(newContext.hdc, newContext.renderingContext);
+    bool success = QOpenGLStaticContext::opengl32.wglMakeCurrent(hdc, m_renderingContext);
     if (!success) {
         if (m_getGraphicsResetStatus && m_getGraphicsResetStatus()) {
             m_lost = true;
diff --git a/src/plugins/platforms/windows/qwindowsglcontext.h b/src/plugins/platforms/windows/qwindowsglcontext.h
index ba617f1..41be932 100644
--- a/src/plugins/platforms/windows/qwindowsglcontext.h
+++ b/src/plugins/platforms/windows/qwindowsglcontext.h
@@ -254,6 +254,8 @@ private:
     inline void releaseDCs();
     bool updateObtainedParams(HDC hdc, int *obtainedSwapInterval = 0);
 
+    bool createContext(HDC hdc);
+
     QOpenGLStaticContext *m_staticContext;
     QOpenGLContext *m_context;
     QSurfaceFormat m_obtainedFormat;
