This commit was generated by cvs2svn to compensate for changes in r5942,

which included commits to RCS files with non-trunk default branches.

git-svn-id: svn://10.65.10.50/trunk@5943 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1998-01-15 16:39:02 +00:00
parent a03d73406e
commit 0c0abd6589
97 changed files with 5421 additions and 0 deletions

BIN
support/dll/al100.dll Executable file

Binary file not shown.

BIN
support/dll/cb5.dll Executable file

Binary file not shown.

BIN
support/dll/devprn.dll Executable file

Binary file not shown.

BIN
support/dll/dllgfm.dll Executable file

Binary file not shown.

BIN
support/dll/hardlock.vxd Executable file

Binary file not shown.

BIN
support/dll/prochook.dll Executable file

Binary file not shown.

BIN
support/dll/raw.drv Executable file

Binary file not shown.

22
support/dll/readme Executable file
View File

@ -0,0 +1,22 @@
Posizionamento e descrizione di DRV, DLL e VXD
----------------------------------------------
I seguenti files vanno installati nel direttorio PRASSI:
AL100.DLL Libreria per compressione/decompressione/archiviazione
CB5.DLL Libreria per accesso ai files in formato FoxPRO
DEVPRN.DLL Libreria per eseguire la stampa di una singola riga senza form-feed (Windows 3.1 e Windows95)
DLLGFM.DLL Libreria per accesso alle funzioni matematiche Green-Leaf
PROCHOOK.DLL Libreria per eseguire piu' istanze di una stessa applicazione a 16-bit (Windows 3.1 e Windows95)
RAW.DRV Driver per l'accesso "grezzo" ai device di stampa (usata da DEVPRN.DLL)
WINSOCK.DLL Libreria per accesso alle funzioni di rete (Win sockets: Windows 3.1 e Windows95)
XWMBA403.DLL Libreria per accesso alle funzioni XVT
XWMHN403.DLL Libreria per accesso alle funzioni XVT
XWMTE403.DLL Libreria per accesso alle funzioni XVT
I seguenti files vanno installati nel direttorio WINDOWS\SYSTEM:
HARDLOCK.VXD Device Driver per accedere alla chiave di protezione (Windows 3.1 e Windows95)
Nota: i programmi PRASSI sotto Windows 3.1 non necessitano di HARDLOCK.VXD
ma tutti quelli che fanno uso di HARDLOCK.FLL (Nota Integrativa) SI'.

BIN
support/dll/winsock.dll Executable file

Binary file not shown.

BIN
support/dll/xwmba403.dll Executable file

Binary file not shown.

BIN
support/dll/xwmhn403.dll Executable file

Binary file not shown.

BIN
support/dll/xwmte403.dll Executable file

Binary file not shown.

BIN
support/esterni/dummy.ldb Executable file

Binary file not shown.

BIN
support/esterni/dummy.mdb Executable file

Binary file not shown.

BIN
support/esterni/msaes110.dll Executable file

Binary file not shown.

BIN
support/esterni/msajt112.dll Executable file

Binary file not shown.

BIN
support/esterni/msajt200.dll Executable file

Binary file not shown.

42
support/esterni/readme Executable file
View File

@ -0,0 +1,42 @@
Posizionamento e descrizione dei files in installazione
-------------------------------------------------------
I seguenti files vanno installati nel direttorio PRASSI
CB0000.EXE
TRRICE.EXE
VCOPIA.EXE
DUMMY.LDB
DUMMY.MDB
MSAES110.DLL
MSAJT112.DLL
MSAJT200.DLL
VBDB300.DLL
VBRUN300.DLL
XBS200.DLL
Inoltre per ogni file exe qui presente, va creato nel direttorio
WINDOWS, il rispettivo file INI. Pertanto avremo:
CB0000.INI
TRRICE.INI
VCOPIA.INI
Il contenuto di questi 3 file e' lo stesso per tutti e 3:
[Installable ISAMs]
FoxPro 2.0=<<<DIRETTORIO PRASSI>>>xbs200.dll
FoxPro 2.5=<<<DIRETTORIO PRASSI>>>xbs200.dll
dBASE III=<<<DIRETTORIO PRASSI>>>xbs200.dll
dBASE IV=<<<DIRETTORIO PRASSI>>>xbs200.dll
[dBase ISAM]
Deleted=On
[Paradox ISAM]
ParadoxNetStyle=3.x
Il parametro <<<DIRETTORIO PRASSI>>> va sostituito con
il path corretto in installazione. La creazione di questi
files va effettuata SEMPRE, anche in aggiunta posto di lavoro.

BIN
support/esterni/vbdb300.dll Executable file

Binary file not shown.

BIN
support/esterni/vbrun300.dll Executable file

Binary file not shown.

BIN
support/esterni/xbs200.dll Executable file

Binary file not shown.

BIN
support/faxman/class1.dat Executable file

Binary file not shown.

BIN
support/faxman/class2.dat Executable file

Binary file not shown.

BIN
support/faxman/class20.dat Executable file

Binary file not shown.

BIN
support/faxman/cover1.pg Executable file

Binary file not shown.

BIN
support/faxman/cover2.pg Executable file

Binary file not shown.

BIN
support/faxman/faxdll.dll Executable file

Binary file not shown.

BIN
support/faxman/faxman.fmf Executable file

Binary file not shown.

BIN
support/faxman/fmfaxdrv.drv Executable file

Binary file not shown.

BIN
support/faxman/im10bmp.dil Executable file

Binary file not shown.

BIN
support/faxman/im10fax.dil Executable file

Binary file not shown.

BIN
support/faxman/im10pcx.dil Executable file

Binary file not shown.

BIN
support/faxman/im10tif.dil Executable file

Binary file not shown.

BIN
support/faxman/im10xfax.del Executable file

Binary file not shown.

48
support/faxman/readme Executable file
View File

@ -0,0 +1,48 @@
Posizionamento e descrizione per installazione di FAXMAN
--------------------------------------------------------
Aggiunte da fare al file WIN.INI per installare il
programma di gestione fax:
[ports]
EASYFAX=
[FaxMan,EASYFAX]
Application=<<<<DIRETTORIO PRASSI>>>>bafax.exe
[Printer Ports]
FaxMan=fmfaxdrv,EASYFAX,5,5
[devices]
FaxMan=fmfaxdrv,EASYFAX
Nota: BAFAX.EXE e' un programma sviluppato internamente, che si occupa
dello spooling e della gestione dei documenti da inviare a FAXMAN.EXE.
I suoi sorgenti sono in BA
I seguenti files vanno installati nel direttorio PRASSI
FAXMAN.EXE
FAXMAN.FMF
COVER1.PG
COVER2.PG
FAXDLL.DLL
IM10XFAX.DEL
IM10FAX.DIL
IM10TIF.DIL
IM10BMP.DIL
IM10PCX.DIL
CLASS2.DAT
CLASS20.DAT
CLASS1.DAT
I seguenti files vanno installati in WINDOWS\SYSTEM
FMFAXDRV.DRV
La directory di faxman (c:\prassi) deve essere nel path.

BIN
support/interni/aga.fll Executable file

Binary file not shown.

BIN
support/interni/aga16.dll Executable file

Binary file not shown.

BIN
support/interni/aga32.dll Executable file

Binary file not shown.

BIN
support/interni/agaexec.dll Executable file

Binary file not shown.

BIN
support/interni/agalight.fll Executable file

Binary file not shown.

BIN
support/interni/dumb.dll Executable file

Binary file not shown.

BIN
support/interni/dumb.fll Executable file

Binary file not shown.

BIN
support/interni/dumbvb.dll Executable file

Binary file not shown.

BIN
support/interni/hardlock.dll Executable file

Binary file not shown.

BIN
support/interni/hardlock.fll Executable file

Binary file not shown.

55
support/interni/readme Executable file
View File

@ -0,0 +1,55 @@
Descrizione dei files
---------------------
I seguenti files sono files di supporto per applicaazioni esterne
realizzate in Visual Basic, FoxPro, Visual FoxPro e altri.
Vanno installati nel direttorio PRASSI.
Libreria Descrizione Usata da...
aga.fll Libreria FoxPro (16 bit) per leggere files Vecchie applicazioni
dichiarazioni; Automaz.Ufficio
aga16.dll Libreria Thunking per win32s (va con aga32.dll)
per eseguire lo spawn sincrono dei programmi Applicazioni SESA, MIVA
aga32.dll Libreria 32bit con aga_exec() esportata
per piattaforme solo 32 bit (win95 winnt) Applicazioni SESA, MIVA
agaexec.dll Libreria 16 bit aga_exec() esportata Cespiti PRASSI
agalight.fll Libreria FoxPro con aga_exec() esportata Dichiarazioni Automaz.Ufficio,
GICI PRASSI
hardlock.dll Libreria per leggere autorizzazioni chiave Programmi VisualBasic: VCOPIA.EXE,
(vecchio metodo tramite GetAut()) TRRICE.EXE, CB0000.EXE
hardlock.fll Libreria FoxPro per legegre autorizzazioni Tutte le applicazioni FoxPro/VisualFoxPro
chiave (vecchio metodo tramite GetAut()) tranne quelle PROCOM.
dumb.dll Libreria per leggere autorizzazioni moduli Nessuno
memorizzati sulla chiave (nuovo metodo con
crittografazione e un poco di scramble)
dumb.fll Libreria FoxPro per leggere autorizzazione Applicazioni PROCOM
moduli memorizzati sulla chiave (nuovo
metodo con crittografazione)
dumbvb.dll Liberia Visual Basic per leggere autorizzaz- Applicazioni PROCOM
zioni moduli (nuovo metodo con crittografazione)
dump16.exe Applicazione MFC 16-bit ODBC per leggere i Cespiti PRASSI tramite CE0.EXE
dati ditta per collegamento CESPITI SESA
dump32.exe Applicazione MFC 32-bit ODBC per leggere i Cespiti PRASSI tramite CE0.EXE
dati ditta per collegamanto CESPITI SESA
I sorgenti per tutte le DLL/FLL sono nel direttorio SRC qui presente:
il direttorio AGA contiene i sorgenti per DLL/FLL che iniziano con AGA
il direttorio DUMB contiene i sorgenti per DLL/FLL che iniziano con DUMB o HARDLOCK.
I sorgenti per dump16.exe dump32.exe sono nel modulo CE.
dump16.exe viene compilato con Visual C++ 1.5, dump32.exe deve venire compilato
con Visual C++ 5.0; per creare un progetto basta entrare nel wizard ed
aggiungere i files settare la versione di RELEASE e lanciare la compilazione.
Analogamente per AGA32.DLL: entrare nel wizard, settare il progetto di RELEASE
per una DLL a 32 bits, settare le macro: /DDLL /DLIGHT. La macro /DWIN32 e'
settata automaticamente.

1094
support/interni/src/aga/aga.cpp Executable file

File diff suppressed because it is too large Load Diff

96
support/interni/src/aga/aga16.c Executable file
View File

