This commit was generated by cvs2svn to compensate for changes in r21,
[reactos.git] / reactos / ntoskrnl / io / iomgr.c
1 /*
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)
7 * REVISION HISTORY:
8 * 29/07/98: Created
9 */
10
11 /* INCLUDES ****************************************************************/
12
13 #include <windows.h>
14 #include <ddk/ntddk.h>
15 #include <internal/kernel.h>
16 #include <internal/objmgr.h>
17
18 /* GLOBALS *******************************************************************/
19
20 OBJECT_TYPE DeviceObjectType = {{0,0,NULL},
21 0,
22 0,
23 ULONG_MAX,
24 ULONG_MAX,
25 sizeof(DEVICE_OBJECT),
26 0,
27 NULL,
28 NULL,
29 NULL,
30 NULL,
31 NULL,
32 NULL,
33 NULL,
34 NULL,
35 };
36
37 OBJECT_TYPE FileObjectType = {{0,0,NULL},
38 0,
39 0,
40 ULONG_MAX,
41 ULONG_MAX,
42 sizeof(FILE_OBJECT),
43 0,
44 NULL,
45 NULL,
46 NULL,
47 NULL,
48 NULL,
49 NULL,
50 NULL,
51 NULL,
52 };
53
54
55 /* FUNCTIONS ****************************************************************/
56
57 VOID IoInit(VOID)
58 {
59 OBJECT_ATTRIBUTES attr;
60 HANDLE handle;
61 UNICODE_STRING string;
62 ANSI_STRING astring;
63
64 /*
65 * Register iomgr types
66 */
67 RtlInitAnsiString(&astring,"Device");
68 RtlAnsiStringToUnicodeString(&DeviceObjectType.TypeName,&astring,TRUE);
69 ObRegisterType(OBJTYP_DEVICE,&DeviceObjectType);
70
71 RtlInitAnsiString(&astring,"File");
72 RtlAnsiStringToUnicodeString(&FileObjectType.TypeName,&astring,TRUE);
73 ObRegisterType(OBJTYP_FILE,&FileObjectType);
74
75 /*
76 * Create the device directory
77 */
78 RtlInitAnsiString(&astring,"\\Device");
79 RtlAnsiStringToUnicodeString(&string,&astring,TRUE);
80 InitializeObjectAttributes(&attr,&string,0,NULL,NULL);
81 ZwCreateDirectoryObject(&handle,0,&attr);
82
83 IoInitCancelHandling();
84 IoInitSymbolicLinkImplementation();
85 }