Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

filobsup.c File Reference

#include "UdfProcs.h"

Go to the source code of this file.

Defines

#define BugCheckFileId   (UDFS_BUG_CHECK_FILOBSUP)
#define Dbg   (UDFS_DEBUG_LEVEL_FILOBSUP)
#define TYPE_OF_OPEN_MASK   (0x00000007)

Functions

VOID UdfSetFileObject (IN PIRP_CONTEXT IrpContext, IN PFILE_OBJECT FileObject, IN TYPE_OF_OPEN TypeOfOpen, IN PFCB Fcb OPTIONAL, IN PCCB Ccb OPTIONAL)
TYPE_OF_OPEN UdfDecodeFileObject (IN PFILE_OBJECT FileObject, OUT PFCB *Fcb, OUT PCCB *Ccb)
TYPE_OF_OPEN UdfFastDecodeFileObject (IN PFILE_OBJECT FileObject, OUT PFCB *Fcb)


Define Documentation

#define BugCheckFileId   (UDFS_BUG_CHECK_FILOBSUP)
 

Definition at line 27 of file filobsup.c.

#define Dbg   (UDFS_DEBUG_LEVEL_FILOBSUP)
 

Definition at line 33 of file filobsup.c.

#define TYPE_OF_OPEN_MASK   (0x00000007)
 

Definition at line 39 of file filobsup.c.

Referenced by UdfDecodeFileObject(), UdfFastDecodeFileObject(), and UdfSetFileObject().


Function Documentation

TYPE_OF_OPEN UdfDecodeFileObject IN PFILE_OBJECT  FileObject,
OUT PFCB Fcb,
OUT PCCB Ccb
 

Definition at line 133 of file filobsup.c.

References ClearFlag, FlagOn, NULL, PAGED_CODE, TYPE_OF_OPEN, TYPE_OF_OPEN_MASK, and UnopenedFileObject.

Referenced by UdfCommonCleanup(), UdfCommonClose(), UdfCommonCreate(), UdfCommonDevControl(), UdfCommonDirControl(), UdfCommonLockControl(), UdfCommonQueryInfo(), UdfCommonQueryVolInfo(), UdfCommonRead(), UdfCommonSetInfo(), UdfDismountVolume(), UdfFastQueryBasicInfo(), UdfFastQueryNetworkInfo(), UdfIsVolumeDirty(), UdfIsVolumeMounted(), UdfLockVolume(), UdfOplockRequest(), and UdfUnlockVolume().

