ReactOS  0.4.14-dev-317-g96040ec
env_spec.h
Go to the documentation of this file.
1 // Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine
3 // All rights reserved
4 // This file was released under the GPLv2 on June 2015.
6 /*************************************************************************
7 *
8 * File: sys_spec.h
9 *
10 * Module: UDF File System Driver (Kernel mode execution only)
11 *
12 * Description:
13 * The main include file for the UDF file system driver.
14 *
15 * Author: Alter
16 *
17 *************************************************************************/
18 
19 #ifndef _UDF_ENV_SPEC_H_
20 #define _UDF_ENV_SPEC_H_
21 
24  PVOID Buffer,
25  SIZE_T Length,
28  ULONG Flags);
29 
31  PDEVICE_OBJECT DeviceObject, // the physical device object
32  PVOID Buffer,
33  SIZE_T Length,
35  PSIZE_T WrittenBytes,
36  ULONG Flags);
37 /*
38 extern NTSTATUS UDFPhWriteVerifySynchronous(
39  PDEVICE_OBJECT DeviceObject, // the physical device object
40  PVOID Buffer,
41  SIZE_T Length,
42  LONGLONG Offset,
43  PSIZE_T WrittenBytes,
44  ULONG Flags);
45 */
46 #define UDFPhWriteVerifySynchronous UDFPhWriteSynchronous
47 
48 extern NTSTATUS NTAPI
51  IN PVCB Vcb,
56  IN BOOLEAN OverrideVerify,
58  );
59 
67  IN BOOLEAN OverrideVerify,
69 /*
70 // This routine performs low-level write (asynchronously if possible)
71 extern NTSTATUS UDFTWriteAsync(
72  IN PVOID _Vcb,
73  IN PVOID Buffer, // Target buffer
74  IN ULONG Length,
75  IN ULONG LBA,
76  OUT PULONG WrittenBytes,
77  IN BOOLEAN FreeBuffer);
78 
79 extern VOID UDFBGWrite(
80  IN PVOID Context);
81 */
82 
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, \
87  NULL,NULL, \
88  E, A, \
89  NULL);*/
90 
91 #ifdef UDF_DBG
93  PUDF_FILE_INFO FI,
94  ULONG E,
95  ULONG A);
98 #else // UDF_DBG
100  PVCB V,
101  PUDF_FILE_INFO FI,
102  ULONG E,
103  ULONG A
104  )
105 {
106  FsRtlNotifyFullReportChange( (V)->NotifyIRPMutex, &((V)->NextNotifyIRP),
107  (PSTRING)&((FI)->Fcb->FCBName->ObjectName),
108  ((FI)->ParentFile) ? ((FI)->ParentFile->Fcb->FCBName->ObjectName.Length + sizeof(WCHAR)) : 0,
109  NULL,NULL,
110  E, A,
111  NULL);
112 }
113 
114 #define UDFNotifyVolumeEvent(FileObject, EventCode) \
115  {/*if(FsRtlNotifyVolumeEvent) FsRtlNotifyVolumeEvent(FileObject, EventCode)*/;}
116 
117 #endif // UDF_DBG
118 
119 
120 #define CollectStatistics(VCB, Field) { \
121  ((VCB)->Statistics[KeGetCurrentProcessorNumber()].Common.##Field) ++; \
122 }
123 
124 #define CollectStatisticsEx(VCB, Field, a) { \
125  ((VCB)->Statistics[KeGetCurrentProcessorNumber()].Common.##Field) += (ULONG)a; \
126 }
127 
128 #define CollectStatistics2(VCB, Field) { \
129  ((VCB)->Statistics[KeGetCurrentProcessorNumber()].Fat.##Field) ++; \
130 }
131 
132 #define CollectStatistics2Ex(VCB, Field, a) { \
133  ((VCB)->Statistics[KeGetCurrentProcessorNumber()].Fat.##Field) += a; \
134 }
135 
137  IN PIRP Irp,
138  IN PVOID Contxt);
139 
141  IN PIRP Irp,
142  IN PVOID Contxt);
143 
145  IN PIRP Irp,
146  IN PVOID Contxt);
147 
148 #define UDFGetDevType(DevObj) (DevObj->DeviceType)
149 
150 #define OSGetCurrentThread() PsGetCurrentThread()
151 
152 #define GetCurrentPID() HandleToUlong(PsGetCurrentProcessId())
153 
154 
155 #endif // _UDF_ENV_SPEC_H_
#define IN
Definition: typedefs.h:38
NTSTATUS NTAPI UDFSyncCompletionRoutine(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Contxt)
Definition: env_spec.cpp:82
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG IoControlCode
Definition: fltkernel.h:1383
_In_ NDIS_STATUS EventCode
Definition: ndis.h:4751
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI UDFPhSendIOCTL(IN ULONG IoControlCode, IN PDEVICE_OBJECT DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, OUT PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN OverrideVerify, OUT PIO_STATUS_BLOCK Iosb OPTIONAL)
Definition: env_spec.cpp:511
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG _In_ ULONG OutputBufferLength
Definition: fltkernel.h:1374
Definition: cdstruc.h:504
NTSTATUS NTAPI UDFTSendIOCTL(IN ULONG IoControlCode, IN PVCB Vcb, IN PVOID InputBuffer, IN ULONG InputBufferLength, OUT PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN OverrideVerify, OUT PIO_STATUS_BLOCK Iosb OPTIONAL)
Definition: env_spec.cpp:462
VOID NTAPI FsRtlNotifyFullReportChange(IN PNOTIFY_SYNC NotifySync, IN PLIST_ENTRY NotifyList, IN PSTRING FullTargetName, IN USHORT TargetNameOffset, IN PSTRING StreamName OPTIONAL, IN PSTRING NormalizedParentName OPTIONAL, IN ULONG FilterMatch, IN ULONG Action, IN PVOID TargetContext)
Definition: notify.c:1523
CHAR InputBuffer[80]
Definition: conmgr.c:33
NTSTATUS NTAPI UDFSyncCompletionRoutine2(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Contxt)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
ULONG_PTR * PSIZE_T
Definition: typedefs.h:78
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
WCHAR * ObjectName
Definition: ntfs.h:520
Definition: bufpool.h:45
_Must_inspect_result_ __drv_aliasesMem _In_ PDEVICE_OBJECT _In_opt_ PVOID _In_ ULONG _Out_opt_ PVOID OutputBuffer
Definition: iofuncs.h:713
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
__inline VOID UDFNotifyFullReportChange(PVCB V, PUDF_FILE_INFO FI, ULONG E, ULONG A)
Definition: env_spec.h:99
static NTSTATUS ReadBytes(IN PDEVICE_OBJECT LowerDevice, OUT PUCHAR Buffer, IN ULONG BufferSize, OUT PULONG_PTR FilledBytes)
Definition: detect.c:67
NTSTATUS NTAPI UDFPhReadSynchronous(PDEVICE_OBJECT DeviceObject, PVOID Buffer, SIZE_T Length, LONGLONG Offset, PSIZE_T ReadBytes, ULONG Flags)
Definition: env_spec.cpp:130
int64_t LONGLONG
Definition: typedefs.h:66
NTSTATUS NTAPI UDFAsyncCompletionRoutine(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Contxt)
Definition: env_spec.cpp:40
__wchar_t WCHAR
Definition: xmlstorage.h:180
return Iosb
Definition: create.c:4426
#define Vcb
Definition: cdprocs.h:1425
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
* PFILE_OBJECT
Definition: iotypes.h:1955
Definition: ttei1.cpp:12
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG _In_ ULONG InputBufferLength
Definition: fltkernel.h:1372
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
ULONG_PTR SIZE_T
Definition: typedefs.h:78
static const WCHAR E[]
Definition: oid.c:1253
#define OUT
Definition: typedefs.h:39
#define UDFNotifyVolumeEvent(FileObject, EventCode)
Definition: env_spec.h:114
unsigned int ULONG
Definition: retypes.h:1
_In_ PFCB Fcb
Definition: cdprocs.h:151
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
NTSTATUS NTAPI UDFPhWriteSynchronous(PDEVICE_OBJECT DeviceObject, PVOID Buffer, SIZE_T Length, LONGLONG Offset, PSIZE_T WrittenBytes, ULONG Flags)
Definition: env_spec.cpp:276