2 * Copyright 1999, 2000 Juergen Schmied
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include "wine/debug.h"
22 #include "ntdll_misc.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
29 /**************************************************************************
30 * NtOpenFile [NTDLL.@]
31 * ZwOpenFile [NTDLL.@]
32 * FUNCTION: Opens a file
34 * FileHandle Variable that receives the file handle on return
35 * DesiredAccess Access desired by the caller to the file
36 * ObjectAttributes Structue describing the file to be opened
37 * IoStatusBlock Receives details about the result of the operation
38 * ShareAccess Type of shared access the caller requires
39 * OpenOptions Options for the file open
41 NTSTATUS WINAPI NtOpenFile(
42 OUT PHANDLE FileHandle,
43 ACCESS_MASK DesiredAccess,
44 POBJECT_ATTRIBUTES ObjectAttributes,
45 OUT PIO_STATUS_BLOCK IoStatusBlock,
49 FIXME("(%p,0x%08lx,%p,%p,0x%08lx,0x%08lx) stub\n",
50 FileHandle, DesiredAccess, ObjectAttributes,
51 IoStatusBlock, ShareAccess, OpenOptions);
52 dump_ObjectAttributes (ObjectAttributes);
56 /**************************************************************************
57 * NtCreateFile [NTDLL.@]
58 * ZwCreateFile [NTDLL.@]
59 * FUNCTION: Either causes a new file or directory to be created, or it opens
60 * an existing file, device, directory or volume, giving the caller a handle
61 * for the file object. This handle can be used by subsequent calls to
62 * manipulate data within the file or the file object's state of attributes.
64 * FileHandle Points to a variable which receives the file handle on return
65 * DesiredAccess Desired access to the file
66 * ObjectAttributes Structure describing the file
67 * IoStatusBlock Receives information about the operation on return
68 * AllocationSize Initial size of the file in bytes
69 * FileAttributes Attributes to create the file with
70 * ShareAccess Type of shared access the caller would like to the file
71 * CreateDisposition Specifies what to do, depending on whether the file already exists
72 * CreateOptions Options for creating a new file
73 * EaBuffer Undocumented
74 * EaLength Undocumented
76 NTSTATUS WINAPI NtCreateFile(
77 OUT PHANDLE FileHandle,
78 ACCESS_MASK DesiredAccess,
79 POBJECT_ATTRIBUTES ObjectAttributes,
80 OUT PIO_STATUS_BLOCK IoStatusBlock,
81 PLARGE_INTEGER AllocateSize,
84 ULONG CreateDisposition,
89 FIXME("(%p,0x%08lx,%p,%p,%p,0x%08lx,0x%08lx,0x%08lx,0x%08lx,%p,0x%08lx) stub\n",
90 FileHandle,DesiredAccess,ObjectAttributes,
91 IoStatusBlock,AllocateSize,FileAttributes,
92 ShareAccess,CreateDisposition,CreateOptions,EaBuffer,EaLength);
93 dump_ObjectAttributes (ObjectAttributes);
97 /******************************************************************************
98 * NtReadFile [NTDLL.@]
99 * ZwReadFile [NTDLL.@]
102 * HANDLE32 FileHandle
103 * HANDLE32 Event OPTIONAL
104 * PIO_APC_ROUTINE ApcRoutine OPTIONAL
105 * PVOID ApcContext OPTIONAL
106 * PIO_STATUS_BLOCK IoStatusBlock
109 * PLARGE_INTEGER ByteOffset OPTIONAL
110 * PULONG Key OPTIONAL
112 NTSTATUS WINAPI NtReadFile (
115 PIO_APC_ROUTINE ApcRoutine,
117 PIO_STATUS_BLOCK IoStatusBlock,
120 PLARGE_INTEGER ByteOffset,
123 FIXME("(0x%08x,0x%08x,%p,%p,%p,%p,0x%08lx,%p,%p),stub!\n",
124 FileHandle,EventHandle,ApcRoutine,ApcContext,IoStatusBlock,Buffer,Length,ByteOffset,Key);
128 /**************************************************************************
129 * NtDeviceIoControlFile [NTDLL.@]
130 * ZwDeviceIoControlFile [NTDLL.@]
132 NTSTATUS WINAPI NtDeviceIoControlFile(
133 IN HANDLE DeviceHandle,
134 IN HANDLE Event OPTIONAL,
135 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
136 IN PVOID UserApcContext OPTIONAL,
137 OUT PIO_STATUS_BLOCK IoStatusBlock,
138 IN ULONG IoControlCode,
139 IN PVOID InputBuffer,
140 IN ULONG InputBufferSize,
141 OUT PVOID OutputBuffer,
142 IN ULONG OutputBufferSize)
144 FIXME("(0x%08x,0x%08x,%p,%p,%p,0x%08lx,%p,0x%08lx,%p,0x%08lx): empty stub\n",
145 DeviceHandle, Event, UserApcRoutine, UserApcContext,
146 IoStatusBlock, IoControlCode, InputBuffer, InputBufferSize, OutputBuffer, OutputBufferSize);
150 /******************************************************************************
151 * NtFsControlFile [NTDLL.@]
152 * ZwFsControlFile [NTDLL.@]
154 NTSTATUS WINAPI NtFsControlFile(
155 IN HANDLE DeviceHandle,
156 IN HANDLE Event OPTIONAL,
157 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
158 IN PVOID ApcContext OPTIONAL,
159 OUT PIO_STATUS_BLOCK IoStatusBlock,
160 IN ULONG IoControlCode,
161 IN PVOID InputBuffer,
162 IN ULONG InputBufferSize,
163 OUT PVOID OutputBuffer,
164 IN ULONG OutputBufferSize)
166 FIXME("(0x%08x,0x%08x,%p,%p,%p,0x%08lx,%p,0x%08lx,%p,0x%08lx): stub\n",
167 DeviceHandle,Event,ApcRoutine,ApcContext,IoStatusBlock,IoControlCode,
168 InputBuffer,InputBufferSize,OutputBuffer,OutputBufferSize);
172 /******************************************************************************
173 * NtSetVolumeInformationFile [NTDLL.@]
174 * ZwSetVolumeInformationFile [NTDLL.@]
176 NTSTATUS WINAPI NtSetVolumeInformationFile(
177 IN HANDLE FileHandle,
178 PIO_STATUS_BLOCK IoStatusBlock,
181 FS_INFORMATION_CLASS FsInformationClass)
183 FIXME("(0x%08x,%p,%p,0x%08lx,0x%08x) stub\n",
184 FileHandle,IoStatusBlock,FsInformation,Length,FsInformationClass);
188 /******************************************************************************
189 * NtQueryInformationFile [NTDLL.@]
190 * ZwQueryInformationFile [NTDLL.@]
192 NTSTATUS WINAPI NtQueryInformationFile(
194 PIO_STATUS_BLOCK IoStatusBlock,
195 PVOID FileInformation,
197 FILE_INFORMATION_CLASS FileInformationClass)
199 FIXME("(0x%08x,%p,%p,0x%08lx,0x%08x),stub!\n",
200 FileHandle,IoStatusBlock,FileInformation,Length,FileInformationClass);
204 /******************************************************************************
205 * NtSetInformationFile [NTDLL.@]
206 * ZwSetInformationFile [NTDLL.@]
208 NTSTATUS WINAPI NtSetInformationFile(
210 PIO_STATUS_BLOCK IoStatusBlock,
211 PVOID FileInformation,
213 FILE_INFORMATION_CLASS FileInformationClass)
215 FIXME("(0x%08x,%p,%p,0x%08lx,0x%08x)\n",
216 FileHandle,IoStatusBlock,FileInformation,Length,FileInformationClass);
220 /******************************************************************************
221 * NtQueryDirectoryFile [NTDLL.@]
222 * ZwQueryDirectoryFile [NTDLL.@]
223 * ZwQueryDirectoryFile
225 NTSTATUS WINAPI NtQueryDirectoryFile(
226 IN HANDLE FileHandle,
227 IN HANDLE Event OPTIONAL,
228 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
229 IN PVOID ApcContext OPTIONAL,
230 OUT PIO_STATUS_BLOCK IoStatusBlock,
231 OUT PVOID FileInformation,
233 IN FILE_INFORMATION_CLASS FileInformationClass,
234 IN BOOLEAN ReturnSingleEntry,
235 IN PUNICODE_STRING FileName OPTIONAL,
236 IN BOOLEAN RestartScan)
238 FIXME("(0x%08x 0x%08x %p %p %p %p 0x%08lx 0x%08x 0x%08x %p 0x%08x\n",
239 FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, FileInformation,
240 Length, FileInformationClass, ReturnSingleEntry,
241 debugstr_us(FileName),RestartScan);
245 /******************************************************************************
246 * NtQueryVolumeInformationFile [NTDLL.@]
247 * ZwQueryVolumeInformationFile [NTDLL.@]
249 NTSTATUS WINAPI NtQueryVolumeInformationFile (
250 IN HANDLE FileHandle,
251 OUT PIO_STATUS_BLOCK IoStatusBlock,
252 OUT PVOID FSInformation,
254 IN FS_INFORMATION_CLASS FSInformationClass)
258 FIXME("(0x%08x %p %p 0x%08lx 0x%08x) stub!\n",
259 FileHandle, IoStatusBlock, FSInformation, Length, FSInformationClass);
261 switch ( FSInformationClass )
263 case FileFsVolumeInformation:
264 len = sizeof( FILE_FS_VOLUME_INFORMATION );
266 case FileFsLabelInformation:
270 case FileFsSizeInformation:
271 len = sizeof( FILE_FS_SIZE_INFORMATION );
274 case FileFsDeviceInformation:
275 len = sizeof( FILE_FS_DEVICE_INFORMATION );
277 case FileFsAttributeInformation:
278 len = sizeof( FILE_FS_ATTRIBUTE_INFORMATION );
281 case FileFsControlInformation:
285 case FileFsFullSizeInformation:
289 case FileFsObjectIdInformation:
293 case FileFsMaximumInformation:
299 return STATUS_BUFFER_TOO_SMALL;
301 switch ( FSInformationClass )
303 case FileFsVolumeInformation:
305 case FileFsLabelInformation:
308 case FileFsSizeInformation:
311 case FileFsDeviceInformation:
314 FILE_FS_DEVICE_INFORMATION * DeviceInfo = FSInformation;
315 DeviceInfo->DeviceType = FILE_DEVICE_DISK;
316 DeviceInfo->Characteristics = 0;
319 case FileFsAttributeInformation:
322 case FileFsControlInformation:
325 case FileFsFullSizeInformation:
328 case FileFsObjectIdInformation:
331 case FileFsMaximumInformation:
334 IoStatusBlock->DUMMYUNIONNAME.Status = STATUS_SUCCESS;
335 IoStatusBlock->Information = len;
336 return STATUS_SUCCESS;