ReactOS 0.4.16-dev-477-g6ada597
create.c File Reference
#include "fatprocs.h"
Include dependency graph for create.c:

Go to the source code of this file.

Macros

#define BugCheckFileId   (FAT_BUG_CHECK_CREATE)
 
#define Dbg   (DEBUG_TRACE_CREATE)
 
#define CollectCreateHitStatistics(VCB)
 
#define CollectCreateStatistics(VCB, STATUS)
 

Functions

 _Requires_lock_held_ (_Global_critical_region_)
 
 _Success_ (return.Status==STATUS_SUCCESS) _Requires_lock_held_(_Global_critical_region_) IO_STATUS_BLOCK FatOpenExistingDirectory(_In_ PIRP_CONTEXT IrpContext
 
 UNREFERENCED_PARAMETER (DeleteOnClose)
 
 UNREFERENCED_PARAMETER (OpenRequiringOplock)
 
 UNREFERENCED_PARAMETER (IrpSp)
 
 PAGED_CODE ()
 
 DebugTrace (+1, Dbg, "FatOpenExistingDirectory...\n", 0)
 
 if (OpenRequiringOplock &&(Iosb.Status==STATUS_SUCCESS))
 
 if (Iosb.Status !=STATUS_SUCCESS)
 
IoSetShareAccessDesiredAccess (*Dcb) ->ShareAccess
 
 FatSetFileObject (FileObject, UserDirectoryOpen,(*Dcb), UnwindCcb=FatCreateCcb(IrpContext))
 
 if (IsFileObjectReadOnly(FileObject))
 
 if (NT_SUCCESS(Iosb.Status))
 
 if (_SEH2_AbnormalTermination())
 
 DebugTrace (-1, Dbg, "FatOpenExistingDirectory -> Iosb.Status = %08lx\n", Iosb.Status)
 
VOID FatSetFullNameInFcb (_In_ PIRP_CONTEXT IrpContext, _Inout_ PFCB Fcb, _In_ PUNICODE_STRING FinalName)
 
NTSTATUS FatCheckSystemSecurityAccess (_In_ PIRP_CONTEXT IrpContext)
 
NTSTATUS FatCheckShareAccess (_In_ PIRP_CONTEXT IrpContext, _In_ PFILE_OBJECT FileObject, _In_ PFCB FcbOrDcb, _In_ PACCESS_MASK DesiredAccess, _In_ ULONG ShareAccess)
 
NTSTATUS FatCallSelfCompletionRoutine (__in PDEVICE_OBJECT DeviceObject, __in PIRP Irp, __in PVOID Contxt)
 

Variables

LUID FatSecurityPrivilege = { SE_SECURITY_PRIVILEGE, 0 }
 
_In_ PIO_STACK_LOCATION IrpSp
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT FileObject
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB Vcb
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCBDcb
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB ParentDcb
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT Dirent
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG LfnByteOffset
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG DirentByteOffset
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING Lfn
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT ShareAccess
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT _In_ ULONG CreateDisposition
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT _In_ ULONG _In_ BOOLEAN NoEaKnowledge
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT _In_ ULONG _In_ BOOLEAN _In_ BOOLEAN DeleteOnClose
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT _In_ ULONG _In_ BOOLEAN _In_ BOOLEAN _In_ BOOLEAN FileNameOpenedDos
 
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT _In_ ULONG _In_ BOOLEAN _In_ BOOLEAN _In_ BOOLEAN _In_ BOOLEAN OpenRequiringOplock
 
PDCB UnwindDcb = NULL
 
PCCB UnwindCcb = NULL
 
BOOLEAN CountsIncremented = FALSE
 
 _SEH2_TRY
 
Iosb Status
 
Dcb UncleanCount = 1
 
Dcb OpenCount = 1
 
Vcb OpenFileCount = 1
 
Iosb Information = FILE_OPENED
 
try_exit __pad0__
 
 _SEH2_FINALLY
 
 _SEH2_END
 
return Iosb
 

Macro Definition Documentation

◆ BugCheckFileId

#define BugCheckFileId   (FAT_BUG_CHECK_CREATE)

Definition at line 23 of file create.c.

◆ CollectCreateHitStatistics

#define CollectCreateHitStatistics (   VCB)
Value:
{ \
Stats->Fat.CreateHits += 1; \
}
struct _VCB VCB
FAT_DATA FatData
Definition: fatdata.c:56
FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID)
Definition: ke.h:341
ULONG NumberProcessors
Definition: fatstruc.h:81
ULONG CreateHits
Definition: winioctl.h:853
FAT_STATISTICS Fat
Definition: fatstruc.h:602

