Changeset 850 for trunk/dll/autoview.c


Ignore:
Timestamp:
Oct 7, 2007, 4:50:15 AM (18 years ago)
Author:
Steven Levine
Message:

Rework large file support wrappers (ticket #41)
Add code to avoid NTFS driver small file read defect (ticket #159)
Add debug code to try to catch David's drive bar exception
Another attempt to correct newview fast viewer text load failure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/autoview.c

    r846 r850  
    302302            HFILE handle;
    303303            ULONG olen, ibufflen, action, obufflen, l;
    304             CHAR *ibuff, *obuff, *p, buffer[80];
     304            CHAR *ibuff, *obuff, *p;
     305            // 06 Oct 07 SHL Protect against NTFS driver small buffer defect
     306            // CHAR buffer[80];
     307            CHAR buffer[4096];
    305308            ARC_TYPE *info;
    306309
     
    314317                         OPEN_FLAGS_RANDOMSEQUENTIAL | OPEN_SHARE_DENYNONE |
    315318                         OPEN_ACCESS_READONLY, 0)) {
    316               ibufflen = (AutoviewHeight < 96) ? 512 : 3072;
    317               ibuff = xmalloc(ibufflen + 2, pszSrcFile, __LINE__);
     319              ibufflen = AutoviewHeight < 96 ? 512 : 3072;
     320              // 06 Oct 07 SHL protect against NTFS driver small buffer defect
     321              // ibuff = xmalloc(ibufflen + 2, pszSrcFile, __LINE__);
     322              ibuff = xmalloc(min(ibufflen + 2, 4096), pszSrcFile, __LINE__);
    318323              if (ibuff) {
    319324                // Depends on CreateHexDump line width
     
    322327                if (obuff) {
    323328                  *obuff = 0;
    324                   if (!DosRead(handle,
    325                                ibuff, ibufflen, &ibufflen) && ibufflen) {
     329                  if (!DosRead(handle, ibuff, ibufflen, &ibufflen) &&
     330                               ibufflen)
     331                  {
    326332                    ibuff[ibufflen] = 0;
    327333                    p = obuff;
Note: See TracChangeset for help on using the changeset viewer.