[INCLUDE]
ctPackage_CachedShared

[CODE]
Public Function ctPackage_GetRawFileDataFromCache(ByVal ctPackagePointer As Long, ByRef PutFilenameGetData As String, Optional ByRef ReturnSize As Long, Optional ByVal ProgressControl As Long = 0&, Optional ByVal ProgressStart As Long = 0&, Optional ByVal ProgressTotal As Long = 0&, Optional ByVal ProgressQueue As Long = 0&) As Boolean
  Dim xLong1 As Long
  Dim xLong2 As Long
  Dim xLong3 As Long
  Dim xChar1 As String
  Dim ctPIType As ctPackage_InfoType
    
  If ctPackage_GetInfoEx(ctPackagePointer, ctPIType) Then
    xChar1 = LCase(PutFilenameGetData)
    PutFilenameGetData = ""
    For xLong3 = 0& To xFileCount - 1&
      If LCase(Mid(xFile(xLong3), FilenameOffset)) = xChar1 Then
        xLong2 = ctPackage_LenCharToLong(xFile(xLong3), FileIntOffset)
        PutFilenameGetData = String(xLong2, vbNullChar)
          
        'Get FileID, ctPackage_LenCharToLong(xFile(xLong3), FilePosOffset) + 1&, PutFilenameGetData
        If Not SetFilePointer(ctPIType.FileHandle, ctPackage_LenCharToLong(xFile(xLong3), FilePosOffset), 0&, 0&) = -1& Then
          If Not ReadFile(ctPIType.FileHandle, ByVal PutFilenameGetData, xLong2, 0&, ByVal 0&) = 0& Then
          
            ReturnSize = ctPackage_LenCharToLong(xFile(xLong3), FileExtOffset)
            xLong1 = Asc(Left(xFile(xLong3), 1))
            If (xLong1 And 1&) = 1& Then
              'PutFilenameGetData = ZLibDecompress(PutFilenameGetData, ReturnSize)
              If ProgressQueue = -1& Then
                ProgressQueue = ReturnSize
                End If
              PutFilenameGetData = ctCompressA_Decompress(PutFilenameGetData, ReturnSize, AddressOf NewDecomProgCallback, ProgressControl, ProgressStart, ProgressTotal, ProgressQueue)
              End If
            ctPackage_GetRawFileDataFromCache = True
            End If
          End If
        Exit For
        End If
      Next
    End If
  End Function