Definition at line 36 of file create.c.

◆ CollectCreateStatistics

#define CollectCreateStatistics (   VCB,
  STATUS 
)
Value:
{ \
if ((STATUS) == STATUS_SUCCESS) { \
Stats->Fat.SuccessfulCreates += 1; \
} else { \
Stats->Fat.FailedCreates += 1; \
} \
}
#define STATUS
Definition: blue.h:116
#define STATUS_SUCCESS
Definition: shellext.h:65
ULONG SuccessfulCreates
Definition: winioctl.h:854
ULONG FailedCreates
Definition: winioctl.h:855

Definition at line 41 of file create.c.

◆ Dbg

#define Dbg   (DEBUG_TRACE_CREATE)

Definition at line 29 of file create.c.

Function Documentation

◆ _Requires_lock_held_()

_Requires_lock_held_ ( _Global_critical_region_  )

Definition at line 56 of file create.c.

307{
309 PIRP_CONTEXT IrpContext = NULL;
310
312 BOOLEAN ExceptionCompletedIrp = FALSE;
313
314
315 PAGED_CODE();
316
317 //
318 // If we were called with our file system device object instead of a
319 // volume device object, just complete this request with STATUS_SUCCESS
320 //
321
322 if ( FatDeviceIsFatFsdo( VolumeDeviceObject)) {
323
324 Irp->IoStatus.Status = STATUS_SUCCESS;
325 Irp->IoStatus.Information = FILE_OPENED;
326
328
329 return STATUS_SUCCESS;
330 }
331
333
334 DebugTrace(+1, Dbg, "FatFsdCreate\n", 0);
335
336 //
337 // Call the common create routine, with block allowed if the operation
338 // is synchronous.
339 //
340
342
344
345 _SEH2_TRY {
346
347 IrpContext = FatCreateIrpContext( Irp, TRUE );
348
349#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
350 Status = FatCommonCreateOnNewStack( IrpContext, Irp );
351#else
352 Status = FatCommonCreate( IrpContext, Irp );
353#endif
354
356
357 //
358 // We had some trouble trying to perform the requested
359 // operation, so we'll abort the I/O request with
360 // the error status that we get back from the
361 // execption code
362 //
363
364 Status = FatProcessException( IrpContext, Irp, _SEH2_GetExceptionCode() );
365 ExceptionCompletedIrp = TRUE;
366 } _SEH2_END;
367
368 if (TopLevel) { IoSetTopLevelIrp( NULL ); }
369
371
372
373 //
374 // Complete the request, unless we had an exception, in which case it
375 // was completed in FatProcessException (and the IrpContext freed).
376 //
377 // IrpContext is freed inside FatCompleteRequest.
378 //
379
380 if (!ExceptionCompletedIrp && Status != STATUS_PENDING) {
381 FatCompleteRequest( IrpContext, Irp, Status );
382 }
383
384 //
385 // And return to our caller
386 //
387
388 DebugTrace(-1, Dbg, "FatFsdCreate -> %08lx\n", Status );
389
390 TimerStop(Dbg,"FatFsdCreate");
391
392 UNREFERENCED_PARAMETER( VolumeDeviceObject );
393
394 return Status;
395}
#define PAGED_CODE()
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
_In_ PIRP Irp
Definition: csq.h:116
#define STATUS_PENDING
Definition: d3dkmdt.h:43
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define Dbg
Definition: create.c:29
ULONG FatExceptionFilter(IN PIRP_CONTEXT IrpContext, IN PEXCEPTION_POINTERS ExceptionPointer)
Definition: fatdata.c:204
BOOLEAN FatIsIrpTopLevel(IN PIRP Irp)
Definition: fatdata.c:817
#define TimerStart(LEVEL)
Definition: fatdata.h:318
#define TimerStop(LEVEL, s)
Definition: fatdata.h:319
#define DebugTrace(INDENT, LEVEL, X, Y)
Definition: fatdata.h:313
IN PFCB IN PCCB IN TYPE_OF_OPEN IN BOOLEAN IN BOOLEAN TopLevel
Definition: fatprocs.h:2418
#define FatCompleteRequest(IRPCONTEXT, IRP, STATUS)
Definition: fatprocs.h:2634
#define FatDeviceIsFatFsdo(D)
Definition: fatprocs.h:3096
PIRP_CONTEXT FatCreateIrpContext(IN PIRP Irp, IN BOOLEAN Wait)
Definition: strucsup.c:2301
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
Status
Definition: gdiplustypes.h:25
#define FILE_OPENED
Definition: nt_native.h:769
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:325
#define IoCompleteRequest
Definition: irp.c:1240
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define _SEH2_GetExceptionInformation()
Definition: pseh2_64.h:164
#define _SEH2_END
Definition: pseh2_64.h:155
#define _SEH2_TRY
Definition: pseh2_64.h:55
#define IO_DISK_INCREMENT
Definition: iotypes.h:600

