home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / iffconverter / loadsavepicture.c < prev    next >
C/C++ Source or Header  |  1997-01-07  |  23KB  |  559 lines

  1. /*
  2. **     $VER: LoadSavePicture.c V0.10 (21-08-95)
  3. **
  4. **     Author:  Gerben Venekamp
  5. **     Updates: 19-06-95  Version 0.01       Intial module
  6. **              21-08-95  Version 0.02       GetFileName() has been modified so that Load and Save
  7. **                                           picture can use their own variables and ASL FileRequester
  8. **                                           structure.
  9. **
  10. **  LoadSavePicture.c this is where a picture gets loaded or pictures
  11. **  get loaded. Also saving picture/pictures is handled here.
  12. **
  13. */
  14.  
  15.  
  16. #include <datatypes/pictureclass.h>
  17. #include <exec/types.h>
  18. #include <exec/execbase.h>
  19. #include <exec/memory.h>
  20. #include <libraries/asl.h>
  21. #include <proto/asl.h>
  22. #include <proto/dos.h>
  23. #include <proto/iffparse.h>
  24.  
  25. #include "IFFConverter.h"
  26.  
  27. // Defining variables
  28. struct ExecBase *SysBase;
  29. BPTR LoadFileName_lock;
  30. BPTR SaveFileName_lock;
  31.  
  32. ULONG Asl_FRTags_Single[] = {
  33.    ASLFR_DoMultiSelect, FALSE,
  34.    ASLFR_DrawersOnly, FALSE,
  35. TAG_DONE
  36. };
  37.  
  38. ULONG Asl_FRTags_Sequence[] = {
  39.    ASLFR_DoMultiSelect, FALSE,
  40.    ASLFR_DrawersOnly, FALSE,
  41.    TAG_DONE
  42. };
  43.  
  44. ULONG Asl_FRTags_Multiple[] = {
  45.    ASLFR_DoMultiSelect, TRUE,
  46. ASLFR_DrawersOnly, FALSE,
  47. TAG_DONE
  48. };
  49.  
  50. ULONG Asl_FRTags_Dir[] = {
  51.    ASLFR_DoMultiSelect, FALSE,
  52.    ASLFR_DrawersOnly, TRUE,
  53.    TAG_DONE
  54. };
  55.  
  56. // NOTE: This structure is also used in SavePicture.a so *ANY* change to this
  57. //       structure should also be made to Savepicture.a
  58. struct Save_Buffer_struct {
  59.    UBYTE *Buffer;
  60.    ULONG BufferSize;
  61.    ULONG BufferLeft;
  62.    BPTR  FileHeader;
  63. };
  64.  
  65.  
  66. // Defining prototypes
  67. void AddExtension(STRPTR, STRPTR);
  68. BOOL GetFileName(APTR, ULONG *, BPTR *, struct FileRequester *, ULONG *, LONG );
  69. void LoadPicture(enum FileModeType);
  70. void  SavePicture(SavePicStruct_t *);
  71. //void SavePicture(struct Screen *, enum FileModeType, enum RenderModeType, IFFClip_s *);
  72. void __asm SaveCopperAGA(register __a2 ULONG *,
  73.                          register __a3 APTR);
  74. void __asm SaveCopperECS(register __a2 ULONG *,
  75.                          register __a3 APTR);
  76. void __asm SaveCopper32bit(register __a2 ULONG *,
  77.                            register __a3 APTR);
  78. void __asm SaveCopper4bit(register __a2 ULONG *,
  79.                           register __a3 APTR);
  80. void __asm SaveFont8(register __a2 struct BitMap *,
  81.                      register __a3 APTR);
  82. void __asm SaveInterleave(register __a0 struct BitMap *,
  83.                           register __a1 APTR,
  84.                           register __a2 APTR,
  85.                           register __a3 APTR);
  86. void __asm SaveRaw(register __a0 struct BitMap *,
  87.                    register __a1 APTR,
  88.                    register __a2 APTR,
  89.                    register __a3 APTR);
  90.  
  91.  
  92. /*
  93. **  LoadPicture(fm_FileMode)
  94. **
  95. **     Loads one or more pictures. When 'FileMode' is 'Single',
  96. **     'LoadPicture' will load a single picture and displays it. In all
  97. **     other cases 'LoadPicture' will load the pictures, ask the place
  98. **     to save them, convert and save them one by one.
  99. **
  100. **  pre:  fm_FileMode - Depending on 'fm_FileMode', 'LoadPicture' acts
  101. **                      differently. When 'fm_FileMode' equals:
  102. **                        Single   - An IFF ILBM picture is loaded and
  103. **                                   displayed. User is able to adjust the
  104. **                                   clipping reagon and then save the
  105. **                                   clipped picture.
  106. **                        Sequence - Loads a sequence of IFF ILBM pictures.
  107. **                                   File name is determined by a basename
  108. **                                   followed by a dot and then a number
  109. **                                   consisting out of 4 digits. You can
  110. **                                   select a clipping reagon for the first
  111. **                                   picture. All other pictures will use
  112. **                                   this clipping.
  113. **                        Multiple - Loads one or more IFF ILBM pictures
  114. **                                   and saves them automaticly. No clipping
  115. **                                   is possible.
  116. **                        Dir      - All files in a particular directory
  117. **                                   are tested for IFF ILBM. If so, then
  118. **                                   the picture is automaticly saved. So,
  119. **                                   no clipping is possible.
  120. **  post: None.
  121. **
  122. */
  123. void LoadPicture(enum FileModeType fm_FileMode)
  124. {
  125.    UWORD register Temp_Width;
  126.    UWORD register Temp_Height;
  127.    UWORD register Temp_Depth;
  128.    ULONG register Temp_Size;
  129.  
  130.    ULONG register *Asl_FRTags;
  131.    
  132.    LONG rc;
  133.    struct IFFHandle *iff = NULL;
  134.    
  135.    switch( fm_FileMode )
  136.    {
  137.       case FM_Single:
  138.          Asl_FRTags = Asl_FRTags_Single;
  139.          break;
  140.       case FM_Sequence:
  141.          Asl_FRTags = Asl_FRTags_Sequence;
  142.          ErrorHandler(IFFerror_NotImplemented, "Load Sequence");
  143.          return;
  144.          break;
  145.       case FM_Multiple:
  146.          Asl_FRTags = Asl_FRTags_Multiple;
  147.          ErrorHandler(IFFerror_NotImplemented, "Load Multiple");
  148.          return;
  149.          break;
  150.       case FM_Dir:
  151.          Asl_FRTags = Asl_FRTags_Dir;
  152.          ErrorHandler(IFFerror_NotImplemented, "Load Dir");
  153.          return;
  154.          break;
  155.    }
  156.    
  157.    if( GetFileName(&LoadFileName, &LoadFileNameSize, &LoadFileName_lock, Asl_FRLoad, Asl_FRTags, ACCESS_READ) )
  158.    {
  159.       if(iff = AllocIFF())
  160.       {
  161.          if( iff->iff_Stream = OpenFromLock(LoadFileName_lock) )
  162.          {
  163.             InitIFFasDOS(iff);
  164.             if( !OpenIFF(iff, IFFF_READ) )
  165.             {
  166.                if( !ParseIFF(iff, IFFPARSE_STEP) )
  167.                {
  168.                   struct ContextNode *cn = NULL;
  169.                   
  170.                   if( (cn = CurrentChunk(iff)) && (cn->cn_ID == ID_FORM) )
  171.                   {
  172.                      LONG propArray[] = { ID_ILBM, ID_CAMG,
  173.                                           ID_ILBM, ID_BMHD,
  174.                                           ID_ILBM, ID_CMAP,
  175.                                           ID_ILBM, ID_BODY
  176.                      };
  177.                      
  178.                      if( !PropChunks(iff, propArray, 4) )
  179.                      {
  180.                         if( !StopOnExit(iff, ID_ILBM, ID_FORM) )
  181.                         {
  182.                            rc = ParseIFF(iff, IFFPARSE_SCAN);
  183.                            if( rc==0 || rc==IFFERR_EOC )
  184.                            {
  185.                               struct StoredProperty *sp;
  186.                               
  187.                               if(sp = FindProp(iff, ID_ILBM, ID_BMHD))
  188.                               {
  189.                                  struct BitMapHeader *BitMapHdr = sp->sp_Data;
  190.                                  
  191.                                  if( sp = FindProp(iff, ID_ILBM, ID_CAMG) )
  192.                                  {
  193.                                     ULONG DisplayMode = *(ULONG *) sp->sp_Data;
  194.                                     
  195.                                     if( sp = FindProp(iff, ID_ILBM, ID_CMAP) )
  196.                                     {
  197.                                        APTR CMapData = sp->sp_Data;
  198.                                        
  199.                                        if( sp = FindProp(iff, ID_ILBM, ID_BODY) )
  200.                                        {
  201.                                           switch( RebuildViewScreen(BitMapHdr, DisplayMode, CMapData, sp->sp_Data) )
  202.                                           {
  203.                                              case RVS_Okay:
  204.                                                 PictureValid = TRUE;
  205.                                                 
  206.                                                 Temp_Width  = BitMapHdr->bmh_Width;
  207.                                                 Temp_Height = BitMapHdr->bmh_Height;
  208.                                                 Temp_Depth  = BitMapHdr->bmh_Depth;
  209.                                                 Temp_Size   = ((Temp_Width + 7) >> 3) * Temp_Height * Temp_Depth;
  210.                                                 
  211.                                                 PicWidth  = Temp_Width;
  212.                                                 PicHeight = Temp_Height;
  213.                                                 PicSize   = IFFClip.ClipSize   = Temp_Size;
  214.                                                 PicDepth  = Temp_Depth;
  215.                                                 IFFClip.ClipLeft  = 0;
  216.                                                 IFFClip.ClipTop   = 0;
  217.                                                 
  218.                                                 IFFClip.ClipWidth  = Temp_Width  - 1;
  219.                                                 IFFClip.ClipHeight = Temp_Height - 1;
  220.                                                 
  221.                                                 // Mark as first clipping
  222.                                                 OldClipLeft = -1;
  223.                                                 
  224.                                                 UpdateDimensions(GD_PicWidth,   PicWidth,
  225.                                                                  GD_PicHeight,  PicHeight,
  226.                                                                  GD_PicDepth,   PicDepth,
  227.                                                                  GD_PicSize,    PicSize,
  228.                                                                  GD_ClipWidth,  IFFClip.ClipWidth + 1,
  229.                                                                  GD_ClipHeight, IFFClip.ClipHeight + 1,
  230.                                                                  GD_ClipLeft,   IFFClip.ClipLeft,
  231.                                                                  GD_ClipTop,    IFFClip.ClipTop,
  232.                                                                  GD_ClipSize,   IFFClip.ClipSize,
  233.                                                                  GD_Sentinal);
  234.                                                 
  235.                                                 UpdateGadgets(GD_Save,       &EnableGadget,
  236.                                                               GD_ClipWidth,  &EnableGadget,
  237.                                                               GD_ClipHeight, &EnableGadget,
  238.                                                               GD_ClipLeft,   &EnableGadget,
  239.                                                               GD_ClipTop,    &EnableGadget,
  240.                                                               TAG_DONE);
  241.                                                 break;
  242.                                              case RVS_PictureFailure:
  243.                                              case RVS_NoWindow_PictureOkay:
  244.                                              case RVS_NoWindow_PictureFailure:
  245.                                              case RVS_BlackScreen:
  246.                                              case RVS_NoScreen:
  247.                                              case RVS_NoColourMap:;
  248.                                           }
  249.                                        }
  250.                                        else
  251.                                           ErrorHandler( IFFerror_NotFound, "BODY Chunk" );
  252.                                     }
  253.                                     else
  254.                                        ErrorHandler( IFFerror_NotFound, "CMAP Chunk" );
  255.                                  }
  256.                                  else
  257.                                     ErrorHandler( IFFerror_NotFound, "CMAG Chunk" );
  258.                               }
  259.                               else
  260.                                  ErrorHandler( IFFerror_NotFound, "BitMapHeader" );
  261.                            }
  262.                            else
  263.                               ErrorHandler( IFFerror_Fail, "IFFParse" );
  264.                         }
  265.                         else
  266.                            ErrorHandler( IFFerror_Fail, "StopOnExit" );
  267.                      }
  268.                      else
  269.                         ErrorHandler( IFFerror_Fail, "PropChunks" );
  270.                   }
  271.                   else
  272.                      ErrorHandler( IFFerror_NoIFFErr, NULL );
  273.                }
  274.                else
  275.                   ErrorHandler( IFFerror_Fail, "ParseIFF" );
  276.                
  277.                CloseIFF(iff);
  278.             }
  279.             else
  280.                ErrorHandler( IFFerror_Fail, "OpenIFF" );
  281.             
  282.             Close(iff->iff_Stream);
  283.          }
  284.          else
  285.             ErrorHandler( IFFerror_Fail, "OpenFromLock" );
  286.          
  287.          FreeIFF(iff);
  288.       }
  289.       else
  290.          ErrorHandler( IFFerror_Fail, "AllocIFF" );
  291.    }
  292. // Remember that when a 'FileName' could not been gotten, a message
  293. // has been displayed to notify the user. So no addtional actions
  294. // are required at this stage.
  295.    
  296. }
  297.  
  298.  
  299. /*
  300. **  SavePicture(PicScreen, fm_FileMode, rm_RenderMode, Clip)
  301. **
  302. **     Save one or more pictures to disk.
  303. **
  304. **  pre:  PicScreen - Pointer to the screen to be saved.
  305. **        fm_Filemode - Mode of file to be saved.
  306. **        fm_Rendermode - Mode of file to be saved.
  307. **        Clip - Pointer to a clipping reagon
  308. **  post: None.
  309. **
  310. */
  311. //void SavePicture(struct Screen *PicScreen, enum FileModeType fm_FileMode, enum RenderModeType rm_RenderMode, IFFClip_s *IFFClip)
  312. void  SavePicture(SavePicStruct_t *PictureToSave)
  313. {
  314.    ULONG register *Asl_FRTags;
  315.    
  316.    switch( PictureToSave->FileMode )
  317.    {
  318.       case FM_Single:
  319.          Asl_FRTags = Asl_FRTags_Single;
  320.          break;
  321.       case FM_Sequence:
  322.          ErrorHandler(IFFerror_NotImplemented, "Save Sequence");
  323.          break;
  324.       case FM_Multiple:
  325.          ErrorHandler(IFFerror_NotImplemented, "Save Multiple");
  326.          break;
  327.       case FM_Dir:
  328.          ErrorHandler(IFFerror_NotImplemented, "Save Dir");
  329.          break;
  330.    }
  331.    
  332.    if( GetFileName(&SaveFileName, &SaveFileNameSize, &SaveFileName_lock, Asl_FRSave, Asl_FRTags, ACCESS_WRITE) )
  333.    {
  334.       struct Save_Buffer_struct SaveBuf;
  335.       
  336.       // Check to see whether we need to allocate memory for a screen buffer or
  337.       // for a copperlist / colourmap.
  338.       if( PictureToSave->RenderMode == RM_Copper )
  339.          SaveBufferSize = 16000;
  340.       else
  341.          SaveBufferSize = PictureToSave->IFFClip.ClipSize;
  342.          
  343.       if( !(AllocThisMemNoComplain(&SaveBuffer, SaveBufferSize, MEMF_CLEAR)) )
  344.       {
  345.          SaveBufferSize = DefaultSaveBufferSize;
  346.          if( !(AllocThisMemNoComplain(&SaveBuffer, SaveBufferSize, MEMF_CLEAR)) )
  347.             SaveBufferSize = 0;
  348.       }
  349.       
  350.       // All locks need to be unlocked. Since getting a name also means getting a lock
  351.       // and we don't use this lock, we need to unlock it. Easy huh.
  352.       UnLock(SaveFileName_lock);
  353.       
  354.       SaveBuf.Buffer     = SaveBuffer;
  355.       SaveBuf.BufferSize = SaveBuf.BufferLeft = SaveBufferSize;
  356.       SaveBuf.FileHeader = Open(SaveFileName, MODE_NEWFILE);
  357.  
  358.       switch( PictureToSave->RenderMode )
  359.       {
  360.          case RM_Interleave:
  361.             FreeThisMem(&PlanePtrs, PlanePtrsSize);
  362.             PlanePtrsSize = (PictureToSave->ViewScreen->ViewPort.RasInfo->BitMap->Depth)<<2;
  363.             AllocThisMem(&PlanePtrs, PlanePtrsSize, MEMF_CLEAR);
  364.             
  365.             SaveInterleave( PictureToSave->ViewScreen->RastPort.BitMap, PlanePtrs, &(PictureToSave->IFFClip), &SaveBuf );
  366.             break;
  367.             
  368.          case RM_Raw:
  369.             FreeThisMem(&PlanePtrs, PlanePtrsSize);
  370.             PlanePtrsSize = (PictureToSave->ViewScreen->ViewPort.RasInfo->BitMap->Depth)<<2;
  371.             AllocThisMem(&PlanePtrs, PlanePtrsSize, MEMF_CLEAR);
  372.             
  373.             SaveRaw( PictureToSave->ViewScreen->RastPort.BitMap, PlanePtrs, &(PictureToSave->IFFClip), &SaveBuf );
  374.             break;
  375.             
  376.          case RM_Copper:
  377.             // Close and delete current file. This is necessary because it is not
  378.             // the right name it's just a base name. What we need are base names
  379.             // with the proper extensions. Call this a diry hack, but it works.
  380.             // What we do is build some sort of colourmap and save each different
  381.             // colourmap to a file. Since we maintain only one buffer, we can also
  382.             // hold just one filehandle. This means that we need to close the buffer
  383.             // and open a new file.
  384.             Close(SaveBuf.FileHeader);    // Wrong name! So close it.
  385.             DeleteFile(SaveFileName);     // Now delete it, because it's just an empty file.
  386.             
  387.             // Extra space has been reserved to fit an extension. So no worries
  388.             // about array boundries.
  389.             AddExtension(SaveFileName, ".AGA");
  390.             SaveBuf.FileHeader = Open(SaveFileName, MODE_NEWFILE);
  391.             SaveCopperAGA( ColourMap, &SaveBuf );
  392.             Close(SaveBuf.FileHeader);
  393.             
  394.             AddExtension(SaveFileName, ".ECS");
  395.             SaveBuf.FileHeader = Open(SaveFileName, MODE_NEWFILE);
  396.             SaveCopperECS( ColourMap, &SaveBuf );
  397.             Close(SaveBuf.FileHeader);
  398.             
  399.             AddExtension(SaveFileName, ".32bit");
  400.             SaveBuf.FileHeader = Open(SaveFileName, MODE_NEWFILE);
  401.             SaveCopper32bit( ColourMap, &SaveBuf );
  402.             Close(SaveBuf.FileHeader);
  403.             
  404.             AddExtension(SaveFileName, ".4bit");
  405.             SaveBuf.FileHeader = Open(SaveFileName, MODE_NEWFILE);
  406.             SaveCopper4bit( ColourMap, &SaveBuf );
  407.             // Do NOT Close. This will be done outside the switch statement.
  408.             
  409.             break;
  410.          case RM_Font8:
  411.             SaveFont8( ViewScreen->RastPort.BitMap, &SaveBuf) ;
  412.             break;
  413.       }
  414.       
  415.       Close(SaveBuf.FileHeader);
  416.       
  417.       FreeThisMem(&SaveBuffer, SaveBufferSize);
  418.    }
  419. }
  420.  
  421.  
  422. /*
  423. **  AddExtension( BaseName, BaseNameLenghth, Extension )
  424. **
  425. **     Add an extension to a basename. If an extension already exists,
  426. **     it will be replaced by the new extention.
  427. **
  428. **  pre:  BaseName - Pointer to a basename.
  429. **        BaseNameLength - Length of the basename in bytes.
  430. **        Extension - Extension tot add.
  431. **  post: BaseName - Pointer to the updates basename
  432. **
  433. */
  434. void AddExtension(STRPTR BaseName, STRPTR Extension)
  435. {
  436.    // Locate the end of the base filename.
  437.    while( (*BaseName != '\0') && (*BaseName != '.') )
  438.       *BaseName++;
  439.       
  440.    // Make sure the String terminator '\0' is included! This makes
  441.    // it possible to overwrite an old extension.
  442.    do
  443.       *BaseName++ = *Extension;
  444.    while(*Extension++ != '\0');
  445. }
  446.  
  447.  
  448. /*
  449. **  succes = GetFileName(FileName, FileNameSize, FileName_lock, Asl_FileRequester, Asl_FRTags, accessMode)
  450. **
  451. **     Get a file name through an Asl FileRequester.
  452. **
  453. **  pre:  FileName - Pointer to an address of a pointer variable
  454. **                   which holds the address of block of allocated
  455. **                   memory.
  456. **        FileNameSize - Pointer to a variable which hold the length
  457. **                       of the file name.
  458. **        FileName_lock - Pointer to a variable which hold the
  459. **                        lock on the filename.
  460. **        Asl_FileRequester - Pointer to an asl FileRequester structure.
  461. **        Asl_FRTags - Pointer to a structure which holds some additional
  462. **                     tags to be used with 'AslRequest'.
  463. **        accessMode - ACCESS_READ or ACCESS_WRITE depending whether function
  464. **                     is used to get a filename and lock for a read or
  465. **                     write file.
  466. **  post: FileName - The value of the pointer to which 'FileName' points,
  467. **                   has been filled with the address of a new allocated
  468. **                   memory block, which holds the file name.
  469. **        FileNameSize - The value of the variable to which 'FileNameSize'
  470. **                       points, has been changed to the new size of
  471. **                       the new file name.
  472. **        FileName_lock - The value of the variable to which 'FileName_lock'
  473. **                        points, has been changed to the new lock of
  474. **                        the new file name.
  475. **
  476. */
  477. BOOL GetFileName(APTR FileName, ULONG *FileNameSize, BPTR *FileName_lock, struct FileRequester *Asl_FileRequester, ULONG *Asl_FRTags, LONG accessMode)
  478. {
  479.    BOOL Retry;
  480.    STRPTR Source, Destination;
  481.    
  482.    do {
  483.       Retry = FALSE;
  484.       
  485.       if( AslRequest(Asl_FileRequester, (struct TagItem *)Asl_FRTags) )
  486.       {
  487.          // Free possible allocated memory.
  488.          FreeThisMem(FileName, *FileNameSize);
  489.          
  490.          // Get the filename length inorder to create a buffer which
  491.          // will hold the entire filename, including its path.
  492.          *FileNameSize = StringLength(Asl_FileRequester->fr_Drawer) + StringLength(Asl_FileRequester->fr_File) + 2;
  493.          
  494.          // Compemsate for write files. Add extension size.
  495.          if( accessMode == ACCESS_WRITE )
  496.             *FileNameSize += ExtensionSize;
  497.  
  498.          // Allocate appropiate memory for filename buffer
  499.          AllocThisMem(FileName, *FileNameSize, MEMF_CLEAR);
  500.          
  501.          // Setup 'Source' and 'Destination' for copying path.
  502.          Source = Asl_FileRequester->fr_Drawer;
  503.          Destination = *(STRPTR *)FileName;
  504.          
  505.          // Copy path of FileName
  506.          while( *Destination++ = *Source++ );
  507.          
  508.          // Concatenate 'Path' and 'FileName' to make one name.
  509.          AddPart( *(STRPTR *)FileName, Asl_FileRequester->fr_File, *FileNameSize );
  510.          
  511.          if( accessMode == ACCESS_READ )
  512.          {
  513.             if(!( *FileName_lock = Lock( *(STRPTR *)FileName, ACCESS_READ ) ))
  514.                Retry = ErrorHandler( IFFerror_NoLockDoReturn, *(STRPTR *)FileName );
  515.          }
  516.          else
  517.          {
  518.             if( *FileName_lock = Lock( *(STRPTR *)FileName, ACCESS_READ ) )
  519.                switch( ErrorHandler(IFFerror_FileExistsAsk, SaveFileName) )
  520.                {
  521.                   case 1:
  522.                      Retry = TRUE;
  523.                   case 0:
  524.                      UnLock(*FileName_lock);
  525.                      break;
  526.                }
  527.          }
  528.       }
  529.       else
  530.       {
  531.          FileName_lock = NULL;
  532.          // AslRequest returnd FALSE. Check for KickStart Version for additional checking.
  533.          if( SysBase->LibNode.lib_Version >= 38 )
  534.          {
  535.             // KickStart V38+. Now we can check whether the user cancelled
  536.             // the job, or a problem caused AlsRequest to return FALSE.
  537.             switch( IoErr() )
  538.             {
  539.                case 0:
  540.                   // User cancelled the job.
  541.                   break;
  542.                case ERROR_NO_FREE_STORE:
  543.                   ErrorHandler(IFFerror_AslNoFreeStore, NULL);
  544.                   break;
  545.                case ERROR_NO_MORE_ENTRIES:
  546.                   ErrorHandler(IFFerror_AslNoMoreEntries, NULL);
  547.                   break;
  548.             }
  549.          }
  550.          // AslRequest just returned FALSE and pre V38 there's nothing we can do.
  551.          return(FALSE);
  552.       }
  553.    } while(Retry);
  554.    
  555.    if( (accessMode == ACCESS_READ) && (*FileName_lock == NULL) )
  556.       return(FALSE);
  557.    return(TRUE);
  558. }
  559.