***************************************************************************
***************************************************************************
************  NETLOCK/95/NT  V1.3 Demo  for Win95/Windows NT ************** 
******************* (C) Johann Weinzierl 1995 *****************************
***************************************************************************
*****              Copyright Johann Weinzierl '1995             ***********
***************************************************************************


NETLOCK/95/NT is published in the known terms of Shareware.
Be sure you have read 'licence.txt' before continuing.

Short Description:
------------------

NETLOCK/95/NT is a small library which enables you to add double-licence
detection to your application in a Local Area Network (LAN) 
in a very easy way.

NETLOCK/95/NT offers you functions to determine if the 
same copy of your Win95 or Windows/NT application already 
runs in the network segment.


********************************
** NETLOCK/95/NT feature list **
********************************

  * prevents a customer to use a single licence more than once 
    at the same time on most networks.
  * Both NETBIOS and TCP/IP are used for licence checking.
  * very easy to use and implement.
  * tells you the name of the computer running the 'illegal copy'
  * once you are registered, you can use NETLOCK/95/NT in as many of 
    your products you like at no extra charge.
  * no runtime charge needed.
  * very small and efficient.
  * approximately zero network stress.
  * free support 
  * absolute no obstruction for the legal user.
  * user can start 'locked' application on _one_ computer as often he likes.
  * no additional 'cost-intensive' hardware required.
  * works with Win95 and all Versions of Windows NT including NT 3.51  
  * even mixed environments (some machines Win95 some WinNT) are supported.
  * Registration also via Cedit Card or Compuserve. 
  * The last but the best: 
    Due to the low registration fee it's very likely that the usage 
    of NETLOCK/95/NT is profitable for you if you sell only 
    _one_ additional copy of your application!

Usage: 
------

Adding NETLOCK/95/NT protection to your application is extreme easy:

 1, add   #include <netlock.h>  to your source module.

 2, add the netlock.lib (included in the netlock package) to the list
    of libraries you link.

 3, add the wsock32.lib and the advapi32.lib (comes with the SDK or VisualC++ Compiler) to the 
    list of libraries you link.

 4  now you can call the interface function register_licence(...)
    (Descriptio see below)

   that's all.
   Now rebuild your application and enjoy piracy-protection!


Restrictions in the DEMO Version:
---------------------------------
There are no restrictions other that the protection for a application
build with the DEMO Version of NETLOCK/95/NT only works for 5 minutes.
After these 5 minutes NETLOCK/95/NT does no longer see the second licence
already running. 

If you get a registered version, the locking mechanism of course works as long
as your application runs.
					

Please note:
------------

- NETLOCK/95/NT cannot detect a licence violation to a second LAN that is 
  coupled via a router. Since a router normally doesn't allow 
  broadcast packages it is like a 'firewall' for NETLOCK/95/NT.
  This should not be a problem since most Local Area Networks are
  coupled via brigdes in addition to routers.

- Due to the various existing network configurations, NETLOCK/95/NT 
  cannot detect a second application in all cases, so it's not a 100% 
  protection, but nevertheless NETLOCK/95/NT is designed to find a second 
  application in the most common cases.


Registering:
------------

If you want to get registered please use the file 'register.txt'.
You can get registered by cash,check via Compuserve or credit card. 


Problems, Support
-----------------

If you have any problems, questions or suggestions, please feel free to 
contact me via one of the following ways:

								 
   Compuserve: Weinzierl Johann: 100531,401
   email: weinzij@kontron.de
   Fido: 2:2494/17.1  Johann Weinzierl

   Support Mailbox:
		    (49)-8781/3418  Line I   
                    (49)-8781/92116 Line II   
		    (49)-8781/92117 ISDN

   My address:
   -----------
   Johann Weinzierl     
   Software Development
   Eichstaett 29
   84098 Hohenthann
   Germany
   Tel: 08784/789                  
   Fax: 08784/789


NETLOCK/95/NT Application Programmer's Interface:   (API)
--------------------------------------------------

    The NETLOCK/95/NT API consists of a single function:

    int register_licence ( 
			   long idnumber,
			   long *protocols,
			   char *current_licence_user,
			   long reserved
			 )

Description: 

	This function allows you to install a 'licence lock' on the net.
	Once this function is called the licence number you pass with 
	idnumber is 'locked'on the net for the computer it run's on.
	(In the DEMO Version this is limited to 5 minutes).
	The lock remains until you free the lock 
	(by passing idnumber=0 to the function)
	or by the termination of your application. 

Return:

	0:  No other computer found running this licence, licence 
	    lock installed for your computer.  
	1:  Licence is already used by another computer. 
	    The name of this computer is stored in 'current_licence_user'


Parameters:

 long   idnumber

       pass here the licence number you want to lock. 
       Since this is a 'long' you can sell a lot copies 
       of your application :-) 

       If you pass '0' the current lock is removed.

 long *protocols

       With this paramter you can specify the protocols used for 
       finding a double licence.
       Normally you should use the macro USE_ALL defined in 'netlock.h', so 
       all available protocols are used.

       Other values are:   USE_NETBIOS        Use Netbios only
			   USE_TCPIP          Use TCPIP   only

       Note: It is neccessary to set this parameter every time you 
	     call register_licence(), since the function return 
	     some debug info in 'protocols'.

 char * current_licence_user

       This is the buffer used to return the name of the computer that 
       already has your licence locked.
       Note: This buffer must be at least 25 bytes long!

 long reserved

	  reserved for future use.
	  pass 0 here.

 
Sample source 'locktest.c' 
------------------------

 // 
 //      The following is a simple source sample how to implement the register_licence function
 //      into your applications source code.
 // 
 //      Copyright Johann Weinzierl '1995
 // 
 #include <stdio.h>
 #include "netlock.h"

 #define LICENCE_ID  123456

 main()
 {
    int count;
    int ret;
    long protocols;
    char current_licence_user[25];

    // We want to use all available protocols
    protocols=USE_ALL;
    ret=register_licence(LICENCE_ID,&protocols,current_licence_user,0);

    if (ret==1)
    {
	  printf("Computer %s is already using the licence!, exiting ..\n",current_licence_user);
	  return(0);
    }

    printf("Now i am owner of licence NR %d \n",LICENCE_ID);

    for (count=0;count <50;count++)
    {
	  printf("Now doing my normal application work ...\n");
	  Sleep(2000);
    }

    // Now let's free the 'locked licence' 
    // This is not a must, bacause the licence is automatically freed, 
    // once the program has terminated.

    register_licence(0,&protocols,current_licence_user,0);
    printf("Freeing licence and exiting ...\n");
    return(1);
 }

	
 You can also create a separate thread which checks at a specific intervall 
 for licence violation. 
 This would prevent that a user temporary disconnects the network cable
 in order to start a NETLOCK/95/NT protected application.

 WM_THANX for your interest.

------

 Windows, Win95 and WindowsNT are trademarks of Microsoft corporation.
