
mouclass.nostrip.sys:     file format pei-i386

Disassembly of section .text:

00011000 <_MouseClassCallBack>:

BOOLEAN MouseClassCallBack(
   PDEVICE_OBJECT ClassDeviceObject, PMOUSE_INPUT_DATA MouseDataStart,
   PMOUSE_INPUT_DATA MouseDataEnd, PULONG InputCount)
{
   11000:	55                   	push   %ebp
   11001:	89 e5                	mov    %esp,%ebp
   11003:	57                   	push   %edi
   11004:	56                   	push   %esi
   11005:	53                   	push   %ebx
   11006:	83 ec 0c             	sub    $0xc,%esp
   PDEVICE_EXTENSION ClassDeviceExtension = ClassDeviceObject->DeviceExtension;
   11009:	8b 45 08             	mov    0x8(%ebp),%eax
   1100c:	8b 78 28             	mov    0x28(%eax),%edi
   PIRP Irp;
   KIRQL OldIrql;
   PIO_STACK_LOCATION Stack;
   ULONG SafeInputCount = *InputCount;
   1100f:	8b 45 14             	mov    0x14(%ebp),%eax
   11012:	8b 00                	mov    (%eax),%eax
   11014:	89 45 ec             	mov    %eax,0xffffffec(%ebp)
   ULONG ReadSize;

   DPRINT("Entering MouseClassCallBack\n");
   if (ClassDeviceExtension->ReadIsPending == TRUE)
   11017:	80 7f 09 01          	cmpb   $0x1,0x9(%edi)
   1101b:	0f 84 83 00 00 00    	je     110a4 <_MouseClassCallBack+0xa4>
   {
      Irp = ClassDeviceObject->CurrentIrp;
      ClassDeviceObject->CurrentIrp = NULL;
      Stack = IoGetCurrentIrpStackLocation(Irp);

      /* A read request is waiting for input, so go straight to it */
      RtlMoveMemory(Irp->AssociatedIrp.SystemBuffer, MouseDataStart,
                    sizeof(MOUSE_INPUT_DATA));

      /* Go to next packet and complete this request with STATUS_SUCCESS */
      Irp->IoStatus.Status = STATUS_SUCCESS;
      Irp->IoStatus.Information = sizeof(MOUSE_INPUT_DATA);
      Stack->Parameters.Read.Length = sizeof(MOUSE_INPUT_DATA);

      IoStartNextPacket(ClassDeviceObject, FALSE);
      IoCompleteRequest(Irp, IO_MOUSE_INCREMENT);      
      ClassDeviceExtension->ReadIsPending = FALSE;

      /* Skip the packet we just sent away */
      MouseDataStart++;
      SafeInputCount--;
   }

   /* If we have data from the port driver and a higher service to send the data to */
   if (SafeInputCount != 0)
   11021:	8b 45 ec             	mov    0xffffffec(%ebp),%eax
   11024:	85 c0                	test   %eax,%eax
   11026:	75 0d                	jne    11035 <_MouseClassCallBack+0x35>
   {
      KeAcquireSpinLock(&ClassDeviceExtension->SpinLock, &OldIrql);

      if (ClassDeviceExtension->InputCount + SafeInputCount > MOUSE_BUFFER_SIZE)
      {
         ReadSize = MOUSE_BUFFER_SIZE - ClassDeviceExtension->InputCount;
      } else {
         ReadSize = SafeInputCount;
      }

      /*
       * FIXME: If we exceed the buffer, mouse data gets thrown away.. better
       * solution?
       */

      /*
       * Move the mouse input data from the port data queue to our class data
       * queue.
       */
      RtlMoveMemory(ClassDeviceExtension->PortData, (PCHAR)MouseDataStart,
                    sizeof(MOUSE_INPUT_DATA) * ReadSize);

      /* Move the pointer and counter up */
      ClassDeviceExtension->PortData += ReadSize;
      ClassDeviceExtension->InputCount += ReadSize;

      KeReleaseSpinLock(&ClassDeviceExtension->SpinLock, OldIrql);
   } else {
      DPRINT("MouseClassCallBack() entered, InputCount = %d - DOING NOTHING\n", *InputCount);
   }

   DPRINT("Leaving MouseClassCallBack\n");
   return TRUE;
}
   11028:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   1102b:	b8 01 00 00 00       	mov    $0x1,%eax
   11030:	5b                   	pop    %ebx
   11031:	5e                   	pop    %esi
   11032:	5f                   	pop    %edi
   11033:	5d                   	pop    %ebp
   11034:	c3                   	ret    
   11035:	50                   	push   %eax
   11036:	50                   	push   %eax
   11037:	8d 45 f3             	lea    0xfffffff3(%ebp),%eax
   1103a:	50                   	push   %eax
   1103b:	8d 47 04             	lea    0x4(%edi),%eax
   1103e:	89 45 e8             	mov    %eax,0xffffffe8(%ebp)
   11041:	50                   	push   %eax
   11042:	e8 49 05 00 00       	call   11590 <_KeAcquireSpinLock@8>
   11047:	8b 4d ec             	mov    0xffffffec(%ebp),%ecx
   1104a:	8b 57 0c             	mov    0xc(%edi),%edx
   1104d:	5b                   	pop    %ebx
   1104e:	5e                   	pop    %esi
   1104f:	89 ce                	mov    %ecx,%esi
   11051:	8d 04 0a             	lea    (%edx,%ecx,1),%eax
   11054:	83 f8 20             	cmp    $0x20,%eax
   11057:	76 07                	jbe    11060 <_MouseClassCallBack+0x60>
   11059:	be 20 00 00 00       	mov    $0x20,%esi
   1105e:	29 d6                	sub    %edx,%esi
   11060:	8d 1c 76             	lea    (%esi,%esi,2),%ebx
   11063:	c1 e3 03             	shl    $0x3,%ebx
   11066:	50                   	push   %eax
   11067:	53                   	push   %ebx
   11068:	8b 45 0c             	mov    0xc(%ebp),%eax
   1106b:	50                   	push   %eax
   1106c:	8b 47 10             	mov    0x10(%edi),%eax
   1106f:	50                   	push   %eax
   11070:	e8 1b 04 00 00       	call   11490 <_RtlMoveMemory@12>
   11075:	8b 47 10             	mov    0x10(%edi),%eax
   11078:	01 d8                	add    %ebx,%eax
   1107a:	89 47 10             	mov    %eax,0x10(%edi)
   1107d:	8b 47 0c             	mov    0xc(%edi),%eax
   11080:	01 f0                	add    %esi,%eax
   11082:	89 47 0c             	mov    %eax,0xc(%edi)
   11085:	53                   	push   %ebx
   11086:	31 c0                	xor    %eax,%eax
   11088:	8a 45 f3             	mov    0xfffffff3(%ebp),%al
   1108b:	50                   	push   %eax
   1108c:	8b 4d e8             	mov    0xffffffe8(%ebp),%ecx
   1108f:	51                   	push   %ecx
   11090:	e8 0b 05 00 00       	call   115a0 <_KeReleaseSpinLock@8>
   11095:	58                   	pop    %eax
   11096:	b8 01 00 00 00       	mov    $0x1,%eax
   1109b:	5a                   	pop    %edx
   1109c:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   1109f:	5b                   	pop    %ebx
   110a0:	5e                   	pop    %esi
   110a1:	5f                   	pop    %edi
   110a2:	5d                   	pop    %ebp
   110a3:	c3                   	ret    
   110a4:	8b 4d 08             	mov    0x8(%ebp),%ecx
   110a7:	8b 59 14             	mov    0x14(%ecx),%ebx
   110aa:	c7 41 14 00 00 00 00 	movl   $0x0,0x14(%ecx)
   110b1:	8b 73 60             	mov    0x60(%ebx),%esi
   110b4:	50                   	push   %eax
   110b5:	6a 18                	push   $0x18
   110b7:	8b 45 0c             	mov    0xc(%ebp),%eax
   110ba:	50                   	push   %eax
   110bb:	8b 43 0c             	mov    0xc(%ebx),%eax
   110be:	50                   	push   %eax
   110bf:	e8 cc 03 00 00       	call   11490 <_RtlMoveMemory@12>
   110c4:	c7 43 18 00 00 00 00 	movl   $0x0,0x18(%ebx)
   110cb:	c7 43 1c 18 00 00 00 	movl   $0x18,0x1c(%ebx)
   110d2:	c7 46 04 18 00 00 00 	movl   $0x18,0x4(%esi)
   110d9:	50                   	push   %eax
   110da:	6a 00                	push   $0x0
   110dc:	8b 75 08             	mov    0x8(%ebp),%esi
   110df:	56                   	push   %esi
   110e0:	e8 bb 03 00 00       	call   114a0 <_IoStartNextPacket@8>
   110e5:	6a 06                	push   $0x6
   110e7:	53                   	push   %ebx
   110e8:	e8 c3 03 00 00       	call   114b0 <_IoCompleteRequest@8>
   110ed:	c6 47 09 00          	movb   $0x0,0x9(%edi)
   110f1:	8b 5d 0c             	mov    0xc(%ebp),%ebx
   110f4:	8b 4d ec             	mov    0xffffffec(%ebp),%ecx
   110f7:	83 c3 18             	add    $0x18,%ebx
   110fa:	49                   	dec    %ecx
   110fb:	89 5d 0c             	mov    %ebx,0xc(%ebp)
   110fe:	89 4d ec             	mov    %ecx,0xffffffec(%ebp)
   11101:	58                   	pop    %eax
   11102:	5a                   	pop    %edx
   11103:	e9 19 ff ff ff       	jmp    11021 <_MouseClassCallBack+0x21>
   11108:	90                   	nop    
   11109:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

