3 * Copyright (C) 2002 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 /* $Id: finfo.c,v 1.1 2002/04/15 20:39:49 ekohl Exp $
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
23 * FILE: services/fs/cdfs/dirctl.c
24 * PURPOSE: CDROM (ISO 9660) filesystem driver
25 * PROGRAMMER: Art Yerkes
29 /* INCLUDES *****************************************************************/
31 #include <ddk/ntddk.h>
39 /* FUNCTIONS ****************************************************************/
42 CdfsQueryNameInformation(PFILE_OBJECT FileObject
,
44 PDEVICE_OBJECT DeviceObject
,
45 PFILE_NAME_INFORMATION NameInfo
,
48 * FUNCTION: Retrieve the file name information
53 assert (NameInfo
!= NULL
);
57 NameLength
= wcslen(FCB
->PathName
) * sizeof(WCHAR
);
58 if (*BufferLength
< sizeof(FILE_NAME_INFORMATION
) + NameLength
)
59 return STATUS_BUFFER_OVERFLOW
;
61 NameInfo
->FileNameLength
= NameLength
;
62 memcpy(NameInfo
->FileName
,
64 NameLength
+ sizeof(WCHAR
));
69 wcscpy(NameInfo
->FileName
, L
"\\");
72 (sizeof(FILE_NAME_INFORMATION
) + NameLength
+ sizeof(WCHAR
));
74 return STATUS_SUCCESS
;
79 CdfsQueryInformation(PDEVICE_OBJECT DeviceObject
,
82 * FUNCTION: Retrieve the specified file information
85 FILE_INFORMATION_CLASS FileInformationClass
;
86 PIO_STACK_LOCATION Stack
;
87 PFILE_OBJECT FileObject
;
92 NTSTATUS Status
= STATUS_SUCCESS
;
94 DPRINT1("CdfsQueryInformation() called\n");
96 Stack
= IoGetCurrentIrpStackLocation(Irp
);
97 FileInformationClass
= Stack
->Parameters
.QueryFile
.FileInformationClass
;
98 FileObject
= Stack
->FileObject
;
99 Fcb
= FileObject
->FsContext
;
101 SystemBuffer
= Irp
->AssociatedIrp
.SystemBuffer
;
102 BufferLength
= Stack
->Parameters
.QueryFile
.Length
;
104 switch (FileInformationClass
)
107 case FileStandardInformation
:
108 Status
= CdfsGetStandardInformation(Fcb
,
109 IrpContext
->DeviceObject
,
113 case FilePositionInformation
:
114 RC
= CdfsGetPositionInformation(IrpContext
->FileObject
,
116 IrpContext
->DeviceObject
,
120 case FileBasicInformation
:
121 RC
= CdfsGetBasicInformation(FileObject
,
129 case FileNameInformation
:
130 Status
= CdfsQueryNameInformation(FileObject
,
138 case FileInternalInformation
:
139 Status
= CdfsGetInternalInformation(Fcb
,
144 case FileAlternateNameInformation
:
145 case FileAllInformation
:
146 Status
= STATUS_NOT_IMPLEMENTED
;
150 DPRINT("Unimplemented information class %u\n", FileInformationClass
);
151 Status
= STATUS_NOT_SUPPORTED
;
154 Irp
->IoStatus
.Status
= Status
;
155 if (NT_SUCCESS(Status
))
156 Irp
->IoStatus
.Information
=
157 Stack
->Parameters
.QueryFile
.Length
- BufferLength
;
159 Irp
->IoStatus
.Information
= 0;
161 IoCompleteRequest(Irp
, IO_NO_INCREMENT
);