udfdata.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef _UDFDATA_
00022
#define _UDFDATA_
00023
00024
00025
00026
00027
00028 extern UDF_DATA UdfData;
00029 extern FAST_IO_DISPATCH UdfFastIoDispatch;
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #define UDFS_BASE_RESIDUAL_REFERENCE (6)
00053 #define UDFS_BASE_RESIDUAL_USER_REFERENCE (3)
00054
00055 #define UDFS_CDUDF_RESIDUAL_REFERENCE (2)
00056 #define UDFS_CDUDF_RESIDUAL_USER_REFERENCE (1)
00057
00058
00059
00060
00061
00062 #define UDFS_SIGNATURE 0x53464455
00063
00064
00065
00066
00067
00068 #define SELF_ENTRY 0
00069 #define PARENT_ENTRY 1
00070
00071 extern WCHAR
UdfUnicodeSelfArray[];
00072 extern WCHAR
UdfUnicodeParentArray[];
00073
00074 extern UNICODE_STRING
UdfUnicodeDirectoryNames[];
00075
00076
00077
00078
00079
00080 extern STRING
UdfCS0Identifier;
00081 extern STRING
UdfDomainIdentifier;
00082 extern STRING
UdfVirtualPartitionDomainIdentifier;
00083 extern STRING
UdfVatTableIdentifier;
00084 extern STRING
UdfSparablePartitionDomainIdentifier;
00085 extern STRING
UdfSparingTableIdentifier;
00086 extern STRING
UdfNSR02Identifier;
00087
00088
00089
00090
00091
00092
00093 extern PARSE_KEYVALUE VsdIdentParseTable[];
00094 extern PARSE_KEYVALUE NsrPartContIdParseTable[];
00095
00096
00097
00098
00099
00100 extern NPAGED_LOOKASIDE_LIST UdfFcbNonPagedLookasideList;
00101 extern NPAGED_LOOKASIDE_LIST UdfIrpContextLookasideList;
00102
00103 extern PAGED_LOOKASIDE_LIST UdfCcbLookasideList;
00104 extern PAGED_LOOKASIDE_LIST UdfFcbIndexLookasideList;
00105 extern PAGED_LOOKASIDE_LIST UdfFcbDataLookasideList;
00106 extern PAGED_LOOKASIDE_LIST UdfLcbLookasideList;
00107
00108
00109
00110
00111
00112 extern PUSHORT UdfCrcTable;
00113
00114
00115
00116
00117
00118
#if (!DBG && defined( UDFS_FREE_ASSERTS )) || defined( UDFSDBG )
00119
#undef ASSERT
00120
#undef ASSERTMSG
00121
#define ASSERT(exp) \
00122
((exp) ? TRUE : \
00123
(DbgPrint( "%s:%d %s\n",__FILE__,__LINE__,#exp ), \
00124
DbgBreakPoint(), \
00125
TRUE))
00126
#define ASSERTMSG(msg,exp) \
00127
((exp) ? TRUE : \
00128
(DbgPrint( "%s:%d %s %s\n",__FILE__,__LINE__,msg,#exp ), \
00129
DbgBreakPoint(), \
00130
TRUE))
00131
#endif
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
#if DBG || UDF_FREE_ASSERTS
00212
#undef UDF_SANITY
00213
#define UDF_SANITY
00214
#endif
00215
00216
#ifdef UDF_SANITY
00217
00218
extern LONG UdfDebugTraceLevel;
00219
extern LONG UdfDebugTraceIndent;
00220
extern BOOLEAN UdfNoisyVerifyDescriptor;
00221
extern BOOLEAN UdfTestRaisedStatus;
00222
00223 BOOLEAN
00224 UdfDebugTrace (
00225 LONG IndentIncrement,
00226 ULONG TraceMask,
00227 PCHAR Format,
00228 ...
00229 );
00230
00231
#define DebugTrace(x) UdfDebugTrace x
00232
00233
#define DebugUnwind(X) { \
00234
if (AbnormalTermination()) { \
00235
DebugTrace(( -1, UDFS_DEBUG_LEVEL_UNWIND, #X ", Abnormal termination.\n" )); \
00236
} \
00237
}
00238
00239
#define DebugBreakOnStatus(S) { \
00240
if (UdfTestRaisedStatus) { \
00241
if ((S) == STATUS_DISK_CORRUPT_ERROR || \
00242
(S) == STATUS_FILE_CORRUPT_ERROR || \
00243
(S) == STATUS_CRC_ERROR) { \
00244
DbgPrint( "UDFS: Breaking on interesting raised status (%08x)\n", (S) ); \
00245
DbgPrint( "UDFS: Set UdfTestRaisedStatus @ %08x to 0 to disable\n", \
00246
&UdfTestRaisedStatus ); \
00247
DbgBreakPoint(); \
00248
} \
00249
} \
00250
}
00251
00252
#define ASSERT_STRUCT(S,T) ASSERT( SafeNodeType( S ) == (T) )
00253
#define ASSERT_OPTIONAL_STRUCT(S,T) ASSERT( ((S) == NULL) || (SafeNodeType( S ) == (T)) )
00254
00255
#define ASSERT_VCB(V) ASSERT_STRUCT( (V), UDFS_NTC_VCB )
00256
#define ASSERT_OPTIONAL_VCB(V) ASSERT_OPTIONAL_STRUCT( (V), UDFS_NTC_VCB )
00257
00258
#define ASSERT_FCB(F) \
00259
ASSERT( (SafeNodeType( F ) == UDFS_NTC_FCB_DATA ) || \
00260
(SafeNodeType( F ) == UDFS_NTC_FCB_INDEX ) )
00261
00262
#define ASSERT_OPTIONAL_FCB(F) \
00263
ASSERT( ((F) == NULL) || \
00264
(SafeNodeType( F ) == UDFS_NTC_FCB_DATA ) || \
00265
(SafeNodeType( F ) == UDFS_NTC_FCB_INDEX ) )
00266
00267
#define ASSERT_FCB_DATA(F) ASSERT( (SafeNodeType( F ) == UDFS_NTC_FCB_DATA ) )
00268
00269
#define ASSERT_OPTIONAL_FCB_DATA(F) \
00270
ASSERT( ((F) == NULL) || \
00271
(SafeNodeType( F ) == UDFS_NTC_FCB_DATA ) )
00272
00273
#define ASSERT_FCB_INDEX(F) ASSERT( (SafeNodeType( F ) == UDFS_NTC_FCB_INDEX ) )
00274
00275
#define ASSERT_OPTIONAL_FCB_INDEX(F) \
00276
ASSERT( ((F) == NULL) || \
00277
(SafeNodeType( F ) == UDFS_NTC_FCB_INDEX ) )
00278
00279
#define ASSERT_FCB_NONPAGED(FN) ASSERT_STRUCT( (FN), UDFS_NTC_FCB_NONPAGED )
00280
#define ASSERT_OPTIONAL_FCB_NONPAGED(FN) ASSERT_OPTIONAL_STRUCT( (FN), UDFS_NTC_FCB_NONPAGED )
00281
00282
#define ASSERT_CCB(C) ASSERT_STRUCT( (C), UDFS_NTC_CCB )
00283
#define ASSERT_OPTIONAL_CCB(C) ASSERT_OPTIONAL_STRUCT( (C), UDFS_NTC_CCB )
00284
00285
#define ASSERT_PCB(C) ASSERT_STRUCT( (C), UDFS_NTC_PCB )
00286
#define ASSERT_OPTIONAL_PCB(C) ASSERT_OPTIONAL_STRUCT( (C), UDFS_NTC_PCB )
00287
00288
#define ASSERT_LCB(C) ASSERT_STRUCT( (C), UDFS_NTC_LCB )
00289
#define ASSERT_OPTIONAL_LCB(C) ASSERT_OPTIONAL_STRUCT( (C), UDFS_NTC_LCB )
00290
00291
#define ASSERT_IRP_CONTEXT(IC) ASSERT_STRUCT( (IC), UDFS_NTC_IRP_CONTEXT )
00292
#define ASSERT_OPTIONAL_IRP_CONTEXT(IC) ASSERT_OPTIONAL_STRUCT( (IC), UDFS_NTC_IRP_CONTEXT )
00293
00294
#define ASSERT_IRP_CONTEXT_LITE(IC) ASSERT_STRUCT( (IC), UDFS_NTC_IRP_CONTEXT_LITE )
00295
#define ASSERT_OPTIONAL_IRP_CONTEXT_LITE(IC) ASSERT_OPTIONAL_STRUCT( (IC), UDFS_NTC_IRP_CONTEXT_LITE )
00296
00297
#define ASSERT_IRP(I) ASSERT_STRUCT( (I), IO_TYPE_IRP )
00298
#define ASSERT_OPTIONAL_IRP(I) ASSERT_OPTIONAL_STRUCT( (I), IO_TYPE_IRP )
00299
00300
#define ASSERT_FILE_OBJECT(FO) ASSERT_STRUCT( (FO), IO_TYPE_FILE )
00301
#define ASSERT_OPTIONAL_FILE_OBJECT(FO) ASSERT_OPTIONAL_STRUCT( (FO), IO_TYPE_FILE )
00302
00303
#define ASSERT_EXCLUSIVE_RESOURCE(R) ASSERT( ExIsResourceAcquiredExclusive( R ))
00304
00305
#define ASSERT_SHARED_RESOURCE(R) ASSERT( ExIsResourceAcquiredShared( R ))
00306
00307
#define ASSERT_RESOURCE_NOT_MINE(R) ASSERT( !ExIsResourceAcquiredShared( R ))
00308
00309
#define ASSERT_EXCLUSIVE_UDFDATA ASSERT( ExIsResourceAcquiredExclusive( &UdfData.DataResource ))
00310
#define ASSERT_EXCLUSIVE_VCB(V) ASSERT( ExIsResourceAcquiredExclusive( &(V)->VcbResource ))
00311
#define ASSERT_SHARED_VCB(V) ASSERT( ExIsResourceAcquiredShared( &(V)->VcbResource ))
00312
00313
#define ASSERT_EXCLUSIVE_FCB_OR_VCB(F) ASSERT( ExIsResourceAcquiredExclusive( &(F)->FcbNonpaged->FcbResource ) || \
00314
ExIsResourceAcquiredExclusive( &(F)->Vcb->VcbResource ))
00315
00316
#define ASSERT_EXCLUSIVE_FCB(F) ASSERT( ExIsResourceAcquiredExclusive( &(F)->FcbNonpaged->FcbResource ))
00317
#define ASSERT_SHARED_FCB(F) ASSERT( ExIsResourceAcquiredShared( &(F)->FcbNonpaged->FcbResource ))
00318
00319
#define ASSERT_EXCLUSIVE_FILE(F) ASSERT( ExIsResourceAcquiredExclusive( (F)->Resource ))
00320
#define ASSERT_SHARED_FILE(F) ASSERT( ExIsResourceAcquiredShared( (F)->Resource ))
00321
00322
#define ASSERT_LOCKED_VCB(V) ASSERT( (V)->VcbLockThread == PsGetCurrentThread() )
00323
#define ASSERT_NOT_LOCKED_VCB(V) ASSERT( (V)->VcbLockThread != PsGetCurrentThread() )
00324
00325
#define ASSERT_LOCKED_FCB(F) ASSERT( (F)->FcbLockThread == PsGetCurrentThread() )
00326
#define ASSERT_NOT_LOCKED_FCB(F) ASSERT( (F)->FcbLockThread != PsGetCurrentThread() )
00327
00328
#else
00329
00330 #define DebugTrace(X) TRUE
00331 #define DebugUnwind(X) { NOTHING; }
00332 #define DebugBreakOnStatus(S) { NOTHING; }
00333
00334 #define ASSERT_STRUCT(S,T) { NOTHING; }
00335 #define ASSERT_OPTIONAL_STRUCT(S,T) { NOTHING; }
00336 #define ASSERT_VCB(V) { NOTHING; }
00337 #define ASSERT_OPTIONAL_VCB(V) { NOTHING; }
00338 #define ASSERT_FCB(F) { NOTHING; }
00339 #define ASSERT_OPTIONAL_FCB(F) { NOTHING; }
00340 #define ASSERT_FCB_DATA { NOTHING; }
00341 #define ASSERT_OPTIONAL_FCB_DATA(F) { NOTHING; }
00342 #define ASSERT_FCB_INDEX(F) { NOTHING; }
00343 #define ASSERT_OPTIONAL_FCB_INDEX(F) { NOTHING; }
00344 #define ASSERT_FCB_NONPAGED(FN) { NOTHING; }
00345 #define ASSERT_OPTIONAL_FCB_NONPAGED(FN) { NOTHING; }
00346 #define ASSERT_CCB(C) { NOTHING; }
00347 #define ASSERT_OPTIONAL_CCB(C) { NOTHING; }
00348 #define ASSERT_PCB(C) { NOTHING; }
00349 #define ASSERT_OPTIONAL_PCB(C) { NOTHING; }
00350 #define ASSERT_LCB(C) { NOTHING; }
00351 #define ASSERT_OPTIONAL_LCB(C) { NOTHING; }
00352 #define ASSERT_IRP_CONTEXT(IC) { NOTHING; }
00353 #define ASSERT_OPTIONAL_IRP_CONTEXT(IC) { NOTHING; }
00354 #define ASSERT_IRP_CONTEXT_LITE(IC) { NOTHING; }
00355 #define ASSERT_OPTIONAL_IRP_CONTEXT_LITE(IC) { NOTHING; }
00356 #define ASSERT_IRP(I) { NOTHING; }
00357 #define ASSERT_OPTIONAL_IRP(I) { NOTHING; }
00358 #define ASSERT_FILE_OBJECT(FO) { NOTHING; }
00359 #define ASSERT_OPTIONAL_FILE_OBJECT(FO) { NOTHING; }
00360 #define ASSERT_EXCLUSIVE_RESOURCE(R) { NOTHING; }
00361 #define ASSERT_SHARED_RESOURCE(R) { NOTHING; }
00362 #define ASSERT_RESOURCE_NOT_MINE(R) { NOTHING; }
00363 #define ASSERT_EXCLUSIVE_UDFDATA { NOTHING; }
00364 #define ASSERT_EXCLUSIVE_VCB(V) { NOTHING; }
00365 #define ASSERT_SHARED_VCB(V) { NOTHING; }
00366 #define ASSERT_EXCLUSIVE_FCB_OR_VCB(F) { NOTHING; }
00367 #define ASSERT_EXCLUSIVE_FCB(F) { NOTHING; }
00368 #define ASSERT_SHARED_FCB(F) { NOTHING; }
00369 #define ASSERT_EXCLUSIVE_FILE(F) { NOTHING; }
00370 #define ASSERT_SHARED_FILE(F) { NOTHING; }
00371 #define ASSERT_LOCKED_VCB(V) { NOTHING; }
00372 #define ASSERT_NOT_LOCKED_VCB(V) { NOTHING; }
00373 #define ASSERT_LOCKED_FCB(F) { NOTHING; }
00374 #define ASSERT_NOT_LOCKED_FCB(F) { NOTHING; }
00375
00376
#endif
00377
00378
#endif // _UDFDATA_
00379
Generated on Sat May 15 19:42:10 2004 for test by
1.3.7