#include <os2.h>
#include <i86.h>
#include <stdint.h>
#include <devtypes.h>
#include <devhdr.h>
#include <devreqp.h>
#include <devaux.h>
#pragma code_seg ( "_INITCODE" ) ;
#pragma data_seg ( "_INITDATA", "INITDATA" ) ;
extern USHORT OffFinalCS;
extern USHORT OffFinalDS;
extern ULONG DevHlp; // DevHelp Interface Address
// Sign on and installation messages
static const char WELCOME[] =
"\r\n"
"Hello World Driver Installed.\r\n"
"(C) ACP Soft 1996.\r\n"
"M Greene <greenemk@cox.net> 2007.\r\n"
"All Rights Reserved.\r\n";
const int WELCOME_LENGTH = sizeof(WELCOME) - 1;
// Initialize device driver
uint16_t StratInit( REQP_INIT FAR *rp )
{
USHORT ret;
DevHlp = rp->in.devhlp; // save far pointer to DevHlp
// Signal that we've installed successfully by setting the size of
// our code and data segments.
rp->out.finalcs = FP_OFF( &OffFinalCS ); // set pointers to
rp->out.finalds = FP_OFF( &OffFinalDS ); //discardable code/data
DosWrite( 1, WELCOME, WELCOME_LENGTH, &ret );
//user code
return RPDONE;
}
There are no comments on this page. [Add comment]