Changeset 563


Ignore:
Timestamp:
Mar 15, 2007, 6:21:34 AM (19 years ago)
Author:
Steven Levine
Message:

Avoid DosStartSession viewer hangs

Location:
trunk/dll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r562 r563  
    132132          if (*viewer) {
    133133            ExecOnList((HWND) 0, viewer, WINDOWED | SEPARATE |
    134                         (fViewChild ? CHILD : 0),
     134                        (fViewChild ? CHILD : 0),
    135135                       NULL, list, NULL);
    136136          }
     
    379379    DosError(FERR_DISABLEHARDERR);
    380380    if (!DosQAppType(s, &apptype) &&
    381         ((apptype & FAPPTYP_DOS) ||
    382          (apptype & FAPPTYP_WINDOWSREAL) ||
    383          (apptype & FAPPTYP_WINDOWSPROT) || (apptype & 0x1000))) {
     381        (apptype & FAPPTYP_DOS ||
     382         apptype & FAPPTYP_WINDOWSREAL ||
     383         apptype & FAPPTYP_WINDOWSPROT ||
     384         apptype & FAPPTYP_WINDOWSPROT31)) {
    384385      p = GetCmdSpec(TRUE);
    385386      runemf2(SEPARATE | INVISIBLE | MINIMIZED | BACKGROUND | WAIT,
     
    13471348                needs_quoting(s) ? "\"" : NullStr,
    13481349                s,
    1349                 needs_quoting(s) ? "\"" : NullStr);
     1350                needs_quoting(s) ? "\"" : NullStr);
    13501351
    13511352        // printf("%s %d runemf2 returned\n", __FILE__, __LINE__); fflush(stdout);      // 10 Mar 07 SHL
     
    21572158        }
    21582159      }
    2159       if ((dcd->arcfilled &&
    2160            !dcd->totalfiles) || !IsArcThere(hwnd, dcd->arcname))
     2160      if ((dcd->arcfilled && !dcd->totalfiles) ||
     2161          !IsArcThere(hwnd, dcd->arcname))
    21612162        PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);
    21622163    }
     
    25262527          hwndActive = WinQueryFocus(HWND_DESKTOP);
    25272528          WinSetFocus(HWND_DESKTOP,
    2528                       ((hwndActive == hwnd) ?
    2529                        WinWindowFromID(dcd->hwndClient, ARC_EXTRACTDIR) :
    2530                        hwnd));
     2529                      hwndActive == hwnd ?
     2530                        WinWindowFromID(dcd->hwndClient, ARC_EXTRACTDIR) :
     2531                        hwnd);
    25312532        }
    25322533        break;
     
    26742675              (!fExternalCollector && !strcmp(realappname, FM3Str)))
    26752676            GetNextWindowPos(dcd->hwndParent, &swp, NULL, NULL);
    2676           hwndC = StartCollector((fExternalCollector ||
    2677                                   strcmp(realappname, FM3Str)) ?
    2678                                  HWND_DESKTOP : dcd->hwndParent, 4);
     2677          hwndC = StartCollector(fExternalCollector ||
     2678                                   strcmp(realappname, FM3Str) ?
     2679                                     HWND_DESKTOP : dcd->hwndParent, 4);
    26792680          if (hwndC) {
    26802681            if (!ParentIsDesktop(hwnd, dcd->hwndParent) && !fAutoTile &&
  • trunk/dll/systemf.c

    r562 r563  
    10821082      }
    10831083
    1084      // printf("%s %d DosStartsession thread 0x%x data\n ",
     1084      // printf("%s %d DosStartsession thread 0x%x data\n ",
    10851085      //       __FILE__, __LINE__,ptib->tib_ordinal); fflush(stdout);   // 10 Mar 07 SHL hang
    1086      // printf(" %d %d %d %s %s %s %d %d\n %s %x %x\n",
     1086      // printf(" %d %d %d %s %s %s %d %d\n %s %x %x\n",
    10871087      //       sdata.Length , sdata.Related, sdata.FgBg, sdata.PgmName,
    1088         //     sdata.PgmInputs, sdata.TermQ, sdata.InheritOpt,
    1089           //   sdata.SessionType, szTermQName,
    1090        //   hTermQ, hTermQSem); fflush(stdout);
     1088      //     sdata.PgmInputs, sdata.TermQ, sdata.InheritOpt,
     1089      //   sdata.SessionType, szTermQName,
     1090      //   hTermQ, hTermQSem); fflush(stdout);
    10911091      ret = DosStartSession(&sdata, &ulSessID, &sessPID);
    1092       if (type & WAIT) {
    1093        // printf("%s %d DosStartession thread 0x%x rc = %d sess = %u pid = 0x%x\n",
    1094        //        __FILE__, __LINE__, ptib->tib_ordinal,ret, ulSessID, sessPID); fflush(stdout); // 10 Mar 07 SHL hang
    1095       }
    1096       else {
    1097        // printf("%s %d DosStartession thread 0x%x nowait rc = %d\n",
    1098          //      __FILE__, __LINE__, ptib->tib_ordinal,ret); fflush(stdout);    // 10 Mar 07 SHL hang
    1099       }
     1092
     1093      // if (type & WAIT) {
     1094      // printf("%s %d DosStartession thread 0x%x rc = %d sess = %u pid = 0x%x\n",
     1095      //        __FILE__, __LINE__, ptib->tib_ordinal,ret, ulSessID, sessPID); fflush(stdout);  // 10 Mar 07 SHL hang
     1096      // }
     1097      // else {
     1098      // printf("%s %d DosStartession thread 0x%x nowait rc = %d\n",
     1099      //      __FILE__, __LINE__, ptib->tib_ordinal,ret); fflush(stdout);       // 10 Mar 07 SHL hang
     1100      // }
    11001101
    11011102      if (pszDirectory && *pszDirectory)
     
    11131114          STATUSDATA sd;
    11141115          // Could not create queue - fallback - fixme to be gone?
    1115          // printf("%s %d waiting wo/termq\n", __FILE__, __LINE__); fflush(stdout);     // 12 Mar 07 SHL hang
     1116          // printf("%s %d waiting wo/termq\n", __FILE__, __LINE__); fflush(stdout);    // 12 Mar 07 SHL hang
    11161117
    11171118          memset(&sd, 0, sizeof(sd));
     
    11251126              break;
    11261127            if (ctr > 10) {
    1127            //   printf("%s %d thread 0x%x showing slow sess %u pid 0x%x\n",
    1128              //        __FILE__, __LINE__,ptib->tib_ordinal,ulSessID,sessPID); fflush(stdout);  // 12 Mar 07 SHL
     1128              //   printf("%s %d thread 0x%x showing slow sess %u pid 0x%x\n",
     1129              //        __FILE__, __LINE__,ptib->tib_ordinal,ulSessID,sessPID); fflush(stdout); // 12 Mar 07 SHL
    11291130              ShowSession(hwnd, sessPID);       // Show every 2 seconds
    11301131              ctr = 0;
     
    11451146            else {
    11461147              if (ctr == 20) {
    1147                // printf("%s %d thread 0x%x showing slow sess %u pid 0x%x\n",
     1148                // printf("%s %d thread 0x%x showing slow sess %u pid 0x%x\n",
    11481149                //       __FILE__, __LINE__,ptib->tib_ordinal,ulSessID,sessPID); fflush(stdout);
    11491150                ShowSession(hwnd, sessPID);             // Show long running session
    11501151              }
    1151              // printf("%s %d thread 0x%x waiting for slow sess %u pid 0x%x\n",
    1152                //      __FILE__, __LINE__,ptib->tib_ordinal,ulSessID, sessPID); fflush(stdout);
    11531152              rc = DosReadQueue(hTermQ, &rq, &ulLength, (PPVOID)&pTermInfo, 0,
    11541153                                DCWW_WAIT, &bPriority, 0);
     
    11621161            }
    11631162
    1164           //  printf("%s %d DosReadQueue thread 0x%x sess %u sessRC %u rq.pid 0x%x rq.data 0x%x\n",
     1163            //  printf("%s %d DosReadQueue thread 0x%x sess %u sessRC %u rq.pid 0x%x rq.data 0x%x\n",
    11651164            //       __FILE__, __LINE__,ptib->tib_ordinal,pTermInfo->usSessID,pTermInfo->usRC,rq.pid, rq.ulData); fflush(stdout);
    11661165
    1167             // might be looping here if confused about session id - fixme to ensure not possible?
    11681166            if (pTermInfo->usSessID == ulSessID)
    11691167              break;                    // Our session is done
     
    11721170            {
    11731171              static ULONG ulLastSessID;
    1174              // printf("%s %d requeue thread 0x%x our sess %u term sess %u term rc %u\n",
     1172              // printf("%s %d requeue thread 0x%x our sess %u term sess %u term rc %u\n",
    11751173              //       __FILE__, __LINE__,ptib->tib_ordinal,ulSessID,pTermInfo->usSessID,pTermInfo->usRC); fflush(stdout);
    11761174              // fixme to be gone when no longer needed for debug?
     
    11881186
    11891187          ret = pTermInfo->usRC == 0;           // Set 1 if rc 0 else 0
    1190          // printf("%s %d thread 0x%x term for sess %u\n",
    1191            //      __FILE__, __LINE__,ptib->tib_ordinal,ulSessID);fflush(stdout);
     1188          // printf("%s %d thread 0x%x term for sess %u\n",
     1189          //      __FILE__, __LINE__,ptib->tib_ordinal,ulSessID);fflush(stdout);
    11921190          DosFreeMem(pTermInfo);
    11931191        }
Note: See TracChangeset for help on using the changeset viewer.