00011110 <_ConnectMousePortDriver>:

NTSTATUS ConnectMousePortDriver(PDEVICE_OBJECT ClassDeviceObject)
{
   11110:	55                   	push   %ebp
   11111:	89 e5                	mov    %esp,%ebp
   11113:	57                   	push   %edi
   11114:	56                   	push   %esi
   11115:	53                   	push   %ebx
   11116:	83 ec 3c             	sub    $0x3c,%esp
   PDEVICE_OBJECT PortDeviceObject = NULL;
   PFILE_OBJECT FileObject = NULL;
   NTSTATUS status;
   UNICODE_STRING PortName = ROS_STRING_INITIALIZER(L"\\Device\\PointerClass0");
   IO_STATUS_BLOCK ioStatus;
   KEVENT event;
   PIRP irp;
   CLASS_INFORMATION ClassInformation;
   PDEVICE_EXTENSION DeviceExtension = ClassDeviceObject->DeviceExtension;

   // Get the port driver's DeviceObject
   // FIXME: The name might change.. find a way to be more dynamic?

   status = IoGetDeviceObjectPointer(&PortName, FILE_READ_ATTRIBUTES, &FileObject, &PortDeviceObject);
   11119:	8d 45 cc             	lea    0xffffffcc(%ebp),%eax
   1111c:	8b 7d 08             	mov    0x8(%ebp),%edi
   1111f:	c7 45 cc 00 00 00 00 	movl   $0x0,0xffffffcc(%ebp)
   11126:	c7 45 c8 00 00 00 00 	movl   $0x0,0xffffffc8(%ebp)
   1112d:	66 c7 45 d0 2a 00    	movw   $0x2a,0xffffffd0(%ebp)
   11133:	66 c7 45 d2 2c 00    	movw   $0x2c,0xffffffd2(%ebp)
   11139:	c7 45 d4 00 20 01 00 	movl   $0x12000,0xffffffd4(%ebp)
   11140:	8b 5f 28             	mov    0x28(%edi),%ebx
   11143:	50                   	push   %eax
   11144:	8d 45 c8             	lea    0xffffffc8(%ebp),%eax
   11147:	50                   	push   %eax
   11148:	8d 45 d0             	lea    0xffffffd0(%ebp),%eax
   1114b:	68 80 00 00 00       	push   $0x80
   11150:	50                   	push   %eax
   11151:	e8 6a 03 00 00       	call   114c0 <_IoGetDeviceObjectPointer@16>

   if(status != STATUS_SUCCESS)
   11156:	85 c0                	test   %eax,%eax
   11158:	74 08                	je     11162 <_ConnectMousePortDriver+0x52>
   {
      DPRINT("MOUCLASS: Could not connect to mouse port driver\n");
      DPRINT("Status: %x\n", status);
      return status;
   }

   DeviceExtension->PortDeviceObject = PortDeviceObject;
   DeviceExtension->PortData = ExAllocatePool(NonPagedPool, MOUSE_BUFFER_SIZE * sizeof(MOUSE_INPUT_DATA));
   DeviceExtension->InputCount = 0;
   DeviceExtension->ReadIsPending = FALSE;
   DeviceExtension->WorkItem = NULL;
   KeInitializeSpinLock(&(DeviceExtension->SpinLock));
   DeviceExtension->PassiveCallbackQueued = FALSE;

   // Connect our callback to the port driver

   KeInitializeEvent(&event, NotificationEvent, FALSE);

   ClassInformation.DeviceObject = ClassDeviceObject;
   ClassInformation.CallBack     = MouseClassCallBack;

   irp = IoBuildDeviceIoControlRequest(IOCTL_INTERNAL_MOUSE_CONNECT,
      PortDeviceObject, &ClassInformation, sizeof(CLASS_INFORMATION), NULL, 0, TRUE, &event, &ioStatus);

   status = IoCallDriver(DeviceExtension->PortDeviceObject, irp);

   if (status == STATUS_PENDING) {
      KeWaitForSingleObject(&event, Suspended, KernelMode, FALSE, NULL);
   } else {
      ioStatus.Status = status;
   }

   return ioStatus.Status;
}
   1115a:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   1115d:	5b                   	pop    %ebx
   1115e:	5e                   	pop    %esi
   1115f:	5f                   	pop    %edi
   11160:	5d                   	pop    %ebp
   11161:	c3                   	ret    
   11162:	8b 45 cc             	mov    0xffffffcc(%ebp),%eax
   11165:	89 43 14             	mov    %eax,0x14(%ebx)
   11168:	56                   	push   %esi
   11169:	56                   	push   %esi
   1116a:	68 00 03 00 00       	push   $0x300
   1116f:	6a 00                	push   $0x0
   11171:	e8 5a 03 00 00       	call   114d0 <_ExAllocatePool@8>
   11176:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
   1117d:	c6 43 09 00          	movb   $0x0,0x9(%ebx)
   11181:	89 43 10             	mov    %eax,0x10(%ebx)
   11184:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
   1118a:	8d 43 04             	lea    0x4(%ebx),%eax
   1118d:	51                   	push   %ecx
   1118e:	50                   	push   %eax
   1118f:	e8 4c 03 00 00       	call   114e0 <_KeInitializeSpinLock@4>
   11194:	c6 43 08 00          	movb   $0x0,0x8(%ebx)
   11198:	8d 75 d8             	lea    0xffffffd8(%ebp),%esi
   1119b:	58                   	pop    %eax
   1119c:	5a                   	pop    %edx
   1119d:	6a 00                	push   $0x0
   1119f:	6a 00                	push   $0x0
   111a1:	56                   	push   %esi
   111a2:	e8 49 03 00 00       	call   114f0 <_KeInitializeEvent@12>
   111a7:	89 7d c0             	mov    %edi,0xffffffc0(%ebp)
   111aa:	c7 45 c4 00 10 01 00 	movl   $0x11000,0xffffffc4(%ebp)
   111b1:	50                   	push   %eax
   111b2:	50                   	push   %eax
   111b3:	8d 45 b8             	lea    0xffffffb8(%ebp),%eax
   111b6:	50                   	push   %eax
   111b7:	8d 45 c0             	lea    0xffffffc0(%ebp),%eax
   111ba:	56                   	push   %esi
   111bb:	6a 01                	push   $0x1
   111bd:	6a 00                	push   $0x0
   111bf:	6a 00                	push   $0x0
   111c1:	6a 08                	push   $0x8
   111c3:	50                   	push   %eax
   111c4:	8b 7d cc             	mov    0xffffffcc(%ebp),%edi
   111c7:	57                   	push   %edi
   111c8:	68 03 02 0f 00       	push   $0xf0203
   111cd:	e8 2e 03 00 00       	call   11500 <_IoBuildDeviceIoControlRequest@36>
   111d2:	89 04 24             	mov    %eax,(%esp)
   111d5:	8b 5b 14             	mov    0x14(%ebx),%ebx
   111d8:	53                   	push   %ebx
   111d9:	e8 32 03 00 00       	call   11510 <_IoCallDriver@8>
   111de:	5a                   	pop    %edx
   111df:	3d 03 01 00 00       	cmp    $0x103,%eax
   111e4:	59                   	pop    %ecx
   111e5:	74 0b                	je     111f2 <_ConnectMousePortDriver+0xe2>
   111e7:	89 45 b8             	mov    %eax,0xffffffb8(%ebp)
   111ea:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   111ed:	5b                   	pop    %ebx
   111ee:	5e                   	pop    %esi
   111ef:	5f                   	pop    %edi
   111f0:	5d                   	pop    %ebp
   111f1:	c3                   	ret    
   111f2:	83 ec 0c             	sub    $0xc,%esp
   111f5:	6a 00                	push   $0x0
   111f7:	6a 00                	push   $0x0
   111f9:	6a 00                	push   $0x0
   111fb:	6a 05                	push   $0x5
   111fd:	56                   	push   %esi
   111fe:	e8 1d 03 00 00       	call   11520 <_KeWaitForSingleObject@20>
   11203:	8b 45 b8             	mov    0xffffffb8(%ebp),%eax
   11206:	83 c4 0c             	add    $0xc,%esp
   11209:	e9 4c ff ff ff       	jmp    1115a <_ConnectMousePortDriver+0x4a>
   1120e:	89 f6                	mov    %esi,%esi

