/*static char *SCCSID = "@(#)ffn.h	6.1 90/11/17";*/

/* XLATOFF */
#define LITTLE_ENDIAN		    /* word ordering */

/*
 * First, the three levels of FileFindBuf, packed.  Renamed for consistency
 */

typedef FILEFINDBUF  FFB;

typedef FILEFINDBUF2 FFB2;

typedef struct FFB3 {
    FDATE  fdateCreation;
    FTIME  ftimeCreation;
    FDATE  fdateLastAccess;
    FTIME  ftimeLastAccess;
    FDATE  fdateLastWrite;
    FTIME  ftimeLastWrite;
    ULONG  cbFile;
    ULONG  cbFileAlloc;
    USHORT attrFile;
 // ULONG  cbList;		    // this ULONG becomes 2 USHORTS
#ifdef LITTLE_ENDIAN		    // want (US) cbList to be in the same
    USHORT cbList;		    // place as low word of (UL) cbList
    USHORT cbPrevFFB;		    // want cbPrevFFB to use the high word
#else
    USHORT cbPrevFFB;
    USHORT cbList;
#endif
    FEA	   afea[1];
 // UCHAR  cchName;
 // CHAR   achName[CCHMAXPATHCOMP];
} FFB3;

/*
 * For FindFirst/Next with position reporting on
 */

typedef struct _MYFFB {
    ULONG   ulPosition;
    FFB	    ffb;
} MYFFB;

typedef struct _MYFFB2 {
    ULONG   ulPosition;
    FFB2    ffb;
} MYFFB2;

typedef struct _MYFFB3 {
    ULONG   ulPosition;
    FFB3    ffb;
} MYFFB3;


/*
 * Next, the unpacked versions of the same.
 */

typedef FILEFINDBUF3 FFBU;

typedef FILEFINDBUF4 FFB2U;

typedef struct FFB3U {
    ULONG  oNextEntryOffset;
    FDATE  fdateCreation;
    FTIME  ftimeCreation;
    FDATE  fdateLastAccess;
    FTIME  ftimeLastAccess;
    FDATE  fdateLastWrite;
    FTIME  ftimeLastWrite;
    ULONG  cbFile;
    ULONG  cbFileAlloc;
    ULONG  attrFile;
    ULONG  cbList;
    FEA2   afea[1];
 // UCHAR  cchName;
 // CHAR   achName[CCHMAXPATHCOMP];
} FFB3U;

/* Structure to pass info between the kernel and user modes. */
/* XLATON */
typedef struct _FFNDATA { /* FFN */
    ULONG   cbSrc;	    /* offset to end of last source entry */
    ULONG   cbDest;	    /* offset to end of last dest entry	  */
    ULONG   cbPrev;	    /* Used for back-chaining		  */
    ULONG   ulPosition;	    /* for findfromname			  */
    ULONG   oName;	    /* Offset to last name		  */
    ULONG   ulInfoLevel;    /* Information level		  */
    ULONG   cbBuffer;	    /* This is the REAL buffer size	  */
    USHORT  ffnFlags;	    /* Misc. flags			  */
} FFNDATA;

/*  Values for ffnFlags:
 *
 *  FFN_EAS_DIDNT_FIT:	For info level 3, the worker returned with
 *			error ERROR_EAS_DIDNT_FIT, so the buffer
 *			contains a level 2 structure (preceded by
 *			an EAOP structure).
 */
#define FFN_EAS_DIDNT_FIT   0x0001
