New debug scheme with explicit debug channels declaration.
[wine] / dlls / ntdll / om.c
1 /*
2  *      Object management functions
3  */
4
5 #include <stdlib.h>
6 #include <string.h>
7 #include "debug.h"
8
9 #include "ntddk.h"
10
11 DEFAULT_DEBUG_CHANNEL(ntdll)
12
13 /* move to somewhere */
14 typedef void * POBJDIR_INFORMATION;
15
16 /*
17  *      Generic object functions
18  */
19  
20 /******************************************************************************
21  * NtQueryObject [NTDLL.161]
22  */
23 NTSTATUS WINAPI NtQueryObject(
24         IN HANDLE ObjectHandle,
25         IN OBJECT_INFORMATION_CLASS ObjectInformationClass,
26         OUT PVOID ObjectInformation,
27         IN ULONG Length,
28         OUT PULONG ResultLength)
29 {
30         FIXME(ntdll,"(0x%08x,0x%08x,%p,0x%08lx,%p): stub\n",
31         ObjectHandle, ObjectInformationClass, ObjectInformation, Length, ResultLength);
32         return 0;
33 }
34
35 /******************************************************************************
36  *  NtQuerySecurityObject       [NTDLL] 
37  */
38 NTSTATUS WINAPI NtQuerySecurityObject(DWORD x1,DWORD x2,DWORD x3,DWORD x4,DWORD x5) 
39 {
40         FIXME(ntdll,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx,0x%08lx) stub!\n",x1,x2,x3,x4,x5);
41         return 0;
42 }
43 /******************************************************************************
44  *  NtDuplicateObject           [NTDLL] 
45  */
46 NTSTATUS WINAPI NtDuplicateObject(
47         IN HANDLE SourceProcessHandle,
48         IN PHANDLE SourceHandle,
49         IN HANDLE TargetProcessHandle,
50         OUT PHANDLE TargetHandle,
51         IN ACCESS_MASK DesiredAccess,
52         IN BOOLEAN InheritHandle,
53         ULONG Options)
54 {
55         FIXME(ntdll,"(0x%08x,%p,0x%08x,%p,0x%08lx,0x%08x,0x%08lx) stub!\n",
56         SourceProcessHandle,SourceHandle,TargetProcessHandle,TargetHandle,
57         DesiredAccess,InheritHandle,Options);
58         *TargetHandle = 0;
59         return 0;
60 }
61
62 /**************************************************************************
63  *                 NtClose                              [NTDLL.65]
64  * FUNCTION: Closes a handle reference to an object
65  * ARGUMENTS:
66  *      Handle  handle to close
67  */
68 NTSTATUS WINAPI NtClose(
69         HANDLE Handle) 
70 {
71         FIXME(ntdll,"(0x%08x),stub!\n",Handle);
72         return 1;
73 }
74
75 /******************************************************************************
76  *  NtWaitForSingleObject               [NTDLL] 
77  */
78 NTSTATUS WINAPI NtWaitForSingleObject(
79         IN PHANDLE Object,
80         IN BOOLEAN Alertable,
81         IN PLARGE_INTEGER Time)
82 {
83         FIXME(ntdll,"(%p,0x%08x,%p),stub!\n",Object,Alertable,Time);
84         return 0;
85 }
86
87 /*
88  *      Directory functions
89  */
90
91 /**************************************************************************
92  * NtOpenDirectoryObject [NTDLL.124]
93  * FUNCTION: Opens a namespace directory object
94  * ARGUMENTS:
95  *  DirectoryHandle     Variable which receives the directory handle
96  *  DesiredAccess       Desired access to the directory
97  *  ObjectAttributes    Structure describing the directory
98  * RETURNS: Status
99  */
100 NTSTATUS WINAPI NtOpenDirectoryObject(
101         PHANDLE DirectoryHandle,
102         ACCESS_MASK DesiredAccess,
103         POBJECT_ATTRIBUTES ObjectAttributes)
104 {
105     FIXME(ntdll,"(%p,0x%08lx,%p(%s)): stub\n", 
106     DirectoryHandle, DesiredAccess, ObjectAttributes,
107     ObjectAttributes ? debugstr_w(ObjectAttributes->ObjectName->Buffer) : NULL);
108     return 0;
109 }
110
111 /******************************************************************************
112  *  NtCreateDirectoryObject     [NTDLL] 
113  */
114 NTSTATUS WINAPI NtCreateDirectoryObject(
115         PHANDLE DirectoryHandle,
116         ACCESS_MASK DesiredAccess,
117         POBJECT_ATTRIBUTES ObjectAttributes) 
118 {
119         FIXME(ntdll,"(%p,0x%08lx,%p(%s)),stub!\n",
120         DirectoryHandle,DesiredAccess,ObjectAttributes,
121         ObjectAttributes ? debugstr_w(ObjectAttributes->ObjectName->Buffer) : NULL);
122         return 0;
123 }
124
125 /******************************************************************************
126  * NtQueryDirectoryObject [NTDLL.149] 
127  * FUNCTION: Reads information from a namespace directory
128  * ARGUMENTS:
129  *  DirObjInformation   Buffer to hold the data read
130  *  BufferLength        Size of the buffer in bytes
131  *  GetNextIndex        If TRUE then set ObjectIndex to the index of the next object
132  *                      If FALSE then set ObjectIndex to the number of objects in the directory
133  *  IgnoreInputIndex    If TRUE start reading at index 0
134  *                      If FALSE start reading at the index specified by object index
135  *  ObjectIndex         Zero based index into the directory, interpretation depends on IgnoreInputIndex and GetNextIndex
136  *  DataWritten         Caller supplied storage for the number of bytes written (or NULL)
137  */
138 NTSTATUS WINAPI NtQueryDirectoryObject(
139         IN HANDLE DirObjHandle,
140         OUT POBJDIR_INFORMATION DirObjInformation,
141         IN ULONG BufferLength,
142         IN BOOLEAN GetNextIndex,
143         IN BOOLEAN IgnoreInputIndex,
144         IN OUT PULONG ObjectIndex,
145         OUT PULONG DataWritten OPTIONAL)
146 {
147         FIXME(ntdll,"(0x%08x,%p,0x%08lx,0x%08x,0x%08x,%p,%p) stub\n",
148                 DirObjHandle, DirObjInformation, BufferLength, GetNextIndex,
149                 IgnoreInputIndex, ObjectIndex, DataWritten);
150     return 0xc0000000; /* We don't have any. Whatever. (Yet.) */
151 }
152
153 /*
154  *      Link objects
155  */
156  
157 /******************************************************************************
158  *  NtOpenSymbolicLinkObject    [NTDLL] 
159  */
160 NTSTATUS WINAPI NtOpenSymbolicLinkObject(
161         OUT PHANDLE LinkHandle,
162         IN ACCESS_MASK DesiredAccess,
163         IN POBJECT_ATTRIBUTES ObjectAttributes)
164 {
165         FIXME(ntdll,"(%p,0x%08lx,%p(%s)) stub\n",
166         LinkHandle, DesiredAccess, ObjectAttributes,
167         ObjectAttributes ? debugstr_w(ObjectAttributes->ObjectName->Buffer) : NULL);
168         return 0;
169 }
170
171 /******************************************************************************
172  *  NtCreateSymbolicLinkObject  [NTDLL] 
173  */
174 NTSTATUS WINAPI NtCreateSymbolicLinkObject(
175         OUT PHANDLE SymbolicLinkHandle,
176         IN ACCESS_MASK DesiredAccess,
177         IN POBJECT_ATTRIBUTES ObjectAttributes,
178         IN PUNICODE_STRING Name)
179 {
180         FIXME(ntdll,"(%p,0x%08lx,%p(%s), %p) stub\n",
181         SymbolicLinkHandle, DesiredAccess, ObjectAttributes, 
182         ObjectAttributes ? debugstr_w(ObjectAttributes->ObjectName->Buffer) : NULL,
183         debugstr_w(Name->Buffer));
184         return 0;
185 }
186
187 /******************************************************************************
188  *  NtQuerySymbolicLinkObject   [NTDLL] 
189  */
190 NTSTATUS WINAPI NtQuerySymbolicLinkObject(
191         IN HANDLE LinkHandle,
192         IN OUT PUNICODE_STRING LinkTarget,
193         OUT PULONG ReturnedLength OPTIONAL)
194 {
195         FIXME(ntdll,"(0x%08x,%p,%p) stub\n",
196         LinkHandle, debugstr_w(LinkTarget->Buffer), ReturnedLength);
197
198         return 0;
199 }
200