Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

vdmprint.h File Reference

Go to the source code of this file.

Defines

#define DATA_PORT_OFFSET   0
#define STATUS_PORT_OFFSET   1
#define CONTROL_PORT_OFFSET   2
#define LPT1_PORT_STATUS   0x3bd
#define LPT2_PORT_STATUS   0x379
#define LPT3_PORT_STATUS   0x279
#define LPT_MASK   0xff0
#define IRQ   0x10
#define NOTBUSY   0x80
#define HOST_LPT_BUSY   (1 << 0)
#define STATUS_REG_MASK   0x07
#define get_status(adap)   (*(PUCHAR)((ULONG)(((PVDM_PROCESS_OBJECTS)(PsGetCurrentProcess()->VdmObjects))->PrinterStatus)+(ULONG)adap))
#define get_control(adap)   (*(PUCHAR)((ULONG)(((PVDM_PROCESS_OBJECTS)(PsGetCurrentProcess()->VdmObjects))->PrinterControl)+(ULONG)adap))
#define host_lpt_status(adap)   (*(PUCHAR)((ULONG)(((PVDM_PROCESS_OBJECTS)(PsGetCurrentProcess()->VdmObjects))->PrinterHostState)+(ULONG)adap))
#define set_status(adap, val)   *(PUCHAR)((ULONG)(((PVDM_PROCESS_OBJECTS)(PsGetCurrentProcess()->VdmObjects))->PrinterStatus)+(ULONG)adap) = val

Functions

NTSTATUS PspSetProcessIoHandlers (IN PEPROCESS Process, IN PVOID IoHandlerInformation, IN ULONG IoHandlerLength)
NTSTATUS VdmFlushPrinterWriteData (USHORT Adapter)


Define Documentation

#define CONTROL_PORT_OFFSET   2
 

Definition at line 26 of file vdmprint.h.

#define DATA_PORT_OFFSET   0
 

Definition at line 24 of file vdmprint.h.

Referenced by VdmPrinterWriteData().

#define get_control (  adap   )     (*(PUCHAR)((ULONG)(((PVDM_PROCESS_OBJECTS)(PsGetCurrentProcess()->VdmObjects))->PrinterControl)+(ULONG)adap))
 

Definition at line 39 of file vdmprint.h.

Referenced by VdmPrinterStatus().

#define get_status (  adap   )     (*(PUCHAR)((ULONG)(((PVDM_PROCESS_OBJECTS)(PsGetCurrentProcess()->VdmObjects))->PrinterStatus)+(ULONG)adap))
 

Definition at line 38 of file vdmprint.h.

Referenced by VdmPrinterStatus().

#define HOST_LPT_BUSY   (1 << 0)
 

Definition at line 35 of file vdmprint.h.

Referenced by VdmPrinterStatus().

#define host_lpt_status (  adap   )     (*(PUCHAR)((ULONG)(((PVDM_PROCESS_OBJECTS)(PsGetCurrentProcess()->VdmObjects))->PrinterHostState)+(ULONG)adap))
 

Definition at line 40 of file vdmprint.h.

Referenced by VdmPrinterStatus().

#define IRQ   0x10
 

Definition at line 32 of file vdmprint.h.

Referenced by VdmPrinterStatus().

#define LPT1_PORT_STATUS   0x3bd
 

Definition at line 28 of file vdmprint.h.

#define LPT2_PORT_STATUS   0x379
 

Definition at line 29 of file vdmprint.h.

#define LPT3_PORT_STATUS   0x279
 

Definition at line 30 of file vdmprint.h.

#define LPT_MASK   0xff0
 

Definition at line 31 of file vdmprint.h.

#define NOTBUSY   0x80
 

Definition at line 34 of file vdmprint.h.

Referenced by VdmPrinterStatus().

#define set_status (  adap,
val   )     *(PUCHAR)((ULONG)(((PVDM_PROCESS_OBJECTS)(PsGetCurrentProcess()->VdmObjects))->PrinterStatus)+(ULONG)adap) = val
 

Definition at line 41 of file vdmprint.h.

Referenced by VdmPrinterStatus().

#define STATUS_PORT_OFFSET   1
 

Definition at line 25 of file vdmprint.h.

Referenced by VdmPrinterStatus().

