site logo  DevDriver1initc

HomePage | Categories |* BLOG *| RecentChanges | RecentlyCommented | Login/Register

#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]

Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.7
Page was generated in 0.6450 seconds