00011210 <_MouseClassDispatch@8>:

NTSTATUS STDCALL MouseClassDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
   11210:	55                   	push   %ebp
   PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp);
   NTSTATUS Status;

   switch (Stack->MajorFunction)
   11211:	31 c0                	xor    %eax,%eax
   11213:	89 e5                	mov    %esp,%ebp
   11215:	56                   	push   %esi
   11216:	53                   	push   %ebx
   11217:	8b 5d 0c             	mov    0xc(%ebp),%ebx
   1121a:	8b 53 60             	mov    0x60(%ebx),%edx
   1121d:	8a 02                	mov    (%edx),%al
   1121f:	83 f8 02             	cmp    $0x2,%eax
   11222:	74 5c                	je     11280 <_MouseClassDispatch@8+0x70>
   11224:	7e 4d                	jle    11273 <_MouseClassDispatch@8+0x63>
   11226:	83 f8 03             	cmp    $0x3,%eax
   11229:	74 59                	je     11284 <_MouseClassDispatch@8+0x74>
   {
      case IRP_MJ_CREATE:
         Status = STATUS_SUCCESS;
         break;
	
      case IRP_MJ_CLOSE:
         Status = STATUS_SUCCESS;
         break;

      case IRP_MJ_READ:
         if (Stack->Parameters.Read.Length < sizeof(MOUSE_INPUT_DATA))
         {
            Status = STATUS_BUFFER_TOO_SMALL;
            break;
         }
         IoMarkIrpPending(Irp);
         IoStartPacket(DeviceObject, Irp, NULL, NULL);
	 return STATUS_PENDING;

      default:
         DPRINT1("NOT IMPLEMENTED\n");
   1122b:	50                   	push   %eax
   1122c:	68 ae 00 00 00       	push   $0xae
   11231:	68 2c 20 01 00       	push   $0x1202c
   11236:	68 37 20 01 00       	push   $0x12037
         Status = STATUS_NOT_IMPLEMENTED;
   1123b:	be 02 00 00 c0       	mov    $0xc0000002,%esi
   11240:	e8 3b 03 00 00       	call   11580 <_DbgPrint>
   11245:	c7 04 24 40 20 01 00 	movl   $0x12040,(%esp)
   1124c:	e8 2f 03 00 00       	call   11580 <_DbgPrint>
         break;
   11251:	83 c4 10             	add    $0x10,%esp
   }

   Irp->IoStatus.Status = Status;
   11254:	89 73 18             	mov    %esi,0x18(%ebx)
   Irp->IoStatus.Information = 0;
   11257:	c7 43 1c 00 00 00 00 	movl   $0x0,0x1c(%ebx)
   IoCompleteRequest(Irp, IO_NO_INCREMENT);
   1125e:	50                   	push   %eax
   1125f:	50                   	push   %eax
   11260:	6a 00                	push   $0x0
   11262:	53                   	push   %ebx
   11263:	e8 48 02 00 00       	call   114b0 <_IoCompleteRequest@8>

   return Status;
   11268:	89 f0                	mov    %esi,%eax
}
   1126a:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   1126d:	5b                   	pop    %ebx
   1126e:	5e                   	pop    %esi
   1126f:	5d                   	pop    %ebp
   11270:	c2 08 00             	ret    $0x8
   11273:	31 f6                	xor    %esi,%esi
   11275:	85 c0                	test   %eax,%eax
   11277:	74 db                	je     11254 <_MouseClassDispatch@8+0x44>
   11279:	eb b0                	jmp    1122b <_MouseClassDispatch@8+0x1b>
   1127b:	90                   	nop    
   1127c:	8d 74 26 00          	lea    0x0(%esi),%esi
   11280:	31 f6                	xor    %esi,%esi
   11282:	eb d0                	jmp    11254 <_MouseClassDispatch@8+0x44>
   11284:	be 23 00 00 c0       	mov    $0xc0000023,%esi
   11289:	83 7a 04 17          	cmpl   $0x17,0x4(%edx)
   1128d:	76 c5                	jbe    11254 <_MouseClassDispatch@8+0x44>
   1128f:	80 4a 03 01          	orb    $0x1,0x3(%edx)
   11293:	8b 45 08             	mov    0x8(%ebp),%eax
   11296:	6a 00                	push   $0x0
   11298:	6a 00                	push   $0x0
   1129a:	53                   	push   %ebx
   1129b:	50                   	push   %eax
   1129c:	e8 8f 02 00 00       	call   11530 <_IoStartPacket@16>
   112a1:	b8 03 01 00 00       	mov    $0x103,%eax
   112a6:	eb c2                	jmp    1126a <_MouseClassDispatch@8+0x5a>
   112a8:	90                   	nop    
   112a9:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

