EVERLOCK EVCHK3.DLL WITH CLARION FOR WINDOWS VERSION 1003

STEP 1:

CONFIGURE EVBUILD FOR YOUR PARTICULAR NEEDS.  THE FILE THAT YOU WILL PROTECT
IS CALLED PCHECK.EXE.   THIS FILE MUST BE COPIED TO YOUR FLOPPY PRIOR TO 
PROTECTION.  RUN EVBUILD AND PROTECT THE PCHECK.EXE FILE.  COPY THE 
PROTECTED PCHECK.EXE TO YOUR PROJECT SUB-DIRECTORY.  FOR THIS EXAMPLE, RUN 
THE WINMOVE PROGRAM LIKE "WINMOVE B: C:\your_project_sub\" TO COPY THE 
HIDDEN SYSTEM FILES TO YOUR PROJECT SUBDIRECTORY.

STEP 2:

IN YOUR APPLICATION, SET UP THE FOLLOWING VARIABLES, UNDER GLOBAL DATA.  (AS
AN ALTERNATIVE, YOU MAY SET UP THE VARIABLES UNDER A "SOURCE" FUNCTION UNDER
THE DATA EMBED, SO THAT THIS MEMORY IS NOT OCCUPIED ALL OF THE TIME.)


SB      GROUP        ! OFFSET   DESCRIPTION
ID      STRING(4)    !  000    ID literal to scan for 'AZSB'       
DRV     STRING(1)    !  004    Drive Pgm was loaded from (ASCII)   
AUTH    STRING(1)    !  005    Auth Device (A,B,C=disk)            
PTYPE   STRING(1)    !  006    Protection Type (C,E,I,N,P)         
PROD    STRING(9)    !  007    Product Name (ASCIIZ)               
SNP     LONG         !  016    Product serial number               
HNUC    SHORT        !  020    Net-Users file handle               
AVERS   SHORT        !  022    Authorization Version
ECL     SHORT        !  024    Exec-Count Limit                    
DFT     SHORT        !  026    0 = m/d/y, 1 = d/m/y, 2 = y/m/d     
EDL     SHORT        !  028    Expire-Days Limit                   
ETL     SHORT        !  030    Elapsed time on last day (etl * 2)secs
ED      STRING(9)    !  032    Expire-Date (ASCIIZ)                
CHKSUM  BYTE         !  041    checksum                            
NUC     SHORT        !  042    Network-Users current count         
NUL     SHORT        !  044    Network-Users Limit                 
ICR     SHORT        !  046    Install counts remaining            
ACCFLG  STRING(8)    !  048    Access Flags 1-64                   
USRDAT  STRING(8)    !  056    User-Data                           
RTYPE   BYTE         !  064    Reg. Type (N=Non-Verified)          
RNAME   STRING(51)   !  065    Register name (ASCIIZ)              
RCOMP   STRING(51)   !  116    Register to company (ASCIIZ)        
RLOC    STRING(51)   !  167    Register to location (ASCIIZ)       
RDATE   STRING(9)    !  218    Register Date (ASCIIZ)              
CDATE   STRING(9)    !  227    Current System Date (ASCIIZ)        
RSRVD1  STRING(20)   !  236                                        
SECSTR  STRING(256)  !  256    Secure-String (expanded ASCIIZ)     
FUNC    SHORT        !  512    function # (0,1,2)                  
STAT1   SHORT        !  514    pass completion status              
STAT2   SHORT        !  516    pass completion status              
STAT3   SHORT        !  518    pass completion status              
SOURCE  STRING(63)   !  520    from path (including drive ASCIIZ)  
TARGET  STRING(63)   !  583    to path (including drive ASCIIZ)    
RSRVD2  STRING(2)    !  646                                        
PIN     LONG         !  648    PIN (SCB Only)                      
RUC     SHORT        !  652    reset use count                     
PCNT    SHORT        !  654    # programs updated                  
RSRVD3  STRING(2)    !  656                                        
UNINST  SHORT        !  658    DO Uninstall (0=No/1=Yes)           
REG     SHORT        !  660    NV Reg during install (0=No/1=Yes)  
RSRVD4  STRING(4)    !  662                                        
CODE    STRING(30)   !  666    auth code (ASCIIZ nnnnn-nnnnn-nnnnn)
RSRVD5  STRING(74)   !  696                                        
END                     


