ReactOS 0.4.16-dev-297-gc569aee
phys_lib.h
Go to the documentation of this file.
1
2// 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#ifndef __UDF_PHYS_LIB__H__
8#define __UDF_PHYS_LIB__H__
9
10#ifndef UDF_FORMAT_MEDIA
13extern ULONG LockMode;
14#endif //UDF_FORMAT_MEDIA
15
17 IN PVCB Vcb
18 );
19
23 IN void* _Vcb,
24 IN void* Buffer, // Target buffer
26 IN uint32 LBA,
27 OUT PSIZE_T IOBytes,
29 );
30
31extern OSSTATUS
33 IN void* _Vcb,
34 IN void* Buffer, // Target buffer
36 IN uint32 LBA,
37 OUT PSIZE_T WrittenBytes,
39 );
40
41extern OSSTATUS
43 IN void* _Vcb,
44 IN void* Buffer, // Target buffer
46 IN uint32 LBA,
49 );
50
52 PVOID Buffer, // Target buffer
54 ULONG LBA,
56 ULONG Flags = 0);
57
59 IN PVOID Buffer, // Target buffer
61 IN ULONG LBA,
62 OUT PSIZE_T WrittenBytes,
63 IN ULONG Flags = 0);
64
65#define PH_TMP_BUFFER 1
66#define PH_VCB_IN_RETLEN 2
67#define PH_LOCK_CACHE 0x10000000
68
69#define PH_EX_WRITE 0x80000000
70#define PH_IO_LOCKED 0x20000000
71
72
73extern
76 IN PVCB Vcb
77 );
78
80 IN PVCB Vcb,
81 IN ULONG Lba,
82 IN ULONG BCount);
83
84extern OSSTATUS UDFReadDiscTrackInfo(PDEVICE_OBJECT DeviceObject, // the target device object
85 PVCB Vcb); // Volume Control Block for ^ DevObj
86
87extern OSSTATUS UDFReadAndProcessFullToc(PDEVICE_OBJECT DeviceObject, // the target device object
88 PVCB Vcb);
89
90extern OSSTATUS UDFUseStandard(PDEVICE_OBJECT DeviceObject, // the target device object
91 PVCB Vcb); // Volume control block fro this DevObj
92
93extern OSSTATUS UDFGetBlockSize(PDEVICE_OBJECT DeviceObject, // the target device object
94 PVCB Vcb); // Volume control block fro this DevObj
95
96extern OSSTATUS UDFGetDiskInfo(IN PDEVICE_OBJECT DeviceObject, // the target device object
97 IN PVCB Vcb); // Volume control block from this DevObj
98
100
102
104 IN uint32 Lba,
105 IN uint32 BCount
106 );
107//#define UDFPrepareForReadOperation(a,b) (STATUS_SUCCESS)
108
110 ULONG LBA,
111 ULONG BCount,
112 OSSTATUS RC);
113
116 IN BOOLEAN Eject);
117
118// read physical sectors
119/*OSSTATUS UDFReadSectors(IN PVCB Vcb,
120 IN BOOLEAN Translate,// Translate Logical to Physical
121 IN ULONG Lba,
122 IN ULONG BCount,
123 IN BOOLEAN Direct,
124 OUT PCHAR Buffer,
125 OUT PULONG ReadBytes);*/
126#define UDFReadSectors(Vcb, Translate, Lba, BCount, Direct, Buffer, ReadBytes) \
127 (( WCacheIsInitialized__(&((Vcb)->FastCache)) && (KeGetCurrentIrql() < DISPATCH_LEVEL)) ? \
128 (WCacheReadBlocks__(&((Vcb)->FastCache), Vcb, Buffer, Lba, BCount, ReadBytes, Direct)) : \
129 (UDFTRead(Vcb, Buffer, ((SIZE_T)(BCount))<<((Vcb)->BlockSizeBits), Lba, ReadBytes, 0)))
130
131
132// read data inside physical sector
134 IN BOOLEAN Translate, // Translate Logical to Physical
135 IN ULONG Lba,
136 IN ULONG i, // offset in sector
137 IN ULONG l, // transfer length
138 IN BOOLEAN Direct,
141// read unaligned data
143 IN BOOLEAN Translate, // Translate Logical to Physical
146 IN BOOLEAN Direct,
149
150#ifndef UDF_READ_ONLY_BUILD
151// write physical sectors
153 IN BOOLEAN Translate, // Translate Logical to Physical
154 IN ULONG Lba,
155 IN ULONG WBCount,
156 IN BOOLEAN Direct, // setting this flag delays flushing of given
157 // data to indefinite term
159 OUT PSIZE_T WrittenBytes);
160// write directly to cached sector
162 IN BOOLEAN Translate, // Translate Logical to Physical
163 IN ULONG Lba,
164 IN ULONG i, // offset in sector
165 IN ULONG l, // transfer length
166 IN BOOLEAN Direct,
168 OUT PSIZE_T WrittenBytes);
169// write data at unaligned offset & length
171 IN BOOLEAN Translate, // Translate Logical to Physical
174 IN BOOLEAN Direct, // setting this flag delays flushing of given
175 // data to indefinite term
177 OUT PSIZE_T WrittenBytes);
178#endif //UDF_READ_ONLY_BUILD
179
183
184
185#endif //__UDF_PHYS_LIB__H__
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
unsigned int uint32
Definition: types.h:32
r l[0]
Definition: byte_order.h:168
Definition: bufpool.h:45
static NTSTATUS ReadBytes(IN PDEVICE_OBJECT LowerDevice, OUT PUCHAR Buffer, IN ULONG BufferSize, OUT PULONG_PTR FilledBytes)
Definition: detect.c:67
#define OSSTATUS
Definition: env_spec_w32.h:57
IN OUT PVCB IN PDEVICE_OBJECT TargetDeviceObject
Definition: fatprocs.h:1675
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
Definition: glfuncs.h:248
#define __fastcall
Definition: sync.c:38
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
@ Unlock
Definition: ntsecapi.h:294
#define Vcb
Definition: cdprocs.h:1415
VOID NTAPI UDFEjectReqWaiter(IN PVOID Context)
OSSTATUS UDFDoOPC(IN PVCB Vcb)
Definition: phys_lib.cpp:850
OSSTATUS UDFDoDismountSequence(IN PVCB Vcb, IN PPREVENT_MEDIA_REMOVAL_USER_IN Buf, IN BOOLEAN Eject)
Definition: phys_eject.cpp:704
VOID UDFStopEjectWaiter(PVCB Vcb)
Definition: phys_eject.cpp:673
OSSTATUS UDFPrepareForReadOperation(IN PVCB Vcb, IN uint32 Lba, IN uint32 BCount)
Definition: phys_lib.cpp:3670
OSSTATUS UDFReadData(IN PVCB Vcb, IN BOOLEAN Translate, IN LONGLONG Offset, IN ULONG Length, IN BOOLEAN Direct, OUT PCHAR Buffer, OUT PSIZE_T ReadBytes)
BOOLEAN open_as_device
OSSTATUS UDFTRead(PVOID _Vcb, PVOID Buffer, SIZE_T Length, ULONG LBA, PSIZE_T ReadBytes, ULONG Flags=0)
BOOLEAN opt_invalidate_volume
Definition: env_spec_w32.cpp:9
VOID UDFUpdateNWA(PVCB Vcb, ULONG LBA, ULONG BCount, OSSTATUS RC)
Definition: phys_lib.cpp:3826
OSSTATUS UDFGetBlockSize(PDEVICE_OBJECT DeviceObject, PVCB Vcb)
OSSTATUS UDFTReadVerify(IN void *_Vcb, IN void *Buffer, IN SIZE_T Length, IN uint32 LBA, OUT PSIZE_T ReadBytes, IN uint32 Flags)
OSSTATUS UDFPrepareForWriteOperation(IN PVCB Vcb, IN ULONG Lba, IN ULONG BCount)
Definition: phys_lib.cpp:893
OSSTATUS UDFReadAndProcessFullToc(PDEVICE_OBJECT DeviceObject, PVCB Vcb)
Definition: phys_lib.cpp:2243
OSSTATUS UDFWriteInSector(IN PVCB Vcb, IN BOOLEAN Translate, IN ULONG Lba, IN ULONG i, IN ULONG l, IN BOOLEAN Direct, OUT PCHAR Buffer, OUT PSIZE_T WrittenBytes)
OSSTATUS UDFWriteData(IN PVCB Vcb, IN BOOLEAN Translate, IN LONGLONG Offset, IN SIZE_T Length, IN BOOLEAN Direct, IN PCHAR Buffer, OUT PSIZE_T WrittenBytes)
OSSTATUS UDFTWrite(IN PVOID _Vcb, IN PVOID Buffer, IN SIZE_T Length, IN ULONG LBA, OUT PSIZE_T WrittenBytes, IN ULONG Flags=0)
OSSTATUS UDFWriteSectors(IN PVCB Vcb, IN BOOLEAN Translate, IN ULONG Lba, IN ULONG WBCount, IN BOOLEAN Direct, IN PCHAR Buffer, OUT PSIZE_T WrittenBytes)
OSSTATUS UDFReadInSector(IN PVCB Vcb, IN BOOLEAN Translate, IN ULONG Lba, IN ULONG i, IN ULONG l, IN BOOLEAN Direct, OUT PCHAR Buffer, OUT PSIZE_T ReadBytes)
NTSTATUS UDFSyncCache(IN PVCB Vcb)
Definition: phys_lib.cpp:52
OSSTATUS UDFGetDiskInfo(IN PDEVICE_OBJECT DeviceObject, IN PVCB Vcb)
Definition: phys_lib.cpp:3050
OSSTATUS __fastcall UDFTIOVerify(IN void *_Vcb, IN void *Buffer, IN SIZE_T Length, IN uint32 LBA, OUT PSIZE_T IOBytes, IN uint32 Flags)
ULONG LockMode
Definition: env_spec_w32.cpp:8
OSSTATUS UDFUseStandard(PDEVICE_OBJECT DeviceObject, PVCB Vcb)
Definition: phys_lib.cpp:2386
OSSTATUS UDFReadDiscTrackInfo(PDEVICE_OBJECT DeviceObject, PVCB Vcb)
Definition: phys_lib.cpp:1635
OSSTATUS UDFResetDeviceDriver(IN PVCB Vcb, IN PDEVICE_OBJECT TargetDeviceObject, IN BOOLEAN Unlock)
Definition: phys_lib.cpp:4199
OSSTATUS UDFTWriteVerify(IN void *_Vcb, IN void *Buffer, IN SIZE_T Length, IN uint32 LBA, OUT PSIZE_T WrittenBytes, IN uint32 Flags)
Definition: cdstruc.h:498
ULONG_PTR * PSIZE_T
Definition: typedefs.h:80
int64_t LONGLONG
Definition: typedefs.h:68
#define NTAPI
Definition: typedefs.h:36
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170