000112b0 <_MouseClassStartIo@8>:

VOID STDCALL
MouseClassStartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
   112b0:	55                   	push   %ebp
   112b1:	89 e5                	mov    %esp,%ebp
   112b3:	57                   	push   %edi
   112b4:	56                   	push   %esi
   112b5:	53                   	push   %ebx
   112b6:	83 ec 0c             	sub    $0xc,%esp
   PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
   112b9:	8b 45 08             	mov    0x8(%ebp),%eax
   112bc:	8b 75 0c             	mov    0xc(%ebp),%esi
   112bf:	8b 58 28             	mov    0x28(%eax),%ebx
   PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp);
   112c2:	8b 7e 60             	mov    0x60(%esi),%edi

   if (DeviceExtension->InputCount > 0)
   112c5:	8b 43 0c             	mov    0xc(%ebx),%eax
   112c8:	85 c0                	test   %eax,%eax
   112ca:	75 14                	jne    112e0 <_MouseClassStartIo@8+0x30>
   {
      KIRQL oldIrql;

      KeAcquireSpinLock(&DeviceExtension->SpinLock, &oldIrql);

      RtlMoveMemory(Irp->AssociatedIrp.SystemBuffer,
                    DeviceExtension->PortData - DeviceExtension->InputCount,
                    sizeof(MOUSE_INPUT_DATA));

      if (DeviceExtension->InputCount > 1)
      {
         RtlMoveMemory(
            DeviceExtension->PortData - DeviceExtension->InputCount,
            DeviceExtension->PortData - DeviceExtension->InputCount + 1,
            (DeviceExtension->InputCount - 1) * sizeof(MOUSE_INPUT_DATA));
      }
      DeviceExtension->PortData--;
      DeviceExtension->InputCount--;
      DeviceExtension->ReadIsPending = FALSE;

      /* Go to next packet and complete this request with STATUS_SUCCESS */
      Irp->IoStatus.Status = STATUS_SUCCESS;
      Irp->IoStatus.Information = sizeof(MOUSE_INPUT_DATA);
      Stack->Parameters.Read.Length = sizeof(MOUSE_INPUT_DATA);
      IoCompleteRequest(Irp, IO_MOUSE_INCREMENT);

      IoStartNextPacket(DeviceObject, FALSE);
      KeReleaseSpinLock(&DeviceExtension->SpinLock, oldIrql);
   } else {
      DeviceExtension->ReadIsPending = TRUE;
   112cc:	c6 43 09 01          	movb   $0x1,0x9(%ebx)
   }
}
   112d0:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   112d3:	5b                   	pop    %ebx
   112d4:	5e                   	pop    %esi
   112d5:	5f                   	pop    %edi
   112d6:	5d                   	pop    %ebp
   112d7:	c2 08 00             	ret    $0x8
   112da:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
   112e0:	50                   	push   %eax
   112e1:	50                   	push   %eax
   112e2:	8d 45 f3             	lea    0xfffffff3(%ebp),%eax
   112e5:	50                   	push   %eax
   112e6:	8d 43 04             	lea    0x4(%ebx),%eax
   112e9:	89 45 ec             	mov    %eax,0xffffffec(%ebp)
   112ec:	50                   	push   %eax
   112ed:	e8 9e 02 00 00       	call   11590 <_KeAcquireSpinLock@8>
   112f2:	c7 04 24 18 00 00 00 	movl   $0x18,(%esp)
   112f9:	8b 53 0c             	mov    0xc(%ebx),%edx
   112fc:	8b 43 10             	mov    0x10(%ebx),%eax
   112ff:	8d 14 52             	lea    (%edx,%edx,2),%edx
   11302:	c1 e2 03             	shl    $0x3,%edx
   11305:	29 d0                	sub    %edx,%eax
   11307:	50                   	push   %eax
   11308:	8b 46 0c             	mov    0xc(%esi),%eax
   1130b:	50                   	push   %eax
   1130c:	e8 7f 01 00 00       	call   11490 <_RtlMoveMemory@12>
   11311:	8b 43 0c             	mov    0xc(%ebx),%eax
   11314:	59                   	pop    %ecx
   11315:	83 f8 01             	cmp    $0x1,%eax
   11318:	77 56                	ja     11370 <_MouseClassStartIo@8+0xc0>
   1131a:	8b 53 10             	mov    0x10(%ebx),%edx
   1131d:	48                   	dec    %eax
   1131e:	83 ea 18             	sub    $0x18,%edx
   11321:	89 43 0c             	mov    %eax,0xc(%ebx)
   11324:	89 53 10             	mov    %edx,0x10(%ebx)
   11327:	c6 43 09 00          	movb   $0x0,0x9(%ebx)
   1132b:	c7 46 18 00 00 00 00 	movl   $0x0,0x18(%esi)
   11332:	c7 46 1c 18 00 00 00 	movl   $0x18,0x1c(%esi)
   11339:	c7 47 04 18 00 00 00 	movl   $0x18,0x4(%edi)
   11340:	57                   	push   %edi
   11341:	57                   	push   %edi
   11342:	6a 06                	push   $0x6
   11344:	56                   	push   %esi
   11345:	e8 66 01 00 00       	call   114b0 <_IoCompleteRequest@8>
   1134a:	6a 00                	push   $0x0
   1134c:	8b 5d 08             	mov    0x8(%ebp),%ebx
   1134f:	53                   	push   %ebx
   11350:	e8 4b 01 00 00       	call   114a0 <_IoStartNextPacket@8>
   11355:	31 c0                	xor    %eax,%eax
   11357:	8a 45 f3             	mov    0xfffffff3(%ebp),%al
   1135a:	50                   	push   %eax
   1135b:	8b 4d ec             	mov    0xffffffec(%ebp),%ecx
   1135e:	51                   	push   %ecx
   1135f:	e8 3c 02 00 00       	call   115a0 <_KeReleaseSpinLock@8>
   11364:	58                   	pop    %eax
   11365:	5a                   	pop    %edx
   11366:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11369:	5b                   	pop    %ebx
   1136a:	5e                   	pop    %esi
   1136b:	5f                   	pop    %edi
   1136c:	5d                   	pop    %ebp
   1136d:	c2 08 00             	ret    $0x8
   11370:	52                   	push   %edx
   11371:	8d 14 40             	lea    (%eax,%eax,2),%edx
   11374:	c1 e2 03             	shl    $0x3,%edx
   11377:	8d 42 e8             	lea    0xffffffe8(%edx),%eax
   1137a:	50                   	push   %eax
   1137b:	8b 43 10             	mov    0x10(%ebx),%eax
   1137e:	29 d0                	sub    %edx,%eax
   11380:	83 c0 18             	add    $0x18,%eax
   11383:	50                   	push   %eax
   11384:	8b 53 0c             	mov    0xc(%ebx),%edx
   11387:	8b 43 10             	mov    0x10(%ebx),%eax
   1138a:	8d 14 52             	lea    (%edx,%edx,2),%edx
   1138d:	c1 e2 03             	shl    $0x3,%edx
   11390:	29 d0                	sub    %edx,%eax
   11392:	50                   	push   %eax
   11393:	e8 f8 00 00 00       	call   11490 <_RtlMoveMemory@12>
   11398:	8b 43 0c             	mov    0xc(%ebx),%eax
   1139b:	59                   	pop    %ecx
   1139c:	e9 79 ff ff ff       	jmp    1131a <_MouseClassStartIo@8+0x6a>
   113a1:	eb 0d                	jmp    113b0 <_DriverEntry@8>
   113a3:	90                   	nop    
   113a4:	90                   	nop    
   113a5:	90                   	nop    
   113a6:	90                   	nop    
   113a7:	90                   	nop    
   113a8:	90                   	nop    
   113a9:	90                   	nop    
   113aa:	90                   	nop    
   113ab:	90                   	nop    
   113ac:	90                   	nop    
   113ad:	90                   	nop    
   113ae:	90                   	nop    
   113af:	90                   	nop    