STEP 3:

IN YOUR APPLICATION, UNDER PROJECT, SELECT EDIT CURRENT PROJECT.  NEXT,
HIGHLIGHT THE "LIBRARY AND OBJECT FILES", AND PRESS "ADD".  SELECT THE
"EVCHK3.LIB" FILE.  

STEP 4:

IN THE CW PROCEDURE THAT YOU PLAN TO USE THE EVCHK FUNCTION, YOU MUST
SET UP A MAP FOR THE FUNCTION IN THE DATA SECTION OF THE EMBED.  WITH
A "SOURCE" FUNCTION, THE EMBED HAS A "DATA SECTION" AND "PROCESSED CODE"
EMBED.  WITH MOST OTHER FUNCTIONS, THESE DATA AREAS ARE USUALLY LOCATED
AND CALLED "DATA SECTION, BEFORE/AFTER WINDOW DECLARATION".


! Map for evchk 
    map
        module('')
            evchk3(*CSTRING),RAW,PASCAL,SHORT
        END
    END

CSDATA  CSTRING(768),OVER(SB)



STEP 5:

IN THE FUNCTION THAT YOU CALL EVCHK, INITIALIZE THE VARIABLES AS FOLLOWS:

    id='AZSB'
    drv=chr(0)
    auth=chr(0)
    ptype=chr(0)
    prod=all(chr(0),9)
    snp=0
    hnuc=0
    avers=0
    ecl=0
    dft=0
    edl=0
    etl=0
    ed=all(chr(0),9)
    chksum=chr(0)
    nuc=0
    nul=0
    icr=0
    accflg=all(chr(0),8)
    usrdat=all(chr(0),8)
    rtype=chr(0)
    rname=all(chr(0),51)
    rcomp=all(chr(0),51)
    rloc=all(chr(0),51)
    rdate=all(chr(0),9)
    cdate=all(chr(0),9)
    rsrvd1=all(chr(0),20)
    secstr=all(chr(0),256)
    func=0
    stat1=0
    stat2=0
    stat3=0
    source=all(chr(0),63)
    target=all(chr(0),63)
    rsrvd2=all(chr(0),2)
    pin=0
    ruc=0
    pcnt=0
    rsrvd3=all(chr(0),2)
    uninst=0
    reg=0
    rsrvd4=all(chr(0),4)
    code=all(chr(0),18)
    rsrvd5=all(chr(0),86)


STEP 6:

    THIS IS THE ACTUAL SECURITY CHECK CODE


    id='AZSB'       ! Must have
    stat1=12345     ! Set to Non-Zero to prime
    func=1          ! Set to do Authorization Check
    snp=0           ! Serial number =0 means don't check

    source=path()&'\PCHECK.EXE'&all(chr(0),63)  ! Set to check for protected PCHECK.EXE in current path
                                                ! This assumes that you did an
                                                ! absolute WINMOVE to your project
                                                ! directory, such as WINMOVE B: D:\YOURSUB\

    pin= -560759724         ! Product ID Number (AZTech)
                            ! Note:  EVBUILD (3.0) puts out decimal.  You
                            ! must convert to a signed "Long"
                            ! If the number from EVBUILD is larger than
                            ! 2147483647 then subtract 4294967295 and
                            ! enter the result into this field.
                            ! Dust off your hex calculator!!!

    RetEVChk#=Evchk3(CSDATA) ! Call the function

    if RetEVChk<>0 then     ! EVCHK function could not operate
        d"=message('Error checking protection. May need AZMEMORY.DRV')
    else
        if stat1<>0 then        ! If stat1<>0 then something's wrong
            d"=message('Error Codes: '&stat1&', '&stat2&', '&stat3)
        else
            d"=message('Protection Check passed!')
    .
