1 ////////////////////////////////////////////////////////////////////
2 // Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine
4 // This file was released under the GPLv2 on June 2015.
5 ////////////////////////////////////////////////////////////////////
6 /*************************************************************************
10 * Module: UDF File System Driver (Kernel mode execution only)
13 * The main include file for the UDF file system driver.
17 *************************************************************************/
19 #ifndef _UDF_ENV_SPEC_H_
20 #define _UDF_ENV_SPEC_H_
22 extern NTSTATUS NTAPI
UDFPhReadSynchronous(
23 PDEVICE_OBJECT DeviceObject
,
30 extern NTSTATUS NTAPI
UDFPhWriteSynchronous(
31 PDEVICE_OBJECT DeviceObject
, // the physical device object
38 extern NTSTATUS UDFPhWriteVerifySynchronous(
39 PDEVICE_OBJECT DeviceObject, // the physical device object
46 #define UDFPhWriteVerifySynchronous UDFPhWriteSynchronous
50 IN ULONG IoControlCode
,
52 IN PVOID InputBuffer
,
53 IN ULONG InputBufferLength
,
54 OUT PVOID OutputBuffer
,
55 IN ULONG OutputBufferLength
,
56 IN BOOLEAN OverrideVerify
,
57 OUT PIO_STATUS_BLOCK Iosb OPTIONAL
60 extern NTSTATUS NTAPI
UDFPhSendIOCTL(
61 IN ULONG IoControlCode
,
62 IN PDEVICE_OBJECT DeviceObject
,
63 IN PVOID InputBuffer
,
64 IN ULONG InputBufferLength
,
65 OUT PVOID OutputBuffer
,
66 IN ULONG OutputBufferLength
,
67 IN BOOLEAN OverrideVerify
,
68 OUT PIO_STATUS_BLOCK Iosb OPTIONAL
);
70 // This routine performs low-level write (asynchronously if possible)
71 extern NTSTATUS UDFTWriteAsync(
73 IN PVOID Buffer, // Target buffer
76 OUT PULONG WrittenBytes,
77 IN BOOLEAN FreeBuffer);
79 extern VOID UDFBGWrite(
83 /*#define UDFNotifyFullReportChange(V,FI,E,A) \
84 FsRtlNotifyFullReportChange( (V)->NotifyIRPMutex, &((V)->NextNotifyIRP), \
85 ((FI)->ParentFile) ? (PSTRING)&((FI)->Fcb->FCBName->ObjectName) : (PSTRING)&(UDFGlobalData.UnicodeStrRoot), \
86 ((FI)->ParentFile) ? ((FI)->ParentFile->Fcb->FCBName->ObjectName.Length + sizeof(WCHAR)) : 0, \
92 VOID
UDFNotifyFullReportChange(PVCB V
,
96 VOID
UDFNotifyVolumeEvent(IN PFILE_OBJECT FileObject
,
99 __inline VOID
UDFNotifyFullReportChange(
106 FsRtlNotifyFullReportChange( (V
)->NotifyIRPMutex
, &((V
)->NextNotifyIRP
),
107 (PSTRING
)&((FI
)->Fcb
->FCBName
->ObjectName
),
108 ((FI
)->ParentFile
) ? ((FI
)->ParentFile
->Fcb
->FCBName
->ObjectName
.Length
+ sizeof(WCHAR
)) : 0,
114 #define UDFNotifyVolumeEvent(FileObject, EventCode) \
115 {/*if(FsRtlNotifyVolumeEvent) FsRtlNotifyVolumeEvent(FileObject, EventCode)*/;}
120 #define CollectStatistics(VCB, Field) { \
121 ((VCB)->Statistics[KeGetCurrentProcessorNumber()].Common.##Field) ++; \
124 #define CollectStatisticsEx(VCB, Field, a) { \
125 ((VCB)->Statistics[KeGetCurrentProcessorNumber()].Common.##Field) += (ULONG)a; \
128 #define CollectStatistics2(VCB, Field) { \
129 ((VCB)->Statistics[KeGetCurrentProcessorNumber()].Fat.##Field) ++; \
132 #define CollectStatistics2Ex(VCB, Field, a) { \
133 ((VCB)->Statistics[KeGetCurrentProcessorNumber()].Fat.##Field) += a; \
136 NTSTATUS NTAPI
UDFAsyncCompletionRoutine(IN PDEVICE_OBJECT DeviceObject
,
140 NTSTATUS NTAPI
UDFSyncCompletionRoutine(IN PDEVICE_OBJECT DeviceObject
,
144 NTSTATUS NTAPI
UDFSyncCompletionRoutine2(IN PDEVICE_OBJECT DeviceObject
,
148 #define UDFGetDevType(DevObj) (DevObj->DeviceType)
150 #define OSGetCurrentThread() PsGetCurrentThread()
152 #define GetCurrentPID() HandleToUlong(PsGetCurrentProcessId())
155 #endif // _UDF_ENV_SPEC_H_