000113b0 <_DriverEntry@8>:

NTSTATUS STDCALL
DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
   113b0:	55                   	push   %ebp
   113b1:	89 e5                	mov    %esp,%ebp
   113b3:	57                   	push   %edi
   113b4:	56                   	push   %esi
   113b5:	53                   	push   %ebx
   113b6:	83 ec 20             	sub    $0x20,%esp
   PDEVICE_OBJECT DeviceObject;
   UNICODE_STRING DeviceName = ROS_STRING_INITIALIZER(L"\\Device\\Mouse");
   UNICODE_STRING SymlinkName = ROS_STRING_INITIALIZER(L"\\??\\Mouse");
   NTSTATUS Status;

   DriverObject->MajorFunction[IRP_MJ_CREATE] = MouseClassDispatch;
   DriverObject->MajorFunction[IRP_MJ_CLOSE]  = MouseClassDispatch;
   DriverObject->MajorFunction[IRP_MJ_READ]   = MouseClassDispatch;
   DriverObject->DriverStartIo                = MouseClassStartIo;

   Status = IoCreateDevice(DriverObject,
   113b9:	8d 45 dc             	lea    0xffffffdc(%ebp),%eax
   113bc:	8b 55 08             	mov    0x8(%ebp),%edx
   113bf:	66 c7 45 e8 1a 00    	movw   $0x1a,0xffffffe8(%ebp)
   113c5:	66 c7 45 ea 1c 00    	movw   $0x1c,0xffffffea(%ebp)
   113cb:	c7 45 ec 52 20 01 00 	movl   $0x12052,0xffffffec(%ebp)
   113d2:	66 c7 45 e0 12 00    	movw   $0x12,0xffffffe0(%ebp)
   113d8:	66 c7 45 e2 14 00    	movw   $0x14,0xffffffe2(%ebp)
   113de:	c7 45 e4 6e 20 01 00 	movl   $0x1206e,0xffffffe4(%ebp)
   113e5:	c7 42 38 10 12 01 00 	movl   $0x11210,0x38(%edx)
   113ec:	c7 42 40 10 12 01 00 	movl   $0x11210,0x40(%edx)
   113f3:	c7 42 44 10 12 01 00 	movl   $0x11210,0x44(%edx)
   113fa:	c7 42 30 b0 12 01 00 	movl   $0x112b0,0x30(%edx)
   11401:	8d 75 e8             	lea    0xffffffe8(%ebp),%esi
   11404:	50                   	push   %eax
   11405:	6a 01                	push   $0x1
   11407:	6a 00                	push   $0x0
   11409:	6a 0f                	push   $0xf
   1140b:	56                   	push   %esi
   1140c:	6a 18                	push   $0x18
   1140e:	52                   	push   %edx
   1140f:	e8 2c 01 00 00       	call   11540 <_IoCreateDevice@28>
   11414:	8d 7d e0             	lea    0xffffffe0(%ebp),%edi
			   sizeof(DEVICE_EXTENSION),
			   &DeviceName,
			   FILE_DEVICE_MOUSE,
			   0,
			   TRUE,
			   &DeviceObject);
   if (!NT_SUCCESS(Status))
   11417:	59                   	pop    %ecx
   11418:	85 c0                	test   %eax,%eax
   1141a:	78 34                	js     11450 <_DriverEntry@8+0xa0>
   {
      return(Status);
   }

   DeviceObject->Flags = DeviceObject->Flags | DO_BUFFERED_IO;
   1141c:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
   1141f:	8b 50 1c             	mov    0x1c(%eax),%edx
   11422:	83 ca 04             	or     $0x4,%edx
   11425:	89 50 1c             	mov    %edx,0x1c(%eax)

   Status = IoCreateSymbolicLink(&SymlinkName, &DeviceName);
   11428:	53                   	push   %ebx
   11429:	53                   	push   %ebx
   1142a:	56                   	push   %esi
   1142b:	57                   	push   %edi
   1142c:	e8 1f 01 00 00       	call   11550 <_IoCreateSymbolicLink@8>
   if (!NT_SUCCESS(Status))
   11431:	5a                   	pop    %edx
   11432:	89 c3                	mov    %eax,%ebx
   11434:	59                   	pop    %ecx
   11435:	85 c0                	test   %eax,%eax
   11437:	78 27                	js     11460 <_DriverEntry@8+0xb0>
   {
      IoDeleteDevice(DeviceObject);
      return Status;
   }

   Status = ConnectMousePortDriver(DeviceObject);
   11439:	83 ec 0c             	sub    $0xc,%esp
   1143c:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
   1143f:	50                   	push   %eax
   11440:	e8 cb fc ff ff       	call   11110 <_ConnectMousePortDriver>
   11445:	89 c3                	mov    %eax,%ebx
   if (!NT_SUCCESS(Status))
   11447:	83 c4 10             	add    $0x10,%esp
   {
      IoDeleteSymbolicLink(&SymlinkName);
      IoDeleteDevice(DeviceObject);
      return Status;
   }

   return STATUS_SUCCESS;
   1144a:	31 c0                	xor    %eax,%eax
   1144c:	85 db                	test   %ebx,%ebx
   1144e:	78 28                	js     11478 <_DriverEntry@8+0xc8>
}
   11450:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11453:	5b                   	pop    %ebx
   11454:	5e                   	pop    %esi
   11455:	5f                   	pop    %edi
   11456:	5d                   	pop    %ebp
   11457:	c2 08 00             	ret    $0x8
   1145a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
   11460:	83 ec 0c             	sub    $0xc,%esp
   11463:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
   11466:	50                   	push   %eax
   11467:	e8 f4 00 00 00       	call   11560 <_IoDeleteDevice@4>
   1146c:	89 d8                	mov    %ebx,%eax
   1146e:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11471:	5b                   	pop    %ebx
   11472:	5e                   	pop    %esi
   11473:	5f                   	pop    %edi
   11474:	5d                   	pop    %ebp
   11475:	c2 08 00             	ret    $0x8
   11478:	83 ec 0c             	sub    $0xc,%esp
   1147b:	57                   	push   %edi
   1147c:	e8 ef 00 00 00       	call   11570 <_IoDeleteSymbolicLink@4>
   11481:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
   11484:	50                   	push   %eax
   11485:	e8 d6 00 00 00       	call   11560 <_IoDeleteDevice@4>
   1148a:	89 d8                	mov    %ebx,%eax
   1148c:	eb e0                	jmp    1146e <_DriverEntry@8+0xbe>
   1148e:	90                   	nop    
   1148f:	90                   	nop    

