ReactOS 0.4.15-dev-7788-g1ad9096
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:755
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:756
ULONG FailedCreates
Definition: winioctl.h:757

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 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:2417
#define FatCompleteRequest(IRPCONTEXT, IRP, STATUS)
Definition: fatprocs.h:2633
#define FatDeviceIsFatFsdo(D)
Definition: fatprocs.h:3095
PIRP_CONTEXT FatCreateIrpContext(IN PIRP Irp, IN BOOLEAN Wait)
Definition: strucsup.c:2301
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
Status
Definition: gdiplustypes.h:25
#define FILE_OPENED
Definition: nt_native.h:769
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define IoCompleteRequest
Definition: irp.c:1240
VOID NTAPI IoSetTopLevelIrp(IN PIRP Irp)
Definition: irp.c:2000
#define STATUS_PENDING
Definition: ntstatus.h:82
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:159
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
#define _SEH2_GetExceptionInformation()
Definition: pseh2_64.h:158
#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 6938 of file create.c.

6944{
6945 //
6946 // Set the event so that our call will wake up.
6947 //
6948
6949 KeSetEvent( (PKEVENT)Contxt, 0, FALSE );
6950
6953
6954 //
6955 // If we change this return value then FatIoCallSelf needs to reference the
6956 // file object.
6957 //
6958
6960}
#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 6870 of file create.c.

6901{
6902 PAGED_CODE();
6903
6904#if (NTDDI_VERSION >= NTDDI_VISTA)
6905 //
6906 // Do an extra test for writeable user sections if the user did not allow
6907 // write sharing - this is neccessary since a section may exist with no handles
6908 // open to the file its based against.
6909 //
6910
6911 if ((NodeType( FcbOrDcb ) == FAT_NTC_FCB) &&
6915
6917 }
6918#endif
6919
6920 //
6921 // Check if the Fcb has the proper share access.
6922 //
6923
6926 FileObject,
6928 FALSE );
6929
6930 UNREFERENCED_PARAMETER( IrpContext );
6931}
ULONG NTAPI MmDoesFileHaveUserWritableReferences(IN PSECTION_OBJECT_POINTERS SectionPointer)
Definition: section.c:3352
#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:4147
#define FAT_NTC_FCB
Definition: nodetype.h:29
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
IN PFCB FcbOrDcb
Definition: fatprocs.h:306
#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:3390
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 6828 of file create.c.

6831{
6833 PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation( IrpContext->OriginatingIrp );
6834
6835 PAGED_CODE();
6836
6837 //
6838 // We check if the caller wants ACCESS_SYSTEM_SECURITY access on this
6839 // object and fail the request if he does.
6840 //
6841
6842 NT_ASSERT( IrpSp->Parameters.Create.SecurityContext != NULL );
6843 AccessState = IrpSp->Parameters.Create.SecurityContext->AccessState;
6844
6845 //
6846 // Check if the remaining privilege includes ACCESS_SYSTEM_SECURITY.
6847 //
6848
6849 if (FlagOn( AccessState->RemainingDesiredAccess, ACCESS_SYSTEM_SECURITY )) {
6850
6852 UserMode )) {
6853
6854 return STATUS_ACCESS_DENIED;
6855 }
6856
6857 //
6858 // Move this privilege from the Remaining access to Granted access.
6859 //
6860
6861 ClearFlag( AccessState->RemainingDesiredAccess, ACCESS_SYSTEM_SECURITY );
6862 SetFlag( AccessState->PreviouslyGrantedAccess, ACCESS_SYSTEM_SECURITY );
6863 }
6864
6865 return STATUS_SUCCESS;
6866}
LUID FatSecurityPrivilege
Definition: create.c:50
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define ClearFlag(_F, _SF)
Definition: ext2fs.h:191
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
HRESULT Create([out]ITransactionReceiver **ppReceiver)
#define UserMode
Definition: asm.h:35
#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
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3128
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
#define NT_ASSERT
Definition: rtlfuncs.h:3310
_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 6718 of file create.c.

