1999-03-09 18:47:51 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
1999-05-23 12:25:25 +02:00
|
|
|
#include "debugtools.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"
|
1999-03-09 18:47:51 +01:00
|
|
|
|
|
|
|
#include "ntddk.h"
|
|
|
|
|
2000-11-28 00:54:25 +01:00
|
|
|
DEFAULT_DEBUG_CHANNEL(ntdll);
|
1999-04-19 16:56:29 +02:00
|
|
|
|
1999-03-09 18:47:51 +01:00
|
|
|
/**************************************************************************
|
|
|
|
* NtOpenFile [NTDLL.127]
|
|
|
|
* 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)
|
|
|
|
{
|
- 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,0x%08lx,0x%08lx) stub\n",
|
1999-03-09 18:47:51 +01:00
|
|
|
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);
|
1999-03-09 18:47:51 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* NtCreateFile [NTDLL.73]
|
|
|
|
* 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,
|
|
|
|
ULONG 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
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtReadFile [NTDLL]
|
|
|
|
* ZwReadFile
|
|
|
|
*
|
|
|
|
* 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 NtReadFile (
|
|
|
|
HANDLE FileHandle,
|
|
|
|
HANDLE EventHandle,
|
|
|
|
PIO_APC_ROUTINE ApcRoutine,
|
|
|
|
PVOID ApcContext,
|
|
|
|
PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
PVOID Buffer,
|
|
|
|
ULONG Length,
|
|
|
|
PLARGE_INTEGER ByteOffset,
|
|
|
|
PULONG Key)
|
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x,0x%08x,%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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
* NtDeviceIoControlFile [NTDLL.94]
|
|
|
|
*/
|
|
|
|
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)
|
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x,0x%08x,%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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtFsControlFile [NTDLL.108]
|
|
|
|
*/
|
|
|
|
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)
|
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x,0x%08x,%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;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtSetVolumeInformationFile [NTDLL]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtSetVolumeInformationFile(
|
|
|
|
IN HANDLE FileHandle,
|
1999-07-31 19:32:05 +02:00
|
|
|
PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
PVOID FsInformation,
|
|
|
|
ULONG Length,
|
|
|
|
FS_INFORMATION_CLASS FsInformationClass)
|
1999-03-09 18:47:51 +01:00
|
|
|
{
|
1999-07-31 19:32:05 +02:00
|
|
|
FIXME("(0x%08x,%p,%p,0x%08lx,0x%08x) stub\n",
|
|
|
|
FileHandle,IoStatusBlock,FsInformation,Length,FsInformationClass);
|
1999-03-09 18:47:51 +01:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtQueryInformationFile [NTDLL]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtQueryInformationFile(
|
|
|
|
HANDLE FileHandle,
|
|
|
|
PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
PVOID FileInformation,
|
|
|
|
ULONG Length,
|
|
|
|
FILE_INFORMATION_CLASS FileInformationClass)
|
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x,%p,%p,0x%08lx,0x%08x),stub!\n",
|
1999-03-09 18:47:51 +01:00
|
|
|
FileHandle,IoStatusBlock,FileInformation,Length,FileInformationClass);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtSetInformationFile [NTDLL]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtSetInformationFile(
|
|
|
|
HANDLE FileHandle,
|
|
|
|
PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
PVOID FileInformation,
|
|
|
|
ULONG Length,
|
|
|
|
FILE_INFORMATION_CLASS FileInformationClass)
|
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x,%p,%p,0x%08lx,0x%08x)\n",
|
1999-03-09 18:47:51 +01:00
|
|
|
FileHandle,IoStatusBlock,FileInformation,Length,FileInformationClass);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtQueryDirectoryFile [NTDLL]
|
|
|
|
* 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)
|
|
|
|
{
|
1999-05-23 12:25:25 +02:00
|
|
|
FIXME("(0x%08x 0x%08x %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,
|
|
|
|
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
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* NtQueryVolumeInformationFile [NTDLL]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI NtQueryVolumeInformationFile (
|
|
|
|
IN HANDLE FileHandle,
|
|
|
|
OUT PIO_STATUS_BLOCK IoStatusBlock,
|
|
|
|
OUT PVOID FSInformation,
|
|
|
|
IN ULONG Length,
|
|
|
|
IN FS_INFORMATION_CLASS FSInformationClass)
|
|
|
|
{
|
|
|
|
TRACE("(0x%08x %p %p 0x%08lx 0x%08x) stub\n",
|
|
|
|
FileHandle, IoStatusBlock, FSInformation, Length, FSInformationClass);
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|