00011490 <_RtlMoveMemory@12>:
   11490:	ff 25 e4 30 01 00    	jmp    *0x130e4
   11496:	90                   	nop    
   11497:	90                   	nop    
	...

000114a0 <_IoStartNextPacket@8>:
   114a0:	ff 25 d0 30 01 00    	jmp    *0x130d0
   114a6:	90                   	nop    
   114a7:	90                   	nop    
	...

000114b0 <_IoCompleteRequest@8>:
   114b0:	ff 25 b8 30 01 00    	jmp    *0x130b8
   114b6:	90                   	nop    
   114b7:	90                   	nop    
	...

000114c0 <_IoGetDeviceObjectPointer@16>:
   114c0:	ff 25 cc 30 01 00    	jmp    *0x130cc
   114c6:	90                   	nop    
   114c7:	90                   	nop    
	...

000114d0 <_ExAllocatePool@8>:
   114d0:	ff 25 ac 30 01 00    	jmp    *0x130ac
   114d6:	90                   	nop    
   114d7:	90                   	nop    
	...

000114e0 <_KeInitializeSpinLock@4>:
   114e0:	ff 25 dc 30 01 00    	jmp    *0x130dc
   114e6:	90                   	nop    
   114e7:	90                   	nop    
	...

000114f0 <_KeInitializeEvent@12>:
   114f0:	ff 25 d8 30 01 00    	jmp    *0x130d8
   114f6:	90                   	nop    
   114f7:	90                   	nop    
	...

00011500 <_IoBuildDeviceIoControlRequest@36>:
   11500:	ff 25 b0 30 01 00    	jmp    *0x130b0
   11506:	90                   	nop    
   11507:	90                   	nop    
	...

00011510 <_IoCallDriver@8>:
   11510:	ff 25 b4 30 01 00    	jmp    *0x130b4
   11516:	90                   	nop    
   11517:	90                   	nop    
	...

00011520 <_KeWaitForSingleObject@20>:
   11520:	ff 25 e0 30 01 00    	jmp    *0x130e0
   11526:	90                   	nop    
   11527:	90                   	nop    
	...

00011530 <_IoStartPacket@16>:
   11530:	ff 25 d4 30 01 00    	jmp    *0x130d4
   11536:	90                   	nop    
   11537:	90                   	nop    
	...

00011540 <_IoCreateDevice@28>:
   11540:	ff 25 bc 30 01 00    	jmp    *0x130bc
   11546:	90                   	nop    
   11547:	90                   	nop    
	...

00011550 <_IoCreateSymbolicLink@8>:
   11550:	ff 25 c0 30 01 00    	jmp    *0x130c0
   11556:	90                   	nop    
   11557:	90                   	nop    
	...

00011560 <_IoDeleteDevice@4>:
   11560:	ff 25 c4 30 01 00    	jmp    *0x130c4
   11566:	90                   	nop    
   11567:	90                   	nop    
	...

