/* TMTMod.h
Provides Win32 API veneers for TMT module
by N. Douglas
Started: 30-11-1996
Last updated: ?

Note that parts of this API is (C) to Microsoft Corp.
*/

#ifndef _TMTMod_h
#define _TMTMod_h

#define Tornado_Poll 0xC0002

#define MSG_PASSON 0
#define MSG_HANDLED 1

#define TRUE 1
#define FALSE 0
#define BOOL unsigned

typedef BOOL (*function)(int *);


typedef struct ROINITIALISEBLK
{
  int rovers;			/* RO version */
  int wimpvers;			/* Wimp version */
  int tnvers;			/* Support module version */
  char *taskname;		/* RO Wimp task name */
  function handler;		/* address of 17, 18 & 19 handler */
  int taskh;			/* RO Wimp task handle */

} ROINITIALISEBLK;

extern void ROInitialise(

   ROINITIALISEBLK *		/* As above */
   );

extern void ROClosedown(

   int taskh			/* Task handle as given by initialise */
  );




typedef struct SECURITY_ATTRIBUTES
{
  /* Dunno what this is yet! */
  int n;

} SECURITY_ATTRIBUTES;

typedef int HANDLE;
typedef SECURITY_ATTRIBUTES *LPSECURITY_ATTRIBUTES;
typedef int DWORD;
typedef int *LPTHREAD_START_ROUTINE;
typedef int LPVOID;
typedef DWORD *LPDWORD;

extern HANDLE CreateThread(

    LPSECURITY_ATTRIBUTES,	/* address of thread security attributes */
    DWORD,			/* initial thread stack size, in bytes */
    LPTHREAD_START_ROUTINE,	/* address of thread function */
    LPVOID,			/* argument for new thread */
    DWORD,			/* creation flags */
    LPDWORD			/* address of returned thread ID */
   );

extern void ExitThread(

    DWORD			/* exit code for this thread */
   );

extern BOOL TerminateThread(

    HANDLE,			/* handle to the thread */
    DWORD	 		/* exit code for the thread */
   );

extern DWORD GetLastError(void);

#endif
