Changeset 4271 for trunk/tools


Ignore:
Timestamp:
Sep 16, 2000, 5:17:07 PM (25 years ago)
Author:
bird
Message:

Added dummy signature to LX files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/dbginfo/kHll.cpp

    r4130 r4271  
    1 /* $Id: kHll.cpp,v 1.15 2000-08-31 03:02:27 bird Exp $
     1/* $Id: kHll.cpp,v 1.16 2000-09-16 15:17:07 bird Exp $
    22 *
    33 * kHll - Implementation of the class kHll.
     
    22342234                                lPosDebug = e32.e32_debuginfo;
    22352235                            else
    2236                                 lPosDebug = (cbLXFile + 0x400) & ~0x1FF; //try do some alignment.
     2236                                lPosDebug = cbLXFile;
     2237                                //lPosDebug = (cbLXFile + 0x400) & ~0x1FF; //try do some alignment.
    22372238
    22382239                            /*
     
    22482249                                {
    22492250                                    /*
    2250                                      * Update exeheader.
     2251                                     * Write dummy signature (_VerifySignature in the OS2KRNL checks this).
    22512252                                     */
    2252                                     e32.e32_debuglen = cch;
    2253                                     e32.e32_debuginfo = lPosDebug;
    2254                                     if (fseek(phFile, lPosLXHdr, SEEK_SET) == 0)
     2253                                    static char aFakeSig[0x200] = {0};
     2254                                    if (fseek(phFile, 0, SEEK_END) == 0)
    22552255                                    {
    2256                                         /*
    2257                                          * Write the updated header to disk.
    2258                                          */
    2259                                         cch = fwrite(&e32, 1, sizeof(e32), phFile);
    2260                                         if (cch == sizeof(e32))
    2261                                             rc = NO_ERROR;
     2256                                        if (fwrite(&aFakeSig[0], 1, sizeof(aFakeSig), phFile) == sizeof(aFakeSig))
     2257                                        {
     2258                                            cch += sizeof(aFakeSig);
     2259
     2260                                            /*
     2261                                             * Update exeheader.
     2262                                             */
     2263                                            e32.e32_debuglen = cch;
     2264                                            e32.e32_debuginfo = lPosDebug;
     2265                                            if (fseek(phFile, lPosLXHdr, SEEK_SET) == 0)
     2266                                            {
     2267                                                /*
     2268                                                 * Write the updated header to disk.
     2269                                                 */
     2270                                                cch = fwrite(&e32, 1, sizeof(e32), phFile);
     2271                                                if (cch == sizeof(e32))
     2272                                                    rc = NO_ERROR;
     2273                                                else
     2274                                                    rc = ERROR_WRITE_FAULT;
     2275                                            }
     2276                                            else
     2277                                                rc = ERROR_SEEK;
     2278                                        }
    22622279                                        else
     2280                                        {
     2281                                            fprintf(stderr, "warning - failed to write fake signature.\n");
    22632282                                            rc = ERROR_WRITE_FAULT;
     2283                                        }
    22642284                                    }
    22652285                                    else
Note: See TracChangeset for help on using the changeset viewer.