00011570 <_IoDeleteSymbolicLink@4>:
   11570:	ff 25 c8 30 01 00    	jmp    *0x130c8
   11576:	90                   	nop    
   11577:	90                   	nop    
	...

00011580 <_DbgPrint>:
   11580:	ff 25 a8 30 01 00    	jmp    *0x130a8
   11586:	90                   	nop    
   11587:	90                   	nop    
	...

00011590 <_KeAcquireSpinLock@8>:
   11590:	ff 25 98 30 01 00    	jmp    *0x13098
   11596:	90                   	nop    
   11597:	90                   	nop    
	...

000115a0 <_KeReleaseSpinLock@8>:
   115a0:	ff 25 9c 30 01 00    	jmp    *0x1309c
   115a6:	90                   	nop    
   115a7:	90                   	nop    
	...

000115b0 <__CTOR_LIST__>:
   115b0:	ff                   	(bad)  
   115b1:	ff                   	(bad)  
   115b2:	ff                   	(bad)  
   115b3:	ff 00                	incl   (%eax)
   115b5:	00 00                	add    %al,(%eax)
	...

000115b8 <__DTOR_LIST__>:
   115b8:	ff                   	(bad)  
   115b9:	ff                   	(bad)  
   115ba:	ff                   	(bad)  
   115bb:	ff 00                	incl   (%eax)
   115bd:	00 00                	add    %al,(%eax)
	...
