/***************************************************************************
 * Secure Information Block created by the Safe-D front end.
 ***************************************************************************/
typedef struct tagSIB            // 512 bytes total
{
   char  id[4];                  // 000 ID literal to scan for 'AZSB'
   char  drv;                    // 004 Drive Pgm was loaded from (ASCII)
   char  auth;                   // 005 Auth Device (A,B,C=disk, 1,2,3=LPT#)
   char  ptype;                  // 006 product type
   char  prod[9];                // 007 Product Name (ASCIIZ)
   unsigned long snp;            // 016 product serial number
   unsigned short hnuc;          // 020 NUC file handle
   unsigned short avers;         // 022 Authorization Version
   unsigned short ecl;           // 024 Exec-Count Limit
   short dft;                    // 026 0 = m/d/y, 1 = d/m/y, 2 = y/m/d
   unsigned short edl;           // 028 Expire-Days Limit
   unsigned short etl;           // 030 Elapsed time on last day (etl * 2)secs
   char  ed[9];                  // 032 Expire-Date (ASCIIZ)
   char  chksum;                 // 041 checksum
   unsigned short nuc;           // 042 Network Concurrent-Users current count
   unsigned short nul;           // 044 Network Concurrent-Users Limit
   short icr;                    // 046 install counts remaining
   char  accflg[8];              // 048 Access Flags 1-64
   char  usrdat[8];              // 048 User-Data
   char  rtype;                  // 064 Register Type (V,N,U=Ver,Non-Ver, None)
   char  rname[51];              // 065 register to name (ASCIIZ)
   char  rcomp[51];              // 116 register to company (ASCIIZ)
   char  rloc[51];               // 167 register to location (ASCIIZ)
   char  rdate[9];               // 218 Register Date (ASCIIZ)
   char  cdate[9];               // 227 Current System Date (ASCIIZ)
   char  rsrvd2[20];             // 236 Reserved
   char  secstr[256];            // 256 Secure-String (ASCIIZ)
} SIB;

/***************************************************************************
 * SIB created on the global heap for finding by a user application.
 ***************************************************************************/
typedef struct tagWINSIB
{
   HINSTANCE hi;
   SIB sib;
} WINSIB;

typedef WINSIB *PWINSIB;
typedef WINSIB __far *LPWINSIB;
typedef WINSIB __near *NPWINSIB;

/***************************************************************************
 * Possible return values from FindSIB().
 ***************************************************************************/
enum
{
   FS_SIBFOUND = 0,                 /* SIB was found successfully */
   FS_SIBNOTFOUND,                  /* SIB was not found in global heap */
   FS_GLOBALFIRSTFAILED,            /* GlobalFirst (in TOOLHELP.DLL) failed */
   FS_NUM_ERRORS                    /* Number of possible error codes */
};

/***************************************************************************
 * Function Prototypes.
 ***************************************************************************/
#ifdef __cplusplus
extern "C" int __far __pascal FindSIB( HINSTANCE hInstance, LPWINSIB pUserSib );
#else
int __far __pascal FindSIB( HINSTANCE hInstance, LPWINSIB pUserSib );
#endif
