/* $Id: APICheck.c $ */

/* A simple Windows program to display the CryptoSys API Details */

#define WIN32_LEAN_AND_MEAN
#define STRICT
#include <windows.h>
#include "diCryptoSys.h"

// Compiler-specific explicit link to library
// This works in MSVC and Borland for LIB in current dir.
#pragma comment(lib, ".\\diCryptoSys.lib")


int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
                   LPSTR lpszCmdLine, int nCmdShow)
{
    char msg[2048];
    char compiled[255];
    char modname[MAX_PATH];
    long ver, lic;

    /* Get details from API */
    ver = API_Version();
    API_CompileTime(compiled, sizeof(compiled)-1);
    API_ModuleName(modname, sizeof(modname)-1, 0);
    lic = API_LicenceType(0);

    /* Compose into a string */
    wsprintf(msg, "Version=%ld\r\nLicence Type=%c\r\nModule=%s\r\nCompiled=%s", 
        ver, lic, modname, compiled);
    
    /* Display */
    MessageBox(NULL, msg, "CryptoSys API Check", 0);

    return 0;
}