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.
5 ////////////////////////////////////////////////////////////////////
6 
7 #ifndef __UDF_LIB_COMMON__H__
8 #define __UDF_LIB_COMMON__H__
9 
10 #ifndef WITHOUT_FORMATTER
11 #include "udferr_usr.h"
12 #endif
13 
14 typedef LONG   UDF_STATUS;
15 
16 #define UDF_SUCCESS(x) ( (UDF_STATUS)(x)>=0 )
17 
18 typedef UDF_STATUS (*PREAD_FUNCTION)(
19     PVOID               lpParameter,
20     PVOID               lpBuffer,
21     ULONG               nLength,
22     LONGLONG            liOffset,
23     PULONG              lpNumberOfBytesRead
24 );
25 
26 typedef UDF_STATUS (*PWRITE_FUNCTION)(
27     PVOID               lpParameter,
28     PVOID               lpBuffer,
29     ULONG               nLength,
30     LONGLONG            liOffset,
31     PULONG              lpNumberOfBytesRead
32 );
33 
34 typedef UDF_STATUS (*PIOCTL_FUNCTION)(
35     PVOID               lpParameter,
36     DWORD               dwIoControlCode,
37     LPVOID              lpInBuffer,
38     DWORD               nInBufferSize,
39     LPVOID              lpOutBuffer,
40     DWORD               nOutBufferSize,
41     LPDWORD             lpBytesReturned
42 );
43 
44 // For formatter
45 
46 typedef UDF_STATUS (*PREOPEN_FUNCTION)(
47     PVOID*              lpParameter
48 );
49 
50 typedef UDF_STATUS (*PGETSIZE_FUNCTION)(
51     PVOID               lpParameter,
52     __int64*            size,
53     ULONG*              block_size
54 );
55 
56 typedef UDF_STATUS (*PFLUSH_FUNCTION)(
57     PVOID               lpParameter
58 );
59 
60 #endif //__UDF_LIB_COMMON__H__
61