mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-31 04:13:37 +00:00
- Implemented NtDeleteFile, also a piece of cake now that we have IopParseDevice done.
svn path=/trunk/; revision=22935
This commit is contained in:
@@ -2023,14 +2023,70 @@ NtCancelIoFile(IN HANDLE FileHandle,
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
* @implemented
|
||||
*/
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
NtDeleteFile(IN POBJECT_ATTRIBUTES ObjectAttributes)
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return(STATUS_NOT_IMPLEMENTED);
|
||||
NTSTATUS Status;
|
||||
DUMMY_FILE_OBJECT DummyFileObject;
|
||||
HANDLE Handle;
|
||||
KPROCESSOR_MODE AccessMode = KeGetPreviousMode();
|
||||
OPEN_PACKET OpenPacket;
|
||||
PAGED_CODE();
|
||||
|
||||
/* Setup the Open Packet */
|
||||
OpenPacket.Type = IO_TYPE_OPEN_PACKET;
|
||||
OpenPacket.Size = sizeof(OPEN_PACKET);
|
||||
OpenPacket.FileObject = NULL;
|
||||
OpenPacket.FinalStatus = STATUS_SUCCESS;
|
||||
OpenPacket.Information = 0;
|
||||
OpenPacket.ParseCheck = 0;
|
||||
OpenPacket.RelatedFileObject = NULL;
|
||||
OpenPacket.AllocationSize.QuadPart = 0;
|
||||
OpenPacket.CreateOptions = FILE_DELETE_ON_CLOSE;
|
||||
OpenPacket.FileAttributes = 0;
|
||||
OpenPacket.ShareAccess = FILE_SHARE_READ |
|
||||
FILE_SHARE_WRITE |
|
||||
FILE_SHARE_DELETE;
|
||||
OpenPacket.EaBuffer = NULL;
|
||||
OpenPacket.EaLength = 0;
|
||||
OpenPacket.Options = 0;
|
||||
OpenPacket.Disposition = FILE_OPEN;
|
||||
OpenPacket.BasicInformation = NULL;
|
||||
OpenPacket.NetworkInformation = NULL;
|
||||
OpenPacket.CreateFileType = 0;
|
||||
OpenPacket.MailslotOrPipeParameters = NULL;
|
||||
OpenPacket.Override = FALSE;
|
||||
OpenPacket.QueryOnly = FALSE;
|
||||
OpenPacket.DeleteOnly = TRUE;
|
||||
OpenPacket.FullAttributes = FALSE;
|
||||
OpenPacket.DummyFileObject = &DummyFileObject;
|
||||
OpenPacket.InternalFlags = 0;
|
||||
|
||||
/* Update the operation counts */
|
||||
IopUpdateOperationCount(IopOtherTransfer);
|
||||
|
||||
/*
|
||||
* Attempt opening the file. This will call the I/O Parse Routine for
|
||||
* the File Object (IopParseDevice) which will use the dummy file obejct
|
||||
* send the IRP to its device object. Note that we have two statuses
|
||||
* to worry about: the Object Manager's status (in Status) and the I/O
|
||||
* status, which is in the Open Packet's Final Status, and determined
|
||||
* by the Parse Check member.
|
||||
*/
|
||||
Status = ObOpenObjectByName(ObjectAttributes,
|
||||
NULL,
|
||||
AccessMode,
|
||||
NULL,
|
||||
DELETE,
|
||||
&OpenPacket,
|
||||
&Handle);
|
||||
if (OpenPacket.ParseCheck != TRUE) return Status;
|
||||
|
||||
/* Retrn the Io status */
|
||||
return OpenPacket.FinalStatus;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2044,7 +2100,7 @@ IoFastQueryNetworkAttributes(IN POBJECT_ATTRIBUTES ObjectAttributes,
|
||||
OUT PIO_STATUS_BLOCK IoStatus,
|
||||
OUT PFILE_NETWORK_OPEN_INFORMATION Buffer)
|
||||
{
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
NTSTATUS Status;
|
||||
DUMMY_FILE_OBJECT DummyFileObject;
|
||||
HANDLE Handle;
|
||||
OPEN_PACKET OpenPacket;
|
||||
|
||||
Reference in New Issue
Block a user