/*@P************************************************************************
 * File           : TSTSIB.C
 * Project        : EVERLOCK Windows SIB Test Application
 * Author         : M. Brendan Van Horn
 * Compiler       : Borland C++ v4.02
 *
 * Copyright (c) 1994-95 Az-Tech Software, Inc.
 * ALL RIGHTS RESERVED
 ************************************************************************P@*/

#define STRICT
#include <windows.h>
#include <windowsx.h>
#include <toolhelp.h>
#include <stdio.h>
#include <string.h>
#include <memory.h>
#include "findsib.h"

// disable Microsoft warning for unknown pragmas
#pragma warning (disable: 4068)

/***************************************************************************
 * Global Variables.
 ***************************************************************************/
char szAppName[] = "EVERLOCK Windows SIB Test Application";
UINT errFlags = MB_ICONSTOP | MB_OK;
UINT okFlags = MB_ICONINFORMATION | MB_OK;
WINSIB ws;
char szText[255];

#pragma argsused
int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine,
                    int nCmdShow )
{
   HCURSOR hSaveCursor;
   int result;

   /* turn on the waiting cursor */
   hSaveCursor = SetCursor( LoadCursor( NULL, IDC_WAIT ) );

   /* hunt for the SIB */
   result = FindSIB( hInstance, &ws );

   /* restore the original cursor */
   SetCursor( hSaveCursor );

   /* display the results of the check */
   if ( FS_SIBFOUND != result )
   {
      wsprintf( szText, "ERROR(%d): Can't locate the SIB!", result );

      /* display the error message */
      MessageBox( NULL, szText, szAppName, errFlags );

      /* return control to the OS */
      return 0;
   }

   /* display the success message */
   MessageBox( NULL, (LPCSTR) ws.sib.secstr, szAppName, okFlags );

   /* return to the OS */
   return 0;
}
