SVN maintenance:
[reactos.git] / reactos / drivers / usb / cromwell / core / usbcore.c
1 /*
2 ReactOS specific functions for usbcore module
3 by Aleksey Bragin (aleksey@reactos.com)
4 */
5
6 #include <ddk/ntddk.h>
7 #include <debug.h>
8
9 NTSTATUS AddDevice(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT pdo)
10 {
11 DbgPrint("usbcore: AddDevice called\n");
12
13 /* we need to do kind of this stuff here (as usual)
14 PDEVICE_OBJECT fdo;
15 IoCreateDevice(..., &fdo);
16 pdx->LowerDeviceObject =
17 IoAttachDeviceToDeviceStack(fdo, pdo);*/
18
19 return STATUS_SUCCESS;
20 }
21
22 VOID DriverUnload(PDRIVER_OBJECT DriverObject)
23 {
24 // nothing to do here yet
25 }
26
27 // Dispatch PNP
28 NTSTATUS DispatchPnp(PDEVICE_OBJECT fdo, PIRP Irp)
29 {
30 ULONG fcn;
31 PIO_STACK_LOCATION stack;
32
33 stack = IoGetCurrentIrpStackLocation(Irp);
34 fcn = stack->MinorFunction;
35 DbgPrint("IRP_MJ_PNP, fcn=%d\n", fcn);
36
37 if (fcn == IRP_MN_REMOVE_DEVICE)
38 {
39 IoDeleteDevice(fdo);
40 }
41
42 return STATUS_SUCCESS;
43 }
44
45 NTSTATUS DispatchPower(PDEVICE_OBJECT fido, PIRP Irp)
46 {
47 DbgPrint("IRP_MJ_POWER dispatch\n");
48 return STATUS_SUCCESS;
49 }
50
51 /*
52 * Standard DriverEntry method.
53 */
54 NTSTATUS STDCALL
55 DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegPath)
56 {
57 DriverObject->DriverUnload = DriverUnload;
58 DriverObject->DriverExtension->AddDevice = AddDevice;
59 DriverObject->MajorFunction[IRP_MJ_PNP] = DispatchPnp;
60 DriverObject->MajorFunction[IRP_MJ_POWER] = DispatchPower;
61
62 return STATUS_SUCCESS;
63 }