Patch level : 2.0 nopatch
Files correlati : Ricompilazione Demo : [ ] Commento : Spostata in XVAGA gestione chiavi di protezione Adeguamenti vari per tutte le altre funzioni spostate git-svn-id: svn://10.65.10.50/trunk@11073 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
4935031b66
commit
3df8364584
@ -1,20 +1,11 @@
|
||||
#define __CFILES_C /* fv */
|
||||
|
||||
#ifdef DOS
|
||||
|
||||
#include <xvt.h>
|
||||
#include <checks.h>
|
||||
|
||||
#include <io.h>
|
||||
#include <stdlib.h>
|
||||
#include <direct.h>
|
||||
|
||||
#endif // DOS
|
||||
|
||||
#include "cfiles.h"
|
||||
#include "fldtypes.h"
|
||||
|
||||
|
||||
int hashfun(const char *);
|
||||
void setdec(char *, int);
|
||||
const char* prefname();
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <prefix.h>
|
||||
#include <utility.h>
|
||||
|
||||
#include <extcdecl.h> // GetPrawinName
|
||||
#include <extcdecl.h> // CGetPrawinName
|
||||
|
||||
bool TConfig::add_line(const TString& l)
|
||||
{
|
||||
|
@ -1071,16 +1071,7 @@ void TText_control::set_caption(const char* text)
|
||||
_obj->v.text->fore_color = color;
|
||||
|
||||
#ifdef XI_R4
|
||||
XinFont * &f = _obj->v.text->font;
|
||||
|
||||
if (bold && f == NULL)
|
||||
XinFontCopy(&f, xi_get_system_font());
|
||||
if (f != NULL)
|
||||
{
|
||||
bool is_bold_font = XinFontBoldGet(f) != 0;
|
||||
if (is_bold_font != bold)
|
||||
XinFontBoldSet(f, bold);
|
||||
}
|
||||
xi_set_obj_font_id(_obj, xvt_default_font(bold));
|
||||
#else
|
||||
FONT_OBJ* &font = _obj->v.text->font;
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
#include <checks.h>
|
||||
#include <cfiles.h>
|
||||
#include <csort.h>
|
||||
|
||||
#define MOSTMEM 51200
|
||||
#define LEASTMEM 10240
|
||||
|
||||
/*----------------------- STATIC PER PRIMA PARTE ----------------------------*/
|
||||
|
||||
static struct s_prm datisort;
|
||||
@ -564,13 +568,13 @@ static FILE *wopen(char* name) /* nome del file temporaneo */
|
||||
@(FN)
|
||||
*/
|
||||
|
||||
static char *appr_mem(h)
|
||||
unsigned *h; /* puntatore alla quantita' di byte allocati */
|
||||
static char *appr_mem(unsigned* h)
|
||||
{
|
||||
char *buff = NULL;
|
||||
|
||||
*h = (unsigned) MOSTMEM + 1024;
|
||||
while (buff == NULL && *h > LEASTMEM) {
|
||||
while (buff == NULL && *h > LEASTMEM)
|
||||
{
|
||||
*h -= 1024;
|
||||
buff = malloc(*h);
|
||||
}
|
||||
|
@ -1,13 +1,7 @@
|
||||
#ifndef __CSORT_H
|
||||
#define __CSORT_H
|
||||
|
||||
#ifndef __CFILES_H
|
||||
#include "cfiles.h"
|
||||
#endif
|
||||
|
||||
#define NOFLDS 10
|
||||
#define MOSTMEM 51200
|
||||
#define LEASTMEM 10240
|
||||
|
||||
struct s_prm {
|
||||
int rc_len;
|
||||
|
@ -7,28 +7,16 @@
|
||||
#include <utility.h>
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Hardlock stuff
|
||||
// Dongle stuff
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _DEMO_
|
||||
#include <hlapi_c.h>
|
||||
|
||||
#define USERADR 26952
|
||||
#define AGAADR 26953
|
||||
#define PRASSIADR 26954
|
||||
#define REFKEY (unsigned char*)"CAMPOKEY"
|
||||
#define VERKEY (unsigned char*)"ìpÙˆ¬cê<"
|
||||
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Smartkey stuff
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _DEMO_
|
||||
|
||||
#include "skeylink.h"
|
||||
HIDDEN KEY_NET* _eutron_key = NULL;
|
||||
#define REFKEY (unsigned char*)"CAMPOKEY"
|
||||
#define VERKEY (unsigned char*)"ìpÙˆ¬cê<"
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
@ -115,15 +103,7 @@ bool destroy_dongle()
|
||||
if (ok)
|
||||
{
|
||||
delete _dongle;
|
||||
_dongle = NULL;
|
||||
|
||||
#ifndef _DEMO_
|
||||
if (_eutron_key)
|
||||
{
|
||||
delete _eutron_key;
|
||||
_eutron_key = NULL;
|
||||
}
|
||||
#endif // _DEMO_
|
||||
_dongle = NULL;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
@ -210,20 +190,10 @@ void TDongle::garble(word* data) const
|
||||
switch (_hardware)
|
||||
{
|
||||
case _dongle_hardlock:
|
||||
HL_CODE(data, 1);
|
||||
xvt_dongle_hl_crypt(data);
|
||||
break;
|
||||
case _dongle_eutron:
|
||||
if (_eutron_key)
|
||||
{
|
||||
_eutron_key->net_command = NET_KEY_ACCESS;
|
||||
_eutron_key->command = SCRAMBLING_MODE;
|
||||
memcpy(_eutron_key->data, data, 8);
|
||||
smartlink(_eutron_key);
|
||||
if (_eutron_key->status == ST_OK)
|
||||
memcpy(data, _eutron_key->data, 8);
|
||||
else
|
||||
NFCHECK("EUTRON scrambling error: %d", _eutron_key->status);
|
||||
}
|
||||
xvt_dongle_sl_crypt(data);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -277,24 +247,24 @@ bool TDongle::hardlock_login(bool test_all_keys)
|
||||
_type = _user_dongle;
|
||||
if (test_all_keys)
|
||||
{
|
||||
HL_LOGOUT();
|
||||
if (HL_LOGIN(AGAADR, LOCAL_DEVICE, REFKEY, VERKEY) == STATUS_OK)
|
||||
xvt_dongle_hl_logout();
|
||||
if (xvt_dongle_hl_login(AGAADR, REFKEY, VERKEY))
|
||||
_type = _aga_dongle;
|
||||
else
|
||||
{
|
||||
HL_LOGOUT();
|
||||
if (HL_LOGIN(PRASSIADR, LOCAL_DEVICE, REFKEY, VERKEY) == STATUS_OK)
|
||||
xvt_dongle_hl_logout();
|
||||
if (xvt_dongle_hl_login(PRASSIADR, REFKEY, VERKEY))
|
||||
_type = _prassi_dongle;
|
||||
}
|
||||
}
|
||||
HL_LOGOUT();
|
||||
ok = HL_LOGIN(USERADR, DONT_CARE, REFKEY, VERKEY) == STATUS_OK;
|
||||
xvt_dongle_hl_logout();
|
||||
ok = xvt_dongle_hl_login(USERADR, REFKEY, VERKEY) != 0;
|
||||
|
||||
if (ok)
|
||||
{
|
||||
_hardware = _dongle_hardlock;
|
||||
|
||||
HL_READBL((unsigned char*)_eprom);
|
||||
xvt_dongle_hl_read_block((unsigned char*)_eprom);
|
||||
|
||||
word data[4];
|
||||
memcpy(data, _eprom, sizeof(data));
|
||||
@ -393,26 +363,14 @@ bool TDongle::eutron_login(bool test_all_keys)
|
||||
{
|
||||
bool ok = FALSE;
|
||||
|
||||
if (_eutron_key == NULL)
|
||||
_eutron_key = new KEY_NET;
|
||||
memset(_eutron_key, 0, sizeof(KEY_NET));
|
||||
_eutron_key->net_command = NET_KEY_OPEN;
|
||||
// _eutron_key->command = LOCATING_MODE;
|
||||
_eutron_key->status = ST_HW_FAILURE; // Don't leave ST_OK = 0 here!
|
||||
|
||||
const char* labels[4] = { "AGA.INFORMATICA", "AGA.PRASSI",
|
||||
"AGA.CAMPO", "25EBAI" };
|
||||
TDongleType types[4] = { _aga_dongle, _prassi_dongle,
|
||||
_user_dongle, _developer_dongle };
|
||||
for (int k = test_all_keys ? 0 : 3; k < 4; k++)
|
||||
{
|
||||
memset(_eutron_key->label, 0, LABEL_LENGTH);
|
||||
memcpy(_eutron_key->label, labels[k], strlen(labels[k]));
|
||||
memset(_eutron_key->password, 0, PASSWORD_LENGTH);
|
||||
memcpy(_eutron_key->password, ::encode(labels[k]), strlen(labels[k]));
|
||||
|
||||
smartlink(_eutron_key);
|
||||
ok = _eutron_key->status == ST_OK;
|
||||
const unsigned char* pwd = (const unsigned char*)::encode(labels[k]);
|
||||
ok = xvt_dongle_sl_login((const unsigned char*)labels[k], pwd) != 0;
|
||||
if (ok)
|
||||
{
|
||||
_hardware = _dongle_eutron;
|
||||
@ -485,11 +443,6 @@ bool TDongle::eutron_login(bool test_all_keys)
|
||||
_module.set(); // Activate all modules
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
delete _eutron_key;
|
||||
_eutron_key = NULL;
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
||||
@ -605,15 +558,10 @@ bool TDongle::logout()
|
||||
switch (_hardware)
|
||||
{
|
||||
case _dongle_hardlock:
|
||||
HL_LOGOUT();
|
||||
xvt_dongle_hl_logout();
|
||||
break;
|
||||
case _dongle_eutron:
|
||||
if (_eutron_key)
|
||||
{
|
||||
_eutron_key->net_command = NET_KEY_CLOSE;
|
||||
_eutron_key->command = 0;
|
||||
smartlink(_eutron_key);
|
||||
}
|
||||
xvt_dongle_sl_logout();
|
||||
break;
|
||||
case _dongle_network:
|
||||
rpc_UserLogout();
|
||||
@ -642,35 +590,23 @@ bool TDongle::read_words(word reg, word len, word* ud) const
|
||||
case _dongle_hardlock:
|
||||
{
|
||||
for (word i = 0; i < len; i++)
|
||||
HL_READ(reg+i, &ud[i]);
|
||||
xvt_dongle_hl_read(reg+i, &ud[i]);
|
||||
ok = TRUE;
|
||||
}
|
||||
break;
|
||||
case _dongle_eutron:
|
||||
if (_eutron_key)
|
||||
while (len > 0)
|
||||
{
|
||||
_eutron_key->net_command = NET_KEY_ACCESS;
|
||||
_eutron_key->command = BLOCK_READING_MODE;
|
||||
word* pointer = (word*)(&_eutron_key->data[0]);
|
||||
word* number = (word*)(&_eutron_key->data[2]);
|
||||
while (len > 0)
|
||||
const unsigned short size = (len <= 16) ? len : 16;
|
||||
ok = xvt_dongle_sl_read_block(reg, size, ud) != 0;
|
||||
if (!ok)
|
||||
{
|
||||
*pointer = reg;
|
||||
*number = (len <= 16) ? len : 16;
|
||||
smartlink(_eutron_key);
|
||||
|
||||
ok = _eutron_key->status == ST_OK;
|
||||
if (ok)
|
||||
memcpy(ud, &_eutron_key->data[4], (*number)*2);
|
||||
else
|
||||
{
|
||||
error_box("EUTRON read error: %d", _eutron_key->status);
|
||||
break;
|
||||
}
|
||||
len -= *number;
|
||||
reg += *number;
|
||||
ud += *number;
|
||||
}
|
||||
yesnofatal_box("EUTRON read error");
|
||||
break;
|
||||
}
|
||||
len -= size;
|
||||
reg += size;
|
||||
ud += size;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -691,44 +627,25 @@ bool TDongle::write_words(word reg, word len, word* data) const
|
||||
{
|
||||
case _dongle_hardlock:
|
||||
{
|
||||
int err = STATUS_OK;
|
||||
for (word r = 0; r < len; r++)
|
||||
{
|
||||
const word address = reg+r;
|
||||
err = HL_WRITE(address, data[r]);
|
||||
if (err != STATUS_OK)
|
||||
{
|
||||
error_box("HARDLOCK write error on register %u", address);
|
||||
break;
|
||||
}
|
||||
ok = xvt_dongle_hl_write(address, data[r]) != 0;
|
||||
}
|
||||
ok = err == STATUS_OK;
|
||||
}
|
||||
break;
|
||||
case _dongle_eutron:
|
||||
if (_eutron_key)
|
||||
while (len > 0)
|
||||
{
|
||||
_eutron_key->net_command = NET_KEY_ACCESS;
|
||||
_eutron_key->command = BLOCK_WRITING_MODE;
|
||||
word* pointer = (word*)(&_eutron_key->data[0]);
|
||||
word* number = (word*)(&_eutron_key->data[2]);
|
||||
while (len > 0)
|
||||
{
|
||||
*pointer = reg;
|
||||
*number = len > 16 ? 16 : len;
|
||||
memcpy(&_eutron_key->data[4], data, (*number)*2);
|
||||
smartlink(_eutron_key);
|
||||
ok = _eutron_key->status == ST_OK;
|
||||
if (!ok)
|
||||
{
|
||||
error_box("EUTRON write error: %d", _eutron_key->status);
|
||||
break;
|
||||
}
|
||||
reg += *number;
|
||||
len -= *number;
|
||||
data += *number;
|
||||
}
|
||||
const unsigned short size = (len <= 16) ? len : 16;
|
||||
ok = xvt_dongle_sl_write_block(reg, size, data) != 0;
|
||||
if (!ok)
|
||||
break;
|
||||
len -= size;
|
||||
reg += size;
|
||||
data += size;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ void TCodearray::clear()
|
||||
TArray::add(new TCode(_endsym));
|
||||
}
|
||||
|
||||
|
||||
void TCodearray::add(TCodesym sym, const TValue& val)
|
||||
{
|
||||
TArray::insert(new TCode(sym, val), last());
|
||||
@ -1156,8 +1155,7 @@ bool TExpression::set(const char* expression, TTypeexp type)
|
||||
}
|
||||
|
||||
bool TExpression::compile(const TString& expression, TTypeexp type)
|
||||
{
|
||||
|
||||
{
|
||||
_user_func_defined = FALSE;
|
||||
_s = expression;
|
||||
_type = type;
|
||||
|
@ -1,644 +0,0 @@
|
||||
/****************************************************************************/
|
||||
/** **/
|
||||
/** Hardlock **/
|
||||
/** API-Structures and definitions **/
|
||||
/** **/
|
||||
/** This file contains some helpful defines to access a Hardlock using **/
|
||||
/** the application programming interface (API) for Hardlock. **/
|
||||
/** **/
|
||||
/** Aladdin Germany **/
|
||||
/** **/
|
||||
/** Revision history **/
|
||||
/** ----------------
|
||||
*** $Log: not supported by cvs2svn $
|
||||
*** Revision 1.1.2.1 2002/05/30 13:42:20 guy
|
||||
*** Patch level : 2.0 nopatch
|
||||
*** Files correlati : fastapi.h
|
||||
*** Ricompilazione Demo : [ ]
|
||||
*** Commento :
|
||||
*** Sarà d'uopo includere anch'esso, va là!
|
||||
***
|
||||
*** Revision 1.46 2000/12/19 16:37:41 chris
|
||||
*** detect MacOS X
|
||||
***
|
||||
*** Revision 1.45 2000/07/30 22:22:17 chris
|
||||
*** ia64 detection
|
||||
***
|
||||
*** Revision 1.44 2000/07/10 09:45:09 chris
|
||||
*** Module2 field
|
||||
***
|
||||
*** Revision 1.43 2000/05/25 14:11:43 chris
|
||||
*** added some HASP stuff
|
||||
***
|
||||
*** Revision 1.42 2000/03/21 14:18:28 chris
|
||||
*** HL_SIS and HL_LIS structure definitions
|
||||
***
|
||||
*** Revision 1.41 2000/02/18 14:04:44 chris
|
||||
*** fixed pascal define for CygWin & MingW32
|
||||
***
|
||||
*** Revision 1.40 1999/12/06 13:06:11 chris
|
||||
*** fixed structure packing for MSC compiler
|
||||
***
|
||||
*** Revision 1.39 1999/11/28 01:39:46 chris
|
||||
*** added 64bit support (only tested with AlphaLinux currently)
|
||||
***
|
||||
*** Revision 1.38 1999/10/07 11:28:45 chris
|
||||
*** Duplicate revision
|
||||
***
|
||||
*** Revision 1.37 1999/10/07 11:28:45 Henri
|
||||
*** Removed uneeded TLV defines.
|
||||
***
|
||||
*** Revision 1.36 1999/10/07 10:47:04 Henri
|
||||
*** Removed unused flags.
|
||||
***
|
||||
*** Revision 1.35 1999/09/30 09:27:46 Henri
|
||||
*** Added PORT_BUSY.
|
||||
***
|
||||
*** Revision 1.34 1999/09/24 07:49:43 Werner
|
||||
*** Added RUS_RTB_EXPIRED and RUS_SERIAL_MISMATCH
|
||||
*** error codes.
|
||||
***
|
||||
*** Revision 1.33 1999/09/21 12:06:57 Henri
|
||||
*** Arranged error codes.
|
||||
***
|
||||
*** Revision 1.32 1999/09/20 12:56:28 Werner
|
||||
*** Added FORCE_ALF_CREATE constant.
|
||||
***
|
||||
*** Revision 1.31 1999/09/15 17:04:18 Henri
|
||||
*** Changed WriteLicense.
|
||||
***
|
||||
*** Revision 1.30 1999/09/01 15:06:44 Adi
|
||||
*** Added special handling of global expiration date.
|
||||
***
|
||||
*** Revision 1.29 1999/08/16 13:03:58 chris
|
||||
*** restore previous structure packing after HL_API definition
|
||||
*** (for MSVC)
|
||||
***
|
||||
*** Revision 1.28 1999/08/08 23:10:55 chris
|
||||
*** added 2 bytes to reserved field: API structure was 2 bytes too short
|
||||
***
|
||||
*** Revision 1.27 1999/08/04 13:04:41 chris
|
||||
*** API_FFS_GETRUSINFO define
|
||||
***
|
||||
*** Revision 1.26 1999/08/04 11:03:33 chris
|
||||
*** API_FFS_WRITE_LIC definition and some more status codes
|
||||
***
|
||||
*** Revision 1.25 1999/08/03 20:36:15 chris
|
||||
*** renamed FIB structure to RUS_FIB to avoid clash
|
||||
*** with api_defs.h
|
||||
***
|
||||
*** Revision 1.24 1999/07/26 10:58:28 Henri
|
||||
*** Added FIB structure.
|
||||
***
|
||||
*** Revision 1.23 1999/07/19 10:29:35 Henri
|
||||
*** Renamed define for BUFFER_TOO_SMALL
|
||||
***
|
||||
*** Revision 1.22 1999/07/19 10:11:30 Henri
|
||||
*** Added RUS functionality.
|
||||
***
|
||||
*** Revision 1.21 1998/10/21 15:56:53 Henri
|
||||
*** Changed defines for Borland Builder.
|
||||
***
|
||||
*** Revision 1.20 1998/08/14 11:33:54 Henri
|
||||
*** Changed driver comment.
|
||||
***
|
||||
*** Revision 1.19 1998/07/10 12:34:05 Henri
|
||||
*** Added define for Borland Builder.
|
||||
***
|
||||
*** Revision 1.18 1998/06/29 09:01:36 Henri
|
||||
*** Extended API struc.
|
||||
***
|
||||
*** Revision 1.17 1998/06/08 16:36:31 chris
|
||||
*** fixed structure packing on gcc version 2.7 and above
|
||||
***
|
||||
*** Revision 1.16 1998/05/08 14:11:33 Henri
|
||||
*** Added defines for HL_READID.
|
||||
***
|
||||
*** Revision 1.15 1998/04/07 13:14:59 chris
|
||||
*** added API_READ_ID function code
|
||||
***
|
||||
*** Revision 1.14 1998/02/17 21:56:19 Henri
|
||||
*** Added pragma pack(1) for Watcom 11/DOS
|
||||
***
|
||||
*** Revision 1.13 1997/07/01 13:56:54 henri
|
||||
*** Fixed defines for LabView.
|
||||
***
|
||||
*** Revision 1.12 1997/04/28 15:30:53 chris
|
||||
*** define UNIX32 ifdef __QNX__
|
||||
***
|
||||
*** Revision 1.11 1997/02/03 18:08:36 henri
|
||||
*** Renamed error 17
|
||||
***
|
||||
*** Revision 1.10 1997/01/30 17:16:55 henri
|
||||
*** Added LM return codes.
|
||||
***
|
||||
*** Revision 1.9 1997/01/28 08:23:30 henri
|
||||
*** Missed a semicolon ;-)
|
||||
***
|
||||
*** Revision 1.8 1997/01/27 17:57:11 henri
|
||||
*** Added slot number in API structure.
|
||||
***
|
||||
*** Revision 1.7 1997/01/16 18:18:11 henri
|
||||
*** Added API_LMINIT function code.
|
||||
***
|
||||
*** Revision 1.6 1996/11/13 16:55:49 chris
|
||||
*** added SOLARIS & UNIX32 define
|
||||
***
|
||||
*** Revision 1.5 1996/08/12 16:23:43 henri
|
||||
*** Added VCS log.
|
||||
***
|
||||
**/
|
||||
/****************************************************************************/
|
||||
|
||||
#if !defined(_FASTAPI_H_)
|
||||
#define _FASTAPI_H_
|
||||
|
||||
#if defined(LINUX) || defined(SOLARIS) || defined(SCO) || defined(__QNX__) || defined(DARWIN) || defined(MACOSX)
|
||||
#define UNIX32
|
||||
#if defined(__alpha__) || defined(__ia64__)
|
||||
#ifndef __64BIT__
|
||||
#define __64BIT__
|
||||
#endif
|
||||
#define NO_UNALIGN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __OS2__
|
||||
#ifdef INTERNAL_16BITDLL
|
||||
#define LOAD_DS
|
||||
#else
|
||||
#ifdef __WATCOMC__
|
||||
#ifdef __386__ /* not the 16bit compiler */
|
||||
#include <os2.h>
|
||||
#endif
|
||||
#else
|
||||
#include <os2.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef OS_16
|
||||
#define RET_ Word
|
||||
#define FAR_ far pascal
|
||||
#define DATAFAR_ far
|
||||
#else
|
||||
#define RET_ APIRET
|
||||
#define FAR_
|
||||
#define CALL_ APIENTRY
|
||||
#define DATAFAR_
|
||||
#endif
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
#ifdef UNIX32
|
||||
#define __386__
|
||||
#define pascal
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define __386__
|
||||
#if !defined(__CYGWIN__) && !defined(__MINGW32__)
|
||||
#define pascal
|
||||
#endif
|
||||
#if ((__GNUC__==2) && (__GNUC_MINOR__>=7)) || (__GNUC__>2)
|
||||
#define ALIGN_GCC __attribute__ ((__packed__))
|
||||
#ifdef NO_UNALIGN
|
||||
#define AS_ALIGN __attribute__ ((__aligned__(8)))
|
||||
#endif
|
||||
#else
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if _MSC_VER >= 900
|
||||
#pragma pack(push,_fastapi_h_,1)
|
||||
#else
|
||||
#pragma pack(1)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(WINNT) || defined(__WIN32__) || defined(_WIN32)
|
||||
#ifndef __386__ /* Watcom doesnt like it */
|
||||
#define __386__
|
||||
#endif
|
||||
#ifdef DLL
|
||||
#define CALL_ __stdcall
|
||||
#else
|
||||
#define CALL_
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef DOS386 /* Symantec C */
|
||||
#define __386__
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
#ifdef __HIGHC__ /* Metaware High C */
|
||||
#define __386__
|
||||
#define _PACKED _Packed
|
||||
#endif
|
||||
|
||||
#ifdef __ZTC__ /* Zortech C */
|
||||
#define __386__
|
||||
#endif
|
||||
|
||||
#ifdef SALFORD /* Salford C */
|
||||
#define ALIGN_ 8
|
||||
#endif
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
#pragma pack(1)
|
||||
#ifndef __386__
|
||||
#ifndef OS_16
|
||||
#define CALL_ cdecl
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _CVI_ /* LabWindows/CVI */
|
||||
#define RET_ Word
|
||||
#ifndef _NI_mswin32_
|
||||
#define CALL_ pascal
|
||||
#else /* No pascal in WIN32-Version of LabWindows/CVI 4.0.1 */
|
||||
#define CALL_ _stdcall
|
||||
#endif
|
||||
#ifndef __386__ /* __386__ defined by LabWindows/CVI */
|
||||
#define FAR_ far
|
||||
#define DATAFAR_ far
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __386__
|
||||
#define DATAFAR_
|
||||
#define FAR_
|
||||
#endif
|
||||
|
||||
#ifdef HLHIGH_DLL
|
||||
#define CALL_ pascal _export
|
||||
#endif
|
||||
|
||||
#ifdef LOAD_DS
|
||||
#define CALL_ _loadds
|
||||
#endif
|
||||
|
||||
#ifndef CALL_
|
||||
#define CALL_
|
||||
#endif
|
||||
|
||||
#ifndef _PACKED
|
||||
#define _PACKED
|
||||
#endif
|
||||
|
||||
#ifndef ALIGN_GCC
|
||||
# define ALIGN_GCC
|
||||
#endif
|
||||
|
||||
#ifndef DATAFAR_
|
||||
#define DATAFAR_ far
|
||||
#endif
|
||||
|
||||
#ifndef FAR_
|
||||
#define FAR_ far
|
||||
#endif
|
||||
|
||||
#ifndef RET_
|
||||
#define RET_ Word
|
||||
#endif
|
||||
|
||||
#ifndef ALIGN_
|
||||
#define ALIGN_
|
||||
#endif
|
||||
|
||||
#ifndef AS_ALIGN
|
||||
#define AS_ALIGN
|
||||
#endif
|
||||
|
||||
/* -------------------------------- */
|
||||
/* Definitions and API structures : */
|
||||
/* -------------------------------- */
|
||||
#ifdef __64BIT__
|
||||
typedef unsigned int Long;
|
||||
typedef unsigned long Int64;
|
||||
#else
|
||||
typedef unsigned long Long;
|
||||
#endif
|
||||
#ifndef __BCPLUSPLUS__
|
||||
typedef unsigned char Byte;
|
||||
typedef unsigned short Word;
|
||||
#else
|
||||
#ifndef VCL_H
|
||||
typedef unsigned char Byte;
|
||||
typedef unsigned short Word;
|
||||
#endif
|
||||
#endif
|
||||
#ifndef __64BIT__
|
||||
#define set_data_ptr(api,buf) (api)->Data=(Byte DATAFAR_ *)(buf)
|
||||
#define get_data_ptr(api) ((void *)((api)->Data))
|
||||
#else /* above macros for <=32 bit, below macros for >32 bit */
|
||||
#define set_data_ptr(api,buf) do { (api)->Data=(((Long)(buf)) & 0xffffffffu); \
|
||||
(api)->DataHigh=(((Long)(((Int64)(buf))>>32)) \
|
||||
& 0xffffffffu);} while (0)
|
||||
#define get_data_ptr(api) ((void *)((Int64)((api)->Data) | \
|
||||
(((Int64)((api)->DataHigh))<<32)))
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Word Use_Key;
|
||||
Byte Key[8];
|
||||
} ALIGN_GCC DES_MODE;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Word ModAd; /* Hardlock module address */
|
||||
Word Reg; /* Memory register adress */
|
||||
Word Value; /* Memory value */
|
||||
Byte Reserved[4];
|
||||
} ALIGN_GCC EYE_MODE;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Long PW1; /* HASP passwords */
|
||||
Long PW2;
|
||||
Word P1;
|
||||
} ALIGN_GCC HASP_MODE;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Word LT_Reserved;
|
||||
Word Reg; /* Memory register adress */
|
||||
Word Value; /* Memory value */
|
||||
Word Password[2]; /* Access passwords */
|
||||
} ALIGN_GCC LT_MODE;
|
||||
|
||||
typedef union
|
||||
{
|
||||
DES_MODE Des;
|
||||
EYE_MODE Eye;
|
||||
LT_MODE Lt;
|
||||
HASP_MODE Hasp;
|
||||
} HARDWARE;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Word P2;
|
||||
Word P3;
|
||||
} ALIGN_GCC HASP_MODE2;
|
||||
|
||||
typedef union
|
||||
{
|
||||
HASP_MODE2 Hasp2;
|
||||
} HARDWARE2;
|
||||
|
||||
typedef struct rus_fib
|
||||
{
|
||||
Byte MARKER[2];
|
||||
Long SERIAL_ID;
|
||||
Byte VERSION[2];
|
||||
Word FIXED;
|
||||
Word VAR;
|
||||
Word CRC;
|
||||
} ALIGN_GCC RUS_FIB;
|
||||
|
||||
typedef _PACKED struct ALIGN_ hl_api
|
||||
{
|
||||
Byte API_Version_ID[2]; /* Version */
|
||||
Word API_Options[2]; /* API Optionflags */
|
||||
Word ModID; /* Modul-ID (EYE = 0...) */
|
||||
HARDWARE Module; /* Hardware type */
|
||||
|
||||
#ifdef __OS2__ /* Pointer to cipher data */
|
||||
#ifdef OS_16
|
||||
void far *Data;
|
||||
#else
|
||||
#ifdef __BORLANDC__
|
||||
void FAR16PTR Data;
|
||||
#else
|
||||
void * _Seg16 Data;
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#ifndef __64BIT__
|
||||
void DATAFAR_ *Data;
|
||||
#else
|
||||
Long Data; /* low part only */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Word Bcnt; /* Number of blocks */
|
||||
Word Function; /* Function number */
|
||||
Word Status; /* Actual status */
|
||||
Word Remote; /* Remote or local?? */
|
||||
Word Port; /* Port address if local */
|
||||
Word Speed; /* Speed of port if local */
|
||||
Word NetUsers; /* Current Logins (HL-Server) */
|
||||
Byte ID_Ref[8]; /* Referencestring */
|
||||
Byte ID_Verify[8]; /* Encrypted ID_Ref */
|
||||
Long Task_ID; /* Multitasking program ID */
|
||||
Word MaxUsers; /* Maximum Logins (HL-Server) */
|
||||
Long Timeout; /* Login Timeout in minutes */
|
||||
Word ShortLife; /* (multiple use) */
|
||||
Word Application; /* Application number */
|
||||
Word Protocol; /* Protocol flags */
|
||||
Word PM_Host; /* DOS Extender type */
|
||||
Long OSspecific; /* ptr to OS specific data */
|
||||
Word PortMask; /* Default local search (in) */
|
||||
Word PortFlags; /* Default local search (out) */
|
||||
Word EnvMask; /* Use env string search (in) */
|
||||
Word EnvFlags; /* Use env string search (out) */
|
||||
Byte EEFlags; /* EE type flags */
|
||||
Word Prot4Info; /* (internal use) */
|
||||
Byte FuncOptions; /* Enable add. functionality */
|
||||
Word Slot_ID; /* Licence slot number */
|
||||
Word Slot_ID_HIGH; /* Licence slot High value */
|
||||
Word RUS_ExpDate; /* RUS Expiration date */
|
||||
Long DataHigh; /* Pointer to data high value */
|
||||
#ifndef __64BIT__
|
||||
void DATAFAR_ *VendorKey; /* Pointer to RUS vendor key */
|
||||
#else
|
||||
Long VendorKey; /* dto. */
|
||||
#endif
|
||||
Long VendorKeyHigh; /* Vendor key high value */
|
||||
Long OSspecificHigh; /* ptr to OS specific data */
|
||||
Long RUS_MaxInfo; /* RUS max user/counter */
|
||||
Long RUS_CurInfo; /* RUS current user/counter */
|
||||
RUS_FIB RUS_Fib; /* RUS FIB structure */
|
||||
HARDWARE2 Module2; /* 2nd hw dependend fields */
|
||||
Byte Reserved2[122]; /* Reserved area */
|
||||
} ALIGN_GCC AS_ALIGN HL_API, LT_API, HS_API;
|
||||
|
||||
typedef _PACKED struct ALIGN_ { /* HL_LIS slot information */
|
||||
Long max_user;
|
||||
Long cur_user;
|
||||
Word exp_date;
|
||||
Byte flag; /* singularity flag */
|
||||
Byte res; /* filler to make structure size multiple of 4 bytes */
|
||||
} ALIGN_GCC HL_SIS;
|
||||
|
||||
/* License Information Structure (HL_LIS) */
|
||||
typedef _PACKED struct ALIGN_ {
|
||||
Word current_date;
|
||||
Word res;
|
||||
Long num_slots;
|
||||
Word glob_exp_date;
|
||||
Word res2; /* filler to make size multiple of 4 bytes */
|
||||
HL_SIS slots[1];
|
||||
} ALIGN_GCC HL_LIS;
|
||||
|
||||
#ifdef UNIX32
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef __OS2__
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#if _MSC_VER >= 900
|
||||
#pragma pack(pop,_fastapi_h_)
|
||||
#else
|
||||
#pragma pack()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* ------------- */
|
||||
/* Module-ID's : */
|
||||
/* ------------- */
|
||||
#define EYE_DONGLE 0 /* Hardlock E-Y-E */
|
||||
#define DES_DONGLE 1 /* FAST DES */
|
||||
#define LT_DONGLE 3 /* Hardlock LT */
|
||||
#define HASP_DONGLE 4 /* HASP */
|
||||
|
||||
/* --------------------- */
|
||||
/* API function calls : */
|
||||
/* --------------------- */
|
||||
#define API_INIT 0 /* Init API structure */
|
||||
#define API_DOWN 1 /* Free API structure */
|
||||
#define API_FORCE_DOWN 31 /* Force deinintialization */
|
||||
#define API_MULTI_SHELL_ON 2 /* MTS is enabled */
|
||||
#define API_MULTI_SHELL_OFF 3 /* MTS is disabled */
|
||||
#define API_MULTI_ON 4 /* Enable MTS */
|
||||
#define API_MULTI_OFF 5 /* Disable MTS */
|
||||
#define API_AVAIL 6 /* Dongle available? */
|
||||
#define API_LOGIN 7 /* Login dongle server */
|
||||
#define API_LOGOUT 8 /* Logout dongle server */
|
||||
#define API_INFO 9 /* Get API informations */
|
||||
#define API_GET_TASKID 32 /* Get TaskID from API */
|
||||
#define API_LOGIN_INFO 34 /* Get API Login informations */
|
||||
|
||||
/* --------------------------- */
|
||||
/* Data and memory functions : */
|
||||
/* --------------------------- */
|
||||
#define API_KEYE 11 /* Use KEYE for encryption */
|
||||
#define API_READ 20 /* Read one word of dongle EEPROM */
|
||||
#define API_WRITE 21 /* Write one word of dongle EEPROM */
|
||||
#define API_READ_BLOCK 23 /* Read EEPROM in one block */
|
||||
#define API_WRITE_BLOCK 24 /* Write EEPROM in one block */
|
||||
#define API_READ_ID 29 /* Read USB ID memory */
|
||||
#define API_ABORT 51 /* Critical Error Abort */
|
||||
|
||||
/* -------------- */
|
||||
/* LM functions : */
|
||||
/* -------------- */
|
||||
#define API_LMINIT 40 /* LM compatible API_INIT replacement */
|
||||
#define API_LMPING 41 /* checks if LM dongle and slot is available */
|
||||
#define API_LMINFO 42 /* info about currently used LIMA */
|
||||
|
||||
/* --------------- */
|
||||
/* RUS functions : */
|
||||
/* --------------- */
|
||||
#define API_FFS_INIT 256 /* RUS init function, downed with API_DOWN */
|
||||
#define API_FFS_ISRUSHL 257 /* Is RUS HL ? */
|
||||
#define API_FFS_LOGIN 258 /* RUS Login to Hardlock server */
|
||||
#define API_FFS_CHECK_LIC 259 /* RUS Create LIS */
|
||||
#define API_FFS_READ_LICBLOCK 260 /* RUS Read LIC Block */
|
||||
#define API_FFS_QUERY_SLOT 261 /* RUS query slot function */
|
||||
#define API_FFS_FREE_SLOT 262 /* RUS free slot */
|
||||
#define API_FFS_OCCUPY_SLOT 263 /* RUS occupies a slot */
|
||||
#define API_FFS_INC_CNTR 264 /* RUS counter increment */
|
||||
#define API_FFS_PARSERTB 265 /* RUS Parse RTB */
|
||||
#define API_FFS_GET_HWDEP_INFO 266 /* RUS get hardware dependent information */
|
||||
#define API_FFS_WRITE_LIC 267 /* RUS write updated license information */
|
||||
#define API_FFS_GETRUSINFO 269 /* get RUS info */
|
||||
|
||||
/* -------------------- */
|
||||
/* Dongle access mode : */
|
||||
/* -------------------- */
|
||||
#define LOCAL_DEVICE 1 /* Query local HL only */
|
||||
#define NET_DEVICE 2 /* Query remote HL only */
|
||||
#define DONT_CARE 3 /* Query local or remote HL */
|
||||
|
||||
/* -------------------- */
|
||||
/* EnvMask/Port Flags : */
|
||||
/* -------------------- */
|
||||
#define USB_DEVICE 256 /* Port flag for USB use */
|
||||
#define IGNORE_ENVIRONMENT 0x8000 /* Ignore HL_SEARCH */
|
||||
#define EEF_NOAUTOUSB 8 /* No automatic USB search */
|
||||
|
||||
/* ---------- */
|
||||
/* RUS flags: */
|
||||
/* ---------- */
|
||||
#define FORCE_RUS 1 /* Enable RUS init without VK */
|
||||
#define FORCE_ALF_CREATE 1 /* Force creation of ALF file in HLM_WRITELICENSE */
|
||||
|
||||
/* ------------------ */
|
||||
/* API PM_Host ID's : */
|
||||
/* ------------------ */
|
||||
#define API_XTD_DETECT 0
|
||||
#define API_XTD_DPMI 1 /* QDPMI, Borland, Windows ... */
|
||||
#define API_XTD_PHAR386 2
|
||||
#define API_XTD_PHAR286 3
|
||||
#define API_XTD_CODEBLDR 4 /* Intel Code Builder */
|
||||
#define API_XTD_COBOLXM 5
|
||||
|
||||
/* ------------------ */
|
||||
/* API Status Codes : */
|
||||
/* ------------------ */
|
||||
#define STATUS_OK 0 /* API call was succesfull */
|
||||
#define NOT_INIT 1 /* DONGLE not initialized */
|
||||
#define ALREADY_INIT 2 /* Already initialized */
|
||||
#define UNKNOWN_DONGLE 3 /* Device not supported */
|
||||
#define UNKNOWN_FUNCTION 4 /* Function not supported */
|
||||
#define HLS_FULL 6 /* HL-Server login table full */
|
||||
#define NO_DONGLE 7 /* No device available */
|
||||
#define NETWORK_ERROR 8 /* A network error occured */
|
||||
#define NO_ACCESS 9 /* No device available */
|
||||
#define INVALID_PARAM 10 /* A wrong parameter occured */
|
||||
#define VERSION_MISMATCH 11 /* HL-Server not API version */
|
||||
#define DOS_ALLOC_ERROR 12 /* Error on memory allocation */
|
||||
#define CANNOT_OPEN_DRIVER 14 /* Can not open Hardlock driver */
|
||||
#define INVALID_ENV 15 /* Invalid environment string */
|
||||
#define DYNALINK_FAILED 16 /* Unable to get a function entry */
|
||||
#define INVALID_LIC 17 /* No valid licence info (LM) */
|
||||
#define NO_LICENSE 18 /* Slot/licence not enabled (LM) */
|
||||
#define PORT_BUSY 19 /* Cannot acquire port */
|
||||
#define RUS_NO_DEVICE 20 /* Key is no Hardlock RUS key */
|
||||
#define RUS_INVALID_LIC 21 /* Invalid RUS license */
|
||||
#define RUS_SYNC_ERR 22 /* FIB in key and api struc mismatch */
|
||||
#define NOT_IMPLEMENTED 23 /* not (yet) implemented */
|
||||
#define BUFFER_TOO_SMALL 24 /* Buffer for function too small */
|
||||
#define UNKNOWN_HW_TYPE 25 /* unknown hardware descriptor */
|
||||
#define RUS_INV_FBPOS 26 /* unknown fixed block position */
|
||||
#define RUS_INVALID_SLOT 27 /* Non-existing slot number given */
|
||||
#define RUS_DATE_FAKE 28 /* RUS Date fake detected */
|
||||
#define RUS_COUNT_DOWN 29 /* RUS dead counter limit reached */
|
||||
#define RUS_INVALID_VK 30 /* RUS Vendor key is invalid */
|
||||
#define RUS_NO_LIC_FILE 31 /* RUS License file not found */
|
||||
#define RUS_INV_VBLOCK 32 /* RUS invalid variable block */
|
||||
#define RUS_LIC_FILE_WRITE_ERR 33 /* error writing (updated) license file */
|
||||
#define RUS_NO_INFO_AVAILABLE 34 /* GET_HWDEP_INFO: no info there */
|
||||
#define RUS_INFO_PACK_ERR 35 /* " " " " : cannot TLV encode data */
|
||||
#define RUS_LIC_WRITE_ERR 36 /* write license failed */
|
||||
#define RUS_DATE_EXPIRED 37 /* RUS Expiration Date reached. */
|
||||
#define TS_DETECTED 38 /* Term. Server / Citrix Winframe detected*/
|
||||
#define RUS_INVALID_RTB 39 /* Invalid updated data (RTB) */
|
||||
#define RUS_RTB_EXPIRED 40 /* Update data (RTB) has expired. */
|
||||
#define RUS_SERIAL_MISMATCH 41 /* Update data serial does not match */
|
||||
#define TOO_MANY_USERS 256 /* Login table full (remote) */
|
||||
#define SELECT_DOWN 257 /* Printer not On-line */
|
||||
#define NO_SERIALID 258 /* Serial ID not readable or n/a */
|
||||
|
||||
#endif /*_FASTAPI_H_*/
|
||||
/* eof */
|
||||
|
@ -50,44 +50,23 @@ bool goto_url(const char* url)
|
||||
link.set(ext, "");
|
||||
}
|
||||
|
||||
bool retflag = FALSE;
|
||||
|
||||
HINSTANCE hinst = ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOWNORMAL);
|
||||
DWORD winst = DWORD((DWORD*)hinst);
|
||||
UINT error = UINT(winst); // Tutto 'sto giro per evitare un warning
|
||||
retflag = error > 32;
|
||||
|
||||
return retflag;
|
||||
return xvt_sys_goto_url(url, "open") != 0;
|
||||
}
|
||||
|
||||
bool edit_url(const char* url)
|
||||
{
|
||||
bool retflag = FALSE;
|
||||
|
||||
HINSTANCE hinst = ShellExecute(NULL, "edit", url, NULL, NULL, SW_SHOWNORMAL);
|
||||
DWORD winst = DWORD((DWORD*)hinst);
|
||||
UINT error = UINT(winst); // Tutto 'sto giro per evitare un warning
|
||||
if (error <= 32)
|
||||
retflag = goto_url(url);
|
||||
else
|
||||
retflag = TRUE;
|
||||
|
||||
return retflag;
|
||||
bool ok = xvt_sys_goto_url(url, "edit") != 0;
|
||||
if (!ok)
|
||||
ok = goto_url(url);
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool print_url(const char* url)
|
||||
{
|
||||
bool retflag = FALSE;
|
||||
|
||||
HINSTANCE hinst = ShellExecute(NULL, "print", url, NULL, NULL, SW_SHOWNORMAL);
|
||||
DWORD winst = DWORD((DWORD*)hinst);
|
||||
UINT error = UINT(winst); // Tutto 'sto giro per evitare un warning
|
||||
if (error <= 32)
|
||||
retflag = goto_url(url);
|
||||
else
|
||||
retflag = TRUE;
|
||||
|
||||
return retflag;
|
||||
bool ok = xvt_sys_goto_url(url, "print") != 0;
|
||||
if (!ok)
|
||||
ok = goto_url(url);
|
||||
return ok;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
|
@ -1,72 +0,0 @@
|
||||
/* $Id: hlapi_c.h,v 1.2 2002-02-28 11:34:54 guy Exp $ */
|
||||
|
||||
#include "fastapi.h"
|
||||
|
||||
/* --------------------- */
|
||||
/* Function prototypes : */
|
||||
/* --------------------- */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ------------------ */
|
||||
/* Basic Hardlock API */
|
||||
/* ------------------ */
|
||||
RET_ FAR_ CALL_ HL_LOGIN (Word ModAd, Word Access, Byte DATAFAR_ *RefKey, Byte DATAFAR_ *VerKey);
|
||||
RET_ FAR_ CALL_ HL_LOGOUT (void);
|
||||
RET_ FAR_ CALL_ HL_AVAIL (void);
|
||||
RET_ FAR_ CALL_ HL_PORTINF (void);
|
||||
RET_ FAR_ CALL_ HL_ACCINF (void);
|
||||
RET_ FAR_ CALL_ HL_USERINF (void);
|
||||
RET_ FAR_ CALL_ HL_MAXUSER (void);
|
||||
RET_ FAR_ CALL_ HL_MEMINF (void);
|
||||
RET_ FAR_ CALL_ HL_CODE (void DATAFAR_ *Data, Word Count);
|
||||
RET_ FAR_ CALL_ HL_WRITE (Word Reg, Word Value);
|
||||
RET_ FAR_ CALL_ HL_READ (Word Reg, Word DATAFAR_ *Value);
|
||||
RET_ FAR_ CALL_ HL_READBL (Byte DATAFAR_ *Eeprom);
|
||||
RET_ FAR_ CALL_ HL_WRITEBL (Byte DATAFAR_ *Eeprom);
|
||||
RET_ FAR_ CALL_ HL_ABORT (void);
|
||||
RET_ FAR_ CALL_ HL_VERSION (void);
|
||||
RET_ FAR_ CALL_ HL_HLSVERS (void);
|
||||
RET_ FAR_ CALL_ HL_SELECT (HL_API DATAFAR_ *hl_ptr);
|
||||
RET_ FAR_ CALL_ HL_READID (Word DATAFAR_ *IDLow, Word DATAFAR_ *IDHigh);
|
||||
|
||||
/* ---------------- */
|
||||
/* Hardlock RUS API */
|
||||
/* ---------------- */
|
||||
RET_ FAR_ CALL_ HLM_LOGIN (Word ModAd, Word Access, Byte DATAFAR_ *RefKey, Byte DATAFAR_ *VerKey, Byte DATAFAR_ * VKey, Long RUSOptions, Byte DATAFAR_ * SearchStr);
|
||||
RET_ FAR_ CALL_ HLM_OCCUPYSLOT (Long Slot);
|
||||
RET_ FAR_ CALL_ HLM_FREESLOT (Long Slot);
|
||||
RET_ FAR_ CALL_ HLM_CHECKSLOT (Long Slot, Long * MaxUser, Long * CurrentUser);
|
||||
RET_ FAR_ CALL_ HLM_CHECKCOUNTER (Word IncVal, Long * MaxCounter, Long * CurrentCounter);
|
||||
RET_ FAR_ CALL_ HLM_CHECKEXPDATE (Long Slot, Word * Year, Word * Month, Word * Day);
|
||||
RET_ FAR_ CALL_ HLM_GETRUSINFO (Long * BufLen, Byte DATAFAR_ * RTBBuffer, Word Base64);
|
||||
RET_ FAR_ CALL_ HLM_WRITELICENSE (Long BufLen, Byte DATAFAR_ * RTBBuffer, Word Access, Byte DATAFAR_ * SearchStr,Word Options);
|
||||
RET_ FAR_ CALL_ HLM_ISRUSHL (Long * ID);
|
||||
RET_ FAR_ CALL_ HLM_CHECKALLSLOTS (Long *BufLen, HL_LIS *Buffer);
|
||||
RET_ FAR_ CALL_ HLM_LOGOUT (void);
|
||||
|
||||
/* ---------------------- */
|
||||
/* Hardlock Error Routine */
|
||||
/* ---------------------- */
|
||||
const char * FAR_ CALL_ HL_ERRMSG (Word num, Long options, Byte ** errdefine, Byte ** errextmsg);
|
||||
|
||||
/* ------------------------------------------- */
|
||||
/* Obsolete functions, for compatiblity only!! */
|
||||
/* ------------------------------------------- */
|
||||
#ifndef __OS2__
|
||||
void FAR_ CALL_ HL_ON (Word Port, Word ModAd);
|
||||
void FAR_ CALL_ HL_OFF (Word Port);
|
||||
Word FAR_ CALL_ K_EYE (Word Port, char DATAFAR_ *Inp, Word BlkCnt);
|
||||
void FAR_ CALL_ HL_WR (Word Port, Word Reg, Word Val);
|
||||
Word FAR_ CALL_ HL_RD (Word Port, Word Reg);
|
||||
void FAR_ CALL_ INT_ON (void);
|
||||
void FAR_ CALL_ INT_OFF (void);
|
||||
#endif
|
||||
RET_ FAR_ CALL_ HL_CALC (Word i1, Word i2, Word i3, Word i4);
|
||||
RET_ FAR_ CALL_ HL_LMLOGIN (Word ModAd, Word Access, Byte DATAFAR_ *RefKey, Byte DATAFAR_ *VerKey, Word SlotID, Byte DATAFAR_ *SearchStr);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
/* eof */
|
@ -1,5 +1,3 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#define XVT_INCL_NATIVE
|
||||
#include <progind.h>
|
||||
#include <config.h>
|
||||
@ -707,14 +705,8 @@ bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local
|
||||
ofstream outfile(local, ios::out | ios::binary);
|
||||
if (outfile.good())
|
||||
{
|
||||
TString msg;
|
||||
msg << remote << " - ";
|
||||
if (size > 1024)
|
||||
msg << (size / 1024) << " K";
|
||||
else
|
||||
msg << size << ' ';
|
||||
msg << "bytes.";
|
||||
TProgind pi(size, msg, TRUE, TRUE);
|
||||
buf.cut(0) << remote << " - " << (size / 1024 + 1) << " KBytes";
|
||||
TProgind pi(size, buf, TRUE, TRUE);
|
||||
long total = 0;
|
||||
|
||||
skstream* cur_socket = ((TSocket_connection*)GetConnection(id))->GetSocket();
|
||||
@ -724,30 +716,11 @@ bool TSocketClient::HttpGetFile(CONNID id, const char* remote, const char* local
|
||||
const int count = cur_socket->gcount();
|
||||
if (count > 0)
|
||||
{
|
||||
outfile.write(buf, count);
|
||||
|
||||
total += count;
|
||||
bool tick = pi.setstatus(total);
|
||||
if (pi.iscancelled())
|
||||
break;
|
||||
/* Obsoleto con le nuove barre
|
||||
if (tick)
|
||||
{
|
||||
const double estimated_ticks = double(size - total) * double(clock() - start) / total;
|
||||
long secs = long(estimated_ticks / CLOCKS_PER_SEC) + 1;
|
||||
CHECK(secs >= 0, "Bad time estimation");
|
||||
const int hours = int(secs / 3600L);
|
||||
secs %= 3600L;
|
||||
const int mins = int(secs / 60L);
|
||||
secs %= 60L;
|
||||
const int append_pos = msg.find("o: ")+3;
|
||||
msg.cut(append_pos);
|
||||
TString16 tempo;
|
||||
tempo.format("%02d:%02d:%02ld", hours, mins, secs);
|
||||
msg << tempo;
|
||||
pi.set_text(msg);
|
||||
}
|
||||
*/
|
||||
outfile.write(buf, count);
|
||||
total += count;
|
||||
pi.setstatus(total);
|
||||
if (pi.iscancelled())
|
||||
break;
|
||||
}
|
||||
}
|
||||
ok = pi.isfinished();
|
||||
@ -804,7 +777,7 @@ bool TSocketClient::HttpSoap(CONNID id, const char* cmd)
|
||||
return ok;
|
||||
|
||||
char hostname[64];
|
||||
aga_get_host_name(hostname, sizeof(hostname));
|
||||
xvt_sys_get_host_name(hostname, sizeof(hostname));
|
||||
|
||||
TString content(256);
|
||||
content = cmd;
|
||||
|
@ -1046,7 +1046,7 @@ void TPrinter::read_configuration(
|
||||
if (host.not_empty())
|
||||
{
|
||||
char hostname[32];
|
||||
aga_get_host_name(hostname, sizeof(hostname));
|
||||
xvt_sys_get_host_name(hostname, sizeof(hostname));
|
||||
read_rcd = (host == hostname); // Safe to read
|
||||
if (!read_rcd)
|
||||
read_rcd = yesno_box("Le impostazioni della stampante sono relative alla stazione di lavoro %s:\n"
|
||||
@ -1137,7 +1137,7 @@ void TPrinter::save_configuration()
|
||||
|
||||
#ifdef XVAGA
|
||||
char hostname[80];
|
||||
aga_get_host_name(hostname, sizeof(hostname));
|
||||
xvt_sys_get_host_name(hostname, sizeof(hostname));
|
||||
prini.set("Host", hostname);
|
||||
prini.set("User", user());
|
||||
#endif
|
||||
|
@ -1,7 +1,9 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <regexp.h>
|
||||
|
||||
/*
|
||||
#include <stdtypes.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
// codici di ritorno della matche()
|
||||
#define regexp_MATCH_PATTERN (6) // pattern non valido
|
||||
#define regexp_MATCH_LITERAL (5) // il pattern non coincide su un carattere comune
|
||||
@ -195,3 +197,12 @@ bool match(const char *pat, const char *str)
|
||||
int err= matche(pat, str);
|
||||
return (err == regexp_MATCH_VALID); // ritorna TRUE se il pattern e la stringa coincidono
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
#include <xvt.h>
|
||||
|
||||
bool match(const char *pat, const char *str)
|
||||
{
|
||||
return xvt_str_match(str, pat, TRUE) != 0;
|
||||
}
|
||||
|
@ -1,10 +1,6 @@
|
||||
#ifndef __REGEXP_H
|
||||
#define __REGEXP_H
|
||||
|
||||
#ifndef __STDTYPES_H
|
||||
#include <stdtypes.h>
|
||||
#endif
|
||||
|
||||
// Composizione delle regular expression:
|
||||
// -------------------------------------
|
||||
// - '*' sostituisce una qualunque sottostringa (0 o più caratteri)
|
||||
|
@ -1,181 +0,0 @@
|
||||
#ifndef __SKEYLINK_H
|
||||
#define __SKEYLINK_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef __SKEYDRV_H
|
||||
#define __SKEYDRV_H
|
||||
|
||||
/*
|
||||
Smartkey commands
|
||||
*/
|
||||
#define MAKE_KEY_CODE(low,high) (((unsigned short)(low)) | (((unsigned short)(high)) << 8))
|
||||
|
||||
#define SCRAMBLING_MODE 's'
|
||||
#define READING_MODE 'r'
|
||||
#define WRITING_MODE 'w'
|
||||
#define FIXING_MODE 'f'
|
||||
#define LOCATING_MODE 'l'
|
||||
#define COMPARING_MODE 'c'
|
||||
#define PROGRAMMING_MODE 'p'
|
||||
#define MODEL_READING_MODE 'm'
|
||||
#define ENCRYPTING_MODE 'e'
|
||||
#define BLOCK_READING_MODE MAKE_KEY_CODE('b','r')
|
||||
#define BLOCK_WRITING_MODE MAKE_KEY_CODE('b','w')
|
||||
|
||||
/*
|
||||
Smartkey NEW commands
|
||||
*/
|
||||
#define SERIAL_NUMBER_READING_MODE 'n'
|
||||
#define FIX_READING_MODE 'x'
|
||||
#define EXT_MODEL_READING_MODE 'h'
|
||||
#define FAIL_COUNTER_READING_MODE 'a'
|
||||
|
||||
/*
|
||||
Legacy commands
|
||||
*/
|
||||
#define DEACTIVATE_ACCESS_MODE MAKE_KEY_CODE('d','d')
|
||||
#define ACTIVATE_ACCESS_MODE MAKE_KEY_CODE('d','a')
|
||||
#define ANTIHACKER_MODE 't'
|
||||
|
||||
/*
|
||||
Smartkey models
|
||||
*/
|
||||
#define SKEY_NONE '0' /* No Smartkey */
|
||||
#define SKEY_FX '1' /* Smartkey mod. FX */
|
||||
#define SKEY_PR '2' /* Smartkey mod. PR */
|
||||
#define SKEY_EP '3' /* Smartkey mod. EP */
|
||||
#define SKEY_NET_5 '4' /* Smartkey mod. NET 5 users */
|
||||
#define SKEY_NET_10 '5' /* Smartkey mod. NET 10 users */
|
||||
#define SKEY_NET_25 '6' /* Smartkey mod. NET 25 users */
|
||||
#define SKEY_NET_50 '7' /* Smartkey mod. NET 50 users */
|
||||
#define SKEY_NET_NL '8' /* Smartkey mod. NET no limit */
|
||||
#define SKEY_SP '9' /* Smartkey mod. SP */
|
||||
#define SKEY_NET 'A' /* Smartkey mod. NET */
|
||||
#define SKEY_SB 'B' /* Smartkey mod. SB */
|
||||
#define SKEY_WI 'C' /* Smartkey mod. WI */
|
||||
|
||||
/*
|
||||
Return codes
|
||||
*/
|
||||
#define ST_OK 0 /* No errors */
|
||||
#define ST_NONE_KEY -1 /* No Smartkey present */
|
||||
#define ST_SYNT_ERR -2 /* Syntax error */
|
||||
#define ST_LABEL_FAILED -3 /* Uncorrect label */
|
||||
#define ST_PW_DATA_FAILED -4 /* Uncorrect password or data */
|
||||
#define ST_EXEC_ERROR -16 /* Max exec reached */
|
||||
#define ST_HW_FAILURE -20 /* Smartkey damaged */
|
||||
|
||||
/*
|
||||
Field length
|
||||
*/
|
||||
#define LABEL_LENGTH 16
|
||||
#define PASSWORD_LENGTH 16
|
||||
#define DATA_LENGTH 64
|
||||
#define EXTENDED_DATA_LENGTH 352
|
||||
#define SCRAMBLE_LENGTH 8
|
||||
|
||||
/*
|
||||
Communication structure definition
|
||||
*/
|
||||
#pragma pack(push,1)
|
||||
|
||||
typedef struct __SKEY_DATA {
|
||||
short lpt;
|
||||
short command;
|
||||
unsigned char label[LABEL_LENGTH];
|
||||
unsigned char password[PASSWORD_LENGTH];
|
||||
unsigned char data[DATA_LENGTH];
|
||||
short fail_counter;
|
||||
short status;
|
||||
unsigned char ext_data[EXTENDED_DATA_LENGTH];
|
||||
} SKEY_DATA;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif /* __SKEYDRV_H */
|
||||
|
||||
/*
|
||||
Smartkey net command codes
|
||||
*/
|
||||
#define NET_KEY_OPEN 'O'
|
||||
#define NET_KEY_ACCESS 'A'
|
||||
#define NET_KEY_CLOSE 'C'
|
||||
|
||||
/*
|
||||
Smartkey command codes
|
||||
*/
|
||||
#define USER_NUMBER_MODE 'U'
|
||||
|
||||
/*
|
||||
Net return codes
|
||||
*/
|
||||
#define ST_NET_ERROR -5 /* Lan error */
|
||||
#define ST_CLOSE_ERROR -6 /* Attempting to CLOSE without OPENing */
|
||||
#define ST_ACCESS_ERROR -7 /* Attempting to ACCESS without OPENing */
|
||||
#define ST_USER_ERROR -8 /* Max user reached */
|
||||
#define ST_NET_PWD_ERR -9 /* Net password wrong */
|
||||
#define ST_TSR_NOT_INST -10 /* SKEYSRV not found */
|
||||
#define ST_INIT_ERROR -11 /* Insufficient PC memory */
|
||||
#define ST_PATH_ERR -12 /* Path error of file not found */
|
||||
#define ST_DRIVER_NOT_INST -13 /* SKEYTSR not installed */
|
||||
#define ST_TOO_MANY_OPEN_KEY -14 /* Too many open SmartKey */
|
||||
#define ST_NET_PASS_INVALID -15 /* Invalid net password */
|
||||
|
||||
#define ST_NET_CONF_ERROR -21 /* Configuration error in INI/Registry/Environment */
|
||||
#define ST_NET_ANP_INIT_ERROR -22 /* Error inizializing the ANP protocol */
|
||||
#define ST_NET_TCPIP_INIT_ERROR -23 /* Error inizializing the TCPIP protocol */
|
||||
#define ST_NET_NOVELL_INIT_ERROR -24 /* Error inizializing the Novell protocol */
|
||||
#define ST_NET_LOCAL_INIT_ERROR -25 /* Error inizializing the Local protocol */
|
||||
#define ST_NET_KEY_NOT_MAP -26 /* Not MAP programmed key found when MAP is requested */
|
||||
|
||||
/*
|
||||
Code returned in data[0] after NET_OPEN
|
||||
*/
|
||||
#define NET_TYPE_LOCAL 0
|
||||
#define NET_TYPE_IPX 1
|
||||
#define NET_TYPE_ANP 2
|
||||
#define NET_TYPE_TCPIP 3
|
||||
|
||||
/*
|
||||
Structure definition
|
||||
*/
|
||||
#pragma pack(push,1)
|
||||
|
||||
typedef struct __KEY_NET {
|
||||
short net_command;
|
||||
unsigned long net_password;
|
||||
short lpt;
|
||||
short command;
|
||||
unsigned char label[LABEL_LENGTH];
|
||||
unsigned char password[PASSWORD_LENGTH];
|
||||
unsigned char data[DATA_LENGTH];
|
||||
short fail_counter;
|
||||
short status;
|
||||
unsigned char ext_data[EXTENDED_DATA_LENGTH];
|
||||
} KEY_NET;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
/*
|
||||
int smartlink_inizialize(void)
|
||||
Inizialize the smartlink driver
|
||||
Return 0 if successfull
|
||||
|
||||
void smartlink_deinizialize(void)
|
||||
Deinizialize the smartlink driver
|
||||
Return 0 if successfull
|
||||
|
||||
short smartlink(KEY_NET* key)
|
||||
Call the driver.
|
||||
Return key->k.status code
|
||||
*/
|
||||
short __cdecl smartlink(KEY_NET*);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,4 +1,4 @@
|
||||
#ifndef __XINCLUDE_H
|
||||
#ifndef __XINCLUDE_H
|
||||
|
||||
#ifndef INCL_XI
|
||||
#include <xi.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user