2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: ntoskrnl/io/iomgr.c
5 * PURPOSE: Initializes the io manager
6 * PROGRAMMER: David Welch (welch@mcmail.com)
11 /* INCLUDES ****************************************************************/
14 #include <ddk/ntddk.h>
15 #include <internal/ob.h>
16 #include <internal/io.h>
19 #include <internal/debug.h>
21 /* GLOBALS *******************************************************************/
23 POBJECT_TYPE IoDeviceType
= NULL
;
24 POBJECT_TYPE IoFileType
= NULL
;
27 /* FUNCTIONS ****************************************************************/
31 OBJECT_ATTRIBUTES attr
;
33 UNICODE_STRING UnicodeString
;
34 ANSI_STRING AnsiString
;
37 * Register iomgr types
39 IoDeviceType
= ExAllocatePool(NonPagedPool
,sizeof(OBJECT_TYPE
));
41 IoDeviceType
->TotalObjects
= 0;
42 IoDeviceType
->TotalHandles
= 0;
43 IoDeviceType
->MaxObjects
= ULONG_MAX
;
44 IoDeviceType
->MaxHandles
= ULONG_MAX
;
45 IoDeviceType
->PagedPoolCharge
= 0;
46 IoDeviceType
->NonpagedPoolCharge
= sizeof(DEVICE_OBJECT
);
47 IoDeviceType
->Dump
= NULL
;
48 IoDeviceType
->Open
= NULL
;
49 IoDeviceType
->Close
= NULL
;
50 IoDeviceType
->Delete
= NULL
;
51 IoDeviceType
->Parse
= NULL
;
52 IoDeviceType
->Security
= NULL
;
53 IoDeviceType
->QueryName
= NULL
;
54 IoDeviceType
->OkayToClose
= NULL
;
56 RtlInitAnsiString(&AnsiString
,"Device");
57 RtlAnsiStringToUnicodeString(&IoDeviceType
->TypeName
,&AnsiString
,TRUE
);
59 IoFileType
= ExAllocatePool(NonPagedPool
,sizeof(OBJECT_TYPE
));
61 IoFileType
->TotalObjects
= 0;
62 IoFileType
->TotalHandles
= 0;
63 IoFileType
->MaxObjects
= ULONG_MAX
;
64 IoFileType
->MaxHandles
= ULONG_MAX
;
65 IoFileType
->PagedPoolCharge
= 0;
66 IoFileType
->NonpagedPoolCharge
= sizeof(FILE_OBJECT
);
67 IoFileType
->Dump
= NULL
;
68 IoFileType
->Open
= NULL
;
69 IoFileType
->Close
= NULL
;
70 IoFileType
->Delete
= NULL
;
71 IoFileType
->Parse
= NULL
;
72 IoFileType
->Security
= NULL
;
73 IoFileType
->QueryName
= NULL
;
74 IoFileType
->OkayToClose
= NULL
;
76 RtlInitAnsiString(&AnsiString
,"File");
77 RtlAnsiStringToUnicodeString(&IoFileType
->TypeName
,&AnsiString
,TRUE
);
80 * Create the device directory
82 RtlInitAnsiString(&AnsiString
,"\\Device");
83 RtlAnsiStringToUnicodeString(&UnicodeString
,&AnsiString
,TRUE
);
84 InitializeObjectAttributes(&attr
,&UnicodeString
,0,NULL
,NULL
);
85 ZwCreateDirectoryObject(&handle
,0,&attr
);
87 RtlInitAnsiString(&AnsiString
,"\\??");
88 RtlAnsiStringToUnicodeString(&UnicodeString
,&AnsiString
,TRUE
);
89 InitializeObjectAttributes(&attr
,&UnicodeString
,0,NULL
,NULL
);
90 ZwCreateDirectoryObject(&handle
,0,&attr
);
92 IoInitCancelHandling();
93 IoInitSymbolicLinkImplementation();
94 IoInitFileSystemImplementation();