--- wine/dlls/wined3d/directx.c	2009-01-30 22:54:01.000000000 +0600
+++ wine/dlls/wined3d/directx.c	2009-02-08 17:13:15.000000000 +0600
@@ -1399,6 +1399,10 @@ static BOOL IWineD3DImpl_FillGLCaps(Wine
     /* Make sure there's an active HDC else the WGL extensions will fail */
     hdc = pwglGetCurrentDC();
     if (hdc) {
+        if(NULL == GL_EXTCALL(wglGetExtensionsStringARB)) {
+            WARN("wglGetExtensionsStringARB is unavailable\n");
+        }
+        else {
         WGL_Extensions = GL_EXTCALL(wglGetExtensionsStringARB(hdc));
         TRACE_(d3d_caps)("WGL_Extensions reported:\n");
 
@@ -1435,6 +1439,7 @@ static BOOL IWineD3DImpl_FillGLCaps(Wine
             }
         }
     }
+    }
     LEAVE_GL();
 
     return return_value;
@@ -4286,6 +4291,51 @@ BOOL InitAdapters(void) {
         TRACE("DeviceName: %s\n", debugstr_w(DisplayDevice.DeviceName));
         strcpyW(Adapters[0].DeviceName, DisplayDevice.DeviceName);
 
+        if(NULL == GL_EXTCALL(wglGetPixelFormatAttribivARB)) {
+            WARN("wglGetPixelFormatAttribivARB is unavailable\n");
+            Adapters[0].nCfgs=DescribePixelFormat(hdc,0,0,NULL);
+
+            Adapters[0].cfgs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Adapters[0].nCfgs *sizeof(WineD3D_PixelFormat));
+            cfgs = Adapters[0].cfgs;
+
+            for(iPixelFormat=1; iPixelFormat<=Adapters[0].nCfgs; iPixelFormat++) {
+            	PIXELFORMATDESCRIPTOR pfd={0};
+                res = DescribePixelFormat(hdc,iPixelFormat,sizeof(pfd),&pfd);
+
+                if(!res)
+                    continue;
+
+                /* Cache the pixel format */
+                cfgs->iPixelFormat = iPixelFormat;
+                cfgs->redSize = pfd.cRedBits;
+                cfgs->greenSize = pfd.cGreenBits;
+                cfgs->blueSize = pfd.cBlueBits;
+                cfgs->alphaSize = pfd.cAlphaBits;
+                cfgs->depthSize = pfd.cDepthBits;
+                cfgs->stencilSize = pfd.cStencilBits;
+                cfgs->windowDrawable = (PFD_DRAW_TO_WINDOW == (pfd.dwFlags & PFD_DRAW_TO_WINDOW));
+                switch (pfd.iPixelType)
+                {
+                case PFD_TYPE_RGBA:
+                	cfgs->iPixelType = WGL_TYPE_RGBA_ARB;
+                	break;
+                case PFD_TYPE_COLORINDEX:
+                	cfgs->iPixelType = WGL_TYPE_COLORINDEX_ARB;
+                	break;
+                default:
+                	cfgs->iPixelType = 0;
+                }
+                cfgs->doubleBuffer = (PFD_DOUBLEBUFFER == (pfd.dwFlags & PFD_DOUBLEBUFFER));
+                cfgs->auxBuffers = pfd.cAuxBuffers;
+
+                cfgs->pbufferDrawable = FALSE;
+                cfgs->numSamples = 0;
+
+                TRACE("iPixelFormat=%d, iPixelType=%#x, doubleBuffer=%d, RGBA=%d/%d/%d/%d, depth=%d, stencil=%d, windowDrawable=%d, pbufferDrawable=%d\n", cfgs->iPixelFormat, cfgs->iPixelType, cfgs->doubleBuffer, cfgs->redSize, cfgs->greenSize, cfgs->blueSize, cfgs->alphaSize, cfgs->depthSize, cfgs->stencilSize, cfgs->windowDrawable, cfgs->pbufferDrawable);
+                cfgs++;
+            }
+        }
+        else {
         attribute = WGL_NUMBER_PIXEL_FORMATS_ARB;
         GL_EXTCALL(wglGetPixelFormatAttribivARB(hdc, 0, 0, 1, &attribute, &Adapters[0].nCfgs));
 
@@ -4346,6 +4396,7 @@ BOOL InitAdapters(void) {
             TRACE("iPixelFormat=%d, iPixelType=%#x, doubleBuffer=%d, RGBA=%d/%d/%d/%d, depth=%d, stencil=%d, windowDrawable=%d, pbufferDrawable=%d\n", cfgs->iPixelFormat, cfgs->iPixelType, cfgs->doubleBuffer, cfgs->redSize, cfgs->greenSize, cfgs->blueSize, cfgs->alphaSize, cfgs->depthSize, cfgs->stencilSize, cfgs->windowDrawable, cfgs->pbufferDrawable);
             cfgs++;
         }
+        }
 
         /* D16, D24X8 and D24S8 are common depth / depth+stencil formats. All drivers support them though this doesn't
          * mean that the format is offered in hardware. For instance Geforce8 cards don't have offer D16 in hardware
