3 * Copyright (C) 2002, 2004 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.
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
23 * FILE: services/fs/cdfs/misc.c
24 * PURPOSE: CDROM (ISO 9660) filesystem driver
25 * PROGRAMMER: Eric Kohl
29 /* INCLUDES *****************************************************************/
31 #include <ddk/ntddk.h>
39 /* FUNCTIONS ****************************************************************/
42 CdfsSwapString(PWCHAR Out
,
46 PUCHAR t
= (PUCHAR
)Out
;
49 for (i
= 0; i
< Count
; i
+= 2)
53 if (t
[i
+1] == 0 && t
[i
] == ';')
62 CdfsDateTimeToSystemTime(PFCB Fcb
,
63 PLARGE_INTEGER SystemTime
)
65 TIME_FIELDS TimeFields
;
66 LARGE_INTEGER LocalTime
;
68 TimeFields
.Milliseconds
= 0;
69 TimeFields
.Second
= Fcb
->Entry
.Second
;
70 TimeFields
.Minute
= Fcb
->Entry
.Minute
;
71 TimeFields
.Hour
= Fcb
->Entry
.Hour
;
73 TimeFields
.Day
= Fcb
->Entry
.Day
;
74 TimeFields
.Month
= Fcb
->Entry
.Month
;
75 TimeFields
.Year
= Fcb
->Entry
.Year
+ 1900;
77 RtlTimeFieldsToTime(&TimeFields
,
79 ExLocalTimeToSystemTime(&LocalTime
, SystemTime
);
84 CdfsFileFlagsToAttributes(PFCB Fcb
,
85 PULONG FileAttributes
)
87 /* FIXME: Fix attributes */
89 *FileAttributes
= // FILE_ATTRIBUTE_READONLY |
90 ((Fcb
->Entry
.FileFlags
& FILE_FLAG_HIDDEN
) ? FILE_ATTRIBUTE_HIDDEN
: 0) |
91 ((Fcb
->Entry
.FileFlags
& FILE_FLAG_DIRECTORY
) ? FILE_ATTRIBUTE_DIRECTORY
: 0) |
92 ((Fcb
->Entry
.FileFlags
& FILE_FLAG_SYSTEM
) ? FILE_ATTRIBUTE_SYSTEM
: 0) |
93 ((Fcb
->Entry
.FileFlags
& FILE_FLAG_READONLY
) ? FILE_ATTRIBUTE_READONLY
: 0);