◆ _Success_()

_Success_ ( return.  Status = STATUS_SUCCESS)

◆ DebugTrace() [1/2]

DebugTrace ( 1,
Dbg  ,
"FatOpenExistingDirectory...\n"  ,
 
)

◆ DebugTrace() [2/2]

DebugTrace ( 1,
Dbg   
)

◆ DesiredAccess()

◆ FatCallSelfCompletionRoutine()

NTSTATUS FatCallSelfCompletionRoutine ( __in PDEVICE_OBJECT  DeviceObject,
__in PIRP  Irp,
__in PVOID  Contxt 
)

Definition at line 6939 of file create.c.

6945{
6946 //
6947 // Set the event so that our call will wake up.
6948 //
6949
6950 KeSetEvent( (PKEVENT)Contxt, 0, FALSE );
6951
6954
6955 //
6956 // If we change this return value then FatIoCallSelf needs to reference the
6957 // file object.
6958 //
6959
6961}
#define KeSetEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:476
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055

◆ FatCheckShareAccess()

NTSTATUS FatCheckShareAccess ( _In_ PIRP_CONTEXT  IrpContext,
_In_ PFILE_OBJECT  FileObject,
_In_ PFCB  FcbOrDcb,
_In_ PACCESS_MASK  DesiredAccess,
_In_ ULONG  ShareAccess 
)

Definition at line 6871 of file create.c.

6902{
6903 PAGED_CODE();
6904
6905#if (NTDDI_VERSION >= NTDDI_VISTA)
6906 //
6907 // Do an extra test for writeable user sections if the user did not allow
6908 // write sharing - this is neccessary since a section may exist with no handles
6909 // open to the file its based against.
6910 //
6911
6912 if ((NodeType( FcbOrDcb ) == FAT_NTC_FCB) &&
6916
6918 }
6919#endif
6920
6921 //
6922 // Check if the Fcb has the proper share access.
6923 //
6924
6927 FileObject,
6929 FALSE );
6930
6931 UNREFERENCED_PARAMETER( IrpContext );
6932}
ULONG NTAPI MmDoesFileHaveUserWritableReferences(IN PSECTION_OBJECT_POINTERS SectionPointer)
Definition: section.c:2985
#define NodeType(P)
Definition: nodetype.h:51
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT ShareAccess
Definition: create.c:4148
#define FAT_NTC_FCB
Definition: nodetype.h:29
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
IN PFCB FcbOrDcb
Definition: fatprocs.h:307
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_WRITE_DATA
Definition: nt_native.h:631
#define FILE_READ_DATA
Definition: nt_native.h:628
#define FILE_EXECUTE
Definition: nt_native.h:642
#define FILE_APPEND_DATA
Definition: nt_native.h:634
#define DELETE
Definition: nt_native.h:57
#define MAXIMUM_ALLOWED
Definition: nt_native.h:83
NTSTATUS NTAPI IoCheckShareAccess(IN ACCESS_MASK DesiredAccess, IN ULONG DesiredShareAccess, IN PFILE_OBJECT FileObject, IN PSHARE_ACCESS ShareAccess, IN BOOLEAN Update)
Definition: file.c:3391
SHARE_ACCESS ShareAccess
Definition: cdstruc.h:1009
PNON_PAGED_FCB NonPaged
Definition: fatstruc.h:811
SECTION_OBJECT_POINTERS SectionObjectPointers
Definition: fatstruc.h:729
#define STATUS_SHARING_VIOLATION
Definition: udferr_usr.h:154
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550

◆ FatCheckSystemSecurityAccess()

NTSTATUS FatCheckSystemSecurityAccess ( _In_ PIRP_CONTEXT  IrpContext)

Definition at line 6829 of file create.c.