#define STATUS_REG_MASK   0x07
 

Definition at line 36 of file vdmprint.h.

Referenced by VdmPrinterStatus().


Function Documentation

NTSTATUS PspSetProcessIoHandlers (  IN PEPROCESS  Process,
IN PVOID  IoHandlerInformation,
IN ULONG  IoHandlerLength
) 
 

Definition at line 25 of file alpha/psvdm.c.

Referenced by NtSetInformationProcess().

00032 : 00033 00034 This routine returns STATUS_NOT_IMPLEMENTED 00035 00036 Arguments: 00037 00038 Process -- Supplies a pointer to the process for which Io port handlers 00039 are to be installed 00040 IoHandlerInformation -- Supplies a pointer to the information about the 00041 io port handlers 00042 IoHandlerLength -- Supplies the length of the IoHandlerInformation 00043 structure. 00044 00045 Return Value: 00046 00047 Returns STATUS_NOT_IMPLEMENTED 00048 00049 --*/ 00050 { 00051 UNREFERENCED_PARAMETER(Process); 00052 UNREFERENCED_PARAMETER(IoHandlerInformation); 00053 UNREFERENCED_PARAMETER(IoHandlerLength); 00054 return STATUS_NOT_IMPLEMENTED; 00055 }

NTSTATUS VdmFlushPrinterWriteData (  USHORT  Adapter  ) 
 

Definition at line 236 of file vdmprint.c.

References DbgPrint, EXCEPTION_EXECUTE_HANDLER, FALSE, KeLowerIrql(), KeRaiseIrql(), NT_SUCCESS, NtDeviceIoControlFile(), NTSTATUS(), NULL, PAGED_CODE, PASSIVE_LEVEL, Status, VdmpGetVdmTib(), and VDMTIB_KMODE.

Referenced by VdmpPrinterDirectIoClose(), VdmPrinterStatus(), and VdmPrinterWriteData().

00237 { 00238 KIRQL OldIrql; 00239 PVDM_TIB VdmTib; 00240 PVDM_PRINTER_INFO PrtInfo; 00241 PIO_STATUS_BLOCK IoStatusBlock; 00242 NTSTATUS Status; 00243 00244 00245 PAGED_CODE(); 00246 00247 00248 Status = VdmpGetVdmTib(&VdmTib, VDMTIB_KMODE); 00249 if (!NT_SUCCESS(Status)) { 00250 return(FALSE); 00251 } 00252 00253 PrtInfo = &VdmTib->PrinterInfo; 00254 IoStatusBlock = (PIO_STATUS_BLOCK)&VdmTib->TempArea1; 00255 try { 00256 if (PrtInfo->prt_Handle[adapter] && 00257 PrtInfo->prt_BytesInBuffer[adapter] && 00258 PRT_MODE_DIRECT_IO == PrtInfo->prt_Mode[adapter]) { 00259 00260 OldIrql = KeGetCurrentIrql(); 00261 KeLowerIrql(PASSIVE_LEVEL); 00262 Status = NtDeviceIoControlFile(PrtInfo->prt_Handle[adapter], 00263 NULL, // notification event 00264 NULL, // APC routine 00265 NULL, // APC context 00266 IoStatusBlock, 00267 IOCTL_VDM_PAR_WRITE_DATA_PORT, 00268 &PrtInfo->prt_Buffer[adapter][0], 00269 PrtInfo->prt_BytesInBuffer[adapter], 00270 NULL, 00271 0 00272 ); 00273 PrtInfo->prt_BytesInBuffer[adapter] = 0; 00274 KeRaiseIrql(OldIrql, &OldIrql); 00275 if (!NT_SUCCESS(Status)) { 00276 #ifdef DBG 00277 DbgPrint("IOCTL_VDM_PAR_WRITE_DATA_PORT failed %lx %x\n", 00278 Status, IoStatusBlock->Status); 00279 #endif 00280 Status = IoStatusBlock->Status; 00281 00282 } 00283 } 00284 else 00285 Status = STATUS_INVALID_PARAMETER; 00286 } except (EXCEPTION_EXECUTE_HANDLER) { 00287 Status = GetExceptionCode(); 00288 } 00289 return Status; 00290 00291 }


Generated on Sat May 15 19:46:07 2004 for test by doxygen 1.3.7