@ -0,0 +1,96 @@
/* Aga16.dll. 16 bit side of the thunk for aga32.dll */
#ifndef APYENTRY
#define APYENTRY
#endif
#define W32SUT_16
#include <windows.h>
#include <toolhelp.h>
#include <stdio.h>
#include <malloc.h>
#include "w32sut.h"
#define SYNCHSPAWN 1
UT16CBPROC glpfnUT16CallBack;
int FAR PASCAL LibMain (HANDLE hLibInst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine)
{
return (1);
}
DWORD FAR PASCAL UTInit (UT16CBPROC lpfnUT16CallBack, LPVOID lpBuf)
{
glpfnUT16CallBack = lpfnUT16CallBack;
return (1);
}
DWORD FAR PASCAL UTProc (LPVOID lpBuf, DWORD dwFunc)
{
switch (dwFunc)
{
case SYNCHSPAWN:
{
WORD WM_WAKEUP = RegisterWindowMessage("WAKEUP");
UINT nCmdShow;
LPCSTR lpszCmdLine;
HINSTANCE inst;
HTASK child = NULL;
TASKENTRY te;
BOOL ok;
BOOL again = TRUE;
BYTE i;
MSG msg;
lpszCmdLine = (LPSTR) ((LPDWORD)lpBuf)[0];
nCmdShow = (UINT) ((LPDWORD)lpBuf)[1];
inst = WinExec(lpszCmdLine, nCmdShow);
te.dwSize = sizeof(TASKENTRY);
for (ok = TaskFirst(&te); ok && child == NULL; ok = TaskNext(&te))
if (te.hInst == inst)
{
child = te.hTask;
break;
}
for (i = 0; again; i++)
{/* Esegue la TaskFindHandle ogni 256 cicli */
if (i == 0 && ok && TaskFindHandle(&te, child) == FALSE)
break;
/* Questo (utilizzato in agalight.dll) metodo non funziona in Win32s.
GetMessage(&msg, (HWND)NULL, 0, 0);
TranslateMessage(&msg);
if (msg.message == WM_WAKEUP && msg.wParam == child)
break;
*/
while (PeekMessage(&msg, NULL, 0,0, PM_REMOVE) && again)
{
if (msg.message == WM_QUIT ||
(msg.message == WM_WAKEUP && msg.wParam == child))
again=FALSE;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return inst >= 32;
}
}
return ((DWORD) -1L);
}
int FAR PASCAL _WEP(int bSystemExit)
{
return (1);
}

View File

@ -0,0 +1,9 @@
LIBRARY AGA16
EXETYPE WINDOWS
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD MOVEABLE SINGLE
HEAPSIZE 1024
EXPORTS
UTInit @1
UTProc @2

View File

@ -0,0 +1,9 @@
aga16
..\..\aga16.dll
nul
w32sut16+
toolhelp+
libw+
/NOD:llibce ldllcew
aga16.def

View File

@ -0,0 +1,135 @@
INFORMAZIONI SULL'UTILIZZO DELLE DLL PER CHIAMARE PROGRAMMI ESTERNI
===================================================================
Le DLL utilizzabili sono 2:
AGAEXEC.DLL (Analoga alla AGALIGHT.FLL)
AGA32.DLL : questa DLL necessita di un secondo componente: AGA16.DLL (vedi sotto la spiegazione)
AGALIGHT.DLL viene utilizzata per programmi a 16 bit
AGA32.DLL viene utilizzata per programmi a 32 bit su piattaforme a 32 bit (Win95 WinNT)
AGA16.DLL viene utilizzata per programmi a 32 bit su piattaforme con Win32s (Windows 3.11 + Win32s)
AGA32.DLL e AGA16.DLL vanno SEMPRE in coppia in quanto inerenti a programmi a 32 bit.
Quindi per programmi a 16 bit si utilizza AGAEXEC.DLL, mentre per programmi a 32
si utilizza AGA32.DLL, la quale a sua volta si accorgera' automaticamente di quale
tipo di piattaforma si tratti, collegandosi ad AGA16.DLL nel caso vi siano chiamate a funzione
Aga_exec(). Il motivo per il quale e' stata realizzata la versione per Win32s e' che le funzioni del
Kernel di Windows a 32 bit utilizzate in AGA32.DLL non hanno un corretto funzionamento in Win32s.
Pertanto e' stato necessario un thunking a 16 bit.
FUNZIONI ESPORTATE
------------------
int Aga_setvar(const char* p, const char* u, const char* t)
const char* Aga_workdir()
int Aga_wakeup()
int Aga_exec(const char* p)
*******************************************************
Aga_setvar(const char* p, const char* u, const char* t)
*******************************************************
Serve per inizializzare alcune variabili interne alla DLL.
Le stringhe da passare sono, in ordine, le seguenti:
p : contenuto della variabile d'ambiente PREFPATH
u : nome dell'utente con il quale viene chiamato il programma PRASSI
t : contenuto della variabile d'ambiente TMP o TEMP se non esiste la precedente
La sua chiamata e' obbligatoria se si intende utilizzare anche AGA_WORKDIR(),
solitamente la si applica all'inizio del programma. Se si utilizzano solo
Aga_wakeup() o Aga_exec() non e' necessario il suo utilizzo.
Esempio.
...
strcpy(a,"");
strcpy(a,getenv("PREFPATH"));
if (!strlen(a))
strcpy(a,"PREFIX.TXT");
strcpy(b,"PRASSI");
strcpy(c,"c:\\tmp");
Aga_setvar(a,b,c);
...
**************************
const char* Aga_workdir()
**************************
Serve a ritornare il prefisso dati corrente dei programmi PRASSI, composto
tramite i contenuti di PATHPREF.INI e il file identificato dal contenuto della
variabile d'ambiente PREFPATH.
Esempio:
Il file PATHPREF.INI presente sotto il direttorio programmi PRASSI contiene f:\dati
La variabile PREFPATH vale c:\prassi\prefix.txt
Il file C:\PRASSI\PREFIX.TXT identificato da PREFPATH contiene 00001a come ditta corrente.
Il risultato della chiamata a AGA_WORKDIR sara'
f:\dati\00001a
****************
int Aga_wakeup()
****************
Serve per togliere dall'attesa il programma chiamante. La chiamata
va effettuata prima dell'uscita del programma. Questa funzione
viene utilizzata all'interno del programma chiamato; e' tipico
l'utilizzo in coppia con la Aga_exec(), che permette di eseguire un
programma figlio e di attendere la fine della sua esecuzione.
Tutti i programmi PRASSI effettuano le stesse istruzioni della Aga_wakeup()
prima della fine, in modo che eventuali programmi chiamanti possano poi
ripristinare il loro stato.
Esempio:
Programma padre Programma figlio
START
|
Istruzione 1
|
Aga_exec()---------------> INIZIO
|
Istruzione 1
|
Aga_wakeup()
|
Istruzione 2 <------------- FINE
|
FINE
***************************
int Aga_exec(const char* p)
***************************
Serve per eseguire un programma figlio ed attendere la sua fine (effettua
una WinExec() sincrona).
Il parametro p contiene il pathname completo del programma da eseguire.
Esempio:
Aga_exec("ba1.exe /uPRASSI");

View File

@ -0,0 +1,12 @@
LIBRARY AGAEXEC
EXETYPE WINDOWS 3.0
CODE PRELOAD MOVABLE SHARED
DATA SHARED PRELOAD
EXPORTS
AGA_SETVAR @1
AGA_EXEC @2
AGA_WAKEUP @3
AGA_WORKDIR @4

View File

@ -0,0 +1,8 @@
agaexec
..\..\agaexec.dll
nul
libw+
toolhelp+
/NOD:llibce ldllcew
agaexec.def

View File

@ -0,0 +1,7 @@
LIBRARY AGAFLL
EXETYPE WINDOWS 3.0
CODE PRELOAD MOVABLE SHARED
DATA SHARED PRELOAD
INCLUDE CB5IMP.DEF

Binary file not shown.

View File

@ -0,0 +1,12 @@
agafll+ccustio+cfiles+codeb+csort+
getaut+hlprot+ioresult+upstring+tmpfname+
array+checks+files+date+isam+object+
prefix+scanner+stdtypes+strings+utility+
..\foxlck\libentry
..\..\aga.fll
nul
..\foxlck\proapiml+
libw+
/NOD:llibce ldllcew
agafll.def

View File

@ -0,0 +1,7 @@
LIBRARY AGALIGHT
EXETYPE WINDOWS 3.0
CODE PRELOAD MOVABLE SHARED
DATA SHARED PRELOAD

View File

@ -0,0 +1,10 @@
agalight+
..\foxlck\libentry.obj
..\..\agalight.fll
nul
..\foxlck\proapiml+
toolhelp+
libw+
/NOD:llibce ldllcew
agalight.def

View File

@ -0,0 +1,462 @@
IMPORTS
C4ATOD = CB5.1
C4ATOI = CB5.2
C4ATOL = CB5.3
C4DESCEND = CB5.4
C4DESCEND_DATE = CB5.5
C4DESCEND_NUM = CB5.6
C4DESCEND_STR = CB5.7
C4ENCODE = CB5.8
CODE4ALLOC = CB5.9
D4ALIAS = CB5.10
D4ALIAS_SET = CB5.11
D4APPEND = CB5.12
D4APPEND_BLANK = CB5.13
D4APPEND_DATA = CB5.14
D4APPEND_START = CB5.15
D4BLANK = CB5.16
D4BOF = CB5.17
D4BOTTOM = CB5.18
D4CHANGED = CB5.19
D4CHECK = CB5.20
D4CLOSE = CB5.21
D4CLOSE_ALL = CB5.22
D4CREATE = CB5.23
D4DATA = CB5.24
D4DELETE = CB5.25
D4DELETED = CB5.26
D4EOF = CB5.27
D4FIELD = CB5.28
D4FIELD_INFO = CB5.29
D4FIELD_J = CB5.30
D4FIELD_NUMBER = CB5.31
D4FLUSH = CB5.32
D4FLUSH_DATA = CB5.33
D4FLUSH_FILES = CB5.34
D4FREE_BLOCKS = CB5.35
D4GO = CB5.36
D4GO_DATA = CB5.37
D4GO_EOF = CB5.38
D4INDEX = CB5.39
D4INIT = CB5.40
D4INIT_UNDO = CB5.41
D4LOCK = CB5.42
D4LOCK_ALL = CB5.43
D4LOCK_APPEND = CB5.44
D4LOCK_FILE = CB5.45
D4LOCK_GROUP = CB5.46
D4LOCK_INDEX = CB5.47
D4LOCK_TEST = CB5.48
D4LOCK_TEST_APPEND = CB5.49
D4LOCK_TEST_FILE = CB5.50
D4LOCK_TEST_INDEX = CB5.51
D4MEMO_COMPRESS = CB5.52
D4NUM_FIELDS = CB5.53
D4OPEN = CB5.54
D4OPT_START = CB5.55
D4OPT_SUSPEND = CB5.56
D4OPTIMIZE = CB5.57
D4OPTIMIZE_WRITE = CB5.58
D4PACK = CB5.59
D4PACK_DATA = CB5.60
D4POSITION = CB5.61
D4POSITION_SET = CB5.62
D4READ = CB5.63
D4READ_OLD = CB5.64
D4RECALL = CB5.65
D4RECCOUNT = CB5.66
D4RECNO = CB5.67
D4RECORD = CB5.68
D4RECORD_POSITION = CB5.69
D4RECORD_WIDTH = CB5.70
D4REFRESH = CB5.71
D4REFRESH_RECORD = CB5.72
D4REINDEX = CB5.73
D4SEEK = CB5.74
D4SEEK_DOUBLE = CB5.75
D4SKIP = CB5.76
D4TAG = CB5.77
D4TAG_DEFAULT = CB5.78
D4TAG_NEXT = CB5.79
D4TAG_PREV = CB5.80
D4TAG_SELECT = CB5.81
D4TAG_SELECTED = CB5.82
D4TOP = CB5.83
D4UNLOCK = CB5.84
D4UNLOCK_FILES = CB5.85
D4VALIDATE_MEMO_IDS = CB5.86
D4WRITE = CB5.87
D4WRITE_DATA = CB5.88
D4WRITE_KEYS = CB5.89
D4ZAP = CB5.90
D4ZAP_DATA = CB5.91
DATE4ASSIGN = CB5.92
DATE4CDOW = CB5.93
DATE4CMONTH = CB5.94
DATE4DAY = CB5.95
DATE4DOW = CB5.96
DATE4FORMAT = CB5.97
DATE4FORMAT_MDX = CB5.98
DATE4INIT = CB5.99
DATE4LONG = CB5.100
DATE4MONTH = CB5.101
DATE4TIME_NOW = CB5.102
DATE4TODAY = CB5.103
DATE4YEAR = CB5.104
E4 = CB5.105
E4CODE = CB5.106
E4DESCRIBE = CB5.107
E4EXIT = CB5.108
E4EXIT_TEST = CB5.109
E4HOOK = CB5.110
E4SET = CB5.111
E4SEVERE = CB5.112
E4TEXT = CB5.113
EXPR4CALC_CREATE = CB5.114
EXPR4DOUBLE = CB5.115
EXPR4FREE = CB5.116
EXPR4KEY = CB5.117
EXPR4KEY_LEN = CB5.118
EXPR4LEN = CB5.119
EXPR4PARSE = CB5.120
EXPR4SOURCE = CB5.121
EXPR4TRUE = CB5.122
EXPR4TYPE = CB5.123
EXPR4VARY = CB5.124
F4ASSIGN = CB5.125
F4ASSIGN_CHAR = CB5.126
F4ASSIGN_DOUBLE = CB5.127
F4ASSIGN_FIELD = CB5.128
F4ASSIGN_INT = CB5.129
F4ASSIGN_LONG = CB5.130
F4ASSIGN_N = CB5.131
F4ASSIGN_PTR = CB5.132
F4BLANK = CB5.133
F4CHAR = CB5.134
F4DATA = CB5.135
F4DECIMALS = CB5.136
F4DOUBLE = CB5.137
F4INT = CB5.138
F4LEN = CB5.139
F4LONG = CB5.140
F4MEMO_ASSIGN = CB5.150
F4MEMO_ASSIGN_N = CB5.151
F4MEMO_FREE = CB5.152
F4MEMO_LEN = CB5.153
F4MEMO_NCPY = CB5.154
F4MEMO_PTR = CB5.155
F4MEMO_STR = CB5.156
F4NAME = CB5.157
F4NCPY = CB5.158
F4PTR = CB5.159
F4STR = CB5.160
F4TRUE = CB5.161
F4TYPE = CB5.162
FILE4CLOSE = CB5.163
FILE4CREATE = CB5.164
FILE4FLUSH = CB5.165
FILE4LEN = CB5.166
FILE4LEN_SET = CB5.167
FILE4LOCK = CB5.168
FILE4LOCK_HOOK = CB5.169
FILE4OPEN = CB5.170
FILE4OPTIMIZE = CB5.171
FILE4OPTIMIZE_WRITE = CB5.172
FILE4READ = CB5.173
FILE4READ_ALL = CB5.174
FILE4READ_ERROR = CB5.175
FILE4REFRESH = CB5.176
FILE4REPLACE = CB5.177
FILE4TEMP = CB5.178
FILE4UNLOCK = CB5.179
FILE4WRITE = CB5.180
FILE4SEQ_READ = CB5.181
FILE4SEQ_READ_ALL = CB5.182
FILE4SEQ_READ_INIT = CB5.183
FILE4SEQ_WRITE = CB5.184
FILE4SEQ_WRITE_FLUSH = CB5.185
FILE4SEQ_WRITE_INIT = CB5.186
FILE4SEQ_WRITE_REPEAT = CB5.187
I4CLOSE = CB5.188
I4CREATE = CB5.189
I4LOCK = CB5.190
I4OPEN = CB5.191
I4REINDEX = CB5.192
I4TAG = CB5.193
I4TAG_INFO = CB5.194
I4UNLOCK = CB5.195
L4ADD = CB5.196
L4ADD_AFTER = CB5.197
L4ADD_BEFORE = CB5.198
L4FIRST = CB5.199
L4LAST = CB5.200
L4NEXT = CB5.201
L4POP = CB5.202
L4PREV = CB5.203
L4REMOVE = CB5.204
MEM4ALLOC = CB5.205
MEM4CREATE = CB5.206
MEM4FREE = CB5.207
MEM4RELEASE = CB5.208
MEM4RESET = CB5.209
RELATE4BOTTOM = CB5.210
RELATE4CHANGED = CB5.211
RELATE4CREATE_SLAVE = CB5.212
RELATE4DO = CB5.213
RELATE4DO_ONE = CB5.214
RELATE4ERROR_ACTION = CB5.215
RELATE4FREE = CB5.216
RELATE4INIT = CB5.217
RELATE4LOCK = CB5.218
RELATE4MATCH_LEN = CB5.219
RELATE4NEXT = CB5.220
RELATE4QUERY_SET = CB5.221
RELATE4SKIP = CB5.222
RELATE4SKIP_ENABLE = CB5.223
RELATE4SORT_SET = CB5.224
RELATE4TOP = CB5.225
RELATE4TYPE = CB5.226
RELATE4UNLOCK = CB5.227
SORT4FREE = CB5.229
SORT4GET = CB5.230
SORT4GET_INIT = CB5.231
SORT4INIT = CB5.232
SORT4PUT = CB5.233
T4ADD = CB5.234
T4ADD_CALC = CB5.235
T4BOTTOM = CB5.236
T4DOWN = CB5.237
T4DUMP = CB5.238
T4EOF = CB5.239
T4FLUSH = CB5.240
T4FREE_ALL = CB5.241
T4GO = CB5.242
T4KEY = CB5.243
T4OPEN = CB5.244
T4POSITION = CB5.245
T4POSITION_SET = CB5.246
T4RECNO = CB5.247
T4REMOVE = CB5.248
T4REMOVE_CALC = CB5.249
T4SEEK = CB5.250
T4SKIP = CB5.251
T4TOP = CB5.252
T4UP = CB5.253
T4UP_TO_ROOT = CB5.254
U4ALLOC = CB5.255
U4ALLOC_AGAIN = CB5.256
U4ALLOC_ER = CB5.257
U4ALLOC_FREE = CB5.258
U4FREE = CB5.259
U4NAME_CHAR = CB5.260
U4NAME_EXT = CB5.261
U4NAME_PIECE = CB5.262
U4NCPY = CB5.263
U4YYMMDD = CB5.264
EXPR4CALC_LOOKUP = CB5.265
C4TRIM_N = CB5.266
EXPR4FUNCTIONS = CB5.267
C4DTOA45 = CB5.268
EXPR4CALC_DELETE = CB5.269
E4LOOKUP = CB5.270
C4UPPER = CB5.271
EXPR4CALC_NAME_CHANGE = CB5.272
EXPR4CALC_MODIFY = CB5.273
RELATE4FREE_RELATE = CB5.274
EXPR4CALC_MASSAGE = CB5.275
D4UPDATE_HEADER = CB5.276
U4SWITCH = CB5.277
DATE4FORMAT_MDX2 = CB5.278
EXPR4DOUBLE2 = CB5.279
D4POSITION2 = CB5.280
F4DOUBLE2 = CB5.281
T4POSITION2 = CB5.282
F4MEMO_SET_LEN = CB5.283
C4LTOA45 = CB5.284
I4ADD_TAG = CB5.285
EXPR4CALC_RESET = CB5.286
T4IS_DESCENDING = CB5.287
I4IS_PRODUCTION = CB5.288
T4UNIQUE = CB5.289
D4SEEK_N = CB5.290
C4DLL_INST = CB5.291
C4ATOD2 = CB5.292
F4MEMO_CHECK = CB5.293
D4UNLOCK_APPEND = CB5.294
D4UNLOCK_DATA = CB5.295
D4UNLOCK_FILE = CB5.296
D4UNLOCK_RECORDS = CB5.297
C4LOWER = CB5.298
I4CHECK = CB5.299
U4REMOVE = CB5.300
AREA4CREATE = CB5.301
AREA4FREE = CB5.302
AREA4NUMOBJECTS = CB5.303
AREA4OBJFIRST = CB5.304
AREA4OBJLAST = CB5.305
AREA4OBJNEXT = CB5.306
AREA4OBJPREV = CB5.307
AREA4PAGEBREAK = CB5.308
GROUP4CREATE = CB5.309
GROUP4FOOTERFIRST = CB5.310
GROUP4FOOTERNEXT = CB5.311
GROUP4FOOTERPREV = CB5.312
GROUP4FREE = CB5.313
GROUP4HEADERFIRST = CB5.314
GROUP4HEADERNEXT = CB5.315
GROUP4HEADERPREV = CB5.316
GROUP4NUMFOOTERS = CB5.317
GROUP4NUMHEADERS = CB5.318
GROUP4REPEATHEADER = CB5.319
GROUP4RESETEXPRSET = CB5.320
GROUP4RESETPAGE = CB5.321
GROUP4RESETPAGENUM = CB5.322
GROUP4SWAPFOOTER = CB5.323
GROUP4SWAPHEADER = CB5.324
OBJ4BITMAPSTATICCREATE = CB5.325
OBJ4BITMAPSTATICFREE = CB5.326
OBJ4BITMAPFILECREATE = CB5.327
OBJ4BITMAPFILEFREE = CB5.328
OBJ4BITMAPFIELDCREATE = CB5.329
OBJ4BITMAPFIELDFREE = CB5.330
OBJ4BRACKETS = CB5.331
OBJ4CALCCREATE = CB5.332
OBJ4CALCFREE = CB5.333
OBJ4DATEFORMAT = CB5.334
OBJ4DECIMALS = CB5.335
OBJ4DELETE = CB5.336
OBJ4DISPLAYONCE = CB5.337
OBJ4DISPLAYZERO = CB5.338
OBJ4EXPRCREATE = CB5.339
OBJ4EXPRFREE = CB5.340
OBJ4FIELDCREATE = CB5.341
OBJ4FIELDFREE = CB5.342
OBJ4FRAMECORNERS = CB5.343
OBJ4FRAMECREATE = CB5.344
OBJ4FRAMEFILL = CB5.345
OBJ4FRAMEFREE = CB5.346
OBJ4JUSTIFY = CB5.347
OBJ4LEADINGZERO = CB5.348
OBJ4LINECREATE = CB5.349
OBJ4LINEFREE = CB5.350
OBJ4LINEWIDTH = CB5.351
OBJ4LOOKAHEAD = CB5.352
OBJ4NUMERICTYPE = CB5.353
OBJ4STYLE = CB5.354
OBJ4TEXTCREATE = CB5.355
OBJ4TEXTFREE = CB5.356
OBJ4TOTALCREATE = CB5.357
OBJ4TOTALFREE = CB5.358
RELATE4RETRIEVE = CB5.359
RELATE4SAVE = CB5.360
REPORT4CAPTION = CB5.361
REPORT4CURRENCY = CB5.362
REPORT4DATEFORMAT = CB5.363
REPORT4DECIMAL = CB5.364
REPORT4DO = CB5.365
REPORT4FREE = CB5.366
REPORT4GENERATEPAGE = CB5.367
REPORT4GROUPFIRST = CB5.368
REPORT4GROUPLAST = CB5.369
REPORT4GROUPLOOKUP = CB5.370
REPORT4GROUPNEXT = CB5.371
REPORT4GROUPPREV = CB5.372
REPORT4GROUPHARDRESETS = CB5.373
REPORT4INIT = CB5.374
REPORT4MARGINS = CB5.375
REPORT4NUMGROUPS = CB5.376
REPORT4NUMSTYLES = CB5.377
REPORT4OUTPUT = CB5.378
REPORT4PAGEFREE = CB5.379
REPORT4PAGEHEADERFOOTER = CB5.380
REPORT4PAGEINIT = CB5.381
REPORT4PAGEMARGINSGET = CB5.382
REPORT4PAGEOBJFIRST = CB5.383
REPORT4PAGEOBJNEXT = CB5.384
REPORT4PAGESIZE = CB5.385
REPORT4PAGESIZEGET = CB5.386
REPORT4PARENT = CB5.387
REPORT4PRINTERSELECT = CB5.388
REPORT4PRINTERDC = CB5.389
REPORT4QUERYSET = CB5.390
REPORT4RETRIEVE = CB5.391
REPORT4SAVE = CB5.392
REPORT4SEPARATOR = CB5.393
REPORT4SORTSET = CB5.394
REPORT4STYLEFIRST = CB5.395
REPORT4STYLELAST = CB5.396
REPORT4STYLENEXT = CB5.397
REPORT4STYLESELECT = CB5.398
REPORT4STYLESELECTED = CB5.399
REPORT4STYLESHEETLOAD = CB5.400
REPORT4STYLESHEETSAVE = CB5.401
REPORT4TITLEPAGE = CB5.402
REPORT4TITLESUMMARY = CB5.403
REPORT4TOSCREEN = CB5.404
STYLE4COLOR = CB5.405
STYLE4CREATE = CB5.406
STYLE4DELETE = CB5.407
STYLE4FREE = CB5.408
STYLE4INDEX = CB5.409
STYLE4LOOKUP = CB5.410
TOTAL4CREATE = CB5.411
TOTAL4FREE = CB5.412
REPORT4DATADO = CB5.413
TOTAL4ADDCONDITION = CB5.414
REPORT4DATAFILESET = CB5.415
REPORT4DATAGROUP = CB5.416
OBJ4DATAFIELDSET = CB5.417
WRITEDIB = CB5.418
GETDIB = CB5.419
PALETTESIZE = CB5.420
FINDDIBBITS = CB5.421
REPORT4INDEX_TYPE = CB5.422
AREA4ADD_OBJECT = CB5.423
OBJ4REMOVE = CB5.424
GROUP4POSITIONSET = CB5.425
REPORT4GET_PRINTERIC = CB5.426
TOTAL4LOOKUP = CB5.427
AREA4SORT_OBJ_TREE = CB5.428
RELATE4LOOKUP_DATA = CB5.429
REPORT4RETRIEVE2 = CB5.430
RELATE4SAVE2 = CB5.431
RELATE4RETRIEVE2 = CB5.432
U4DELAY_SEC = CB5.433
T4BLOCK = CB5.451
T4CHECK = CB5.452
CTRL4ADDCODE = CB5.500
CTRL4CODELISTINIT = CB5.501
CTRL4FREECTRLNODE = CB5.502
CTRL4FREECODELIST = CB5.503
CTRL4GETCTRLCODE = CB5.504
CTRL4INITVBX = CB5.505
CTRL4INITVBXUNDO = CB5.506
X4BOTTOM = CB5.600
X4INIT_WORK = CB5.601
X4FILTER_TEST = CB5.602
X4GO = CB5.603
X4SEEK = CB5.604
X4SEEK_DOUBLE = CB5.605
X4SKIP = CB5.606
X4TOP = CB5.607
I4CHANGED = CB5.608

142
support/interni/src/aga/makefile Executable file
View File

@ -0,0 +1,142 @@
#
# Comando per avere le versioni di DEBUG:
# nmake DBG=D
#
#
# Per compilare aga.fll scommentare tutte le dipendenze di aga.fll
#
# Compiler setup
#
CC = cl
CFLAGS = /nologo /c /ALw # large memory model; SS != DS; DS not loaded at fn entry
CFLAGS = $(CFLAGS) /GD # fn entry code optimized for Windows DLLs
CFLAGS = $(CFLAGS) /G2 #
CFLAGS = $(CFLAGS) /O # optimizations (optional)
CFLAGS = $(CFLAGS) /W3 # set warning level as desired
CFLAGS = $(CFLAGS) /Zp2 # pack 2 bytes
! if "$(DBG)" == "D"
CFLAGS = $(CFLAGS) /DDBG
CFLAGS = $(CFLAGS) /Zi
! endif
#
# Link setup
#
LINKER = link
LFLAGS = /ONERROR:NOEXE/NOFARCALL/NOE
! if "$(DBG)" == "D"
LFLAGS = $(LFLAGS) /CO
! endif
SUPP=$(SROOT)/support/interni
ICPP=$(SROOT)/include
DLL=\
$(SUPP)/agaexec.dll $(SUPP)/aga16.dll
FLL=\
$(SUPP)/agalight.fll
# $(SUPP)/agalight.fll $(SUPP)/aga.fll
CLEAN=dummy
.PRECIOUS: $(DLL) $(FLL)
main: $(FLL) $(DLL) $(CLEAN)
dummy: agalight.obj
del *.obj
#ccustio.obj: $(ICPP)\ccustio.c
# $(CC) $(CFLAGS) /I$(ICPP) /Foccustio.obj /DDOS /DFOXPRO $(ICPP)/ccustio.c
#cfiles.obj: $(ICPP)\cfiles.c
# $(CC) $(CFLAGS) /I$(ICPP) /Focfiles.obj /DDOS /DFOXPRO $(ICPP)/cfiles.c
#codeb.obj: $(ICPP)\codeb.c
# $(CC) $(CFLAGS) /I$(ICPP) /Focodeb.obj /DDOS /DFOXPRO $(ICPP)/codeb.c
#csort.obj: $(ICPP)\csort.c
# $(CC) $(CFLAGS) /I$(ICPP) /Focsort.obj /DDOS /DFOXPRO $(ICPP)/csort.c
#getaut.obj: $(ICPP)\getaut.c
# $(CC) $(CFLAGS) /I$(ICPP) /Fogetaut.obj /DDOS /DFOXPRO $(ICPP)/getaut.c
#hlprot.obj: $(ICPP)\hlprot.c
# $(CC) $(CFLAGS) /I$(ICPP) /Fohlprot.obj /DDOS /DFOXPRO $(ICPP)/hlprot.c
#ioresult.obj: $(ICPP)\ioresult.c
# $(CC) $(CFLAGS) /I$(ICPP) /Foioresult.obj /DDOS /DFOXPRO $(ICPP)/ioresult.c
#upstring.obj: $(ICPP)\upstring.c
# $(CC) $(CFLAGS) /I$(ICPP) /Foupstring.obj /DDOS /DFOXPRO $(ICPP)/upstring.c
#tmpfname.obj: $(ICPP)\tmpfname.c
# $(CC) $(CFLAGS) /I$(ICPP) /Fotmpfname.obj /DDOS /DFOXPRO $(ICPP)/tmpfname.c
#agafll.obj: aga.c
# $(CC) $(CFLAGS) /I$(ICPP) /Foagafll.obj /DFOXPRO aga.c
#array.obj: $(ICPP)/array.cpp
# $(CC) $(CFLAGS) /I$(ICPP) /Foarray.obj /DFOXPRO $(ICPP)/array.cpp
#checks.obj: $(ICPP)/checks.cpp
# $(CC) $(CFLAGS) /I$(ICPP) /Fochecks.obj /DFOXPRO $(ICPP)/checks.cpp
#files.obj: $(ICPP)/files.cpp
# $(CC) $(CFLAGS) /I$(ICPP) /Fofiles.obj /DFOXPRO $(ICPP)/files.cpp
#date.obj: $(ICPP)/date.cpp
# $(CC) $(CFLAGS) /I$(ICPP) /Fodate.obj /DFOXPRO $(ICPP)/date.cpp
#isam.obj: $(ICPP)/isam.cpp
# $(CC) $(CFLAGS) /I$(ICPP) /Foisam.obj /DFOXPRO $(ICPP)/isam.cpp
#object.obj: $(ICPP)/object.cpp
# $(CC) $(CFLAGS) /I$(ICPP) /Foobject.obj /DFOXPRO $(ICPP)/object.cpp
#prefix.obj: $(ICPP)/prefix.cpp
# $(CC) $(CFLAGS) /I$(ICPP) /Foprefix.obj /DFOXPRO $(ICPP)/prefix.cpp
#scanner.obj: $(ICPP)/scanner.cpp
# $(CC) $(CFLAGS) /I$(ICPP) /Foscanner.obj /DFOXPRO $(ICPP)/scanner.cpp
#stdtypes.obj: stdtypes.cpp
# $(CC) $(CFLAGS) /I$(ICPP) /Fostdtypes.obj /DFOXPRO stdtypes.cpp
#strings.obj: $(ICPP)/strings.cpp
# $(CC) $(CFLAGS) /I$(ICPP) /Fostrings.obj /DFOXPRO $(ICPP)/strings.cpp
#utility.obj: $(ICPP)/utility.cpp
# $(CC) $(CFLAGS) /I$(ICPP) /Foutility.obj /DFOXPRO $(ICPP)/utility.cpp
#XOBJS=\
# ccustio.obj cfiles.obj codeb.obj csort.obj getaut.obj hlprot.obj \
# ioresult.obj upstring.obj tmpfname.obj \
# array.obj checks.obj files.obj date.obj isam.obj object.obj \
# prefix.obj scanner.obj stdtypes.obj strings.obj utility.obj
#$(SUPP)aga.fll: agafll.obj $(XOBJS)
# $(LINKER) $(LFLAGS) @agafll.lrf
agalight.obj: aga.cpp
$(CC) $(CFLAGS) /Foagalight.obj /DLIGHT aga.cpp
agaexec.obj: aga.cpp
$(CC) $(CFLAGS) /I$(ICPP) /Foagaexec.obj /DLIGHT /DDLL aga.cpp
aga16.obj: aga16.c
$(CC) $(CFLAGS) /Foaga16.obj aga16.c
$(SUPP)/agalight.fll: agalight.obj
$(LINKER) $(LFLAGS) @agalight.lrf
$(SUPP)/agaexec.dll: agaexec.obj
$(LINKER) $(LFLAGS) @agaexec.lrf
$(SUPP)/aga16.dll: aga16.obj
$(LINKER) $(LFLAGS) @aga16.lrf

View File

@ -0,0 +1,125 @@
#define __STDTYPES_CPP
#include <stdtypes.h>
#include <extcdecl.h>
#include <isam.h>
#include <prefix.h>
#include <utility.h>
#include <codeb.h>
short CHARY,CHARX;
void init_global_vars()
{
prefix_init();
CGetPref();
prefix().set("");
FileDes d;
CGetFile(LF_DIR, &d, _nolock, NORDIR);
long maxfdir = d.EOX;
prefix().set("DEF");
CGetFile(LF_DIR, &d, _nolock, NORDIR);
if (d.EOD > maxfdir) maxfdir = d.EOD;
openf = new isfdptr[maxfdir];
openrec = new TRectype*[maxfdir];
for (long i = 0; i < maxfdir; i++)
{
openf[i] = NULL;
openrec[i] = NULL;
}
DB_init();
}
void free_global_vars()
{
delete openrec;
delete openf;
prefix_destroy();
DB_exit();
}
#include <pro_ext.h>
void* operator new(size_t size)
{
MHANDLE hnd = _AllocHand(size+2);
if (hnd == 0) fatal_box("Out of memory handles");
_HLock(hnd);
MHANDLE * phnd = (MHANDLE *) _HandToPtr(hnd);
*phnd = hnd;
return (void*) (phnd+1);
}
void operator delete(void* ptr)
{
if (ptr == NULL) fatal_box("Can't delete NULL handle");
MHANDLE * phnd = ((MHANDLE *) ptr) - 1;
_HUnLock(*phnd);
_FreeHand(*phnd);
}
static bool get_fox(const char* var, char* val)
{
*val = '\0';
const NTI nti = _NameTableIndex((char*)var);
if (nti >= 0)
{
Locator loc;
if (_FindVar(nti, -1, &loc)) // Find memory variable
{
Value value;
_Load(&loc, &value);
if (value.ev_type == 'C')
{
const char* p = (const char*)_HandToPtr(value.ev_handle);
if (*p > ' ')
strcpy(val, p);
}
}
}
return *val != '\0';
}
static char _tmp[256];
char* prefname()
{
if (!get_fox("PREFPATH", _tmp))
strcpy(_tmp, "prefix.txt");
return _tmp;
}
const char* username()
{
if (!get_fox("USER", _tmp))
strcpy(_tmp, "PRASSI");
return _tmp;
}
const char* tempdir()
{
char user[16];
strncpy(user, username(), 16);
if (!get_fox("TEMPDIR", _tmp))
strcpy(_tmp, "\\tmp");
if (!fexist(_tmp))
make_dir(_tmp);
strcat(_tmp, "\\"); strcat(_tmp, user);
if (!fexist(_tmp))
make_dir(_tmp);
return _tmp;
}

View File

@ -0,0 +1,68 @@
/***
*w32sut.h -
*
* Copyright (c) 1987-1992, Microsoft Corporation. All rights reserved.
*
*Purpose:
* This file declares the constants, structures, and functions
* used for accessing and using the Universal Thunk mechanism.
*
* This file should be compiled either with constants W32SUT_16 or
* W32SUT_32 defined.
*
****/
/* Check that one of the 2 constants is defined */
#ifdef W32SUT_16
#ifdef W32SUT_32
#error W32SUT_16 and W32SUT_32 cannot be defined simultaneously
#endif
#endif
#ifndef W32SUT_16
#ifndef W32SUT_32
#error Either W32SUT_16 or W32SUT_32 should be defined
#endif
#endif
/**** Prototypes for 32 bit DLL ***********/
#ifdef W32SUT_32
typedef DWORD ( WINAPI * UT32PROC)( LPVOID lpBuff,
DWORD dwUserDefined,
LPVOID *lpTranslationList
);
BOOL WINAPI UTRegister( HANDLE hModule,
LPCSTR lpsz16BitDLL,
LPCSTR lpszInitName,
LPCSTR lpszProcName,
UT32PROC * ppfn32Thunk,
FARPROC pfnUT32Callback,
LPVOID lpBuff
);
VOID WINAPI UTUnRegister(HANDLE hModule);
#endif
/**** Prototypes for 16 bit DLL ***********/
#ifdef W32SUT_16
typedef DWORD (FAR PASCAL * UT16CBPROC)( LPVOID lpBuff,
DWORD dwUserDefined,
LPVOID FAR *lpTranslationList
);
LPVOID WINAPI UTLinearToSelectorOffset(LPBYTE lpByte);
LPVOID WINAPI UTSelectorOffsetToLinear(LPBYTE lpByte);
#endif

Binary file not shown.

Binary file not shown.

301
support/interni/src/dumb/dumb.c Executable file
View File

@ -0,0 +1,301 @@
#ifdef DUMBFLL
#include "../foxlck/pro_ext.h"
#else
#include <windows.h>
/* Visual Basic interface with OLE 2 */
#ifdef DUMBDLLVB
#include <compobj.h>
#include <dispatch.h>
#include <variant.h>
#include <olenls.h>
#endif
#endif
#include <stdio.h>
#ifdef _MSC_VER
#define _BreakPoint() __asm \
{ \
int 3h \
}
#endif
#include "hlapi_c.h"
#define MODULE 26952
#define REFKEY "CAMPOKEY"
#define VERKEY "ìpÙˆ¬cê<"
unsigned int getser();
int CGetAut(int);
#ifdef DUMBFLL
int FAR Fox_HL_LOGIN()
#else
int far pascal _export hl_login()
#endif
{
int status;
#ifdef DBG
_BreakPoint();
#endif
status = HL_LOGIN(MODULE, DONT_CARE, REFKEY, VERKEY);
getser();
#ifdef DUMBFLL
_RetInt(status,10);
#endif
return status;
}
#ifdef DUMBFLL
int FAR Fox_HL_LOGOUT()
#else
int far pascal _export hl_logout()
#endif
{
HL_LOGOUT();
return 0;
}
#ifdef DUMBFLL
static void load_string(char * str_to_load, ParamBlk far * param)
{
Value val;
Locator loc;
int i;
loc = param->p[0].loc;
loc.l_subs = _ALen(param->p[0].loc.l_NTI, AL_ELEMENTS);
for (i = 0; i < 16; i++)
{
loc.l_sub1 = i+1;
_Load(&loc,&val);
if (val.ev_type == 'N')
str_to_load[i] = (char) (long)val.ev_real;
}
str_to_load[16] = '\0';
}
static void store_string(char * str_to_store, ParamBlk far * param)
{
Value val;
Locator loc;
int i;
loc = param->p[0].loc;
loc.l_subs = _ALen(param->p[0].loc.l_NTI, AL_ELEMENTS);
for (i = 0; i < 16 ; i++)
{
loc.l_sub1 = i+1;
_Load(&loc,&val);
if (val.ev_type == 'N')
{
val.ev_long = (unsigned char)str_to_store[i];
val.ev_real = (double) val.ev_long;
_Store(&loc,&val);
}
}
}
#endif
#ifdef DUMBDLLVB
static void load_string(char * str_to_load, SAFEARRAY FAR** sa)
{
long lLb, lUlb,l;
int i;
unsigned char element;
if (*sa == NULL)
return ;
if ((*sa)->cDims != 1)
return ;
if (FAILED(SafeArrayGetLBound(*sa, 1, &lLb)) ||
FAILED(SafeArrayGetUBound(*sa, 1, &lUlb)))
return ;
for (l = lLb, i = 0; l <= lUlb && i < 18; l++, i++)
if (FAILED(SafeArrayGetElement(*sa, &l, &element)))
return;
else
str_to_load[i] = element;
}
static void store_string(char * str_to_store, SAFEARRAY FAR** sa)
{
long lLb, lUlb,l;
int i;
unsigned char element;
if (*sa == NULL)
return ;
if ((*sa)->cDims != 1)
return ;
if (FAILED(SafeArrayGetLBound(*sa, 1, &lLb)) ||
FAILED(SafeArrayGetUBound(*sa, 1, &lUlb)))
return ;
for (l = lLb, i = 0; l <= lUlb && i < 18; l++, i++)
if (FAILED(SafeArrayPutElement(*sa, &l, &str_to_store[i])))
return;
}
#endif
#ifdef DUMBFLL
int FAR Fox_HL_CODE(ParamBlk far *param)
#else
#ifdef DUMBDLLVB
int far pascal _export hl_code(SAFEARRAY FAR** sa)
#else
int far pascal _export hl_code(char * kk)
#endif
#endif
{
char data [18];
#ifdef DUMBFLL
load_string(data, param);
#else
#ifdef DUMBDLLVB
load_string(data, sa);
#else
strncpy(data,kk,18);
#endif
#endif
HL_CODE(EYECAST data,2);
#ifdef DUMBFLL
store_string(data, param);
#else
#ifdef DUMBDLLVB
store_string(data, sa);
#else
strncpy(kk,data,18);
#endif
#endif
}
#ifdef DUMBFLL
int FAR Fox_GETSER()
#else
int far pascal _export hl_getser()
#endif
{
int r;
r = getser();
#ifdef DUMBFLL
_RetInt(r, 10);
#endif
return r;
}
#ifdef DUMBFLL
int FAR Fox_GETSTR(ParamBlk FAR *parm)
#else
#ifdef DUMBDLLVB
int far pascal _export hl_getstr(SAFEARRAY FAR ** sa)
#else
int far pascal _export hl_getstr(char * kk)
#endif
#endif
{
char chiave[18];
char tmp_str[18];
char chiave_segreta[8];
int i;
int j;
int module;
int ok ;
#ifdef DUMBFLL
load_string(chiave, parm);
#else
#ifdef DUMBDLLVB
load_string(chiave, sa);
#else
strncpy(chiave,kk,18);
#endif
#endif
HL_CODE(EYECAST chiave, 2);
strcpy(chiave_segreta,"P39S41");
module = 0;
ok = 0;
for (i = 0; i<9;i++)
if (i>5)
chiave[i] = chiave[i] - chiave[i-6];
else
chiave[i] = chiave[i] - chiave_segreta[i];
strncpy(tmp_str,chiave+6,3);
tmp_str[3] = '\0';
module = atoi(tmp_str);
ok = CGetAut(module);
strcpy(tmp_str,chiave);
for (i = 0, j=5;i<6; i++, j--)
chiave[i] = tmp_str[j];
chiave[6] = '0';chiave[7] = '0';
chiave[8] = ok ? '1': '0';
for (i=8;i>=0;i--)
if (i>5)
chiave[i] = chiave[i] + chiave[i-6];
else
chiave[i] = chiave[i] + chiave_segreta[i];
for (i=9;i<16;i++) chiave[i] = ' ';
chiave[16] = '\0';
HL_CODE(EYECAST chiave,2);
#ifdef DUMBFLL
store_string(chiave, parm);
#else
#ifdef DUMBDLLVB
store_string(chiave, sa);
#else
strncpy(kk,chiave,18);
#endif
#endif
return 0;
}
#ifdef DUMBFLL
FoxInfo DumbFoxInfo[] =
{
{ "HL_LOGIN", (FPFI)Fox_HL_LOGIN, CALLONLOAD, "" },
{ "HL_LOGOUT", (FPFI)Fox_HL_LOGOUT, CALLONUNLOAD, "" },
{ "HL_CODE", (FPFI)Fox_HL_CODE, 1, "R" },
{ "HL_GETSER", (FPFI)Fox_GETSER, 0, "" },
{ "HL_GETSTR", (FPFI)Fox_GETSTR, 1, "R" }
};
FoxTable _FoxTable =
{
(FoxTable FAR *)0,
sizeof(DumbFoxInfo)/sizeof(FoxInfo),
DumbFoxInfo
};
#else
int CALLBACK LibMain (HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine)
{
int rt = hl_login();
return rt == STATUS_OK;
}
int CALLBACK WEP (int nExitType)
{
if (nExitType == WEP_FREE_DLL)
hl_logout();
return 1;
}
#endif

View File

@ -0,0 +1,16 @@
LIBRARY DUMBDLL
DESCRIPTION 'DUMB DLL'
EXETYPE WINDOWS
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD FIXED SINGLE
HEAPSIZE 4096
EXPORTS
HL_LOGIN @1
HL_LOGOUT @2
HL_CODE @3
HL_GETSER @4
HL_GETSTR @5

View File

@ -0,0 +1,8 @@
dumbdll+getaut
..\..\dumb.dll
nul
libw+
/NOD:llibce ldllcew+
hlapi_cd
dumbdll.def

View File

@ -0,0 +1,6 @@
LIBRARY DUMBFLL
EXETYPE WINDOWS 3.0
CODE PRELOAD MOVABLE SHARED
DATA SHARED PRELOAD

View File

@ -0,0 +1,9 @@
dumbfll+getaut+..\foxlck\libentry
..\..\dumb.fll
nul
..\foxlck\proapiml+
libw+
/NOD:llibce ldllcew+
hlapi_cd
dumbfll.def

View File

@ -0,0 +1,16 @@
LIBRARY DUMBVB
DESCRIPTION 'DUMBVB DLL'
EXETYPE WINDOWS
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD FIXED SINGLE
HEAPSIZE 4096
EXPORTS
HL_LOGIN @1
HL_LOGOUT @2
HL_CODE @3
HL_GETSER @4
HL_GETSTR @5

View File

@ -0,0 +1,8 @@
dumbvb+getaut
..\..\dumbvb.dll
nul
libw+
/NOD:llibce ldllcew+
ole2disp+hlapi_cd
dumbvb.def

View File

@ -0,0 +1,96 @@
Attribute VB_Name = "Modulo1"
Private Declare Function hl_getstr Lib "dumbvb.dll" (ByRef b() As Byte) As Integer
Private Declare Function hl_code Lib "dumbvb.dll" (ByRef b() As Byte) As Integer
Function GetAut(Modulo As Integer) As Boolean
Dim risultato(18) As Byte
Dim tmp_res(18) As Byte
Dim chiave(18) As Byte
Dim terzo_carattere As Byte
Dim ultimo_carattere As Byte
Dim stringa_segreta As String
Dim stringa_tmp As String
stringa_segreta = "P39S41"
' Genera un numero casuale di 6 cifre...
' Questo e' solo un esempio, ma in realta
' Andrebbe generato un numero veramente casuale...
' La Randomize e' chiamata una sola volta al
' caricamento della form
stringa_tmp = Format(Modulo, "000")
For i = 0 To 14
If (i < 6) Then
chiave(i) = Asc(Mid(stringa_segreta, i + 1, 1)) ' I primi 6 chars sono la stringa segreta
ElseIf (i < 12) Then
chiave(i) = Int((10 * Rnd)) ' Questo e' il numero casuale generato
' chiave(i) = 9
Else
chiave(i) = Asc(Mid(stringa_tmp, i - 11, 1)) ' Questo e' il numero del modulo (zerofilled)
End If
Next i
' Codifica la stringa chiave tramite la stringa casuale
' Esegue la somma algebrica dei valori ASCII dei singoli caratteri
For i = 0 To 17
If i > 8 Then
risultato(i) = Asc(" ") ' I caratteri in eccesso diventano blanks
Else
risultato(i) = chiave(i) + chiave(i + 6)
End If
Next i
' Chiama la funzione hl_code(), che effettua una ulteriore crittografazione
copia_array tmp_res, risultato
hl_code risultato
If compara_array(risultato, tmp_res) Then
GetAut = False ' Se le stringhe sono uguali significa che la chiave non c'e' o che qualcuno sta
Exit Function ' cercando di sproteggere il programma
End If
' Ora passiamo la stringa criptata alla DLL per farci restituire l'autorizzazione
copia_array tmp_res, risultato
hl_getstr risultato
' Chiama la funzione hl_code(), che effettua la crittografazione al contrario
copia_array tmp_res, risultato
hl_code risultato
If compara_array(risultato, tmp_res) Then
GetAut = False ' Se le stringhe sono uguali significa che la chiave non c'e' o che qualcuno sta
Exit Function ' cercando di sproteggere il programma
End If
' Adesso possiamo estrarre l'autorizzazione
' Ricodifichiamo seguendo il procedimento inverso:
' Sottraiamo i valori ASCII dal risultato carattere per carattere
' In realta' l'autorizzazione e' codificata nel terzo carattere della stringa
terzo_carattere = risultato(2) - Asc(Mid(stringa_segreta, 3, 1))
ultimo_carattere = Chr(risultato(8) - terzo_carattere)
If ultimo_carattere = "1" Then
GetAut = True
Else
GetAut = False
End If
End Function
Public Function compara_array(b1() As Byte, b2() As Byte) As Boolean
' confronta gli elementi di b1 e b2 e ritorna True se gli elementi sono tutti
' uguali. Sono significativi solo i primi 16 bytes
compara_array = True
For i = 0 To 15
If b1(i) <> b2(i) Then
compara_array = False
Exit For
End If
Next i
End Function
Sub copia_array(b1() As Byte, b2() As Byte)
' copia gli elementi di b2 in b1
For i = 0 To 15
b1(i) = b2(i)
Next i
End Sub

View File

@ -0,0 +1,94 @@
VERSION 4.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "DUMB Test"
ClientHeight = 2040
ClientLeft = 1140
ClientTop = 1512
ClientWidth = 3708
Height = 2460
Left = 1092
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2040
ScaleWidth = 3708
Top = 1140
Width = 3804
Begin VB.CommandButton Command2
Caption = "Esci"
Height = 375
Left = 2160
TabIndex = 4
Top = 1440
Width = 1335
End
Begin VB.CheckBox Check1
Enabled = 0 'False
Height = 252
Left = 1920
TabIndex = 3
Top = 600
Width = 252
End
Begin VB.TextBox Text1
Height = 288
Left = 840
TabIndex = 1
Top = 600
Width = 372
End
Begin VB.CommandButton Command1
Caption = "Test"
Height = 375
Left = 120
TabIndex = 0
Top = 1440
Width = 1335
End
Begin VB.Label Label2
Caption = "Autorizzazione"
Height = 252
Left = 2280
TabIndex = 5
Top = 600
Width = 1092
End
Begin VB.Label Label1
Caption = "Modulo"
Height = 255
Left = 120
TabIndex = 2
Top = 600
Width = 615
End
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Private Sub Command1_Click()
' Prende il modulo inserito e chiama la funzione
' GetAut(), settando il checkbox se il modulo
' e' abilitato o meno
If (GetAut(Val(Text1.Text))) Then
Check1.Value = Checked
Else
Check1.Value = Unchecked
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
' Questo e' solo un esempio, ma in realta
' Andrebbe generato un numero veramente casuale...
Randomize Timer
End Sub

View File

@ -0,0 +1,22 @@
Form=DUMB.FRM
Module=Modulo1; DUMB.BAS
Object={F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.0#0; COMDLG16.OCX
Object={BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.0#0; TABCTL16.OCX
Object={FAEEE763-117E-101B-8933-08002B2F4F5A}#1.0#0; DBLIST16.OCX
Object={00028C01-0000-0000-0000-000000000046}#1.0#0; DBGRID16.OCX
Reference=*\G{BEF6E001-A874-101A-8BBA-00AA00300CAB}#1.0#0#C:\WINDOWS\SYSTEM\OC25.DLL#Standard OLE Types
Reference=*\G{00025E01-0000-0000-C000-000000000046}#2.5#0#C:\WINDOWS\SYSTEM\DAO2516.DLL#Microsoft DAO 2.5 Object Library
ProjWinSize=127,687,233,129
ProjWinShow=2
IconForm="Form1"
ExeName="DUMB.EXE"
Name="Proget1"
HelpContextID="0"
StartMode=0
VersionCompatible="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Aga Informatica"

View File

@ -0,0 +1,178 @@
=================================
4: Passaggio e restituzione di stringhe
=================================
Le stringhe a lunghezza variabile vengono mantenute all'interno di Visual Basic
come BSTR. Nei file di intestazione OLE, i BSTR vengono definiti come
OLECHAR FAR *. Un OLECHAR corrisponde ad un carattere UNICODE
nell'OLE a 32 bit e ad un carattere ANSI nell'OLE a 16 bit. Un BSTR può
contenere valori NULL, in quanto nel BSTR viene mantenuto, tra gli altri,
un'attributo che specifica la lunghezza della variabile. I BSTR contengono
un valore NULL come valore terminale e possono pertanto essere trattati
come LPSTR. L'attributo relativo alla lunghezza viene attualmente
memorizzato nella posizione che precede immediatamente la stringa.
Questa caratteristica, tuttavia, potrebbe essere modificata in futuro
in modo da consentire di accedere alla lunghezza della stringa
utilizzando le API OLE.
Il passaggio di una stringa da Visual Basic ad una DLL può essere
eseguito in due modi. È possibile passare la stringa "per valore"
(ByVal) o "per riferimento". Se si passa una stringa ByVal,
Visual Basic passa un puntatore che fa riferimento all'inizio dei dati
della stringa, ovvero passa un BSTR. Quando una stringa viene passata
per riferimento, Visual Basic passa un puntatore al puntatore
che fa riferimento ai dati della stringa, ovvero passa un BSTR *.
La seguente tabella indica quali attributi vengono passati da Visual Basic
ad una DLL durante il passaggio di una stringa.
Versione Per valore Per riferimento
------------------------------------
3.0 LPSTR HLSTR
4.0 BSTR BSTR *
In Visual Basic 3.0, era possibile utilizzare le routine API di Visual Basic
per accedere ad un HLSTR e modificarlo. In Visual Basic 4.0, è necessario
utilizzare le API OLE per accedere ad un BSTR. Nella seguente tabella
vengono riportate le API per la gestione delle stringhe in Visual Basic
3.0 e gli equilvalenti OLE.
API di Visual Basic API OLE
--------------------------------------------------------
VBCreateHlstr SysAllocString/SysAllocStringLen
VBCreateTempHlstr SysAllocString/SysAllocStringLen
VBDerefHlstr* N/A
VBDerefHlstrLen* N/A
VBDerefZeroTermHlstr N/A
VBDestroyHlstr SysFreeString
VBGetHlstrLen SysStringLen
VBResizeHlstr SysReAllocStringLen
VBSetHlstr SysReAllocString
NOTA: Il BTSR è un puntatore che fa riferimento alla stringa,
pertanto non è necessario eliminare i riferimenti contenuti in tale puntatore.
Esempio per le versioni a 16\32 bit
-----------------
La prima funzione considerata in questo esempio accetta una stringa
Visual Basic per riferimento e restituisce una copia a lettere maiuscole
di tale stringa. La seconda funzione accetta una stringa Visual Basic per
valore e restituisce, analogamente, una copia a lettere maiuscole di tale
stringa. Queste funzioni sono dunque simili alla funzione UCase di
Visual Basic. In entrambi i casi, la funzione della DLL modifica la stringa
passata, che viene quindi restituita a VB. Ciò accade inoltre quando la
stringa di VB viene passata "ByVal", in quanto alla funzione DLL viene
passato un BSTR che corrisponde ad un char far *. Sarà pertanto possibile
accedere direttamente al buffer della memoria a cui punta il BTSR.
#include <windows.h>
#include <ole2.h>
#ifdef _WIN32
#define CCONV _stdcall
#define NOMANGLE
#else
#define CCONV FAR PASCAL _export
#define NOMANGLE EXTERN_C
#include <stdlib.h>
#include <compobj.h>
#include <dispatch.h>
#include <variant.h>
#include <olenls.h>
#endif
NOMANGLE BSTR CCONV UpperCaseByRef(BSTR *pbstrOriginal)
{
BSTR bstrUpperCase;
int i;
int cbOriginalLen;
LPSTR strSrcByRef, strDst;
#if !defined(_WIN32)
cbOriginalLen = SysStringLen(*pbstrOriginal);
#else
cbOriginalLen = SysStringByteLen(*pbstrOriginal);
#endif
bstrUpperCase = SysAllocStringLen(NULL, cbOriginalLen);
strSrcByRef = (LPSTR)*pbstrOriginal;
strDst = (LPSTR)bstrUpperCase;
for(i=0; i<=cbOriginalLen; i++)
*strDst++ = toupper(*strSrcByRef++);
SysReAllocString (pbstrOriginal, (BSTR)"Arrivederci");
return bstrUpperCase;
}
NOMANGLE BSTR CCONV UpperCaseByVal(BSTR bstrOriginal)
{
BSTR bstrUpperCase;
int i;
int cbOriginalLen;
LPSTR strSrcByVal, strDst;
#if !defined(_WIN32)
cbOriginalLen = SysStringLen(bstrOriginal);
#else
cbOriginalLen = SysStringByteLen(bstrOriginal);
#endif
bstrUpperCase = SysAllocStringLen(NULL, cbOriginalLen);
strSrcByVal = (LPSTR)bstrOriginal;
strDst = (LPSTR)bstrUpperCase;
for(i=0; i<=cbOriginalLen; i++)
*strDst++ = toupper(*strSrcByVal++);
SysReAllocString (&bstrOriginal, (BSTR)"Arrivederci");
return bstrUpperCase;
}
Il seguente codice Visual Basic richiama le due funzioni UpperCase illustrate
in precedenza:
#If Win32 Then
Private Declare Function UpperCaseByRef Lib "vb4dll32.dll" (Str _
As String) As String
Private Declare Function UpperCaseByVal Lib "vb4dll32.dll" _
(ByVal Str As String) As String
#Else
Private Declare Function UpperCaseByRef Lib "vb4dll16.dll" (Str _
As String) As String
Private Declare Function UpperCaseByVal Lib "vb4dll16.dll" _
(ByVal Str As String) As String
#End If
Private Sub StringTest ()
Dim Str As String, NewStr As String
Str = "Salve gente!"
MsgBox "In VB, Prima: " & Str
NewStr = UpperCaseByRef(Str)
MsgBox "In VB, Dopo: " & Str
MsgBox "In VB, StrMaiuscola: " & NewStr
Str = "Salve gente!"
MsgBox "In VB, Prima: " & Str
NewStr = UpperCaseByVal(Str)
MsgBox "In VB, Dopo: " & Str
MsgBox "In VB, StrMaiuscola: " & NewStr
End Sub

View File

@ -0,0 +1,83 @@
* programma principale
* includere dumb.fll all'inizio del programma
* per effettuare automaticamente le operazioni
* di HL_LOGIN sulla chiave
SET LIBR TO DUMB.FLL
? HL_GETAUT(41)
? HL_GETAUT(42)
? HL_GETAUT(45)
? HL_GETAUT(5)
? HL_GETAUT(11)
? HL_GETAUT(18)
? HL_GETAUT(21)
************ Funzione HL_GETAUT
************ prende in input il numero del modulo
************ di cui si vuole sapere l'abilitazione
************ restituisce:
************ 0 se non abilitato
************ 1 se abilitato
FUNCTION HL_GETAUT
PARAMETER MODULO
DIMENSION RISULTATO(18)
DIMENSION TMP_RES(18)
OLD_DECIMALS = INT(VAL(SYS(2001,'DECIMALS')))
SET DECIMALS TO 6
STORE 0 TO ABILITAZIONE
STORE "P39S41" TO STRINGA_SEGRETA
** Cripta la chiave di ricerca casualmente
CASUALE = STR(INT(RAND(-1) * 1000000),6,0)
CASUALE = CASUALE + TRANSFORM(MODULO,"@L 999")
CHIAVE = STRINGA_SEGRETA + LEFT(CASUALE,3)
FOR I = 1 TO 16
IF I > 9 THEN
RISULTATO (I) = 32 && PAD a 16 bytes
ELSE
RISULTATO(I) = ASC(SUBSTR(CHIAVE,I,1)) + ASC(SUBSTR(CASUALE,I,1))
ENDIF
ENDFOR
** Controlla che la chiave codificata non sia uguale
=ACOPY(RISULTATO,TMP_RES)
=HL_CODE(@RISULTATO)
STORE .T. TO UGUALI
FOR I = 1 TO 16
IF RISULTATO(I) <> TMP_RES(I) THEN
UGUALI = .F.
ENDIF
ENDFOR
IF UGUALI THEN
SET DECIMALS TO OLD_DECIMALS
RETURN 0
ENDIF
** Passa alla FLL la stringa da analizzare
=HL_GETSTR(@RISULTATO)
** Ora analizza la stringa ritornata, prima la ricodifica
=ACOPY(RISULTATO,TMP_RES)
=HL_CODE(@RISULTATO)
STORE .T. TO UGUALI
FOR I = 1 TO 16
IF RISULTATO(I) <> TMP_RES(I) THEN
UGUALI = .F.
ENDIF
ENDFOR
IF UGUALI THEN
SET DECIMALS TO OLD_DECIMALS
RETURN 0
ENDIF
** Infine estrae... l'autorizzazione
TERZO_CARATTERE = CHR(RISULTATO(3) - ASC(SUBSTR(STRINGA_SEGRETA,3,1)))
ULTIMO_CARATTERE = CHR(RISULTATO(9) - ASC(TERZO_CARATTERE))
ABILITAZIONE = INT(VAL(ULTIMO_CARATTERE))
SET DECIMALS TO OLD_DECIMALS
RETURN ABILITAZIONE

View File

@ -0,0 +1,89 @@
#include <windows.h>
#include <time.h>
/*
Funzione HL_GETAUT
prende in input il numero del modulo
di cui si vuole sapere l'abilitazione
restituisce:
0 se non abilitato
1 se abilitato
*/
int hl_getaut(int modulo)
{
char risultato[18];
char tmp_res[18]
char stringa_segreta[18]
char casuale[36]
char chiave[18]
int abilitazione = 0,i;
strcpy(stringa_segreta,"P39S41");
/* Generare un numero casuale di 6 cifre... */
srand( (unsigned)time( NULL ) );
sprintf(casuale,"%d%d%d%d%d%d", rand(),rand(),rand(),rand(),rand(),rand() );
casuale[6] = '\0'; /* Tronca a 6 la stringa casuale */
/* Gli ultimi 3 caratteri della stringa sara' il modulo zerofilled (ex: 21 -> 021, 7 -> 007 ecc */
sprintf(casuale,"%s%03d",casuale,modulo);
/* Compone la chiave: stringa_segreta + i primi 3 caratteri della stringa casuale */
strcpy(chiave,stringa_segreta);
strcat(chiave,casuale);
chiave[9] = '\0';
/* Codifica la stringa chiave tramite la stringa casuale */
/* Esegue la somma algebrica dei valori ASCII dei singoli caratteri */
for (i=0; i < 16; i++)
{
if (i>8)
risultato[i] = ' '; /* I caratteri in eccesso diventano blanks */
else
risultato[i] = chiave[i] + casuale[i];
}
/* Chiama la funzione hl_code(), che effettua una ulteriore crittografazione */
strcpy(tmp_res,risultato);
hl_code(risultato);
if (strcmp(risultato,tmp_res) == 0)
return 0; /* Se le stringhe sono uguali significa che la chiave non c'e' o che qualcuno sta
cercando di sproteggere il programma */
/* Ora passiamo la stringa criptata alla DLL per farci restituire l'autorizzazione */
hl_getstr(risultato);
/* Chiama la funzione hl_code(), che effettua la crittografazione al contrario */
strcpy(tmp_res,risultato);
hl_code(risultato);
if (strcmp(risultato,tmp_res) == 0)
return 0; /* Se le stringhe sono uguali significa che la chiave non c'e' o che qualcuno sta
cercando di sproteggere il programma */
/* Adesso possiamo estrarre l'autorizzazione */
/* Ricodifichiamo seguendo il procedimento inverso: */
/* Sottraiamo i valori ASCII dal risultato carattere per carattere */
terzo_carattere = risultato[2] - stringa_segreta[2];
ultimo_carattere = risultato[8] - terzo_carattere;
abilitazione = ultimo_carattere;
return abilitazione;
}
int PASCAL WinMain(HINSTANCE cur, HINSTANCE prev, LPSTR cmd, int i)
{
char m[128];
/* Visualizza l'autorizzazione per il Modulo 21 */
wsprintf(m,"Module %d: %d",21,hl_getaut(21));
MessageBox(NULL,m,"API",MB_OK);
/* Visualizza l'autorizzazione per il Modulo 33 */
wsprintf(m,"Module %d: %d",33,hl_getaut(33));
MessageBox(NULL,m,"API",MB_OK);
/* Visualizza l'autorizzazione per il Modulo 7 */
wsprintf(m,"Module %d: %d",7,hl_getaut(7));
MessageBox(NULL,m,"API",MB_OK);
return (1);
}

View File

@ -0,0 +1,83 @@
* programma principale
* includere dumb.fll all'inizio del programma
* per effettuare automaticamente le operazioni
* di HL_LOGIN sulla chiave
SET LIBR TO DUMB.FLL
? HL_GETAUT(41)
? HL_GETAUT(42)
? HL_GETAUT(45)
? HL_GETAUT(5)
? HL_GETAUT(11)
? HL_GETAUT(18)
? HL_GETAUT(21)
************ Funzione HL_GETAUT
************ prende in input il numero del modulo
************ di cui si vuole sapere l'abilitazione
************ restituisce:
************ 0 se non abilitato
************ 1 se abilitato
FUNCTION HL_GETAUT
PARAMETER MODULO
DIMENSION RISULTATO(18)
DIMENSION TMP_RES(18)
OLD_DECIMALS = INT(VAL(SYS(2001,'DECIMALS')))
SET DECIMALS TO 6
STORE 0 TO ABILITAZIONE
STORE "P39S41" TO STRINGA_SEGRETA
** Cripta la chiave di ricerca casualmente
CASUALE = STR(INT(RAND(-1) * 1000000),6,0)
CASUALE = CASUALE + TRANSFORM(MODULO,"@L 999")
CHIAVE = STRINGA_SEGRETA + LEFT(CASUALE,3)
FOR I = 1 TO 16
IF I > 9 THEN
RISULTATO (I) = 32 && PAD a 16 bytes
ELSE
RISULTATO(I) = ASC(SUBSTR(CHIAVE,I,1)) + ASC(SUBSTR(CASUALE,I,1))
ENDIF
ENDFOR
** Controlla che la chiave codificata non sia uguale
=ACOPY(RISULTATO,TMP_RES)
=HL_CODE(@RISULTATO)
STORE .T. TO UGUALI
FOR I = 1 TO 16
IF RISULTATO(I) <> TMP_RES(I) THEN
UGUALI = .F.
ENDIF
ENDFOR
IF UGUALI THEN
SET DECIMALS TO OLD_DECIMALS
RETURN 0
ENDIF
** Passa alla FLL la stringa da analizzare
=HL_GETSTR(@RISULTATO)
** Ora analizza la stringa ritornata, prima la ricodifica
=ACOPY(RISULTATO,TMP_RES)
=HL_CODE(@RISULTATO)
STORE .T. TO UGUALI
FOR I = 1 TO 16
IF RISULTATO(I) <> TMP_RES(I) THEN
UGUALI = .F.
ENDIF
ENDFOR
IF UGUALI THEN
SET DECIMALS TO OLD_DECIMALS
RETURN 0
ENDIF
** Infine estrae... l'autorizzazione
TERZO_CARATTERE = CHR(RISULTATO(3) - ASC(SUBSTR(STRINGA_SEGRETA,3,1)))
ULTIMO_CARATTERE = CHR(RISULTATO(9) - ASC(TERZO_CARATTERE))
ABILITAZIONE = INT(VAL(ULTIMO_CARATTERE))
SET DECIMALS TO OLD_DECIMALS
RETURN ABILITAZIONE

View File

@ -0,0 +1,64 @@
#include "hlapi_c.h"
#define BOOLEAN int
#define FALSE 0
#define TRUE 1
#define HLBLOCK 1
#define CBITTEST(w,p) (((w) & (0x0001 << (p))) != 0)
Word _int_tab0[4] = {0xFFFF, 0xFFFF, 0xFFFF, 0x0000};
Word SerNo = -1;
/*
Restituisce il numero di serie della chiave
*/
Word getser()
{
Word Val[4];
BOOLEAN ok;
int i;
SerNo = -1;
if (HL_AVAIL() == STATUS_OK)
{
SerNo = 0;
HL_READ(0, &Val[0]);
HL_READ(1, &Val[1]);
HL_READ(2, &Val[2]);
HL_READ(3, &Val[3]);
HL_CODE(EYECAST &Val[0], HLBLOCK);
if (Val[0] == 0xFAE8)
{
SerNo = Val[1];
return(Val[1]);
}
}
return (0);
}
/*
Restituisce l'autorizzazione ad utilizzare un modulo
*/
BOOLEAN CGetAut(af)
int af; /* numero del modulo */
{
int i;
BOOLEAN ok;
if (!af) return(!af);
if (af > 48) return(FALSE);
if (!SerNo) return(!getser());
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);
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));
}

View File

@ -0,0 +1,16 @@
LIBRARY HARDDLL
DESCRIPTION 'Hardlock DLL'
EXETYPE WINDOWS
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD FIXED SINGLE
HEAPSIZE 4096
EXPORTS
H_LOGIN @1
H_LOGOUT @2
H_GETAUT @3
H_GETSER @4

View File

@ -0,0 +1,8 @@
harddll+getaut
..\..\hardlock.dll
nul
libw+
/NOD:llibce ldllcew+
hlapi_cd
harddll.def

View File

@ -0,0 +1,6 @@
LIBRARY HARDFLL
EXETYPE WINDOWS 3.0
CODE PRELOAD MOVABLE SHARED
DATA SHARED PRELOAD

View File

@ -0,0 +1,9 @@
hardfll+getaut+..\foxlck\libentry
..\..\hardlock.fll
nul
..\foxlck\proapiml+
libw+
/NOD:llibce ldllcew+
hlapi_cd
hardfll.def

View File

@ -0,0 +1,137 @@
#ifdef FLL
#include "../foxlck/pro_ext.h"
#else
#include <windows.h>
#ifdef _MSC_VER
#define _BreakPoint() __asm \
{ \
int 3h \
}
#endif
#endif
#include "hlapi_c.h"
#define MODULE 26952
#define REFKEY "CAMPOKEY"
#define VERKEY "ìpÙˆ¬cê<"
unsigned int getser();
int CGetAut(int);
#ifdef FLL
int FAR Fox_HL_LOGIN()
{
#ifdef DBG
_BreakPoint();
#endif
/* Questa riga e' solo temporanea! 11.3.1996, per ovviare a problemi sul alcuni PC */
/* con la parallela non compatibile */
HL_LOGIN(MODULE, DONT_CARE, REFKEY, VERKEY);
getser();
return 1;
}
int FAR Fox_HL_LOGOUT()
{
/* Questa riga e' solo temporanea! 11.3.1996, per ovviare a problemi sul alcuni PC */
/* con la parallela non compatibile */
HL_LOGOUT();
return 1;
}
long getlong(ParamBlk FAR *parm, int pos)
{
long val = 0;
if (pos < parm->pCount && parm->p[pos].val.ev_type == 'I')
val = parm->p[pos].val.ev_long;
return val;
}
int FAR Fox_getser()
{
int r;
/* Questa riga e' solo temporanea! 11.3.1996, per ovviare a problemi sul alcuni PC */
/* con la parallela non compatibile */
/*r = 1;*/
r = getser();
_RetInt(r, 10);
return r;
}
int FAR Fox_CGetAut(ParamBlk FAR *parm)
{
int module = getlong(parm, 0);
int ok;
/* Questa riga e' solo temporanea! 11.3.1996, per ovviare a problemi sul alcuni PC */
/* con la parallela non compatibile */
/*if (module == 21 || module == 22) ok = 1;*/
ok = CGetAut(module);
_RetLogical(ok);
return ok;
}
FoxInfo hardlockFoxInfo[] =
{
{ "HL_LOGIN", (FPFI)Fox_HL_LOGIN, CALLONLOAD, "" },
{ "HL_LOGOUT", (FPFI)Fox_HL_LOGOUT, CALLONUNLOAD, "" },
{ "HL_GETSER", (FPFI)Fox_getser, 0, "" },
{ "HL_GETAUT", (FPFI)Fox_CGetAut, 1, "I" }
};
FoxTable _FoxTable =
{
(FoxTable FAR *)0,
sizeof(hardlockFoxInfo)/sizeof(FoxInfo),
hardlockFoxInfo
};
#else
int far pascal _export h_login()
{
#ifdef DBG
_BreakPoint();
#endif
return HL_LOGIN(MODULE, DONT_CARE, REFKEY, VERKEY);
}
int far pascal _export h_logout()
{
HL_LOGOUT();
return 0;
}
int far pascal _export h_getser()
{
int a ;
a = getser();
return a;
}
int far pascal _export h_getaut(int module)
{
int ok = CGetAut(module);
return ok;
}
int CALLBACK LibMain (HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine)
{
int rt = h_login();
return rt == STATUS_OK;
}
int CALLBACK WEP (int nExitType)
{
if (nExitType == WEP_FREE_DLL)
h_logout();
return 1;
}
#endif

View File

@ -0,0 +1,172 @@
#ifndef __HLAPI_H
#define __HLAPI_H
/****************************************************************************/
/** **/
/** Hardlock E-Y-E **/
/** API-Structures and definitions **/
/** **/
/** This file contains some helpful defines to access a Hardlock using **/
/** the application programing interface (API) for Hardlock E-Y-E. **/
/** **/
/** (c) 1992 by ///FAST Electronic **/
/** **/
/** **/
/** Authors : Thomas Schr”ter **/
/** Henri Volk **/
/** Version : 3.0 **/
/** Date : 01-Sep-1992 **/
/** **/
/****************************************************************************/
#define EYECAST (char huge *)
/* -------------------------------- */
/* Definitions and API structures : */
/* -------------------------------- */
typedef unsigned char Byte;
typedef signed short Word;
typedef unsigned long Long;
typedef struct
{
Word Use_Key;
Byte Key[8];
}
DES_MODE;
typedef struct
{
Word ModAd; /* Moduleaddress EYE */
Word Register; /* Memory register adress */
Word Value; /* Memory value */
Byte Reserved[4];
}
EYE_MODE;
typedef union
{
DES_MODE Des;
EYE_MODE Eye;
}
HARDWARE;
typedef struct hl_api
{
Byte API_Version_ID[2]; /* Version */
Word API_Options[2]; /* API Optionflags */
Word ModID; /* Modul-ID (EYE = 0...) */
HARDWARE Module; /* Hardware type */
void far *Data; /* Pointer to cipher data */
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 (HLSERVER) */
Byte ID_Ref[8]; /* Referencestring */
Byte ID_Verify[8]; /* Encrypted ID_Ref */
Long Task_ID; /* Multitasking program ID */
Byte Reserved[200]; /* Reserved area */
}
HL_API;
/* ------------- */
/* Module-ID's : */
/* ------------- */
#define EYE_DONGLE 0 /* Hardlock E-Y-E */
#define DES_DONGLE 1 /* FAST DES */
/* --------------------- */
/* 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 */
/* --------------------------- */
/* 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_GET_ID_KEY 30 /* Encrypt ID_Ref to ID_Verify */
#define API_ABORT 53 /* Critical Error Abort */
/* -------------------- */
/* 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 */
/* ------------------ */
/* 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 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 */
#ifdef __cplusplus
extern "C" {
#endif
/* --------------------- */
/* Function prototypes : */
/* --------------------- */
static int CALL_API (HL_API far *as);
Word far HL_LOGIN (Word ModAd, Word Access, char * RefKey, char * VerKey);
Word far HL_LOGOUT (void);
Word far HL_AVAIL (void);
Word far HL_PORTINF (void);
Word far HL_ACCINF (void);
Word far HL_USERINF (void);
Word far HL_MAXUSER (void);
Word far HL_MEMINF (void);
Word far HL_CODE (void far *Data, Word Count);
Word far HL_WRITE (Word Register, Word Value);
Word far HL_READ (Word Register, int far *Value);
char far * HL_GET_ID (char * id_ref);
Word far HL_READBL (char * Eeprom);
Word far HL_WRITEBL (char * Eeprom);
Word far HL_ABORT (void);
Word far HL_VERSION (void);
/****************************************************************************/
/****************************************************************************/
/* The following functions map the old Hardlock Calls on the new API. These */
/* functions are defined only for compatibility reasons. */
/* !!! Don't mix old and new functions. Don't use if it is not necessary.!!!*/
/****************************************************************************/
/****************************************************************************/
void far HL_ON (int Port, Word ModAd);
void far HL_OFF (int Port);
int far K_EYE (int Port, char huge *Inp, int BlkCnt);
void far HL_WR (int Port, int Register, Word Val);
Word far HL_RD (int Port, int Register);
void far INT_ON (void);
void far INT_OFF (void);
#ifdef __cplusplus
}
#endif
#endif

Binary file not shown.

View File

@ -0,0 +1,82 @@
#
# Comand per avere le versioni di DEBUG:
# nmake DBG=D
#
#
#
# Compiler setup
#
CC = cl
CFLAGS = /nologo /c /ALw # large memory model; SS != DS; DS not loaded at fn entry
CFLAGS = $(CFLAGS) /DWINVER=0x0300
CFLAGS = $(CFLAGS) /FPc # calls floating point emulator library
CFLAGS = $(CFLAGS) /GD # fn entry code optimized for Windows DLLs
CFLAGS = $(CFLAGS) /Gs # suppress stack checking (see GP p. 483)
CFLAGS = $(CFLAGS) /Oegs # optimizations (optional)
CFLAGS = $(CFLAGS) /W2 # set warning level as desired
! if "$(DBG)" == "D"
CFLAGS = $(CFLAGS) /DDBG
CFLAGS = $(CFLAGS) /Zi
! endif
#
# Link setup
#
LINKER = link
LFLAGS = /ONERROR:NOEXE/NOFARCALL/NOE
! if "$(DBG)" == "D"
LFLAGS = $(LFLAGS) /CO
! endif
SUPP=$(SROOT)/support/interni
DLL=\
$(SUPP)/hardlock.dll $(SUPP)/dumb.dll $(SUPP)/dumbvb.dll
FLL=\
$(SUPP)/hardlock.fll $(SUPP)/dumb.fll
CLEAN=dummy
.PRECIOUS: $(DLL) $(FLL)
main: $(DLL) $(FLL) $(CLEAN)
dummy: getaut.obj
del *.obj
getaut.obj: getaut.c
$(CC) $(CFLAGS) getaut.c
dumbdll.obj: dumb.c
$(CC) $(CFLAGS) /Fodumbdll.obj /DDUMBDLL dumb.c
dumbvb.obj: dumb.c
$(CC) $(CFLAGS) /Fodumbvb.obj /DDUMBDLLVB dumb.c
dumbfll.obj: dumb.c
$(CC) $(CFLAGS) /Fodumbfll.obj /DDUMBFLL dumb.c
harddll.obj: hardlock.c
$(CC) $(CFLAGS) /Foharddll.obj /DDLL hardlock.c
hardfll.obj: hardlock.c
$(CC) $(CFLAGS) /Fohardfll.obj /DFLL hardlock.c
$(SUPP)/hardlock.dll: harddll.obj getaut.obj
$(LINKER) $(LFLAGS) @harddll.lrf
$(SUPP)/dumb.dll: dumbdll.obj getaut.obj
$(LINKER) $(LFLAGS) @dumbdll.lrf
$(SUPP)/dumbvb.dll: dumbvb.obj getaut.obj
$(LINKER) $(LFLAGS) @dumbvb.lrf
$(SUPP)/hardlock.fll: hardfll.obj getaut.obj
$(LINKER) $(LFLAGS) @hardfll.lrf
$(SUPP)/dumb.fll: dumbfll.obj getaut.obj
$(LINKER) $(LFLAGS) @dumbfll.lrf

51
support/interni/src/dumb/readme Executable file
View File

@ -0,0 +1,51 @@
Istruzioni per l'uso della libreria HARDLOCK.FLL
La libreria HARDLOCK.FLL per Foxpro per Windows fornisce il supporto per
l'uso delle chiavi di protezione HARDLOCK-EYE.
Le funzioni contenute nella libreria sono quattro:
HL_LOGIN Chiamata automaticamente da SET LIBRARY
HL_LOGOUT Chiamata automaticamente da RELEASE LIBRARY
HL_GETSER Ritorna il numero di serie della chiave
HL_GETAUT Controlla l'autorizzazione di un modulo
Per utilizzare le suddette funzioni basta inserire la seguente linea di
codice all'inizio del programma Foxpro:
SET LIBRARY TO HARDLOCK.FLL
Alla fine bisogna invece inserire la riga:
RELEASE LIBRARY HARDLOCK.FLL
*** HL_GETSER ***
Questa funzione ritorna un valore intero:
-1 Chiave non presente
0 Chiave speciale per sviluppatori solamente
>0 Numero di serie della chiave
Esempio:
? HL_GETSER()
*** HL_GETAUT ***
Questa funzione ritorna un valore booleano e richiede un argomento di tipo
intero corrispondente al numero del modulo di cui si vuole verificare la
autorizzazione.
N.B. Il numero del modulo della NOTA INTEGRATIVA e' 21.
Esempio:
? HL_GETAUT(21)
SEARCHING
==================================
Le chiamate di funzione sono rimaste invariate.
Per i personal PS/2 con architettura Microchannel
e' necessario settare questa variabile d'ambiente:
SET HL_SEARCH=378i,278i,3BCi,IPX,NETBIOS
Naturalmente e' necessario caricare anche la nuova
versione di HARDLOCK.FLL.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,58 @@
#
# Sample MS C/C++ 7 makefile for building a DOS API from a single C
# module. Also works with Microsoft's Visual C++. Usage:
#
# >nmake PLBNAME=<source without extension> MODEL=<model> /F dosc7.mak
#
# The following two lines must be edited to reflect the directory
# structure of your machine.
#
C7DIR = c:\windev # where Microsoft C7 is installed
FOXDIR = c:\foxlck # location of FoxPro API
CC = cl
#
# Uppercase MODEL because cl options are case sensitive
#
!IF "$(MODEL)" == "s"
MM = S
!ELSE IF "$(MODEL)" == "m"
MM = M
!ELSE IF "$(MODEL)" == "l"
MM = L
!ELSE IF "$(MODEL)" == "" # default to large if memory model not spec'd
MM = L
!ELSE
MM = $(MODEL)
!ENDIF
CFLAGS = /A$(MM)w /Zp /GW /I$(FOXDIR) /I$(C7DIR)\include /Fs$(PLBNAME).lst
LINKER = $(C7DIR)\bin\link
# LFLAGS = /ONERROR:NOEXE /NOF
LFLAGS = /ONERROR:NOEXE /NOE /NONULLS
OBJS = $(FOXDIR)\api_m$(MM).obj $(PLBNAME).obj
LIBS = $(FOXDIR)\api_m$(MM).lib
MAPFILE = NUL
DEPENDS = $(PLBNAME).obj
all: $(PLBNAME).plb
$(PLBNAME).obj : $(PLBNAME).C $(FOXDIR)\pro_ext.h
set PATH=$(C7DIR)\bin;%PATH%
@$(CC) /c $(CFLAGS) /Fo$(PLBNAME).obj $(PLBNAME).C
$(PLBNAME).plb : $(DEPENDS)
set PATH=$(C7DIR)\bin;%PATH%
set LIB=$(C7DIR)\lib
echo > NUL @<<$(PLBNAME).lrf
$(OBJS: = +^
)
$@
$(MAPFILE)
$(LIBS: = +^
)
$(LFLAGS)
<<
$(LINKER) @$(PLBNAME).lrf

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,320 @@
README.TXT
**********************************************************
Microsoft(R) FoxPro(R) Version 2.5
Library Construction Kit for Windows(TM)and MS-DOS(R)
(C)1993 Microsoft Corporation. All Rights Reserved.
This file contains additions and corrections to the
FoxPro Library Construction Kit Developer's Guide.
**********************************************************
========
CONTENTS
========
Part Description
---- -----------
1 Additions to Documentation Since Printing
2 Corrections to Documentation Since Printing
----------------------------------------------------------
=================================================
Part 1: Additions to Documentation Since Printing
=================================================
The EXAMPLES directory contains a FoxPro database with all
the example code that is used in the manual. Simply
search for the function with example code you wish to
copy and then extract the code from the memo field. You
are free to use this code in your own applications.
-----------------------------------------------------------
The following function has been added:
WHANDLE _WMainWindow( )
Description:
_WMainWindow( ) returns the WHANDLE of the main FoxPro
window in FoxPro for Windows or of the FoxPro desktop
in FoxPro for MS-DOS.
Example:
The following example writes a message to the main FoxPro
window in FoxPro for Windows or to the FoxPro desktop in
FoxPro for MS-DOS.
FoxPro Code:
SET LIBRARY TO WMAIN
= EXWMAIN()
C Code:
#include <pro_ext.h>
void FAR example(ParamBlk FAR *parm)
{
WHANDLE wh = _WMainWindow();
_WPutStr(wh, "\nThis is the main FoxPro window or desktop.");
}
FoxInfo myFoxInfo[] = {
{"EXWMAIN", example, 0, ""},
};
FoxTable _FoxTable = {
(FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};
----------------------------------------------------------
===================================================
Part 2: Corrections to Documentation Since Printing
===================================================
Page 2: In the Reverse.C example:
The comment "/* Check to see if we can allocate the memory
needed. */" is missing the end comment marker */.
The three-line comment "Since this routine doesn't call
any functions that cause memory reorganization . . .
prior to de-referencing them (_HandToPtr)" is missing the
single line comment marker // in the second and third
lines.
This statement:
for (i = 0; i << parm->p[0].val.ev_length; i++)
*(out_string--) = *(in_string++);
should be:
for (i = 0; i < parm->p[0].val.ev_length; i++)
*(out_string--) = *(in_string++);
Change the "<<" in the original example to "<".
----------------------------------------------------------
Page 5: The Value Structure Fields table should include
the General FoxPro data type. The applicable fields and
their values are listed below:
val.ev_type = 'G'
val.ev_width = FCHAN
val.ev_long = length of general field
val.ev_real = offset of general field
----------------------------------------------------------
Page 6: The data type FPFI, a FAR pointer to a function
returning Int, is mistakenly listed as "FPDI".
----------------------------------------------------------
Page 7: In addition to the Point, Rect and EventRec data
structures, PointP and RectP should be included. PointP
and RectP are identical to Point and Rect except that
Point and Rect coordinates are in rows and columns while
PointP and RectP coordinates are in pixels.
----------------------------------------------------------
Page 12: The example
if (parm->p[0].val.ev_type='C'
x=parm->p[0].val.ev_length
should be:
if (parm->p[0].val.ev_type=='C')
x=parm->p[0].val.ev_length;
Use an expression ==, a closed parenthesis at the end of
the first line, and a semicolon at the end of the second
line.
----------------------------------------------------------
Page 22: When compiling a .PLB library in Microsoft C7 or
Visual C/C++, you need to use the following command line:
CL /O /ALw /Zp /GW
When linking a .PLB library in Microsoft C7 or C8, you
need to use the /NOE and /NONULLS switches.
Leaving out /NOE can cause redefinition errors. Leaving
out /NONULLS will cause FoxPro not to recognize the .PLB
as a valid library.
----------------------------------------------------------
Page 25: The section heading for the makefile on this page
is incorrect. It should say "Microsoft C/C++ Makefile for
MS-DOS" instead of "WATCOM C Makefile for MS-DOS."
----------------------------------------------------------
Page 26: The makefile on this page should have the
following section heading: "WATCOM C Makefile for MS-DOS."
----------------------------------------------------------
Page 39: The example doesn't work as intended in all
cases. To have it work, you need to change the following
line:
(( char FAR *) _HandToPtr(p1.ev_handle))[p1.ev_length] = '\0';
to:
(( char FAR *) _HandToPtr(p0.ev_handle))[p0.ev_length - 1] = '\0';
(( char FAR *) _HandToPtr(p1.ev_handle))[p1.ev_length - 1] = '\0';
----------------------------------------------------------
Page 85: The following information applies to the
_DBSeek( ) function: The struct Value passed to _DBSeek( )
(via a pointer) must be of ev_type == 'N' when seeking a
numeric field even if that field has 0 decimal digits.
If the struct Value has an ev_type of 'I', _DBSeek( )will
return the internal error number -302, "Data type
mismatch."
----------------------------------------------------------
Page 109: The struct EDENV documented with _EdGetEnv( ) isn't
correct. The actual structure from PRO_EXT.H appears
as follows:
NOTE: (R) indicates that this member is read-only and
can't be set using _EdSetEnv( ).
(B) indicates that these members takes on one of
two Boolean values: 1 = true or 0 = false.
typedef struct
{
char filename[MAXFILENAME]; // (R)
EDPOS length; // # of bytes in text. (R)
unsigned short lenLimit; // Max allowable length. 0 = infinite.
unsigned short dirty, // Has the file been changed? (R, B)
autoIndent, // Auto indent? (B)
backup, // Make backup files? (B)
addLineFeeds, // Add line feeds when saving? (B)
autoCompile, // Shall we auto compile this thing? (B)
addCtrlZ, // Add end of file ctrl-z? (B)
savePrefs, // Save edit preferences? (B)
dragAndDrop, // Allow drag-and-drop. (B)
readOnly, // 0 = not r/o, 1 = file is r/o,
// 2 = file is r/w, opened r/o,
// 3 = file is r/o, opened r/o. (R)
status, // Display status bar? (B)
lockPrefs, // Can update the preferences ? (B)
insertMode; // (B)
short wrap; // If < 0, new line at Return only.
EDPOS selStart; // Selection start. (R)
EDPOS selEnd; // Selection end. (R)
EDPOS selAnchor; // Selection anchor point. (R)
short justMode; // Justification (0 = left, 1 = right, 2 = center).
short tabWidth; // TAB size in spaces.
char fontName[MAXFONTNAME];
short fontSize;
short fontStyle; // 0 = plain, 1 = bold, 2 = italic, 3 = bold italic.
short kind; // Kind of editor session; EDCOMMAND, EDPROGRAM, etc.
// defined in pro_ext.h. (R)
} EDENV;
----------------------------------------------------------
Page 122: The syntax for _EdOpenFile() is missing the
"mode" argument. It should read:
_EdOpenFile(TEXT *filename, int mode)
TEXT *filename; /* File to open. */
int mode; /* Mode option. */
The following Mode options are available:
FO_READONLY, FO_WRITEONLY, FO_READWRITE.
----------------------------------------------------------
Page 315: zoomEvent is a FoxPro for MS-DOS event. You
can't trap for this event in FoxPro for Windows.
----------------------------------------------------------
In an EventHandler in the FoxPro for Windows Library
Construction Kit, if you make a call to FoxPro which
generates another event, the original event record may be
changed. This won't happen in the FoxPro for MS-DOS
Library Construction Kit. The following example
illustrates this:
#include <pro_ext.h>
int g_eventid = 0; // Our event handler.
FAR EventHandler(WHandle theWindow, EventRec FAR *ev)
{
Point pt;
switch (ev->what) // Determine the event type.
{
case keyDownEvent:
if (theWindow == _WMainWindow())
return NO;
else
{
pt.h = 35;
pt.v = 10;
// This causes the event handler to be re-entered.
_WSize(theWindow, pt);
}
_PutStr("\nDone with the keyDownEvent");
break;
case sizeEvent:
_PutStr("\nSize Event received.");
break;
default:
return NO;
}
return NO;
}
FAR EventExit()
{
_DeActivateHandler(g_eventid); // Get rid of our event handler.
}
FAR Quotes(ParamBlk FAR *parm)
{
// Set up our event handler.
g_eventid = _ActivateHandler(EventHandler);
}
FoxInfo myFoxInfo[] = {
{"QUOTES", Quotes, 0, ""},
{"EVENTEXIT", EventExit, CALLONUNLOAD, ""}
};
FoxTable _FoxTable = {
(FoxTable FAR *)0, sizeof(myFoxInfo) / sizeof(FoxInfo), myFoxInfo
};
----------------------------------------------------------
=================
End of README.TXT
=================

View File

@ -0,0 +1,75 @@
#
# Sample MS C/C++ 7 makefile for building an FLL from a single C
# module. Also works with Microsoft Visual C++. Usage:
#
# >nmake FLLNAME=<source without extension> /F winc7.mak
#
# For further information on building DLLs and the contents of
# this make file consult the MS C/C++ 7 E&T and Guide to
# Programming (Ch. 20 DLLs) manuals.
#
# The following two lines must be edited to reflect the directory
# structure of your machine.
#
C7DIR = c:\c700 # where Microsoft C7 is installed
FOXDIR = c;\foxlck # location of FoxPro API libraries and PRO_EXT.H
LIBENTRY = $(C7DIR)\lib\libentry.obj
#
# Compile setup
#
CC = cl
CFLAGS = /c /ALw # large memory model; SS != DS; DS not loaded at fn entry
CFLAGS = $(CFLAGS) /DWINVER=0x0300
CFLAGS = $(CFLAGS) /FPc # calls floating point emulator library
CFLAGS = $(CFLAGS) /GD # fn entry code optimized for Windows DLLs
CFLAGS = $(CFLAGS) /Gs # suppress stack checking (see GP p. 483)
CFLAGS = $(CFLAGS) /I$(FOXDIR)
CFLAGS = $(CFLAGS) /I$(C7DIR)\include
CFLAGS = $(CFLAGS) /Oegs # optimizations (optional)
CFLAGS = $(CFLAGS) /W2 # set warning level as desired
#
# Link setup
#
MAPFILE = NUL
LINKER = $(C7DIR)\bin\link
LFLAGS = /ONERROR:NOEXE # do not write EXE on error
LFLAGS = $(LFLAGS) /NOF # no far call optimization
OBJS = $(FLLNAME).obj $(LIBENTRY)
LIBS = $(FOXDIR)\proAPImL.LIB
LIBS = $(LIBS) LIBW.LIB
LIBS = $(LIBS) /NOD:LLIBCE LDLLCEW # use DLL library
DEF_FILE = c7.DEF
FILES = $(OBJS) $(DEF_FILE) # link depends
#
# The pieces come together
#
all: $(FLLNAME).fll
$(FLLNAME).obj : $(FLLNAME).C $(FOXDIR)\pro_ext.h
set PATH=$(C7DIR)\bin;%PATH%
@$(CC) @<<$(FLLNAME).rsp
$(CFLAGS) /Fo$(FLLNAME).obj $(FLLNAME).C
<<
$(FLLNAME).fll : $(FILES)
set PATH=$(C7DIR)\bin;%PATH%
set LIB=$(C7DIR)\lib
#
# Write linker arguments to response file
#
echo > NUL @<<$(FLLNAME).lrf
$(OBJS: = +^
)
$@
$(MAPFILE)
$(LIBS: = +^
)
$(DEF_FILE) $(LFLAGS);
<<
$(LINKER) @$(FLLNAME).lrf