Category : Files from Magazines
Archive   : WDMAY92.ZIP
Filename : 3N05033A

 
Output of file : 3N05033A contained in archive : WDMAY92.ZIP
#include
#include "windows.h"
/*
******************************************************************
Title: PIPEFUNC.C - General Purpose Pipe Functions
Author: Thomas W. Olsen
Version: 3.0
Compiler: Microsoft C 6.0
cl /AL /Gs /Zi /c PIPEFUNC.C for DOS
cl /AL /Gsw /W3 /Oas /Zpe /Zi /c PIPEFUNC.C for WINDOWS
******************************************************************
*/
#define GET_API_ENTRY_POINT 0x1684
#define DEVICE_ID 0x2020
#define DEVICE_VERSION 0x0300
#define GET_VERSION 0
#define REGISTER_CALLBACK 1
#define UNREGISTER_CALLBACK 2
#define ALLOCATE_GDT_SELECTOR 3
#define FREE_GDT_SELECTOR 4
#define CALL_WINDOWS_PROCEDURE 5

FARPROC lpPipeProc = NULL;

BOOL PASCAL PipeSetup(void)
{
BOOL retVal = FALSE;
union REGS regs;
struct SREGS sregs;

segread(&sregs); /* Is The Device Loaded? */
regs.x.ax = GET_API_ENTRY_POINT;
regs.x.bx = DEVICE_ID;
sregs.es = regs.x.di = 0;
int86x( 0x2F, ®s, ®s, &sregs);

FP_SEG(lpPipeProc) = sregs.es;
FP_OFF(lpPipeProc) = regs.x.di;

if (lpPipeProc) /* Device Is Loaded */
{
_asm mov ax, GET_VERSION; /* Get Version */
retVal = (*lpPipeProc)() < DEVICE_VERSION ? FALSE:TRUE;
}
return(retVal);
}

BOOL PASCAL PipeRegisterCallback(HWND hWnd, FARPROC lpFuncPtr)
{
BOOL retVal = FALSE;

if (lpPipeProc)
{
_asm mov ax, REGISTER_CALLBACK;
_asm mov bx, hWnd;
_asm mov cx, word ptr lpFuncPtr+2;
_asm mov dx, word ptr lpFuncPtr;
(*lpPipeProc)();
retVal = TRUE;
}
return(retVal);
}

BOOL PASCAL PipeUnregisterCallback(void)
{
BOOL retVal = FALSE;

if (lpPipeProc)
{
_asm mov ax, UNREGISTER_CALLBACK;
(*lpPipeProc)();
retVal = TRUE;
}
return(retVal);
}

WORD PASCAL PipeAllocateSelector(WORD segment)
{
_asm mov ax, ALLOCATE_GDT_SELECTOR
_asm mov bx, segment
return((*lpPipeProc)());
}

void PASCAL PipeFreeSelector(WORD selector)
{
_asm mov ax, FREE_GDT_SELECTOR
_asm mov bx, selector
(*lpPipeProc)();
}

BOOL PASCAL PipeCallWindowsProc(WORD message, WORD wParam, LONG lParam)
{
BOOL retVal = FALSE;

if (lpPipeProc)
{
_asm mov ax, CALL_WINDOWS_PROCEDURE
_asm mov bx, message
_asm mov si, wParam
_asm mov cx, word ptr lParam+2
_asm mov dx, word ptr lParam
(*lpPipeProc)();
retVal = TRUE;
}
return(retVal);
}



  3 Responses to “Category : Files from Magazines
Archive   : WDMAY92.ZIP
Filename : 3N05033A

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/