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 8 Module Name: 9 10 udfpubl.h 11 12 Abstract: 13 14 This file defines the interface between UDFFS driver & user 15 applications | drivers. 16 17 Environment: 18 19 NT kernel mode or Win32 app 20 */ 21 22 #ifndef __UDF_PUBL_H__ 23 #define __UDF_PUBL_H__ 24 25 #pragma pack(push, 8) 26 27 #ifndef CTL_CODE 28 #include "winioctl.h" 29 #endif 30 31 #ifndef IOCTL_UDFFS_BASE 32 #define IOCTL_UDFFS_BASE 0x00000911 33 #endif 34 35 #ifndef IOCTL_UDF_DISABLE_DRIVER 36 #define IOCTL_UDF_DISABLE_DRIVER CTL_CODE(IOCTL_UDFFS_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS) 37 #define IOCTL_UDF_ENABLE_DRIVER CTL_CODE(IOCTL_UDFFS_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS) 38 #define IOCTL_UDF_INVALIDATE_VOLUMES CTL_CODE(IOCTL_UDFFS_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS) 39 #define IOCTL_UDF_GET_RETRIEVAL_POINTERS CTL_CODE(IOCTL_UDFFS_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS) 40 #define IOCTL_UDF_GET_FILE_ALLOCATION_MODE CTL_CODE(IOCTL_UDFFS_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS) 41 #define IOCTL_UDF_SET_FILE_ALLOCATION_MODE CTL_CODE(IOCTL_UDFFS_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS) 42 #define IOCTL_UDF_LOCK_VOLUME_BY_PID CTL_CODE(IOCTL_UDFFS_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS) 43 #define IOCTL_UDF_UNLOCK_VOLUME_BY_PID CTL_CODE(IOCTL_UDFFS_BASE, 0x0008, METHOD_BUFFERED, FILE_READ_ACCESS) 44 #define IOCTL_UDF_SEND_LICENSE_KEY CTL_CODE(IOCTL_UDFFS_BASE, 0x0009, METHOD_BUFFERED, FILE_READ_ACCESS) 45 #define IOCTL_UDF_GET_SPEC_RETRIEVAL_POINTERS CTL_CODE(IOCTL_UDFFS_BASE, 0x000a, METHOD_BUFFERED, FILE_READ_ACCESS) 46 #define IOCTL_UDF_GET_VERSION CTL_CODE(IOCTL_UDFFS_BASE, 0x000b, METHOD_BUFFERED, FILE_ANY_ACCESS) 47 #define IOCTL_UDF_SET_NOTIFICATION_EVENT CTL_CODE(IOCTL_UDFFS_BASE, 0x000c, METHOD_BUFFERED, FILE_ANY_ACCESS) 48 #define IOCTL_UDF_IS_VOLUME_JUST_MOUNTED CTL_CODE(IOCTL_UDFFS_BASE, 0x000d, METHOD_BUFFERED, FILE_ANY_ACCESS) 49 #define IOCTL_UDF_REGISTER_AUTOFORMAT CTL_CODE(IOCTL_UDFFS_BASE, 0x000e, METHOD_BUFFERED, FILE_ANY_ACCESS) 50 #define IOCTL_UDF_SET_OPTIONS CTL_CODE(IOCTL_UDFFS_BASE, 0x000f, METHOD_BUFFERED, FILE_ANY_ACCESS) 51 52 typedef struct _UDF_GET_FILE_ALLOCATION_MODE_OUT { 53 54 CHAR AllocMode; // see definition of ICB_FLAG_AD_XXX in Ecma_167.h 55 56 } UDF_GET_FILE_ALLOCATION_MODE_OUT, *PUDF_GET_FILE_ALLOCATION_MODE_OUT; 57 58 // setting default AllocMode 59 //#define ICB_FLAG_AD_DEFAULT_ALLOC_MODE (UCHAR)(0xff) 60 61 typedef UDF_GET_FILE_ALLOCATION_MODE_OUT UDF_SET_FILE_ALLOCATION_MODE_IN; 62 typedef PUDF_GET_FILE_ALLOCATION_MODE_OUT PUDF_SET_FILE_ALLOCATION_MODE_IN; 63 64 /*typedef struct _RETRIEVAL_POINTERS_BUFFER { 65 int a; 66 } RETRIEVAL_POINTERS_BUFFER, *PRETRIEVAL_POINTERS_BUFFER; 67 */ 68 typedef struct _UDF_LOCK_VOLUME_BY_PID_IN { 69 ULONG PID; // -1 for current process 70 } UDF_LOCK_VOLUME_BY_PID_IN, *PUDF_LOCK_VOLUME_BY_PID_IN; 71 72 typedef UDF_LOCK_VOLUME_BY_PID_IN UDF_UNLOCK_VOLUME_BY_PID_IN; 73 typedef PUDF_LOCK_VOLUME_BY_PID_IN PUDF_UNLOCK_VOLUME_BY_PID_IN; 74 75 #define UDF_DOS_FS_NAME L"\\DosDevices\\DwUdf" 76 #define UDF_WIN_FS_NAME "\\\\.\\DwUdf" 77 78 #define UDF_ISO_STREAM_NAME "UdfIsoBridgeStructure" 79 #define UDF_ISO_STREAM_NAME_W L"UdfIsoBridgeStructure" 80 81 #define UDF_CONFIG_STREAM_NAME "DvdWriteNow.cfg" 82 #define UDF_CONFIG_STREAM_NAME_W L"DvdWriteNow.cfg" 83 84 #ifdef FSCTL_GET_RETRIEVAL_POINTERS 85 86 typedef struct _UDF_GET_SPEC_RETRIEVAL_POINTERS_IN { 87 STARTING_VCN_INPUT_BUFFER Standard; 88 ULONG Special; 89 } UDF_GET_SPEC_RETRIEVAL_POINTERS_IN, *PUDF_GET_SPEC_RETRIEVAL_POINTERS_IN; 90 91 #endif //FSCTL_GET_RETRIEVAL_POINTERS 92 93 typedef struct _UDF_GET_VERSION_OUT { 94 struct { 95 ULONG Length; 96 ULONG DriverVersionMj; 97 ULONG DriverVersionMn; 98 ULONG DriverVersionBuild; 99 } header; 100 ULONG FSVersionMj; 101 ULONG FSVersionMn; 102 ULONG FSFlags; 103 ULONG FSCompatFlags; 104 ULONG FSCfgVersion; 105 } UDF_GET_VERSION_OUT, *PUDF_GET_VERSION_OUT; 106 107 #define UDF_USER_FS_FLAGS_RO 0x0001 108 #define UDF_USER_FS_FLAGS_RAW 0x0002 109 #define UDF_USER_FS_FLAGS_OUR_DRIVER 0x0004 110 #define UDF_USER_FS_FLAGS_FP 0x0008 111 #define UDF_USER_FS_FLAGS_MEDIA_RO 0x0010 112 #define UDF_USER_FS_FLAGS_SOFT_RO 0x0020 113 #define UDF_USER_FS_FLAGS_HW_RO 0x0040 114 #define UDF_USER_FS_FLAGS_MEDIA_DEFECT_RO 0x0080 115 #define UDF_USER_FS_FLAGS_PART_RO 0x0100 // partition is r/o 116 #define UDF_USER_FS_FLAGS_NEW_FS_RO 0x0200 117 118 #endif //IOCTL_UDF_DISABLE_DRIVER 119 120 #define UDF_PART_DAMAGED_RW (0x00) 121 #define UDF_PART_DAMAGED_RO (0x01) 122 #define UDF_PART_DAMAGED_NO (0x02) 123 124 typedef struct _UDF_SET_OPTIONS_IN { 125 struct { 126 ULONG HdrLength; 127 ULONG Flags; 128 } header; 129 UCHAR Data[1]; 130 } UDF_SET_OPTIONS_IN, *PUDF_SET_OPTIONS_IN; 131 132 #define UDF_SET_OPTIONS_FLAG_TEMPORARY 0x00 133 #define UDF_SET_OPTIONS_FLAG_DISK 0x01 134 #define UDF_SET_OPTIONS_FLAG_DRIVE 0x02 135 #define UDF_SET_OPTIONS_FLAG_GLOBAL 0x03 136 #define UDF_SET_OPTIONS_FLAG_MASK 0x03 137 138 #pragma pack(pop) 139 140 #endif //__UDF_PUBL_H__ 141