6832{
6834 PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation( IrpContext->OriginatingIrp );
6835
6836 PAGED_CODE();
6837
6838 //
6839 // We check if the caller wants ACCESS_SYSTEM_SECURITY access on this
6840 // object and fail the request if he does.
6841 //
6842
6843 NT_ASSERT( IrpSp->Parameters.Create.SecurityContext != NULL );
6844 AccessState = IrpSp->Parameters.Create.SecurityContext->AccessState;
6845
6846 //
6847 // Check if the remaining privilege includes ACCESS_SYSTEM_SECURITY.
6848 //
6849
6850 if (FlagOn( AccessState->RemainingDesiredAccess, ACCESS_SYSTEM_SECURITY )) {
6851
6853 UserMode )) {
6854
6855 return STATUS_ACCESS_DENIED;
6856 }
6857
6858 //
6859 // Move this privilege from the Remaining access to Granted access.
6860 //
6861
6862 ClearFlag( AccessState->RemainingDesiredAccess, ACCESS_SYSTEM_SECURITY );
6863 SetFlag( AccessState->PreviouslyGrantedAccess, ACCESS_SYSTEM_SECURITY );
6864 }
6865
6866 return STATUS_SUCCESS;
6867}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
LUID FatSecurityPrivilege
Definition: create.c:50
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4138
#define ClearFlag(_F, _SF)
Definition: ext2fs.h:191
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define UserMode
Definition: asm.h:39
#define ACCESS_SYSTEM_SECURITY
Definition: nt_native.h:77
BOOLEAN NTAPI SeSinglePrivilegeCheck(_In_ LUID PrivilegeValue, _In_ KPROCESSOR_MODE PreviousMode)
Checks if a single privilege is present in the context of the calling thread.
Definition: priv.c:744
union _IO_STACK_LOCATION::@1583 Parameters
struct _IO_STACK_LOCATION::@3982::@3983 Create
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define NT_ASSERT
Definition: rtlfuncs.h:3327
_In_opt_ PVOID _In_opt_ PUNICODE_STRING _In_ PSECURITY_DESCRIPTOR _In_ PACCESS_STATE AccessState
Definition: sefuncs.h:417

◆ FatSetFileObject()

FatSetFileObject ( FileObject  ,
UserDirectoryOpen  ,
Dcb,
UnwindCcb  = FatCreateCcb(IrpContext) 
)

◆ FatSetFullNameInFcb()

VOID FatSetFullNameInFcb ( _In_ PIRP_CONTEXT  IrpContext,
_Inout_ PFCB  Fcb,
_In_ PUNICODE_STRING  FinalName 
)

Definition at line 6719 of file create.c.

6748{
6749 PAGED_CODE();
6750
6751 UNREFERENCED_PARAMETER( IrpContext );
6752
6754
6755 //
6756 // Prefer the ExactCaseLongName of the file for this operation, if set. In
6757 // this way we avoid building the fullname with a short filename. Several
6758 // operations assume this - the FinalNameLength in particular is the Lfn
6759 // (if existant) length, and we use this to crack the fullname in paths
6760 // such as the FsRtlNotify caller.
6761 //
6762 // If the caller specified a particular name and it is short, it is the
6763 // case that the long name was set up.
6764 //
6765
6767
6769 FinalName = &Fcb->ExactCaseLongName;
6770 }
6771
6772 //
6773 // Special case the root.
6774 //
6775
6777
6779 Fcb->FullFileName.MaximumLength = sizeof(WCHAR) + FinalName->Length;
6780
6784
6785 Fcb->FullFileName.Buffer[0] = L'\\';
6786
6788 &FinalName->Buffer[0],
6789 FinalName->Length );
6790
6791 } else {
6792
6794
6795 Prefix = &Fcb->ParentDcb->FullFileName;
6796
6797 //
6798 // It is possible our parent's full filename is not set. Simply fail
6799 // this attempt.
6800 //
6801
6802 if (Prefix->Buffer == NULL) {
6803
6804 return;
6805 }
6806
6808 Fcb->FullFileName.MaximumLength = Prefix->Length + sizeof(WCHAR) + FinalName->Length;
6809
6813
6815 &Prefix->Buffer[0],
6816 Prefix->Length );
6817
6818 Fcb->FullFileName.Buffer[Prefix->Length / sizeof(WCHAR)] = L'\\';
6819
6820 RtlCopyMemory( &Fcb->FullFileName.Buffer[(Prefix->Length / sizeof(WCHAR)) + 1],
6821 &FinalName->Buffer[0],
6822 FinalName->Length );
6823
6824 }
6825}
_In_ PFCB Fcb
Definition: cdprocs.h:159
#define FAT_NTC_ROOT_DCB
Definition: nodetype.h:31
#define TAG_FILENAME_BUFFER
Definition: nodetype.h:167
#define PagedPool
Definition: env_spec_w32.h:308
PVOID NTAPI FsRtlAllocatePoolWithTag(IN POOL_TYPE PoolType, IN ULONG NumberOfBytes, IN ULONG Tag)
Definition: filter.c:229
#define L(x)
Definition: ntvdm.h:50
struct _FCB * ParentDcb
Definition: fatstruc.h:836
UNICODE_STRING ExactCaseLongName
Definition: fatstruc.h:1139
UNICODE_STRING FullFileName
Definition: fatstruc.h:1122
unsigned short Length
Definition: sprintf.c:451
void * Buffer
Definition: sprintf.c:453
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
_In_ __drv_aliasesMem PSTRING Prefix
Definition: rtlfuncs.h:1647
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by FatSetRenameInfo().

