2002-03-10 00:29:33 +01:00
|
|
|
/*
|
|
|
|
* Copyright 1999, 2000 Juergen Schmied
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
2002-06-14 02:36:20 +02:00
|
|
|
#include "config.h"
|
|
|
|
#include "wine/port.h"
|
|
|
|
|
1999-03-09 18:47:51 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2002-06-14 02:36:20 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <errno.h>
|
2002-08-17 02:43:16 +02:00
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
# include <unistd.h>
|
|
|
|
#endif
|
2002-06-14 02:36:20 +02:00
|
|
|
#ifdef HAVE_SYS_ERRNO_H
|
|
|
|
#include <sys/errno.h>
|
|
|
|
#endif
|
2003-01-07 21:36:20 +01:00
|
|
|
|
|
|
|
#define NONAMELESSUNION
|
|
|
|
#define NONAMELESSSTRUCT
|
2002-08-27 03:13:58 +02:00
|
|
|
#include "wine/unicode.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2002-06-14 02:36:20 +02:00
|
|
|
#include "wine/server.h"
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
#include "ntdll_misc.h"
|
2002-06-14 02:36:20 +02:00
|
|
|
#include "file.h" /* FIXME */
|
1999-03-09 18:47:51 +01:00
|
|
|
|
2002-09-13 00:07:02 +02:00
|
|
|
#include "winternl.h"
|
2002-05-09 21:40:30 +02:00
|
|
|
#include "winioctl.h"
|
1999-03-09 18:47:51 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
2002-06-14 02:36:20 +02:00
|
|
|
|
1999-03-09 18:47:51 +01:00
|
|
|
/**************************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NtOpenFile [NTDLL.@]
|
2001-07-11 20:56:41 +02:00
|
|
|
* ZwOpenFile [NTDLL.@]
|
1999-03-09 18:47:51 +01:00
|
|
|
* FUNCTION: Opens a file
|
|
|
|
* ARGUMENTS:
|
|
|
|
* FileHandle Variable that receives the file handle on return
|
|
|
|
* DesiredAccess Access desired by the caller to the file
|
|
|
|
* ObjectAttributes Structue describing the file to be opened
|
|
|
|
* IoStatusBlock Receives details about the result of the operation
|
|
|
|
* ShareAccess Type of shared access the caller requires
|
|
|
|
* OpenOptions Options for the file open
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtOpenFile(
|
|
|
|
OUT PHANDLE FileHandle,
|
|
|
|
ACCESS_MASK DesiredAccess,
|
|
|
|
POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
ULONG ShareAccess,
|
|
|
|
ULONG OpenOptions)
|
|
|
|
{
|
2002-08-27 03:13:58 +02:00
|
|
|
LPWSTR filename;
|
|
|
|
static const WCHAR szDosDevices[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\',0};
|
2002-06-14 02:36:20 +02:00
|
|
|
DOS_FULL_NAME full_name;
|
|
|
|
NTSTATUS r;
|
|
|
|
|
|
|
|
FIXME("(%p,0x%08lx,%p,%p,0x%08lx,0x%08lx) partial stub\n",
|
|
|
|
FileHandle, DesiredAccess, ObjectAttributes,
|
|
|
|
IoStatusBlock, ShareAccess, OpenOptions);
|
|
|
|
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
dump_ObjectAttributes (ObjectAttributes);
|
2002-06-14 02:36:20 +02:00
|
|
|
|
|
|
|
if(ObjectAttributes->RootDirectory)
|
|
|
|
{
|
2002-11-21 04:45:01 +01:00
|
|
|
FIXME("Object root directory unknown %p\n",
|
2002-06-14 02:36:20 +02:00
|
|
|
ObjectAttributes->RootDirectory);
|
|
|
|
return STATUS_OBJECT_NAME_NOT_FOUND;
|
|
|
|
}
|
|
|
|
|
2002-08-27 03:13:58 +02:00
|
|
|
filename = ObjectAttributes->ObjectName->Buffer;
|
2002-06-14 02:36:20 +02:00
|
|
|
|
|
|
|
/* FIXME: DOSFS stuff should call here, not vice-versa */
|
2002-08-27 03:13:58 +02:00
|
|
|
if(strncmpW(filename, szDosDevices, strlenW(szDosDevices)))
|
2002-06-14 02:36:20 +02:00
|
|
|
return STATUS_OBJECT_NAME_NOT_FOUND;
|
|
|
|
|
|
|
|
/* FIXME: this calls SetLastError() -> bad */
|
2002-08-27 03:13:58 +02:00
|
|
|
if(!DOSFS_GetFullName(&filename[strlenW(szDosDevices)], TRUE,
|
2002-06-14 02:36:20 +02:00
|
|
|
&full_name))
|
|
|
|
return STATUS_OBJECT_NAME_NOT_FOUND;
|
|
|
|
|
|
|
|
/* FIXME: modify server protocol so
|
|
|
|
create file takes an OBJECT_ATTRIBUTES structure */
|
|
|
|
SERVER_START_REQ( create_file )
|
|
|
|
{
|
|
|
|
req->access = DesiredAccess;
|
|
|
|
req->inherit = 0;
|
|
|
|
req->sharing = ShareAccess;
|
|
|
|
req->create = OPEN_EXISTING;
|
|
|
|
req->attrs = 0;
|
2002-08-27 03:13:58 +02:00
|
|
|
req->drive_type = GetDriveTypeW( full_name.short_name );
|
2002-06-14 02:36:20 +02:00
|
|
|
wine_server_add_data( req, full_name.long_name, strlen(full_name.long_name) );
|
|
|
|
SetLastError(0);
|
|
|
|
r = wine_server_call( req );
|
|
|
|
*FileHandle = reply->handle;
|
|
|
|
}
|
|
|
|
SERVER_END_REQ;
|
|
|
|
|
|
|
|
return r;
|
1999-03-09 18:47:51 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NtCreateFile [NTDLL.@]
|
2001-07-11 20:56:41 +02:00
|
|
|
* ZwCreateFile [NTDLL.@]
|
1999-03-09 18:47:51 +01:00
|
|
|
* FUNCTION: Either causes a new file or directory to be created, or it opens
|
|
|
|
* an existing file, device, directory or volume, giving the caller a handle
|
|
|
|
* for the file object. This handle can be used by subsequent calls to
|
|
|
|
* manipulate data within the file or the file object's state of attributes.
|
|
|
|
* ARGUMENTS:
|
|
|
|
* FileHandle Points to a variable which receives the file handle on return
|
|
|
|
* DesiredAccess Desired access to the file
|
|
|
|
* ObjectAttributes Structure describing the file
|
|
|
|
* IoStatusBlock Receives information about the operation on return
|
|
|
|
* AllocationSize Initial size of the file in bytes
|
|
|
|
* FileAttributes Attributes to create the file with
|
|
|
|
* ShareAccess Type of shared access the caller would like to the file
|
|
|
|
* CreateDisposition Specifies what to do, depending on whether the file already exists
|
|
|
|
* CreateOptions Options for creating a new file
|
|
|
|
* EaBuffer Undocumented
|
|
|
|
* EaLength Undocumented
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtCreateFile(
|
|
|
|
OUT PHANDLE FileHandle,
|
|
|
|
ACCESS_MASK DesiredAccess,
|
|
|
|
POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
PLARGE_INTEGER AllocateSize,
|
|
|
|
ULONG FileAttributes,
|
|
|
|
ULONG ShareAccess,
|
|
|
|
ULONG CreateDisposition,
|
|
|
|
ULONG CreateOptions,
|
|
|
|
PVOID EaBuffer,
|
2002-06-01 01:06:46 +02:00
|
|
|
ULONG EaLength)
|
1999-03-09 18:47:51 +01:00
|
|
|
{
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
FIXME("(%p,0x%08lx,%p,%p,%p,0x%08lx,0x%08lx,0x%08lx,0x%08lx,%p,0x%08lx) stub\n",
|
1999-03-09 18:47:51 +01:00
|
|
|
FileHandle,DesiredAccess,ObjectAttributes,
|
|
|
|
IoStatusBlock,AllocateSize,FileAttributes,
|
|
|
|
ShareAccess,CreateDisposition,CreateOptions,EaBuffer,EaLength);
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
dump_ObjectAttributes (ObjectAttributes);
|
1999-03-09 18:47:51 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2002-06-14 02:36:20 +02:00
|
|
|
/* set the last error depending on errno */
|
|
|
|
NTSTATUS NTFILE_errno_to_status(int val)
|
|
|
|
{
|
|
|
|
switch (val)
|
|
|
|
{
|
|
|
|
case EAGAIN: return ( STATUS_SHARING_VIOLATION );
|
|
|
|
case ESPIPE:
|
|
|
|
case EBADF: return ( STATUS_INVALID_HANDLE );
|
|
|
|
case ENOSPC: return ( STATUS_DISK_FULL );
|
|
|
|
case EACCES:
|
|
|
|
case ESRCH:
|
|
|
|
case EPERM: return ( STATUS_ACCESS_DENIED );
|
|
|
|
case EROFS: return ( STATUS_MEDIA_WRITE_PROTECTED );
|
|
|
|
case EBUSY: return ( STATUS_FILE_LOCK_CONFLICT );
|
|
|
|
case ENOENT: return ( STATUS_NO_SUCH_FILE );
|
|
|
|
case EISDIR: return ( STATUS_FILE_IS_A_DIRECTORY );
|
|
|
|
case ENFILE:
|
|
|
|
case EMFILE: return ( STATUS_NO_MORE_FILES );
|
|
|
|
case EEXIST: return ( STATUS_OBJECT_NAME_COLLISION );
|
|
|
|
case EINVAL: return ( STATUS_INVALID_PARAMETER );
|
|
|
|
case ENOTEMPTY: return ( STATUS_DIRECTORY_NOT_EMPTY );
|
|
|
|
case EIO: return ( STATUS_ACCESS_VIOLATION );
|
|
|
|
}
|
|
|
|
perror("file_set_error");
|
|
|
|
return ( STATUS_INVALID_PARAMETER );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-03-09 18:47:51 +01:00
|
|
|
/******************************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* NtReadFile [NTDLL.@]
|
2001-07-11 20:56:41 +02:00
|
|
|
* ZwReadFile [NTDLL.@]
|
1999-03-09 18:47:51 +01:00
|
|
|
*
|
|
|
|
* Parameters
|
|
|
|
* HANDLE32 FileHandle
|
|
|
|
* HANDLE32 Event OPTIONAL
|
|
|
|
* PIO_APC_ROUTINE ApcRoutine OPTIONAL
|
|
|
|
* PVOID ApcContext OPTIONAL
|
|
|
|
* PIO_STATUS_BLOCK IoStatusBlock
|
|
|
|
* PVOID Buffer
|
|
|
|
* ULONG Length
|
|
|
|
* PLARGE_INTEGER ByteOffset OPTIONAL
|
|
|
|
* PULONG Key OPTIONAL
|
2002-06-14 02:36:20 +02:00
|
|
|
*
|
|
|
|
* IoStatusBlock->Information contains the number of bytes read on return.
|
1999-03-09 18:47:51 +01:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtReadFile (
|
|
|
|
HANDLE FileHandle,
|
|
|
|
HANDLE EventHandle,
|
|
|
|
PIO_APC_ROUTINE ApcRoutine,
|
|
|
|
PVOID ApcContext,
|
|
|
|
PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
PVOID Buffer,
|
|
|
|
ULONG Length,
|
|
|
|
PLARGE_INTEGER ByteOffset,
|
|
|
|
PULONG Key)
|
2002-06-14 02:36:20 +02:00
|
|
|
{
|
|
|
|
int fd, result, flags, ret;
|
|
|
|
enum fd_type type;
|
|
|
|
|
2002-12-05 20:56:15 +01:00
|
|
|
FIXME("(%p,%p,%p,%p,%p,%p,0x%08lx,%p,%p),partial stub!\n",
|
2002-06-14 02:36:20 +02:00
|
|
|
FileHandle,EventHandle,ApcRoutine,ApcContext,IoStatusBlock,Buffer,Length,ByteOffset,Key);
|
|
|
|
|
|
|
|
if (IsBadWritePtr( Buffer, Length ) ||
|
|
|
|
IsBadWritePtr( IoStatusBlock, sizeof *IoStatusBlock) ||
|
|
|
|
IsBadWritePtr( ByteOffset, sizeof *ByteOffset) )
|
|
|
|
return STATUS_ACCESS_VIOLATION;
|
|
|
|
|
|
|
|
IoStatusBlock->Information = 0;
|
|
|
|
|
|
|
|
ret = wine_server_handle_to_fd( FileHandle, GENERIC_READ, &fd, &type, &flags );
|
|
|
|
if(ret)
|
|
|
|
return ret;
|
|
|
|
|
|
|
|
/* FIXME: this code only does synchronous reads so far */
|
|
|
|
|
|
|
|
/* FIXME: depending on how libc implements this, between two processes
|
|
|
|
there could be a race condition between the seek and read here */
|
|
|
|
do
|
|
|
|
{
|
|
|
|
result = pread( fd, Buffer, Length, ByteOffset->QuadPart);
|
|
|
|
}
|
|
|
|
while ( (result == -1) && ((errno == EAGAIN) || (errno == EINTR)) );
|
|
|
|
|
|
|
|
close( fd );
|
|
|
|
|
|
|
|
if (result == -1)
|
|
|
|
{
|
|
|
|
return IoStatusBlock->u.Status = NTFILE_errno_to_status(errno);
|
|
|
|
}
|
|
|
|
|
|
|
|
IoStatusBlock->Information = result;
|
|
|
|
IoStatusBlock->u.Status = 0;
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtWriteFile [NTDLL.@]
|
|
|
|
* ZwWriteFile [NTDLL.@]
|
|
|
|
*
|
|
|
|
* Parameters
|
|
|
|
* HANDLE32 FileHandle
|
|
|
|
* HANDLE32 Event OPTIONAL
|
|
|
|
* PIO_APC_ROUTINE ApcRoutine OPTIONAL
|
|
|
|
* PVOID ApcContext OPTIONAL
|
|
|
|
* PIO_STATUS_BLOCK IoStatusBlock
|
|
|
|
* PVOID Buffer
|
|
|
|
* ULONG Length
|
|
|
|
* PLARGE_INTEGER ByteOffset OPTIONAL
|
|
|
|
* PULONG Key OPTIONAL
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtWriteFile (
|
|
|
|
HANDLE FileHandle,
|
|
|
|
HANDLE EventHandle,
|
|
|
|
PIO_APC_ROUTINE ApcRoutine,
|
|
|
|
PVOID ApcContext,
|
|
|
|
PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
PVOID Buffer,
|
|
|
|
ULONG Length,
|
|
|
|
PLARGE_INTEGER ByteOffset,
|
|
|
|
PULONG Key)
|
1999-03-09 18:47:51 +01:00
|
|
|
{
|
2002-12-05 20:56:15 +01:00
|
|
|
FIXME("(%p,%p,%p,%p,%p,%p,0x%08lx,%p,%p),stub!\n",
|
1999-03-09 18:47:51 +01:00
|
|
|
FileHandle,EventHandle,ApcRoutine,ApcContext,IoStatusBlock,Buffer,Length,ByteOffset,Key);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NtDeviceIoControlFile [NTDLL.@]
|
2001-07-11 20:56:41 +02:00
|
|
|
* ZwDeviceIoControlFile [NTDLL.@]
|
1999-03-09 18:47:51 +01:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtDeviceIoControlFile(
|
|
|
|
IN HANDLE DeviceHandle,
|
|
|
|
IN HANDLE Event OPTIONAL,
|
|
|
|
IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
|
|
|
|
IN PVOID UserApcContext OPTIONAL,
|
|
|
|
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
IN ULONG IoControlCode,
|
|
|
|
IN PVOID InputBuffer,
|
|
|
|
IN ULONG InputBufferSize,
|
|
|
|
OUT PVOID OutputBuffer,
|
|
|
|
IN ULONG OutputBufferSize)
|
|
|
|
{
|
2002-12-05 20:56:15 +01:00
|
|
|
FIXME("(%p,%p,%p,%p,%p,0x%08lx,%p,0x%08lx,%p,0x%08lx): empty stub\n",
|
1999-03-09 18:47:51 +01:00
|
|
|
DeviceHandle, Event, UserApcRoutine, UserApcContext,
|
|
|
|
IoStatusBlock, IoControlCode, InputBuffer, InputBufferSize, OutputBuffer, OutputBufferSize);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-19 20:20:47 +02:00
|
|
|
* NtFsControlFile [NTDLL.@]
|
2001-07-11 20:56:41 +02:00
|
|
|
* ZwFsControlFile [NTDLL.@]
|
1999-03-09 18:47:51 +01:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtFsControlFile(
|
|
|
|
IN HANDLE DeviceHandle,
|
|
|
|
IN HANDLE Event OPTIONAL,
|
|
|
|
IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
|
|
|
|
IN PVOID ApcContext OPTIONAL,
|
|
|
|
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
IN ULONG IoControlCode,
|
|
|
|
IN PVOID InputBuffer,
|
|
|
|
IN ULONG InputBufferSize,
|
|
|
|
OUT PVOID OutputBuffer,
|
|
|
|
IN ULONG OutputBufferSize)
|
|
|
|
{
|
2002-12-05 20:56:15 +01:00
|
|
|
FIXME("(%p,%p,%p,%p,%p,0x%08lx,%p,0x%08lx,%p,0x%08lx): stub\n",
|
1999-03-09 18:47:51 +01:00
|
|
|
DeviceHandle,Event,ApcRoutine,ApcContext,IoStatusBlock,IoControlCode,
|
|
|
|
InputBuffer,InputBufferSize,OutputBuffer,OutputBufferSize);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* NtSetVolumeInformationFile [NTDLL.@]
|
2001-07-11 20:56:41 +02:00
|
|
|
* ZwSetVolumeInformationFile [NTDLL.@]
|
1999-03-09 18:47:51 +01:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtSetVolumeInformationFile(
|
|
|
|
IN HANDLE FileHandle,
|
1999-07-31 19:32:05 +02:00
|
|
|
PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
PVOID FsInformation,
|
|
|
|
ULONG Length,
|
2002-06-01 01:06:46 +02:00
|
|
|
FS_INFORMATION_CLASS FsInformationClass)
|
1999-03-09 18:47:51 +01:00
|
|
|
{
|
2002-12-05 20:56:15 +01:00
|
|
|
FIXME("(%p,%p,%p,0x%08lx,0x%08x) stub\n",
|
1999-07-31 19:32:05 +02:00
|
|
|
FileHandle,IoStatusBlock,FsInformation,Length,FsInformationClass);
|
1999-03-09 18:47:51 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* NtQueryInformationFile [NTDLL.@]
|
2001-07-11 20:56:41 +02:00
|
|
|
* ZwQueryInformationFile [NTDLL.@]
|
1999-03-09 18:47:51 +01:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtQueryInformationFile(
|
|
|
|
HANDLE FileHandle,
|
|
|
|
PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
PVOID FileInformation,
|
|
|
|
ULONG Length,
|
|
|
|
FILE_INFORMATION_CLASS FileInformationClass)
|
|
|
|
{
|
2002-12-05 20:56:15 +01:00
|
|
|
FIXME("(%p,%p,%p,0x%08lx,0x%08x),stub!\n",
|
1999-03-09 18:47:51 +01:00
|
|
|
FileHandle,IoStatusBlock,FileInformation,Length,FileInformationClass);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* NtSetInformationFile [NTDLL.@]
|
2001-07-11 20:56:41 +02:00
|
|
|
* ZwSetInformationFile [NTDLL.@]
|
1999-03-09 18:47:51 +01:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtSetInformationFile(
|
|
|
|
HANDLE FileHandle,
|
|
|
|
PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
PVOID FileInformation,
|
|
|
|
ULONG Length,
|
|
|
|
FILE_INFORMATION_CLASS FileInformationClass)
|
|
|
|
{
|
2002-12-05 20:56:15 +01:00
|
|
|
FIXME("(%p,%p,%p,0x%08lx,0x%08x)\n",
|
1999-03-09 18:47:51 +01:00
|
|
|
FileHandle,IoStatusBlock,FileInformation,Length,FileInformationClass);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* NtQueryDirectoryFile [NTDLL.@]
|
2001-07-11 20:56:41 +02:00
|
|
|
* ZwQueryDirectoryFile [NTDLL.@]
|
1999-03-09 18:47:51 +01:00
|
|
|
* ZwQueryDirectoryFile
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtQueryDirectoryFile(
|
|
|
|
IN HANDLE FileHandle,
|
|
|
|
IN HANDLE Event OPTIONAL,
|
|
|
|
IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
|
|
|
|
IN PVOID ApcContext OPTIONAL,
|
|
|
|
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
OUT PVOID FileInformation,
|
|
|
|
IN ULONG Length,
|
|
|
|
IN FILE_INFORMATION_CLASS FileInformationClass,
|
|
|
|
IN BOOLEAN ReturnSingleEntry,
|
|
|
|
IN PUNICODE_STRING FileName OPTIONAL,
|
|
|
|
IN BOOLEAN RestartScan)
|
|
|
|
{
|
2002-12-05 20:56:15 +01:00
|
|
|
FIXME("(%p %p %p %p %p %p 0x%08lx 0x%08x 0x%08x %p 0x%08x\n",
|
1999-03-09 18:47:51 +01:00
|
|
|
FileHandle, Event, ApcRoutine, ApcContext, IoStatusBlock, FileInformation,
|
2002-06-01 01:06:46 +02:00
|
|
|
Length, FileInformationClass, ReturnSingleEntry,
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
debugstr_us(FileName),RestartScan);
|
1999-03-09 18:47:51 +01:00
|
|
|
return 0;
|
|
|
|
}
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
|
|
|
|
/******************************************************************************
|
2001-06-21 01:03:14 +02:00
|
|
|
* NtQueryVolumeInformationFile [NTDLL.@]
|
2001-07-11 20:56:41 +02:00
|
|
|
* ZwQueryVolumeInformationFile [NTDLL.@]
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtQueryVolumeInformationFile (
|
|
|
|
IN HANDLE FileHandle,
|
|
|
|
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
OUT PVOID FSInformation,
|
|
|
|
IN ULONG Length,
|
|
|
|
IN FS_INFORMATION_CLASS FSInformationClass)
|
|
|
|
{
|
2002-05-09 21:40:30 +02:00
|
|
|
ULONG len = 0;
|
|
|
|
|
2002-12-05 20:56:15 +01:00
|
|
|
FIXME("(%p %p %p 0x%08lx 0x%08x) stub!\n",
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
FileHandle, IoStatusBlock, FSInformation, Length, FSInformationClass);
|
2002-05-09 21:40:30 +02:00
|
|
|
|
|
|
|
switch ( FSInformationClass )
|
|
|
|
{
|
|
|
|
case FileFsVolumeInformation:
|
|
|
|
len = sizeof( FILE_FS_VOLUME_INFORMATION );
|
|
|
|
break;
|
|
|
|
case FileFsLabelInformation:
|
|
|
|
len = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileFsSizeInformation:
|
|
|
|
len = sizeof( FILE_FS_SIZE_INFORMATION );
|
|
|
|
break;
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
case FileFsDeviceInformation:
|
2002-05-09 21:40:30 +02:00
|
|
|
len = sizeof( FILE_FS_DEVICE_INFORMATION );
|
|
|
|
break;
|
|
|
|
case FileFsAttributeInformation:
|
|
|
|
len = sizeof( FILE_FS_ATTRIBUTE_INFORMATION );
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileFsControlInformation:
|
|
|
|
len = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileFsFullSizeInformation:
|
|
|
|
len = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileFsObjectIdInformation:
|
|
|
|
len = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileFsMaximumInformation:
|
|
|
|
len = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Length < len)
|
|
|
|
return STATUS_BUFFER_TOO_SMALL;
|
|
|
|
|
|
|
|
switch ( FSInformationClass )
|
|
|
|
{
|
|
|
|
case FileFsVolumeInformation:
|
|
|
|
break;
|
|
|
|
case FileFsLabelInformation:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileFsSizeInformation:
|
|
|
|
break;
|
|
|
|
|
2002-06-01 01:06:46 +02:00
|
|
|
case FileFsDeviceInformation:
|
2002-05-09 21:40:30 +02:00
|
|
|
if (FSInformation)
|
|
|
|
{
|
|
|
|
FILE_FS_DEVICE_INFORMATION * DeviceInfo = FSInformation;
|
2002-06-01 01:06:46 +02:00
|
|
|
DeviceInfo->DeviceType = FILE_DEVICE_DISK;
|
2002-05-09 21:40:30 +02:00
|
|
|
DeviceInfo->Characteristics = 0;
|
|
|
|
break;
|
|
|
|
};
|
|
|
|
case FileFsAttributeInformation:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileFsControlInformation:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileFsFullSizeInformation:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileFsObjectIdInformation:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case FileFsMaximumInformation:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
IoStatusBlock->DUMMYUNIONNAME.Status = STATUS_SUCCESS;
|
|
|
|
IoStatusBlock->Information = len;
|
- implementation of RtlReg* (read access), RtlEvent*, RtlSemaphore*,
NtAllocateLocallyUniqueId
- implementation or stubs for NtAccessCheck, NtSetSecurityObject,
RtlClearBits, RtlEqualPrefixSid, RtlFindClearBits,
RtlFormatCurrentUserKeyPath, RtlGetControlSecurityDescriptor,
RtlIdentifierAuthoritySid, RtlImpersonateSelf, RtlInitializeBitMap,
RtlInitializeGenericTable, RtlMakeSelfRelativeSD,
RtlPrefixUnicodeString, RtlSetBits, RtlUnicodeToMultiByteN,
RtlUpcaseUnicodeStringToOemString, RtlUpcaseUnicodeToOemN,
RtlValidSid, RtlxUnicodeStringToOemSize
- corrected most RtlString* functions, added documentation
- more fixes and partial implementations
2000-01-23 23:35:33 +01:00
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|