Index: trunk/src/win32k/ldr/myldrOpen.cpp
===================================================================
--- trunk/src/win32k/ldr/myldrOpen.cpp	(revision 4777)
+++ trunk/src/win32k/ldr/myldrOpen.cpp	(revision 4778)
@@ -1,3 +1,3 @@
-/* $Id: myldrOpen.cpp,v 1.12 2000-09-12 04:40:57 bird Exp $
+/* $Id: myldrOpen.cpp,v 1.13 2000-12-11 06:30:59 bird Exp $
  *
  * myldrOpen - ldrOpen.
@@ -75,10 +75,24 @@
                                         /* When the maximum depth has been reached    */
                                         /* we'll not intercept loading any longer!    */
-    ULONG rc;                           /* Return value. */
+    ULONG   rc;                         /* Return value. */
 
     /** @sketch
-     * Try open the file (that's why this function is called anyway)
+     * Try open the file (that's why this function is called)
+     *   Apply Extention fix if this is requested.
      */
-    rc = ldrOpen(phFile, pszFilename, pfl);
+    if (fldrOpenExtentionFix)
+    {
+        int cchFilename = strlen(pszFilename);
+        pszFilename[cchFilename - 4] = '\0';
+        rc = ldrOpen(phFile, pszFilename, pfl);
+        if (rc != NO_ERROR)
+        {
+            pszFilename[cchFilename - 4] = '.';
+            rc = ldrOpen(phFile, pszFilename, pfl);
+        }
+    }
+    else
+        rc = ldrOpen(phFile, pszFilename, pfl);
+
     if (rc == NO_ERROR)
         kprintf(("myldrOpen-%d:  phFile=%#.4x, flags=%#.8x, pszFn=%s\n", cNesting, *phFile, pfl, pszFilename));
@@ -771,5 +785,5 @@
  *
  * @status    completly implemented.
- * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
+ * @author    knut st. osmundsen (knut.stange.osmundsen@mynd.no)
  * @remark    Implementation note:
  *  The arguments convention is as follows:
@@ -899,5 +913,5 @@
  * @param     pszExecName   Pointer to new executable name.
  * @status    completly implemented.
- * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
+ * @author    knut st. osmundsen (knut.stange.osmundsen@mynd.no)
  * @remark    .
  */
@@ -941,5 +955,5 @@
  * @param     pfl           Some flags set by ldrOpen.
  * @sketch    stub
- * @author    knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
+ * @author    knut st. osmundsen (knut.stange.osmundsen@mynd.no)
  * @remark
  */
Index: trunk/src/win32k/ldr/myldrOpenPath.cpp
===================================================================
--- trunk/src/win32k/ldr/myldrOpenPath.cpp	(revision 4777)
+++ trunk/src/win32k/ldr/myldrOpenPath.cpp	(revision 4778)
@@ -1,8 +1,8 @@
-/* $Id: myldrOpenPath.cpp,v 1.3 2000-09-22 09:22:40 bird Exp $
+/* $Id: myldrOpenPath.cpp,v 1.4 2000-12-11 06:30:59 bird Exp $
  *
  * myldrOpenPath - ldrOpenPath used to open executables we'll override
  * this to altern the search path for DLLs.
  *
- * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
+ * Copyright (c) 2000 knut st. osmundsen (knut.stange.osmundsen@mynd.no)
  *
  * Project Odin Software License can be found in LICENSE.TXT
@@ -37,5 +37,5 @@
 #include "ldr.h"
 #include "ModuleBase.h"
-
+#include "options.h"
 
 
@@ -91,5 +91,5 @@
 {
 
-    APIRET rc;
+    APIRET  rc;
 
     #ifdef DEBUG
@@ -122,4 +122,18 @@
     else
         setLdrStateLoadingUnsupported();
+
+
+    /*
+     * Check if we're to apply the extention fix in myldrOpen.
+     * The required conditions are:
+     *      1. Global class. (ie. DLL)
+     *      2. Name must include a dot.
+     *      3. The extention must not be .DLL.
+     */
+    fldrOpenExtentionFix =      isDllFixesEnabled()
+                            &&  plv->lv_class == CLASS_GLOBAL
+                            &&  memchr(pachFilename, '.', cchFilename)
+                            &&  (   cchFilename < 4
+                                 || memcmp(pachFilename + cchFilename - 4, ".DLL", 4));
 
     /*
@@ -189,4 +203,9 @@
     setLdrStateClearLoadingType();
 
+    /*
+     * Clear the extention fix flag.
+     */
+    fldrOpenExtentionFix = FALSE;
+
     return rc;
 }
