ReactOS 0.4.15-dev-7834-g00c4b3d
ioctl.c File Reference
#include "inport.h"
#include <debug.h>
Include dependency graph for ioctl.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS NTAPI InPortInternalDeviceControl (_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file ioctl.c.

Function Documentation

◆ InPortInternalDeviceControl()

NTSTATUS NTAPI InPortInternalDeviceControl ( _In_ PDEVICE_OBJECT  DeviceObject,
_Inout_ PIRP  Irp 
)

Definition at line 19 of file ioctl.c.

22{
24 PCONNECT_DATA ConnectData;
25 PINPORT_DEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
27
28 DPRINT("%s(%p, %p) 0x%X\n", __FUNCTION__, DeviceObject, Irp,
29 IrpSp->Parameters.DeviceIoControl.IoControlCode);
30
31 switch (IrpSp->Parameters.DeviceIoControl.IoControlCode)
32 {
34 if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < sizeof(CONNECT_DATA))
35 {
37 break;
38 }
39
40 /* Already connected */
41 if (DeviceExtension->ClassService)
42 {
44 break;
45 }
46
47 ConnectData = IrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
48
49 DeviceExtension->ClassDeviceObject = ConnectData->ClassDeviceObject;
50 DeviceExtension->ClassService = ConnectData->ClassService;
51
53 break;
54
56 DeviceExtension->ClassService = NULL;
57
59 break;
60
62 if (IrpSp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(MOUSE_ATTRIBUTES))
63 {
65 break;
66 }
67
68 *(PMOUSE_ATTRIBUTES)Irp->AssociatedIrp.SystemBuffer = DeviceExtension->MouseAttributes;
69 Irp->IoStatus.Information = sizeof(MOUSE_ATTRIBUTES);
70
72 break;
73
74 default:
76 break;
77 }
78
79 Irp->IoStatus.Status = Status;
81
82 return Status;
83}
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
#define NULL
Definition: types.h:112
#define __FUNCTION__
Definition: types.h:116
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
Status
Definition: gdiplustypes.h:25
#define IOCTL_INTERNAL_MOUSE_DISCONNECT
Definition: kbdmou.h:71
#define IOCTL_INTERNAL_MOUSE_CONNECT
Definition: kbdmou.h:68
struct _MOUSE_ATTRIBUTES * PMOUSE_ATTRIBUTES
#define IOCTL_MOUSE_QUERY_ATTRIBUTES
Definition: ntddmou.h:32
#define IoCompleteRequest
Definition: irp.c:1240
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define DPRINT
Definition: sndvol32.h:71
PVOID ClassService
Definition: kbdmou.h:82
PDEVICE_OBJECT ClassDeviceObject
Definition: kbdmou.h:81
PDEVICE_OBJECT ClassDeviceObject
Definition: inport.h:66
MOUSE_ATTRIBUTES MouseAttributes
Definition: inport.h:76
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_SHARING_VIOLATION
Definition: udferr_usr.h:154
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
#define IO_NO_INCREMENT
Definition: iotypes.h:598

Referenced by DriverEntry().