Category : Windows 3.X Files
Archive   : RAWDRV.ZIP
Filename : RESET.C

 
Output of file : RESET.C contained in archive : RAWDRV.ZIP
/***************************************************************************
* *
* RAW.DRV - Windows 3.0 Printer Driver for sending Raw data to the printer *
* using the PASSTHROUGH printer Escape. *
* *
* Copyright (C) 1983-1991 by Microsoft Corporation. All rights reserved. *
* *
* *
* Updated to a true Windows 3.0 Printer Driver, 2/6/91 cek *
* *
****************************************************************************/

#include "printer.h"
#include "gdidefs.inc"
#include "raw.h"

GDIINFO RawGDIInfo = {
0x0300, /* Works on both version 1 and 2 */

DT_PLOTTER, /* Device classification */

1, /* Horizontal size in millimeters */
1, /* Vertical size in millimeters */
1, /* Horizontal width in pixels */
1, /* Vertical width in pixels */

1, /* Number of bits per pixel */
1, /* Number of planes */
0, /* Number of brushes the device has */
0, /* Number of pens the device has */
0, /* Number of markers the device has */
0, /* Number of fonts the device has */
0, /* Number of colors in color table */

sizeof(DEVICE), /* Size required for the device descriptor */

CC_NONE, /* Curves capabilities */
LC_NONE, /* Line capabilities */
PC_NONE, /* Polygonal capabilities */
CP_NONE, /* Text capabilities */
TC_NONE, /* Clipping capabilities */
RC_NONE, /* Bitblt capabilities */

1, /* Length of X leg */
1, /* Length of Y leg */
1, /* Length of hypotenuse */
1, /* Length of segment for line styles */

{ 1, 1 }, /* Metric Lo res WinX,WinY (PTTYPE) */
{ 1, 1 }, /* Metric Lo res VptX,VptY (PTTYPE) */
{ 1, 1 }, /* Metric Hi res WinX,WinY (PTTYPE) */
{ 1, 1 }, /* Metric Hi res VptX,VptY (PTTYPE) */
{ 1, 1 }, /* English Lo res WinX,WinY (PTTYPE) */
{ 1, 1 }, /* English Lo res VptX,VptY (PTTYPE) */
{ 1, 1 }, /* English Hi res WinX,WinY (PTTYPE) */
{ 1, 1 }, /* English Hi res VptX,VptY (PTTYPE) */
{ 1, 1 }, /* Twips WinX,WinY (PTTYPE) */
{ 1, 1 }, /* Twips VptX,VptY (PTTYPE) */

1, /* Logical pixels/inch in X */
1, /* Logical pixels/inch in Y */

DC_SPDevice, /* DC Management flags */

0, 0, 0, 0, 0, /* Reserved for future use */

0, /* dpPalColors - ignored if RC_PALETTE */
0, /* dpPalReserved is not specified. */
0 /* dpPalResolution */
};


short FAR PASCAL Enable(lpDevice, style, lpDeviceType, lpOutputFile, lpStuff)
LPDEVICE lpDevice;
short style;
LPSTR lpDeviceType;
LPSTR lpOutputFile;
LPSTR lpStuff;
{
/* Just tell about ourselves if this is an inquiry. */
if (style & InquireInfo)
{
/* Copy the GDIINFO structure. */
*(GDIINFO FAR *)lpDevice = RawGDIInfo;
return sizeof(RawGDIInfo);
}

/* Make a DC or an IC. */
if (style & InfoContext)
{
/* Make an IC. */
lpDevice->Mode = IC_DEVICE;

lstrcpy(lpDevice->Port, (LPSTR)"");
}
else
{
/* Make a DC. */
lpDevice->Mode = DC_DEVICE;

/* Try to save the output name. */
if (lstrlen(lpOutputFile) < NAME_LEN)
lstrcpy(lpDevice->Port, lpOutputFile);
else
return FALSE;
}

lpDevice->BmpHdr.bmType = TRUE;
lpDevice->Job = (HANDLE)SP_ERROR;
lpDevice->hDC = NULL;

return TRUE;
}


/***** Windows 1.03 and before may NOT pass a valid lpDevice here *****/
short FAR PASCAL Disable(lpDevice)
LPDEVICE lpDevice;
{
/* Make sure it's one of ours. */
if (!lpDevice->BmpHdr.bmType || (lpDevice->Mode != DC_DEVICE))
return FALSE;

/* Close the job if the user didn't. */
if (lpDevice->Job != (HANDLE)SP_ERROR)
{
if (EndSpoolPage(lpDevice->Job) <= 0)
{
DeleteJob(lpDevice->Job, 0);
lpDevice->Job = (HANDLE)SP_ERROR;
return FALSE;
}

if (CloseJob(lpDevice->Job) <= 0)
{
lpDevice->Job = (HANDLE)SP_ERROR;
return FALSE;
}
}

lpDevice->Job = (HANDLE)SP_ERROR;
return TRUE;
}


  3 Responses to “Category : Windows 3.X Files
Archive   : RAWDRV.ZIP
Filename : RESET.C

  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/