68 UdfTime->hundredsOfMicroseconds = (
UCHAR)(
NtTime % 100);
91 return FileDirNdx->SysAttr;
100 if(!FileDirNdx->FileInfo)
103 FileEntry = FileDirNdx->FileInfo->Dloc->FileEntry;
118 FCharact = FileDirNdx->FileCharacteristics;
140 FileDirNdx->SysAttr = NTAttr;
162 if(!FileDirNdx->FileInfo)
165 FileEntry = FileDirNdx->FileInfo->Dloc->FileEntry;
177 FCharact = &(FileDirNdx->FileCharacteristics);
187 NTAttr &= ~FILE_ATTRIBUTE_NORMAL;
189 *FCharact &= ~FILE_DIRECTORY;
197 *
Flags &= ~ICB_FLAG_SYSTEM;
202 *
Flags &= ~ICB_FLAG_ARCHIVE;
207 *FCharact &= ~FILE_HIDDEN;
219 FileDirNdx->SysAttr = NTAttr;
220 if(FileDirNdx->FileInfo)
246 UDFPrint((
"@=%#x, FileDirNdx %x\n", &
Vcb, FileDirNdx));
255 UDFPrint((
" DirInfoToNT: %*.*S\n", FileDirNdx->FName.Length/
sizeof(
WCHAR), FileDirNdx->FName.Length/
sizeof(
WCHAR), FileDirNdx->FName));
257 UDFPrint((
" DirInfoToNT: exception when printing file name\n"));
260 if(FileDirNdx->FileInfo) {
266 FileEntry = (
PFILE_ENTRY)(FileDirNdx->FileInfo->Dloc->FileEntry);
269 if(FileDirNdx->FileInfo->Fcb) {
271 NtReqFcb = FileDirNdx->FileInfo->Fcb->NTRequiredFCB;
272 NTFileInfo->CreationTime.QuadPart =
NtReqFcb->CreationTime.QuadPart;
273 NTFileInfo->LastWriteTime.QuadPart =
NtReqFcb->LastWriteTime.QuadPart;
274 NTFileInfo->LastAccessTime.QuadPart =
NtReqFcb->LastAccessTime.QuadPart;
275 NTFileInfo->ChangeTime.QuadPart =
NtReqFcb->ChangeTime.QuadPart;
277 NTFileInfo->AllocationSize.QuadPart = FileDirNdx->AllocationSize;
280 NTFileInfo->EndOfFile.QuadPart = FileDirNdx->FileSize;
283 NTFileInfo->FileAttributes = FileDirNdx->SysAttr;
286 FileDirNdx->CreationTime = NTFileInfo->CreationTime.QuadPart;
287 FileDirNdx->LastWriteTime = NTFileInfo->LastWriteTime.QuadPart;
288 FileDirNdx->LastAccessTime = NTFileInfo->LastAccessTime.QuadPart;
289 FileDirNdx->ChangeTime = NTFileInfo->ChangeTime.QuadPart;
313 NTFileInfo->CreationTime.QuadPart = FileDirNdx->CreationTime;
314 NTFileInfo->LastWriteTime.QuadPart = FileDirNdx->LastWriteTime;
315 NTFileInfo->LastAccessTime.QuadPart = FileDirNdx->LastAccessTime;
316 NTFileInfo->ChangeTime.QuadPart = FileDirNdx->ChangeTime;
317 NTFileInfo->FileAttributes = FileDirNdx->SysAttr;
318 NTFileInfo->AllocationSize.QuadPart = FileDirNdx->AllocationSize;
319 NTFileInfo->EndOfFile.QuadPart = FileDirNdx->FileSize;
320 NTFileInfo->EaSize = 0;
334 FileDirNdx->CreationTime = NTFileInfo->CreationTime.QuadPart =
336 FileDirNdx->LastAccessTime = NTFileInfo->LastAccessTime.QuadPart =
UDFTimeToNT(&(FileEntry->
accessTime));
337 FileDirNdx->ChangeTime = NTFileInfo->ChangeTime.QuadPart =
UDFTimeToNT(&(FileEntry->
attrTime));
339 FileDirNdx->FileSize =
340 NTFileInfo->EndOfFile.QuadPart =
342 UDFPrint((
" informationLength=%I64x, lengthAllocDescs=%I64x\n",
347 FileDirNdx->AllocationSize =
348 NTFileInfo->AllocationSize.QuadPart =
354 UDFPrint((
" PEXTENDED_FILE_ENTRY\n"));
358 FileDirNdx->CreationTime = NTFileInfo->CreationTime.QuadPart =
UDFTimeToNT(&(ExFileEntry->
createTime));
360 FileDirNdx->LastAccessTime = NTFileInfo->LastAccessTime.QuadPart =
UDFTimeToNT(&(ExFileEntry->
accessTime));
361 FileDirNdx->ChangeTime = NTFileInfo->ChangeTime.QuadPart =
UDFTimeToNT(&(ExFileEntry->
attrTime));
363 FileDirNdx->FileSize =
364 NTFileInfo->EndOfFile.QuadPart =
366 UDFPrint((
" informationLength=%I64x, lengthAllocDescs=%I64x\n",
371 FileDirNdx->AllocationSize =
372 NTFileInfo->AllocationSize.QuadPart =
385 if(!FileDirNdx->CreationTime) {
386 FileDirNdx->CreationTime = NTFileInfo->CreationTime.QuadPart =
Vcb->VolCreationTime;
388 if(!FileDirNdx->LastAccessTime) {
389 FileDirNdx->LastAccessTime = NTFileInfo->LastAccessTime.QuadPart = FileDirNdx->CreationTime;
391 if(!FileDirNdx->LastWriteTime) {
392 FileDirNdx->LastWriteTime = NTFileInfo->LastWriteTime.QuadPart = FileDirNdx->CreationTime;
394 if(!FileDirNdx->ChangeTime) {
395 FileDirNdx->ChangeTime = NTFileInfo->ChangeTime.QuadPart = FileDirNdx->CreationTime;
398 FileDirNdx->SysAttr =
404 UdfName = FileDirNdx->FName;
405 NTFileInfo->FileNameLength = UdfName.
Length;
416 NTFileInfo->AllocationSize.QuadPart =
417 NTFileInfo->EndOfFile.QuadPart = 0;
419 UDFPrint((
" AllocationSize=%I64x, NTFileInfo->EndOfFile=%I64x", NTFileInfo->AllocationSize.QuadPart, NTFileInfo->EndOfFile.QuadPart));
422 if(FileEntry && !FileDirNdx->FileInfo)
429#ifndef UDF_READ_ONLY_BUILD
449 Ident =
FileInfo->Dloc->FileEntry->tagIdent;
459 if(DirNdx && *AttrTime) DirNdx->
ChangeTime = *AttrTime;
481 if(DirNdx && *AttrTime) DirNdx->
ChangeTime = *AttrTime;
513 Ident =
FileInfo->Dloc->FileEntry->tagIdent;
522 (*CrtTime) = *ChgTime;
537 if(AccTime && !(*AccTime)) (*AccTime) = *CrtTime;
538 if(AttrTime && !(*AttrTime)) (*AttrTime) = *CrtTime;
539 if(AccTime && !(*AccTime)) (*AccTime) = *CrtTime;
558 FName->Length-=
sizeof(
WCHAR);
570 FName->Length-=
sizeof(
WCHAR);
588 PWCHAR udfName = UdfName->Buffer;
738#define STRING_BUFFER_ALIGNMENT (32)
739#define STRING_BUFFER_ALIGN(sz) (((sz)+STRING_BUFFER_ALIGNMENT)&(~((ULONG)(STRING_BUFFER_ALIGNMENT-1))))
745#ifdef UDF_TRACK_UNICODE_STR
753#ifdef UDF_TRACK_UNICODE_STR
754 #define UDF_UNC_STR_TAG Tag
756 #define UDF_UNC_STR_TAG "AppUStr"
760 i = Str1->Length + Str2->Length +
sizeof(
WCHAR);
761 ASSERT(Str1->MaximumLength);
762 if(
i > Str1->MaximumLength) {
767 Str1->MaximumLength =
i*2;
777 tmp[(
i /
sizeof(
WCHAR)) - 1] = 0;
778 Str1->Length =
i -
sizeof(
WCHAR);
781 if(Str1->Buffer && (Str1->Length >= 2*
sizeof(
WCHAR))) {
782 ASSERT((Str1->Buffer[0] !=
L'\\') || (Str1->Buffer[1] !=
L'\\'));
787#undef UDF_UNC_STR_TAG
795#ifdef UDF_TRACK_UNICODE_STR
803#ifdef UDF_TRACK_UNICODE_STR
804 #define UDF_UNC_STR_TAG Tag
806 #define UDF_UNC_STR_TAG "AppStr"
809#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__)
838 ASSERT(Str1->MaximumLength);
839 if((Str1->Length+
i+
sizeof(
WCHAR)) > Str1->MaximumLength) {
849 tmp[(
i /
sizeof(
WCHAR))] = 0;
858#undef UDF_UNC_STR_TAG
871#if defined(_X86_) && defined(_MSC_VER) && !defined(__clang__)
904 Str1->Buffer[
i/
sizeof(
WCHAR)] = 0;
921 Str1->Buffer[Str1->Length/
sizeof(
WCHAR)] = 0;
945#ifndef UDF_READ_ONLY_BUILD
1007 hCurDirNdx =
FileInfo->Dloc->DirIndex;
NTSYSAPI VOID NTAPI RtlGenerate8dot3Name(_In_ PCUNICODE_STRING Name, _In_ BOOLEAN AllowExtendedCharacters, _Inout_ PGENERATE_NAME_CONTEXT Context, _Inout_ PUNICODE_STRING Name8dot3)
BOOLEAN UDFIsDirInfoCached(IN PVCB Vcb, IN PUDF_FILE_INFO DirInfo)
NTSTATUS MyAppendUnicodeStringToString_(IN PUNICODE_STRING Str1, IN PUNICODE_STRING Str2)
VOID UDFSetFileXTime(IN PUDF_FILE_INFO FileInfo, IN LONGLONG *CrtTime, IN LONGLONG *AccTime, IN LONGLONG *AttrTime, IN LONGLONG *ChgTime)
#define STRING_BUFFER_ALIGN(sz)
VOID UDFAttributesToUDF(IN PDIR_INDEX_ITEM FileDirNdx, IN tag *FileEntry, IN ULONG NTAttr)
NTSTATUS MyAppendUnicodeToString_(IN PUNICODE_STRING Str1, IN PCWSTR Str2)
NTSTATUS MyInitUnicodeString(IN PUNICODE_STRING Str1, IN PCWSTR Str2)
ULONG UDFAttributesToNT(IN PDIR_INDEX_ITEM FileDirNdx, IN tag *FileEntry)
NTSTATUS MyCloneUnicodeString(IN PUNICODE_STRING Str1, IN PUNICODE_STRING Str2)
NTSTATUS UDFDoesOSAllowFileToBeUnlinked__(IN PUDF_FILE_INFO FileInfo)
LONGLONG UDFTimeToNT(IN PUDF_TIME_STAMP UdfTime)
VOID UDFGetFileXTime(IN PUDF_FILE_INFO FileInfo, OUT LONGLONG *CrtTime, OUT LONGLONG *AccTime, OUT LONGLONG *AttrTime, OUT LONGLONG *ChgTime)
VOID UDFTimeToUDF(IN LONGLONG NtTime, OUT PUDF_TIME_STAMP UdfTime)
NTSTATUS UDFDoesOSAllowFilePretendDeleted__(IN PUDF_FILE_INFO FileInfo)
NTSTATUS UDFDoesOSAllowFileToBeTargetForRename__(IN PUDF_FILE_INFO FileInfo)
NTSTATUS UDFFileDirInfoToNT(IN PVCB Vcb, IN PDIR_INDEX_ITEM FileDirNdx, OUT PFILE_BOTH_DIR_INFORMATION NTFileInfo)
VOID UDFNormalizeFileName(IN PUNICODE_STRING FName, IN USHORT valueCRC)
void __fastcall UDFDOSNameOsNative(IN OUT PUNICODE_STRING DosName, IN PUNICODE_STRING UdfName, IN BOOLEAN KeepIntact)
static void xor(unsigned char *dst, const unsigned char *a, const unsigned char *b, const int count)
PDIR_INDEX_HDR UDFGetDirIndexByFileInfo(IN PUDF_FILE_INFO FileInfo)
#define NT_SUCCESS(StatCode)
#define TID_EXTENDED_FILE_ENTRY
#define UDF_FILE_TYPE_DIRECTORY
#define UDF_FILE_TYPE_STREAMDIR
#define UDF_FILE_TYPE_REGULAR
struct _EXTENDED_FILE_ENTRY * PEXTENDED_FILE_ENTRY
struct _FILE_ENTRY * PFILE_ENTRY
#define TIMESTAMP_TYPE_LOCAL
BOOLEAN RtlTimeToTimeFields(IN PLARGE_INTEGER Time, IN PTIME_FIELDS TimeFields)
BOOLEAN RtlTimeFieldsToTime(IN PTIME_FIELDS TimeFields, IN PLARGE_INTEGER Time)
#define ExLocalTimeToSystemTime(LocTime, SysTime)
#define ValidateFileInfo(fi)
#define KeQuerySystemTime(t)
#define ExSystemTimeToLocalTime(SysTime, LocTime)
_In_ PLARGE_INTEGER NtTime
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define EXCEPTION_EXECUTE_HANDLER
#define cmp(status, error)
static PTIME_FIELDS TimeFields
#define FILE_ATTRIBUTE_READONLY
#define FILE_ATTRIBUTE_HIDDEN
#define FILE_ATTRIBUTE_SYSTEM
#define FILE_ATTRIBUTE_ARCHIVE
#define FILE_ATTRIBUTE_DIRECTORY
NTSTATUS UDFCheckAccessRights(PFILE_OBJECT FileObject, PACCESS_STATE AccessState, PtrUDFFCB Fcb, PtrUDFCCB Ccb, ACCESS_MASK DesiredAccess, USHORT ShareAccess)
#define _SEH2_EXCEPT(...)
static calc_node_t * pop(void)
static void push(calc_node_t *op)
#define STATUS_CANNOT_DELETE
#define UDF_FCB_DELETE_ON_CLOSE
struct _UDF_FILE_INFO * FileInfo
uint8 FileCharacteristics
timestamp modificationTime
timestamp modificationTime
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl ebx
ecx edi movl ebx edx edi decl ecx esi eax jecxz decl eax andl eax esi movl edx movl TEMP incl eax andl eax ecx incl ebx testl eax jnz xchgl ecx incl TEMP esi
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define UDF_VCB_FLAGS_RAW_DISK
uint16 UDFGetFileLinkCount(IN PUDF_FILE_INFO FileInfo)
void __fastcall UDFDOSName(IN PVCB Vcb, IN OUT PUNICODE_STRING DosName, IN PUNICODE_STRING UdfName, IN BOOLEAN KeepIntact)
OSSTATUS UDFReadFileEntry(IN PVCB Vcb, IN long_ad *Icb, IN OUT PFILE_ENTRY FileEntry, IN OUT uint16 *Ident)
__inline PDIR_INDEX_ITEM UDFDirIndex(IN PDIR_INDEX_HDR hDirNdx, IN uint_di i)
#define UDFIsADirectory(FileInfo)
#define UDF_FE_FLAG_FE_MODIFIED
Was modified & should be flushed.
#define UDF_FI_FLAG_FI_MODIFIED
FileIdent was modified & should be flushed.
#define UDF_FI_FLAG_SYS_ATTR
Given entry of file list contains valid file attributes & times in NT-specific format.
#define UDF_FI_FLAG_KEEP_NAME
#define UDF_FI_FLAG_LINKED
Related FileEntry has more than one FileIdent. It happends when we use HardLinks.
#define STATUS_ACCESS_DENIED
#define STATUS_INSUFFICIENT_RESOURCES
#define UDF_VALID_FILE_ATTRIBUTES
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
_Must_inspect_result_ _In_ ULONG Flags
_Out_ PUNICODE_STRING DosName