Ignore:
Timestamp:
Mar 31, 2003, 4:53:32 AM (22 years ago)
Author:
bird
Message:

Cleaned up Customb Dll handling, pluss exclude dll feature. Added support for all object RW.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/win32k/pe2lx/pe2lxmain.cpp

    r6852 r9957  
    1 /* $Id: pe2lxmain.cpp,v 1.8 2001-09-28 07:43:03 sandervl Exp $
     1/* $Id: pe2lxmain.cpp,v 1.9 2003-03-31 02:52:50 bird Exp $
    22 *
    33 * Pe2Lx main program. (Ring 3 only!)
     
    129129                    break;
    130130
    131                 case 'f': //ignore internal fixups
     131                case 'f': /* ignore internal fixups */
    132132                case 'F':
    133133                    options.fSkipFixups = TRUE;
    134134                    break;
    135135
    136                 case 'c':
    137                 case 'C': //custom odin dll name
    138                     if(!hasCustomExports()) {
    139                         printf("Syntax error: export table file not specified (/O).\n\n");
     136                case 'r': /* all read-write objects */
     137                case 'R':
     138                    if (argv[argi][2] != 'w' && argv[argi][2] != 'W')
     139                    {
     140                        printf("Syntax error: Invalid argument, '%s'\n", argv[argi]);
    140141                        return 5;
    141142                    }
     143                    options.fAllRWObjects = TRUE;
     144                    break;
     145
     146                case 'c': /* custom odin dll name */
     147                case 'C':
     148                    if (!hasCustomExports())
     149                    {
     150                        printf("Syntax error: export table file not specified (-o:).\n\n");
     151                        return 5;
     152                    }
    142153                    options.pszCustomDll = &argv[argi][3];
    143154                    break;
    144                 case 'o':
     155
     156                case 'o': /* custom odin dll ordinal mapping */
    145157                case 'O':
    146158                {
     
    152164                    read(fileIn, options.pszCustomExports, sizein);
    153165                    close(fileIn);
     166                    break;
     167                }
     168
     169                case 'x': /* custombuild exclude dll */
     170                case 'X':
     171                {
     172                    int cch = strlen(&argv[argi][3]);
     173                    if (!cch)
     174                    {
     175                        printf("Syntax error: optino -x: requires a dll name!");
     176                        return 5;
     177                    }
     178                    int cchNew = cch + 4;
     179                    if (options.pszCustomDllExclude)
     180                        cchNew += strlen(options.pszCustomDllExclude);
     181                    options.pszCustomDllExclude = (char*)realloc(options.pszCustomDllExclude, cchNew);
     182
     183                    char *psz = options.pszCustomDllExclude;
     184                    if (cchNew != cch + 4)
     185                        psz = psz + strlen(psz);
     186
     187                    /* copy the name in uppercase with ';' at both ends. */
     188                    *psz++ = ';';
     189                    for (strcpy(psz, &argv[argi][3]); *psz; psz++)
     190                        if (*psz >= 'a' && *psz <= 'z')
     191                            *psz += ('A' - 'a');
     192                    *psz++ =';';
     193                    *psz = '\0';
    154194                    break;
    155195                }
     
    293333           "                     *: Forced. Applied every time.\n"
    294334           "                Default: -1*\n"
     335           "  -rw           Make all segments writable. For use with -1+. A trick to make\n"
     336           "                it possible for OS/2 to load the objects following on another.\n"
     337           "                This of course doesn't solve the alignment difference. So if\n"
     338           "                you build the program pass /ALIGN:0x10000 to the linker.\n"
     339           "  -f            Strip fixups forcing. Don't use with DLLs, may cause traps.\n"
     340           "\n"
     341           " Custombuild options:\n"
     342           "  -o:<ordfile>  Ordinal file. form: <W32DLL>.<name/ord> @<CustDLLOrd>\n"
     343           "  -c:<custdll>  Custombuild dll. After -o:!\n"
     344           "  -x:<dll>      Exclude from custombuild. -x:MSVCRT for example.\n"
     345           "\n"
    295346           "  Win32File     Input Win32 Exe, Dll or other Win32 PE file.\n"
    296347           "  Odin32File    Output Odin32-file. If not specified the Win32-file is\n"
Note: See TracChangeset for help on using the changeset viewer.