6747{
6748 PAGED_CODE();
6749
6750 UNREFERENCED_PARAMETER( IrpContext );
6751
6753
6754 //
6755 // Prefer the ExactCaseLongName of the file for this operation, if set. In
6756 // this way we avoid building the fullname with a short filename. Several
6757 // operations assume this - the FinalNameLength in particular is the Lfn
6758 // (if existant) length, and we use this to crack the fullname in paths
6759 // such as the FsRtlNotify caller.
6760 //
6761 // If the caller specified a particular name and it is short, it is the
6762 // case that the long name was set up.
6763 //
6764
6766
6768 FinalName = &Fcb->ExactCaseLongName;
6769 }
6770
6771 //
6772 // Special case the root.
6773 //
6774
6776
6778 Fcb->FullFileName.MaximumLength = sizeof(WCHAR) + FinalName->Length;
6779
6783
6784 Fcb->FullFileName.Buffer[0] = L'\\';
6785
6787 &FinalName->Buffer[0],
6788 FinalName->Length );
6789
6790 } else {
6791
6793
6794 Prefix = &Fcb->ParentDcb->FullFileName;
6795
6796 //
6797 // It is possible our parent's full filename is not set. Simply fail
6798 // this attempt.
6799 //
6800
6801 if (Prefix->Buffer == NULL) {
6802
6803 return;
6804 }
6805
6807 Fcb->FullFileName.MaximumLength = Prefix->Length + sizeof(WCHAR) + FinalName->Length;
6808
6812
6814 &Prefix->Buffer[0],
6815 Prefix->Length );
6816
6817 Fcb->FullFileName.Buffer[Prefix->Length / sizeof(WCHAR)] = L'\\';
6818
6819 RtlCopyMemory( &Fcb->FullFileName.Buffer[(Prefix->Length / sizeof(WCHAR)) + 1],
6820 &FinalName->Buffer[0],
6821 FinalName->Length );
6822
6823 }
6824}
_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:1630
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by FatSetRenameInfo().

◆ if() [1/5]

Definition at line 4379 of file create.c.

4379 {
4380
4381 if (CountsIncremented) {
4382
4383 (*Dcb)->UncleanCount -= 1;
4384 (*Dcb)->OpenCount -= 1;
4385 Vcb->OpenFileCount -= 1;
4386 if (IsFileObjectReadOnly(FileObject)) { Vcb->ReadOnlyCount -= 1; }
4387 }
4388
4389 if (UnwindDcb != NULL) {
4391 FileObject->SectionObjectPointer = NULL;
4392 }
4393 FatDeleteFcb( IrpContext, &UnwindDcb );
4394 *Dcb = NULL;
4395 }
4396 if (UnwindCcb != NULL) { FatDeleteCcb( IrpContext, &UnwindCcb ); }
4397 }
PCCB UnwindCcb
Definition: create.c:4212
PDCB UnwindDcb
Definition: create.c:4211
BOOLEAN CountsIncremented
Definition: create.c:4214
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB * Dcb
Definition: create.c:4140
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:2866
#define ARGUMENT_PRESENT(ArgumentPointer)
#define Vcb
Definition: cdprocs.h:1415

◆ if() [2/5]

Definition at line 4313 of file create.c.

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

◆ if() [3/5]

Definition at line 4343 of file create.c.

4343{ Vcb->ReadOnlyCount += 1; }

◆ if() [4/5]

Definition at line 4355 of file create.c.

4355 {
4356 PCCB Ccb;
4357
4358 Ccb = (PCCB)FileObject->FsContext2;
4359
4360 //
4361 // Mark the OpenedByShortName bit if the operation was successful.
4362 //
4363
4364 if ( FileNameOpenedDos ) {
4365
4367 }
4368 }
_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:4151
#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 4300 of file create.c.

4301 {
4302
4304 IrpContext->OriginatingIrp,
4305 ((*Dcb)->UncleanCount + 1) );
4306 }
#define FatGetFcbOplock(F)
Definition: fatprocs.h:1656
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 4370 of file create.c.

◆ _SEH2_END

_SEH2_END

Definition at line 4400 of file create.c.

◆ _SEH2_FINALLY

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

Definition at line 4371 of file create.c.

◆ _SEH2_TRY

_SEH2_TRY

Definition at line 4226 of file create.c.

◆ CountsIncremented

CountsIncremented = FALSE

Definition at line 4214 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 4353 of file create.c.

◆ Iosb

Definition at line 4402 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(), 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 4137 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_EvalMethod(), 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 4341 of file create.c.

◆ OpenFileCount

Vcb OpenFileCount = 1

Definition at line 4342 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 4287 of file create.c.

◆ UncleanCount

Dcb UncleanCount = 1

Definition at line 4340 of file create.c.

◆ UnwindCcb

PCCB UnwindCcb = NULL

Definition at line 4212 of file create.c.

Referenced by if().

◆ UnwindDcb

PDCB UnwindDcb = NULL

Definition at line 4211 of file create.c.

Referenced by if().

◆ Vcb