◆ if() [1/5]

Definition at line 4380 of file create.c.

4380 {
4381
4382 if (CountsIncremented) {
4383
4384 (*Dcb)->UncleanCount -= 1;
4385 (*Dcb)->OpenCount -= 1;
4386 Vcb->OpenFileCount -= 1;
4387 if (IsFileObjectReadOnly(FileObject)) { Vcb->ReadOnlyCount -= 1; }
4388 }
4389
4390 if (UnwindDcb != NULL) {
4392 FileObject->SectionObjectPointer = NULL;
4393 }
4394 FatDeleteFcb( IrpContext, &UnwindDcb );
4395 *Dcb = NULL;
4396 }
4397 if (UnwindCcb != NULL) { FatDeleteCcb( IrpContext, &UnwindCcb ); }
4398 }
PCCB UnwindCcb
Definition: create.c:4213
PDCB UnwindDcb
Definition: create.c:4212
BOOLEAN CountsIncremented
Definition: create.c:4215
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB * Dcb
Definition: create.c:4141
VOID FatDeleteFcb(IN PIRP_CONTEXT IrpContext, IN PFCB *Fcb)
Definition: strucsup.c:1952
VOID FatDeleteCcb(IN PIRP_CONTEXT IrpContext, IN PCCB *Ccb)
Definition: strucsup.c:2254
#define IsFileObjectReadOnly(FO)
Definition: fatprocs.h:2867
#define ARGUMENT_PRESENT(ArgumentPointer)
#define Vcb
Definition: cdprocs.h:1415

◆ if() [2/5]

Definition at line 4314 of file create.c.

4314 {
4315
4316 NT_ASSERT( Iosb.Status != STATUS_PENDING );
4317
4318 FatRaiseStatus( IrpContext, Iosb.Status );
4319 }
return Iosb
Definition: create.c:4403
#define FatRaiseStatus(IRPCONTEXT, STATUS)
Definition: fatprocs.h:2978

◆ if() [3/5]

Definition at line 4344 of file create.c.

4344{ Vcb->ReadOnlyCount += 1; }

◆ if() [4/5]

Definition at line 4356 of file create.c.

4356 {
4357 PCCB Ccb;
4358
4359 Ccb = (PCCB)FileObject->FsContext2;
4360
4361 //
4362 // Mark the OpenedByShortName bit if the operation was successful.
4363 //
4364
4365 if ( FileNameOpenedDos ) {
4366
4368 }
4369 }
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
Definition: cdprocs.h:592
CCB * PCCB
Definition: cdstruc.h:1101
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT _In_ ULONG _In_ BOOLEAN _In_ BOOLEAN _In_ BOOLEAN FileNameOpenedDos
Definition: create.c:4152
#define CCB_FLAG_OPENED_BY_SHORTNAME
Definition: fatstruc.h:1296
if(dx< 0)
Definition: linetemp.h:194
Definition: cdstruc.h:1067
ULONG Flags
Definition: ntfs.h:536

◆ if() [5/5]

if ( OpenRequiringOplock &&  Iosb.Status==STATUS_SUCCESS)

Definition at line 4301 of file create.c.

4302 {
4303
4305 IrpContext->OriginatingIrp,
4306 ((*Dcb)->UncleanCount + 1) );
4307 }
#define FatGetFcbOplock(F)
Definition: fatprocs.h:1657
NTSTATUS NTAPI FsRtlOplockFsctrl(IN POPLOCK Oplock, IN PIRP Irp, IN ULONG OpenCount)
Definition: oplock.c:1430

◆ PAGED_CODE()

PAGED_CODE ( )

◆ UNREFERENCED_PARAMETER() [1/3]

UNREFERENCED_PARAMETER ( DeleteOnClose  )

◆ UNREFERENCED_PARAMETER() [2/3]

UNREFERENCED_PARAMETER ( IrpSp  )

◆ UNREFERENCED_PARAMETER() [3/3]

UNREFERENCED_PARAMETER ( OpenRequiringOplock  )

Variable Documentation

◆ __pad0__

try_exit __pad0__

Definition at line 4371 of file create.c.

◆ _SEH2_END

_SEH2_END

Definition at line 4401 of file create.c.

◆ _SEH2_FINALLY

_SEH2_FINALLY
Initial value:
{
DebugUnwind( FatOpenExistingDirectory )
#define DebugUnwind(X)
Definition: fatdata.h:315

Definition at line 4372 of file create.c.

◆ _SEH2_TRY

_SEH2_TRY

Definition at line 4227 of file create.c.

◆ CountsIncremented

CountsIncremented = FALSE

Definition at line 4215 of file create.c.

Referenced by if().

◆ CreateDisposition

◆ Dcb

◆ DeleteOnClose

◆ DesiredAccess

◆ Dirent

◆ DirentByteOffset

◆ FatSecurityPrivilege

LUID FatSecurityPrivilege = { SE_SECURITY_PRIVILEGE, 0 }

Definition at line 50 of file create.c.

Referenced by FatCheckSystemSecurityAccess().

◆ FileNameOpenedDos

◆ FileObject

◆ Information

Definition at line 4354 of file create.c.

◆ Iosb

Definition at line 4403 of file create.c.

Referenced by _In_reads_(), _Requires_lock_held_(), _Success_(), AddDiskToList(), addIPAddress(), AddVolumeToList(), CcRosDeleteFileCache(), CcRosFlushDirtyPages(), CcRosFlushVacb(), CcZeroData(), CdPerformDevIoCtrl(), CdPerformDevIoCtrlEx(), CdProcessToc(), CdVerifyVcb(), ClassPnp(), ConnectNamedPipe(), CreateMailslotW(), CreateNamedPipeW(), CreatePartitionList(), deleteIpAddress(), DeviceIoControl(), DisconnectNamedPipe(), DumpDisk(), DumpPartition(), EngpFileIoRequest(), ExeFmtpReadFile(), Ext2OpenDevice(), Ext2OverwriteEa(), FatFlushDirentForFile(), FatFlushFat(), FatFlushFatEntries(), FatIsMediaWriteProtected(), FatPerformDevIoCtrl(), FatPerformVerifyDiskRead(), FatScanForDataTrack(), FatUnpinRepinnedBcbs(), GetMailslotInfo(), if(), IntGdiAddFontResourceEx(), IntLoadSystemFonts(), KdbpCliInit(), KdpDebugLogInit(), KdpLoggerThread(), LdrpCheckForLoadedDll(), LoadSymbolsRoutine(), main(), MiReadPageFile(), MmFlushSegment(), MmMakeSegmentResident(), MmWriteToSwapPage(), OpenInputDevice(), PeekNamedPipe(), QueryDeviceInformation(), ReadFile(), SetMailslotInfo(), SetNamedPipeHandleState(), TdiAssociateAddressFile(), TdiCall(), TdiDisassociateAddressFile(), tdiGetSetOfThings(), TdiOpenDevice(), TdiQueryDeviceControl(), TdiQueryInformation(), TdiReceiveDatagram(), TdiSendDatagram(), TdiSetEventHandler(), TransactNamedPipe(), UDFMountVolume(), UDFPhSendIOCTL(), UDFTSendIOCTL(), UDFVerifyVcb(), UDFVerifyVolume(), VfatFormat(), VfatxFormat(), WriteFile(), and WritePartitions().

◆ IrpSp

Definition at line 4138 of file create.c.

Referenced by __attribute__(), _Dispatch_type_(), _Function_class_(), _Requires_lock_held_(), _Success_(), add_device(), add_thread_job(), AfdAccept(), AfdBindSocket(), AfdCancelHandler(), AfdCleanupSocket(), AfdCloseSocket(), AfdConnectedSocketReadData(), AfdConnectedSocketWriteData(), AfdCreateSocket(), AfdDisconnect(), AfdDispatch(), AfdEnumEvents(), AfdEventSelect(), AfdGetConnectData(), AfdGetConnectOptions(), AfdGetContext(), AfdGetContextSize(), AfdGetDisconnectData(), AfdGetDisconnectOptions(), AfdGetInfo(), AfdGetPeerName(), AfdGetSockName(), AfdGetTdiHandles(), AfdListenSocket(), AfdPacketSocketReadData(), AfdPacketSocketWriteData(), AfdQueryVolumeInformation(), AfdSelect(), AfdSetConnectData(), AfdSetConnectDataSize(), AfdSetConnectOptions(), AfdSetConnectOptionsSize(), AfdSetContext(), AfdSetDisconnectData(), AfdSetDisconnectDataSize(), AfdSetDisconnectOptions(), AfdSetDisconnectOptionsSize(), AfdSetInfo(), AfdStreamSocketConnect(), AfdWaitForListen(), BatteryClassIoctl(), Bus_PDO_QueryInterface(), bus_pnp(), bus_query_capabilities(), CdAddToWorkque(), CdAllowExtendedDasdIo(), CdCommonDevControl(), CdCommonLockControl(), CdCreateIrpContext(), CdFspDispatch(), CdInitializeEnumeration(), CdIsVolumeDirty(), CdIsVolumeMounted(), CdMultipleXAAsync(), CdOperationIsDasdOpen(), CdVerifyFcbOperation(), CdVerifyVcb(), CheckUnlockExtraBuffers(), ClassPnp(), clean_space_cache(), CleanupPendingIrp(), control_ioctl(), create_stream(), delete_reparse_point(), dev_ioctl(), DispCancelListenRequest(), DispCancelRequest(), DispEchoRequest(), DispPrepareIrpForCancel(), DispTdiAssociateAddress(), DispTdiConnect(), DispTdiDisassociateAddress(), DispTdiDisconnect(), DispTdiListen(), DispTdiQueryInformation(), DispTdiQueryInformationEx(), DispTdiQueryIpHwAddress(), DispTdiReceive(), DispTdiReceiveDatagram(), DispTdiSend(), DispTdiSendDatagram(), DispTdiSetEventHandler(), DispTdiSetInformationEx(), do_read(), do_read_job(), Ext2AllowExtendedDasdIo(), Ext2Create(), Ext2CreateFile(), Ext2CreateVolume(), Ext2DeviceControlNormal(), Ext2ExceptionHandler(), Ext2Flush(), Ext2GetReparsePoint(), Ext2GetRetrievalPointerBase(), Ext2GetRetrievalPointers(), Ext2InvalidateVolumes(), Ext2IsVolumeDirty(), Ext2LockIrp(), Ext2LockVolume(), Ext2NotifyChangeDirectory(), Ext2OplockRequest(), Ext2OverwriteEa(), Ext2QueryEa(), Ext2QueryRetrievalPointers(), Ext2ReadWriteBlocks(), Ext2SetDispositionInfo(), Ext2SetEa(), Ext2SetLinkInfo(), Ext2SetRenameInfo(), Ext2SetReparsePoint(), Ext2UnlockVolume(), Ext2VerifyVcb(), Ext2WriteComplete(), FatAddToWorkque(), FatAllowExtendedDasdIo(), FatCheckSystemSecurityAccess(), FatCommonQueryEa(), FatCommonSetEa(), FatCompleteMdl(), FatCreateIrpContext(), FatFspDispatch(), FatGetStatistics(), FatIsVolumeDirty(), FatIsVolumeMounted(), FatMultipleAsync(), FatPagingFileIo(), FatPrePostIrp(), FatQueryBpb(), FatSetRenameInfo(), FatSetZeroOnDeallocate(), FatSingleAsync(), FatSingleNonAlignedSync(), FatSwapVpb(), FatUnlockVolume(), FatUnpinRepinnedBcbs(), FatVerifyOperationIsLegal(), FatVerifyVcb(), FdcFdoPnp(), FdcPdoPnp(), FdcPdoQueryCapabilities(), FdcPdoQueryId(), FdcPower(), FdoPnpControl(), FdoQueryBusRelations(), file_create(), file_create2(), flush_disk_caches(), fsctl_oplock(), fsctl_request(), get_compression(), GetLockedData(), InPortInternalDeviceControl(), InPortPnp(), InPortStartDevice(), IntVideoPortChildQueryCapabilities(), IntVideoPortChildQueryId(), IntVideoPortChildQueryRelations(), IntVideoPortChildQueryText(), IntVideoPortDispatchFdoPnp(), IntVideoPortDispatchPdoPnp(), IntVideoPortDispatchPower(), invalidate_volumes(), IopInitiatePnpIrp(), is_volume_dirty(), IsaFdoPnp(), IsaFdoQueryInterface(), IsaPdoFilterResourceRequirements(), IsaPdoPnp(), IsaPdoQueryCapabilities(), IsaPdoQueryDeviceRelations(), IsaPdoQueryDeviceText(), IsaPdoQueryDeviceUsageNotification(), IsaPdoQueryId(), IsaPdoQueryResourceRequirements(), IsaPdoQueryResources(), IsaReadPortQueryId(), LanAdapterInfo(), LanCloseProtocol(), LanCreateProtocol(), LanDispatch(), LanEnumAdapters(), LanReadData(), LanSetBufferedMode(), LanWriteData(), lock_volume(), LockRequest(), MiSimpleRead(), mount_vol(), mountdev_query_stable_guid(), NdisGenericIrpHandler(), NduDispatchClose(), NduDispatchCreate(), NduDispatchDeviceControl(), NduDispatchRead(), NduDispatchWrite(), nfs41_FsdDispatch(), notify_change_directory(), open_file(), open_file2(), open_file3(), OpenDeviceReadWrite(), oplock_complete(), PciDispatchDeviceControl(), PcmciaDeviceControl(), PcmciaPower(), pdo_device_usage_notification(), pdo_pnp(), pdo_query_device_relations(), pdo_query_id(), PdoPnpControl(), PdoPowerControl(), PdoQueryBusInformation(), PdoQueryCapabilities(), PdoQueryDeviceRelations(), PdoQueryDeviceText(), PdoQueryId(), PdoQueryInterface(), PdoQueryResourceRequirements(), PdoQueryResources(), PdoReadConfig(), PdoStartDevice(), PdoWriteConfig(), pnp_device_usage_notification(), PnpRootFdoPnpControl(), PnpRootPdoPnpControl(), PnpRootPowerControl(), PopSendQuerySystemPowerState(), PopSendSetSystemPowerState(), print_debug_header(), ProcessorPnp(), query_dir_item(), query_directory(), query_info(), QueryAdapterOid(), QueryBinding(), read_data(), ReadIrpCancel(), RxGetSessionId(), SatisfyPacketRecvRequest(), scrub_chunk_raid56_stripe_run(), scrub_extent(), set_case_sensitive_information(), set_compression(), set_reparse_point(), set_valid_data_length_information(), SetAdapterOid(), sync_read_phys(), TCPAcceptEventHandler(), TiCloseFileObject(), TiCreateFileObject(), TiDispatch(), TiDispatchInternal(), TiDispatchOpenClose(), UDFAllocateIrpContext(), UDFCommonCleanup(), UDFCommonClose(), UDFCommonCreate(), UDFCommonDeviceControl(), UDFCommonDirControl(), UDFCommonFileInfo(), UDFCommonFlush(), UDFCommonFSControl(), UDFCommonLockControl(), UDFCommonPnp(), UDFCommonQueryVolInfo(), UDFCommonRead(), UDFCommonSetVolInfo(), UDFCommonShutdown(), UDFCommonWrite(), UDFDismountVolume(), UDFGetFileAllocModeFromICB(), UDFGetRetrievalPointers(), UDFGetStatistics(), UDFGetVolumeBitmap(), UDFInvalidateVolumes(), UDFIsPathnameValid(), UDFIsVolumeDirty(), UDFIsVolumeMounted(), UDFLockVolume(), UDFMdlComplete(), UDFMountVolume(), UDFNotifyChangeDirectory(), UDFPerformVerify(), UDFQueryDirectory(), UDFSetFileAllocModeFromICB(), UDFUnlockVolume(), UDFUserFsCtrlRequest(), UDFVerifyVolume(), unlock_volume(), UnlockRequest(), vol_device_control(), vol_get_device_number(), vol_get_disk_extents(), vol_get_drive_geometry(), vol_get_gpt_attributes(), vol_get_length(), vol_ioctl_passthrough(), vol_is_dynamic(), vol_query_device_name(), vol_query_stable_guid(), vol_query_unique_id(), vol_read(), vol_write(), write_data_phys(), and write_superblock().

◆ Lfn

◆ LfnByteOffset

◆ NoEaKnowledge

◆ OpenCount

Dcb OpenCount = 1

Definition at line 4342 of file create.c.

◆ OpenFileCount

Vcb OpenFileCount = 1

Definition at line 4343 of file create.c.

◆ OpenRequiringOplock

◆ ParentDcb

◆ ShareAccess

◆ Status

Initial value:
= FsRtlCheckOplockEx( FatGetFcbOplock(*Dcb),
IrpContext->OriginatingIrp,
NULL )
#define OPLOCK_FLAG_OPLOCK_KEY_CHECK_ONLY
Definition: fsrtltypes.h:267

Definition at line 4288 of file create.c.

◆ UncleanCount

Dcb UncleanCount = 1

Definition at line 4341 of file create.c.

◆ UnwindCcb

PCCB UnwindCcb = NULL

Definition at line 4213 of file create.c.

Referenced by if().

◆ UnwindDcb

PDCB UnwindDcb = NULL

Definition at line 4212 of file create.c.

Referenced by if().

◆ Vcb