00141 : 00142 00143 This routine takes a file object and extracts the Fcb and Ccb (possibly NULL) 00144 and returns the type of open. 00145 00146 Arguments: 00147 00148 FileObject - Supplies the file object pointer being initialized. 00149 00150 Fcb - Address to store the Fcb contained in the file object. 00151 00152 Ccb - Address to store the Ccb contained in the file object. 00153 00154 Return Value: 00155 00156 TYPE_OF_OPEN - Indicates the type of file object. 00157 00158 --*/ 00159 00160 { 00161 TYPE_OF_OPEN TypeOfOpen; 00162 00163 PAGED_CODE(); 00164 00165 // 00166 // If this is an unopened file object then return NULL for the 00167 // Fcb/Ccb. Don't trust any other values in the file object. 00168 // 00169 00170 TypeOfOpen = (TYPE_OF_OPEN) FlagOn( (ULONG_PTR) FileObject->FsContext2, 00171 TYPE_OF_OPEN_MASK ); 00172 00173 if (TypeOfOpen == UnopenedFileObject) { 00174 00175 *Fcb = NULL; 00176 *Ccb = NULL; 00177 00178 } else { 00179 00180 // 00181 // The Fcb is pointed to by the FsContext field. The Ccb is in 00182 // FsContext2 (after clearing the low three bits). The low three 00183 // bits are the file object type. 00184 // 00185 00186 *Fcb = FileObject->FsContext; 00187 *Ccb = FileObject->FsContext2; 00188 00189 ClearFlag( (ULONG_PTR) *Ccb, TYPE_OF_OPEN_MASK ); 00190 } 00191 00192 // 00193 // Now return the type of open. 00194 // 00195 00196 return TypeOfOpen; 00197 }

TYPE_OF_OPEN UdfFastDecodeFileObject IN PFILE_OBJECT  FileObject,
OUT PFCB Fcb
 

Definition at line 201 of file filobsup.c.

References ASSERT_FILE_OBJECT, FlagOn, PAGED_CODE, TYPE_OF_OPEN, and TYPE_OF_OPEN_MASK.

Referenced by UdfFastLock(), UdfFastQueryStdInfo(), UdfFastUnlockAll(), UdfFastUnlockAllByKey(), and UdfFastUnlockSingle().

00208 : 00209 00210 This procedure takes a pointer to a file object, that has already been 00211 opened by Udfs and does a quick decode operation. It will only return 00212 a non null value if the file object is a user file open 00213 00214 Arguments: 00215 00216 FileObject - Supplies the file object pointer being interrogated 00217 00218 Fcb - Address to store Fcb if this is a user file object. NULL 00219 otherwise. 00220 00221 Return Value: 00222 00223 TYPE_OF_OPEN - type of open of this file object. 00224 00225 --*/ 00226 00227 { 00228 PAGED_CODE(); 00229 00230 ASSERT_FILE_OBJECT( FileObject ); 00231 00232 // 00233 // The Fcb is in the FsContext field. The type of open is in the low 00234 // bits of the Ccb. 00235 // 00236 00237 *Fcb = FileObject->FsContext; 00238 00239 return (TYPE_OF_OPEN) FlagOn( (ULONG_PTR) FileObject->FsContext2, TYPE_OF_OPEN_MASK ); 00240 }

VOID UdfSetFileObject IN PIRP_CONTEXT  IrpContext,
IN PFILE_OBJECT  FileObject,
IN TYPE_OF_OPEN  TypeOfOpen,
IN PFCB Fcb  OPTIONAL,
IN PCCB Ccb  OPTIONAL
 

Definition at line 49 of file filobsup.c.

References ASSERTMSG, BeyondValidType, FlagOn, NULL, PAGED_CODE, SetFlag, TYPE_OF_OPEN_MASK, and UnopenedFileObject.

Referenced by UdfCompleteFcbOpen(), and UdfCreateInternalStream().

00059 : 00060 00061 This routine will initialize the FileObject context fields based on the 00062 input type and data structures. 00063 00064 Arguments: 00065 00066 FileObject - Supplies the file object pointer being initialized. 00067 00068 TypeOfOpen - Sets the type of open. 00069 00070 Fcb - Fcb for this file object. Ignored for UnopenedFileObject. 00071 00072 Ccb - Ccb for the handle corresponding to this file object. Will not 00073 be present for stream file objects. 00074 00075 Return Value: 00076 00077 None. 00078 00079 --*/ 00080 00081 { 00082 PAGED_CODE(); 00083 00084 // 00085 // We only have values 0 to 7 available so make sure we didn't 00086 // inadvertantly add a new type. 00087 // 00088 00089 ASSERTMSG( "FileObject types exceed available bits\n", BeyondValidType <= 8 ); 00090 00091 // 00092 // Setting a file object to type UnopenedFileObject means just 00093 // clearing all of the context fields. All the other input 00094 // 00095 00096 if (TypeOfOpen == UnopenedFileObject) { 00097 00098 FileObject->FsContext = 00099 FileObject->FsContext2 = NULL; 00100 00101 return; 00102 } 00103 00104 // 00105 // Check that the 3 low-order bits of the Ccb are clear. 00106 // 00107 00108 ASSERTMSG( "Ccb is not quad-aligned\n", !FlagOn( ((ULONG_PTR) Ccb), TYPE_OF_OPEN_MASK )); 00109 00110 // 00111 // We will or the type of open into the low order bits of FsContext2 00112 // along with the Ccb value. 00113 // The Fcb is stored into the FsContext field. 00114 // 00115 00116 FileObject->FsContext = Fcb; 00117 FileObject->FsContext2 = Ccb; 00118 00119 SetFlag( ((ULONG_PTR) FileObject->FsContext2), TypeOfOpen ); 00120 00121 // 00122 // Set the Vpb field in the file object. 00123 // 00124 00125 FileObject->Vpb = Fcb->Vcb->Vpb; 00126 00127 return; 00128 }


Generated on Sat May 15 19:43:40 2004 for test by doxygen 1.3.7