Index: trunk/src/win32k/pe2lx/pe2lx.cpp
===================================================================
--- trunk/src/win32k/pe2lx/pe2lx.cpp	(revision 5049)
+++ trunk/src/win32k/pe2lx/pe2lx.cpp	(revision 5050)
@@ -1,3 +1,3 @@
-/* $Id: pe2lx.cpp,v 1.23 2000-12-18 14:19:24 bird Exp $
+/* $Id: pe2lx.cpp,v 1.24 2001-02-02 08:35:54 bird Exp $
  *
  * Pe2Lx class implementation. Ring 0 and Ring 3
@@ -558,13 +558,12 @@
      *    alignment which is not a multiple of 64Kb. The sections are concatenated into one big object. */
     /* TODO! this test has to be enhanced a bit. WWPack32, new Borland++ depends on image layout. */
-    fAllInOneObject = (pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_RELOCS_STRIPPED) == IMAGE_FILE_RELOCS_STRIPPED;
-    fAllInOneObject = 1; /* KSO Fri 22.09.2000: for the time beeing we'll allways apply the alignment fix.
-                          * There are just too many apps failing because of missing baserelocations.
-                          * When I have explored the VDM flag of VMAllocMem I'll remove this.
-                          */
+    fAllInOneObject =  !isPEOneObjectDisabled() 
+                       && (   isPEOneObjectForced()
+                           || (pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_RELOCS_STRIPPED) == IMAGE_FILE_RELOCS_STRIPPED
+                           );
     if (fAllInOneObject)
     {
         printInf(("All-In-One-Object fix is applied.\n"));
-        if (pNtHdrs->OptionalHeader.ImageBase >= 0x04000000UL)
+        if (pNtHdrs->OptionalHeader.ImageBase >= 0x04000000UL && !(pNtHdrs->FileHeader.Characteristics & IMAGE_FILE_DLL))
             printWar(("ImageBase >= 64MB this object may not be runnable! (ImageBase=%#8x)\n",
                      pNtHdrs->OptionalHeader.ImageBase));
Index: trunk/src/win32k/pe2lx/pe2lxmain.cpp
===================================================================
--- trunk/src/win32k/pe2lx/pe2lxmain.cpp	(revision 5049)
+++ trunk/src/win32k/pe2lx/pe2lxmain.cpp	(revision 5050)
@@ -1,3 +1,3 @@
-/* $Id: pe2lxmain.cpp,v 1.5 2000-02-27 02:18:42 bird Exp $
+/* $Id: pe2lxmain.cpp,v 1.6 2001-02-02 08:35:54 bird Exp $
  *
  * Pe2Lx main program. (Ring 3 only!)
@@ -17,4 +17,6 @@
 #define INCL_DOSERRORS
 
+#define DATA16_GLOBAL
+#define OUTPUT_COM2     0x2f8
 
 /*******************************************************************************
@@ -32,4 +34,5 @@
 #include "modulebase.h"
 #include "pe2lx.h"
+#include "options.h"
 #include <stdio.h>
 #include <versionos2.h>
@@ -40,5 +43,5 @@
 *******************************************************************************/
 char szBackupWin32Filename[CCHMAXPATH]; /* too save stack/heap */
-
+struct options options = DEFAULT_OPTION_ASSIGMENTS;
 
 /*******************************************************************************
@@ -82,4 +85,14 @@
             switch (argv[argi][1])
             {
+                case '1':   /* All-In-One-Object fix - temporary...- -1<-|+|*> */
+                    if (argv[argi][2] == '-')
+                        options.fPEOneObject = FLAGS_PEOO_DISABLED;
+                    else if (argv[argi][2] == '+')
+                        options.fPEOneObject = FLAGS_PEOO_ENABLED;
+                    else
+                        options.fPEOneObject = FLAGS_PEOO_FORCED;
+                    break;
+
+
                 case 'h': /* syntax help */
                 case 'H':
@@ -232,5 +245,5 @@
 static void syntax()
 {
-    printf("Syntax: pe2lx.exe -W<0|1|2|3> <Win32File> [Odin32File]\n"
+    printf("Syntax: pe2lx.exe [-W<0|1|2|3>] [-1<+|-|[*]>] <Win32File> [Odin32File]\n"
            "\n"
            "  -W<0|1|2|3|4> Message filter level.\n"
@@ -242,4 +255,9 @@
            "                   -W4: Output absolutely all messages.\n"
            "                Default: -W3\n"
+           "  -1<+|-|[*]>   All-in-one-object fix.\n"
+           "                     +: Fix applied when necessary.\n"
+           "                     -: Disabled. Never applied.\n"
+           "                     *: Forced. Applied every time.\n"
+           "                Default: -1*\n"
            "  Win32File     Input Win32 Exe, Dll or other Win32 PE file.\n"
            "  Odin32File    Output Odin32-file. If not specified the Win32-file is\n"
