Commit 9e09bde2 authored by Alois SCHLOEGL's avatar Alois SCHLOEGL
Browse files

fix use1401 : replacing use1432.lib with use1401.[ch] sources is now working

parent c59bd890
......@@ -10,6 +10,7 @@
#ifndef __USE1401_H__
#define __USE1401_H__
#include "machine.h"
#include "use14_ioc.h" // links to device driver stuff
#define MAX1401 8 // The number of 1401s that can be supported
extern short asType1401[MAX1401+1]; // The type of the 1401
......@@ -243,6 +244,10 @@ U14API(int) U14TestTransferEvent(short hand, WORD wArea);
U14API(int) U14WaitTransferEvent(short hand, WORD wArea, int msTimeOut);
U14API(short) U14GetTransfer(short hand, TGET_TX_BLOCK *pTransBlock);
U14API(short) U14WorkingSet(DWORD dwMinKb, DWORD dwMaxKb);
U14API(short) U14Status1401(short sHand, LONG lCode, TCSBLOCK* pBlk);
U14API(short) U14Control1401(short sHand, LONG lCode, TCSBLOCK* pBlk);
U14API(short) U14ToHost(short hand, char* pAddrHost,DWORD dwSize,DWORD dw1401,
short eSz);
U14API(short) U14To1401(short hand, const char* pAddrHost,DWORD dwSize,DWORD dw1401,
......@@ -294,4 +299,42 @@ U14API(int) U14InitLib(void);
}
#endif
/****************************************************************************/
/* */
/* Windows NT Specifics */
/* */
/****************************************************************************/
#if defined(WIN32)
/* if we are in NT/Win95/Win32s we have extra bits */
#define MINDRIVERMAJREV 1 /* minimum driver revision level we need */
#else
#define MINDRIVERMAJREV 2 /* minimum driver revision level we need */
#endif
/****************************************************************************/
/* */
/* Macintosh Specifics */
/* */
/****************************************************************************/
#if defined(macintosh) || defined(_MAC)
/* The basic resource ID, modified by 1401 type (plus is '1402 etc.) */
#define U14_RES1401COMMAND '1401' /* We should calculate these ... */
#define U14_RESPLUSCOMMAND '1402'
#define U14_RESU1401COMMAND '1403'
#define U14_RESPOWERCOMMAND '1404'
#define U14_RESU14012COMMAND '1405'
#define k1401CommandFile "\p1401Commands"
#define k1401DriverName "\p.Driver1401"
#define MAXAREAS 8 /* The number of transfer areas supported by driver */
#endif
#endif /* End of ifndef __USE1401_H__ */
......@@ -178,12 +178,10 @@
#else
#define VERBOSE 1
#endif
#define STUB 1
#if defined(_IS_WINDOWS_) && !defined(__WINE__)
#include <io.h>
#include <windows.h>
#pragma warning(disable: 4100) /* Disable "Unused formal parameter" warning */
#include <assert.h>
#include "process.h"
......@@ -195,8 +193,9 @@
#define MINDRIVERMAJREV 1 // minimum driver revision level we need
#define __packed // does nothing in Windows
#include "use14_ioc.h" // links to device driver stuff
#endif
// TODO: test whether this is important for _WIN64
// #undef _WIN64
#if defined(LINUX) || defined(__WINE__)
#include <fcntl.h>
......@@ -331,8 +330,6 @@ static short U14Status1401(short sHand, LONG lCode, TCSBLOCK* pBlk)
if ((sHand < 0) || (sHand >= MAX1401)) /* Check parameters */
return U14ERR_BADHAND;
#if !defined(STUB)
#ifndef _WIN64
if (!USE_NT_DIOC(sHand))
{ /* Windows 9x DIOC methods? */
......@@ -353,9 +350,6 @@ static short U14Status1401(short sHand, LONG lCode, TCSBLOCK* pBlk)
return rWork.sState;
}
}
#endif // STUB
return U14ERR_DRIVCOMMS;
}
......@@ -373,8 +367,6 @@ static short U14Control1401(short sHand, LONG lCode, TCSBLOCK* pBlk)
if ((sHand < 0) || (sHand >= MAX1401)) /* Check parameters */
return U14ERR_BADHAND;
#if !defined(STUB)
#ifndef _WIN64
if (!USE_NT_DIOC(sHand))
{ /* Windows 9x DIOC methods */
......@@ -392,9 +384,6 @@ static short U14Control1401(short sHand, LONG lCode, TCSBLOCK* pBlk)
(dwBytes >= sizeof(PARAMBLK)))
return rWork.sState;
}
#endif // STUB
return U14ERR_DRIVCOMMS;
}
......@@ -3178,7 +3167,7 @@ INT APIENTRY DllMain(HANDLE hInst, DWORD ul_reason_being_called, LPVOID lpReserv
int iRetVal = 1;
//if (VERBOSE)
fprintf(stderr,"%s line %i: %s(%i,%i...)\n",__FILE__,__LINE__,__func__,hInst,ul_reason_being_called);
fprintf(stderr,"%s line %i: %s(%p,%i...)\n",__FILE__,__LINE__,__func__,hInst,ul_reason_being_called);
switch (ul_reason_being_called)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment