[KSECDD]
[reactos.git] / reactos / drivers / crypto / ksecdd / dispatch.c
1 /*
2 * PROJECT: ReactOS Drivers
3 * COPYRIGHT: See COPYING in the top level directory
4 * PURPOSE: Kernel Security Support Provider Interface Driver
5 *
6 * PROGRAMMERS: Timo Kreuzer (timo.kreuzer@reactos.org)
7 */
8
9 /* INCLUDES *******************************************************************/
10
11 #include "ksecdd.h"
12
13 #define NDEBUG
14 #include <debug.h>
15
16
17 /* FUNCTIONS ******************************************************************/
18
19 NTSTATUS
20 NTAPI
21 KsecDdDispatch(
22 PDEVICE_OBJECT DeviceObject,
23 PIRP Irp)
24 {
25 PIO_STACK_LOCATION IoStackLocation;
26 ULONG_PTR Information;
27 NTSTATUS Status;
28
29 IoStackLocation = IoGetCurrentIrpStackLocation(Irp);
30
31 switch (IoStackLocation->MajorFunction)
32 {
33 case IRP_MJ_CREATE:
34 case IRP_MJ_CLOSE:
35
36 /* Just return success */
37 Status = STATUS_SUCCESS;
38 Information = 0;
39 break;
40
41 case IRP_MJ_READ:
42
43 /* There is nothing to read */
44 Status = STATUS_END_OF_FILE;
45 Information = 0;
46 break;
47
48 case IRP_MJ_WRITE:
49
50 /* Pretend to have written everything */
51 Status = STATUS_SUCCESS;
52 Information = IoStackLocation->Parameters.Write.Length;
53 break;
54
55 default:
56 DPRINT1("Unhandled major function %lu!\n",
57 IoStackLocation->MajorFunction);
58 ASSERT(FALSE);
59 }
60
61 /* Return the information */
62 Irp->IoStatus.Status = Status;
63 Irp->IoStatus.Information = Information;
64
65 /* Complete the request */
66 IoCompleteRequest(Irp, IO_NO_INCREMENT);
67
68 return Status;
69 }