/disk1/p.uno. git-svn-id: svn://10.65.10.50/trunk@1811 c028cbd2-c16b-5b4b-a496-9718f37d4682
		
			
				
	
	
		
			73 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			73 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			C
		
	
	
		
			Executable File
		
	
	
	
	
 | 
						|
#include        "ccommon.h"
 | 
						|
#include        "libdefs.h"
 | 
						|
 | 
						|
Word _int_tab0[4] = {0xFFFF, 0xFFFF, 0xFFFF, 0x0000};
 | 
						|
 | 
						|
/*
 | 
						|
   @(#) CGetAut
 | 
						|
 | 
						|
   @(ID)
 | 
						|
   Restituisce l'autorizzazione ad utilizzare un modulo. Vedi il file modaut.h.
 | 
						|
   @(FD)
 | 
						|
 | 
						|
   */
 | 
						|
 | 
						|
BOOLEAN                  CGetAut(af)
 | 
						|
  int                                   af; /* numero del modulo */
 | 
						|
 | 
						|
{
 | 
						|
  int    i;
 | 
						|
#ifndef DOS
 | 
						|
  BOOLEAN ok;
 | 
						|
#endif
 | 
						|
  if (!af) return(!af);
 | 
						|
  if (af > 48) return(FALSE);
 | 
						|
  /* @(!) 2.3.01.176 */
 | 
						|
  if (demoflag)
 | 
						|
  {
 | 
						|
    /* @(!) 2.3.01.276 */
 | 
						|
    if (formflag)
 | 
						|
      _int_tab0[0] = 0x019D;
 | 
						|
    else
 | 
						|
      _int_tab0[0] = 0x010D;
 | 
						|
    /* @(:) 2.3.01.276 */
 | 
						|
    _int_tab0[1] = 0x0000;
 | 
						|
    _int_tab0[2] = 0x0000;
 | 
						|
    _int_tab0[3] = 0x0000;
 | 
						|
    af--;
 | 
						|
    return(CBITTEST(_int_tab0[af / 16], af % 16));
 | 
						|
  }
 | 
						|
  /* @(:) 2.3.01.176 */
 | 
						|
  if (!SerNo) return(!getser());
 | 
						|
  /* @(!) 2.3.01.178 */
 | 
						|
#ifdef DOS
 | 
						|
  HL_READ(48, &_int_tab0[0]);
 | 
						|
  HL_READ(49, &_int_tab0[1]);
 | 
						|
  HL_READ(50, &_int_tab0[2]);
 | 
						|
  HL_READ(51, &_int_tab0[3]);
 | 
						|
  HL_CODE(EYECAST &_int_tab0[0], HLBLOCK);
 | 
						|
#else
 | 
						|
  /* @(:) 2.3.01.178 */
 | 
						|
  INT_OFF();
 | 
						|
  HL_ON(Port, ModAd);
 | 
						|
  _int_tab0[0] = HL_RD(Port, 48);
 | 
						|
  _int_tab0[1] = HL_RD(Port, 49);
 | 
						|
  _int_tab0[2] = HL_RD(Port, 50);
 | 
						|
  _int_tab0[3] = HL_RD(Port, 51);
 | 
						|
  HL_OFF(Port);
 | 
						|
  INT_ON();
 | 
						|
  INT_OFF();
 | 
						|
  HL_ON(Port, ModAd);
 | 
						|
  ok = K_EYE(Port, EYECAST &_int_tab0[0], HLBLOCK);
 | 
						|
  HL_OFF(Port);
 | 
						|
  INT_ON();
 | 
						|
  /* @(!) 2.3.01.178 */
 | 
						|
#endif
 | 
						|
  /* @(:) 2.3.01.178 */
 | 
						|
  for (i = 0; i < 4; i++) _int_tab0[i] ^= SerNo;
 | 
						|
  if (_int_tab0[3]) return(FALSE);
 | 
						|
  af--;
 | 
						|
  return(CBITTEST(_int_tab0[af / 16], af % 16));
 | 
						|
}
 |