mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
Fixed compiler warnings.
svn path=/trunk/; revision=451
This commit is contained in:
parent
d0fbe6c728
commit
a2e9c0c7a4
4 changed files with 30 additions and 11 deletions
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
OBJECTS= parallel.o ../../../ntoskrnl/ntoskrnl.a
|
OBJECTS= parallel.o ../../../ntoskrnl/ntoskrnl.a
|
||||||
|
|
||||||
all: parallel.o
|
all: parallel.sys
|
||||||
|
|
||||||
.phony: all
|
.phony: all
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,14 @@
|
||||||
/* FUNCTIONS **************************************************************/
|
/* FUNCTIONS **************************************************************/
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
|
#include <internal/halio.h>
|
||||||
|
|
||||||
#include "parallel.h"
|
#include "parallel.h"
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
|
#include <internal/debug.h>
|
||||||
|
|
||||||
|
|
||||||
#define LP_B (0x378)
|
#define LP_B (0x378)
|
||||||
#define LP_S (inb_p(LP_B+1))
|
#define LP_S (inb_p(LP_B+1))
|
||||||
#define LP_C (LP_B+2)
|
#define LP_C (LP_B+2)
|
||||||
|
@ -52,7 +57,7 @@ static void Parallel_putchar(unsigned char ch)
|
||||||
|
|
||||||
if (count==500000)
|
if (count==500000)
|
||||||
{
|
{
|
||||||
printk("printer_putchar(): timed out\n");
|
DPRINT("printer_putchar(): timed out\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +84,7 @@ NTSTATUS Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
switch (Stack->MajorFunction)
|
switch (Stack->MajorFunction)
|
||||||
{
|
{
|
||||||
case IRP_MJ_CREATE:
|
case IRP_MJ_CREATE:
|
||||||
printk("(Parallel Port Driver) Creating\n");
|
DPRINT("(Parallel Port Driver) Creating\n");
|
||||||
Parallel_Reset();
|
Parallel_Reset();
|
||||||
status = STATUS_SUCCESS;
|
status = STATUS_SUCCESS;
|
||||||
break;
|
break;
|
||||||
|
@ -89,7 +94,7 @@ NTSTATUS Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IRP_MJ_WRITE:
|
case IRP_MJ_WRITE:
|
||||||
printk("(Parallel Port Driver) Writing %d bytes\n",
|
DPRINT("(Parallel Port Driver) Writing %d bytes\n",
|
||||||
Stack->Parameters.Write.Length);
|
Stack->Parameters.Write.Length);
|
||||||
for (i=0;i<Stack->Parameters.Write.Length;i++)
|
for (i=0;i<Stack->Parameters.Write.Length;i++)
|
||||||
{
|
{
|
||||||
|
@ -110,7 +115,8 @@ NTSTATUS Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
|
||||||
return(status);
|
return(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
|
STDCALL NTSTATUS
|
||||||
|
DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Called by the system to initalize the driver
|
* FUNCTION: Called by the system to initalize the driver
|
||||||
* ARGUMENTS:
|
* ARGUMENTS:
|
||||||
|
@ -121,12 +127,20 @@ NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
|
||||||
{
|
{
|
||||||
PDEVICE_OBJECT DeviceObject;
|
PDEVICE_OBJECT DeviceObject;
|
||||||
NTSTATUS ret;
|
NTSTATUS ret;
|
||||||
|
ANSI_STRING ansi_device_name;
|
||||||
|
UNICODE_STRING device_name;
|
||||||
|
|
||||||
printk("Parallel Port Driver 0.0.1\n");
|
DbgPrint("Parallel Port Driver 0.0.1\n");
|
||||||
|
|
||||||
|
RtlInitAnsiString (&ansi_device_name, "\\Device\\Parallel");
|
||||||
ret = IoCreateDevice(DriverObject,0,"\\Device\\Parallel",
|
RtlAnsiStringToUnicodeString (&device_name, &ansi_device_name, TRUE);
|
||||||
FILE_DEVICE_PARALLEL_PORT,0,FALSE,&DeviceObject);
|
ret = IoCreateDevice(DriverObject,
|
||||||
|
0,
|
||||||
|
&device_name,
|
||||||
|
FILE_DEVICE_PARALLEL_PORT,
|
||||||
|
0,
|
||||||
|
FALSE,
|
||||||
|
&DeviceObject);
|
||||||
if (ret!=STATUS_SUCCESS)
|
if (ret!=STATUS_SUCCESS)
|
||||||
{
|
{
|
||||||
return(ret);
|
return(ret);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
OBJECTS= serial.o ../../../ntoskrnl/ntoskrnl.a
|
OBJECTS= serial.o ../../../ntoskrnl/ntoskrnl.a
|
||||||
|
|
||||||
all: serial.o
|
all: serial.sys
|
||||||
|
|
||||||
.phony: all
|
.phony: all
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,10 @@
|
||||||
#include <internal/mmhal.h>
|
#include <internal/mmhal.h>
|
||||||
#include <internal/halio.h>
|
#include <internal/halio.h>
|
||||||
|
|
||||||
|
#define NDEBUG
|
||||||
|
#include <internal/debug.h>
|
||||||
|
|
||||||
|
|
||||||
#define COM1 0x3F8
|
#define COM1 0x3F8
|
||||||
#define COM2 0x2F8
|
#define COM2 0x2F8
|
||||||
#define COM3 0x3E8
|
#define COM3 0x3E8
|
||||||
|
@ -141,7 +145,8 @@ void testserial(void)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
NTSTATUS DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
|
STDCALL NTSTATUS
|
||||||
|
DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
|
||||||
{
|
{
|
||||||
DbgPrint("Serial Driver 0.0.2\n");
|
DbgPrint("Serial Driver 0.0.2\n");
|
||||||
InitializeSerial();
|
InitializeSerial();
|
||||||
|
|
Loading…
Reference in a new issue