|
|
Microsoft OS/2 SDK 03-01-1988
/*
* dynlib2.c
*
* Created by Microsoft Corp. 1987
*
* Dynamic link library demo module with shared data.
*
*/
#define INCL_DOSFILEMGR
#include <os2def.h>
#include <bsedos.h>
#include "dynlib.h" /* calling conventions */
unsigned count=0; /* shared process count */
int APIENTRY /* This routine is called by the initialization */
initroutine() /* asm module to actually do the per-process */
/* initialization. */
{
static char beg[]="I am number ";
static char First[]="First time initialization.\n\r";
static char NotFirst[]="Not first time initialization.\n\r";
char c;
USHORT Written=0;
if (count++ == 0)
{
DosWrite(1, First, sizeof(First)-1, &Written); /* first time */
}
else
{
DosWrite(1, NotFirst, sizeof(NotFirst)-1, &Written); /* not first */
}
DosWrite(1, beg, sizeof(beg)-1, &Written); /* show new count */
c = count + '0';
DosWrite(1, &c, sizeof(char), &Written);
DosWrite(1, ".\n\r", 3, &Written);
INIT_ID( (unsigned far *) &count); /* store count as id */
/* and pointer to count */
return(1); /* indicate success */
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.