19#ifndef _UDF_SYS_SPEC_LIB__H_
20#define _UDF_SYS_SPEC_LIB__H_
58#define UDFUpdateAccessTime(Vcb, FileInfo) \
59if(Vcb->CompatFlags & UDF_VCB_IC_UPDATE_ACCESS_TIME) { \
61 KeQuerySystemTime((PLARGE_INTEGER)&NtTime); \
62 UDFSetFileXTime(FileInfo, NULL, &NtTime, NULL, NULL); \
65#define UDFUpdateModifyTime(Vcb, FileInfo) \
66if(Vcb->CompatFlags & UDF_VCB_IC_UPDATE_MODIFY_TIME) { \
69 PDIR_INDEX_ITEM DirNdx; \
70 KeQuerySystemTime((PLARGE_INTEGER)&NtTime); \
71 UDFSetFileXTime(FileInfo, NULL, &NtTime, NULL, &NtTime); \
72 DirNdx = UDFDirIndex(UDFGetDirIndexByFileInfo(FileInfo), (FileInfo)->Index); \
73 Attr = UDFAttributesToNT(DirNdx, (FileInfo)->Dloc->FileEntry); \
74 if(!(Attr & FILE_ATTRIBUTE_ARCHIVE)) \
75 UDFAttributesToUDF(DirNdx, (FileInfo)->Dloc->FileEntry, Attr); \
78#define UDFUpdateAttrTime(Vcb, FileInfo) \
79if(Vcb->CompatFlags & UDF_VCB_IC_UPDATE_ATTR_TIME) { \
81 KeQuerySystemTime((PLARGE_INTEGER)&NtTime); \
82 UDFSetFileXTime(FileInfo, NULL, &NtTime, &NtTime, NULL); \
85#define UDFUpdateCreateTime(Vcb, FileInfo) \
88 KeQuerySystemTime((PLARGE_INTEGER)&NtTime); \
89 UDFSetFileXTime(FileInfo, &NtTime, &NtTime, &NtTime, &NtTime); \
105#ifdef UDF_TRACK_UNICODE_STR
112#ifdef UDF_TRACK_UNICODE_STR
117#ifdef UDF_TRACK_UNICODE_STR
118 #define MyAppendUnicodeStringToString(s1,s2) MyAppendUnicodeStringToString_(s1,s2,"AppUStr")
119 #define MyAppendUnicodeStringToStringTag(s1,s2,tag) MyAppendUnicodeStringToString_(s1,s2,tag)
120 #define MyAppendUnicodeToString(s1,s2) MyAppendUnicodeToString_(s1,s2,"AppStr")
121 #define MyAppendUnicodeToStringTag(s1,s2,tag) MyAppendUnicodeToString_(s1,s2,tag)
123 #define MyAppendUnicodeStringToString(s1,s2) MyAppendUnicodeStringToString_(s1,s2)
124 #define MyAppendUnicodeStringToStringTag(s1,s2,tag) MyAppendUnicodeStringToString_(s1,s2)
125 #define MyAppendUnicodeToString(s1,s2) MyAppendUnicodeToString_(s1,s2)
126 #define MyAppendUnicodeToStringTag(s1,s2,tag) MyAppendUnicodeToString_(s1,s2)
144#define UDFIsDataCached(Vcb,Lba,BCount) \
145 ( WCacheIsInitialized__(&((Vcb)->FastCache)) && \
146 (KeGetCurrentIrql() < DISPATCH_LEVEL) && \
147 WCacheIsCached__(&((Vcb)->FastCache),Lba, BCount) )
152#define UDFGetNTFileId(Vcb, fi, fn) (((fi)->Dloc->FELoc.Mapping[0].extLocation - UDFPartStart(Vcb, -2)) + \
153 ((ULONG)(UDFUnicodeCksum((fn)->Buffer, (fn)->Length/sizeof(WCHAR))) << 16) + \
154 ((LONGLONG)Vcb<<32) )
156#define UnicodeIsPrint(a) RtlIsValidOemCharacter(&(a))
158#define UDFSysGetAllocSize(Vcb, Size) ((Size + Vcb->LBlockSize - 1) & ~((LONGLONG)(Vcb->LBlockSize - 1)))
161#define UDFDoesOSAllowFileToBeTargetForHLink__ UDFDoesOSAllowFileToBeTargetForRename__
163#define UDFDoesOSAllowFileToBeMoved__ UDFDoesOSAllowFileToBeUnlinked__
167#define UDFIsFSDevObj(DeviceObject) \
168 (DeviceObject->DeviceExtension && \
169 ( (((PVCB)(DeviceObject->DeviceExtension))->NodeIdentifier.NodeType == \
170 UDF_NODE_TYPE_UDFFS_DEVOBJ) || \
171 (((PVCB)(DeviceObject->DeviceExtension))->NodeIdentifier.NodeType == \
172 UDF_NODE_TYPE_UDFFS_DRVOBJ) \
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)
VOID UDFAttributesToUDF(IN PDIR_INDEX_ITEM FileDirNdx, IN tag *FileEntry, IN ULONG NTAttr)
NTSTATUS MyAppendUnicodeToString_(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)
struct _UDF_PH_CALL_CONTEXT * PUDF_PH_CALL_CONTEXT
struct _UDF_PH_CALL_CONTEXT UDF_PH_CALL_CONTEXT
NTSTATUS MyInitUnicodeString(IN PUNICODE_STRING Str1, IN PCWSTR Str2)
_In_ PLARGE_INTEGER NtTime
IO_STATUS_BLOCK IosbToUse
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
_Out_ PUNICODE_STRING DosName