Changeset 1302 for trunk/dll/avl.c


Ignore:
Timestamp:
Nov 30, 2008, 6:28:52 AM (17 years ago)
Author:
Gregg Young
Message:

Add ini entry for LastArchiver so the previous archiver is selected in the select archive dialog if no default is provided. (Ticket 306) Part of remove or replace with a mutex semaphore DosEnterCriSec where appropriate. (Ticket 308)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/avl.c

    r1220 r1302  
    3333  22 Jun 08 GKY Added free_archivers for fortify checking
    3434  19 Jul 08 GKY ifdef Fortify free_archivers
     35  29 Nov 08 GKY Add ini entry for LastArchiver so the previous archiver is selected in the
     36                Select archive dialog if no default is provided.
     37  29 Nov 08 GKY Remove or replace with a mutex semaphore DosEnterCriSec where appropriate.
    3538
    3639***********************************************************************/
     
    8184BOOL arcsigsmodified;
    8285
     86#define ARCHIVER_LINE_BYTES     256
     87
    8388//=== quick_find_type() ===
    8489ARC_TYPE *quick_find_type(CHAR * filespec, ARC_TYPE * topsig)
     
    163168
    164169  // Try to reselect last selection unless user wants default selection
     170  if (sOldSelect == LIT_NONE) {
     171    ULONG size = sizeof(SHORT);
     172
     173    PrfQueryProfileData(fmprof, appname, "LastArchiver", &sOldSelect, &size);
     174  }
    165175  if (sOldSelect != LIT_NONE && !found) {
    166176    SHORT sItemCount =
     
    301311//=== get_line_strip_comments() read line, strip comments and whitespace ===
    302312
    303 #define ARCHIVER_LINE_BYTES     256
    304 
    305313static PSZ get_line_strip_comments(PSZ pszIn, FILE * fp)
    306314{
     
    359367  arcsigs_trailer_line_num = 0;
    360368
    361   DosEnterCritSec();
     369  //DosEnterCritSec(); //GKY 11-29-08
     370  DosRequestMutexSem(hmtxFM2Globals, SEM_INDEFINITE_WAIT);
    362371  psz = searchpath(GetPString(IDS_ARCHIVERBB2));
    363372  if (!psz || !*psz) {
    364     DosExitCritSec();
     373    DosReleaseMutexSem(hmtxFM2Globals);
     374    //DosExitCritSec();
    365375    return -1;
    366376  }
    367377  fp = _fsopen(psz, "r", SH_DENYWR);
    368   DosExitCritSec();
     378  DosReleaseMutexSem(hmtxFM2Globals);
     379  //DosExitCritSec();
    369380  if (!fp)
    370381    return -2;
     
    818829        if (!*szItemText)
    819830          pat = NULL;
    820         else {
     831        else {
    821832          for (; pat; pat = pat->next) {
    822833            if (pat->id && !strcmp(szItemText, pat->id))
     
    839850        return 0;
    840851      }
     852      PrfWriteProfileData(fmprof, appname, "LastArchiver", &sSelect, sizeof(SHORT));
    841853      sLastSelect = sSelect;
    842854      WinDismissDlg(hwnd, TRUE);
     
    858870                                          LM_QUERYSELECTION,
    859871                                          MPFROMSHORT(LIT_FIRST), MPVOID);
    860       if (sSelect != LIT_NONE)
    861         sLastSelect = sSelect;
     872      if (sSelect != LIT_NONE) {
     873        sLastSelect = sSelect;
     874        PrfWriteProfileData(fmprof, appname, "LastArchiver", &sSelect, sizeof(SHORT));
     875      }
    862876      *ppatReturn = NULL;
    863877      PostMsg(hwnd, WM_CLOSE, MPVOID, MPVOID);  // fixme to understand why needed
Note: See TracChangeset for help on using the changeset viewer.