3683{
3691
3693
3694 DPRINT(
"RxFindOrCreateConnections(%p, %wZ, %x, %p, %p, %p, %p)\n",
3695 RxContext, CanonicalName, NetRootType, LocalNetRootName,
3696 FilePathName,
LockState, RxConnectionId);
3697
3698 *FilePathName = *CanonicalName;
3699 LocalNetRootName->Length = 0;
3700 LocalNetRootName->MaximumLength = 0;
3701 LocalNetRootName->Buffer = CanonicalName->Buffer;
3702
3703
3704 if (FilePathName->Buffer[1] == ';')
3705 {
3708
3710 for (
i = 2;
i < FilePathName->Length /
sizeof(
WCHAR); ++
i)
3711 {
3713 {
3715 break;
3716 }
3717 }
3718
3719 if (!Slash)
3720 {
3722 }
3723
3724 FilePathName->Buffer = &FilePathName->Buffer[
i];
3726 LocalNetRootName->Length =
Length;
3727 LocalNetRootName->MaximumLength =
Length;
3728 FilePathName->Length -=
Length;
3729
3730 DPRINT(
"CanonicalName: %wZ\n", CanonicalName);
3731 DPRINT(
" -> FilePathName: %wZ\n", FilePathName);
3732 DPRINT(
" -> LocalNetRootName: %wZ\n", LocalNetRootName);
3733 }
3734
3736 PrefixTable = RxContext->RxDeviceObject->pRxNetNameTable;
3737
3739 {
3740RetryLookup:
3742
3743
3744 if (Container !=
NULL)
3745 {
3747 {
3750 break;
3751
3754 break;
3755
3758 break;
3759
3760 default:
3761
3763 break;
3764 }
3765 }
3766
3767
3769 DPRINT(
"Container %p for path %wZ\n", Container, FilePathName);
3770
3772 {
3774
3778
3779
3780 RxContext->Create.pVNetRoot =
NULL;
3781 RxContext->Create.pNetRoot =
NULL;
3782 RxContext->Create.pSrvCall =
NULL;
3783 RxContext->Create.Type = NetRootType;
3784
3785
3786 if (Container !=
NULL)
3787 {
3788
3790 {
3791 VNetRoot = Container;
3792
3794
3795
3797 {
3799 DPRINT(
"Waiting for stable condition for: %p\n", NetRoot);
3803
3804
3806 {
3807 goto RetryLookup;
3808 }
3809 }
3810
3811
3813 {
3815
3816
3818 SrvCall->RxDeviceObject == RxContext->RxDeviceObject)
3819 {
3823
3826 }
3827 }
3828
3829
3831 {
3833 }
3834 else
3835 {
3836 Status = VNetRoot->ConstructionStatus;
3837 }
3838
3841 }
3842
3843 else
3844 {
3846 SrvCall = Container;
3847
3848
3850 {
3852 DPRINT(
"Waiting for stable condition for: %p\n", SrvCall);
3856
3857
3859 {
3860 goto RetryLookup;
3861 }
3862 }
3863
3864
3866 {
3867
3869 {
3871 }
3872 else
3873 {
3874 Status = SrvCall->Status;
3875 }
3876
3879 }
3880 }
3881 }
3882
3883
3885 SrvCall->RxDeviceObject != RxContext->RxDeviceObject)
3886 {
3890 }
3891
3892
3894 {
3896 {
3900 goto RetryLookup;
3901 }
3902
3905 }
3906
3908
3909
3910 if (Container !=
NULL)
3911 {
3912 break;
3913 }
3914
3915
3917 DPRINT(
" -> SrvCallName: %wZ\n", &SrvCallName);
3918
3920 if (SrvCall ==
NULL)
3921 {
3924 }
3925
3926
3928 RxContext->Create.pVNetRoot =
NULL;
3929 RxContext->Create.pNetRoot =
NULL;
3930 RxContext->Create.pSrvCall =
NULL;
3931 RxContext->Create.Type = NetRootType;
3932 Container = SrvCall;
3933
3934
3938 {
3944 }
3945
3946
3947 }
3948
3949
3952 ASSERT(SrvCall->RxDeviceObject == RxContext->RxDeviceObject);
3953
3954
3955 SrvCall->RxDeviceObject->Dispatch->MRxExtractNetRootName(FilePathName, (
PMRX_SRV_CALL)SrvCall, &NetRootName,
NULL);
3956
3958 if (NetRoot ==
NULL)
3959 {
3962 }
3963 NetRoot->Type = NetRootType;
3964
3966
3967
3968 VNetRoot =
RxCreateVNetRoot(RxContext, NetRoot, CanonicalName, LocalNetRootName, FilePathName, RxConnectionId);
3969 if (VNetRoot ==
NULL)
3970 {
3974 }
3976
3977
3982
3983
3986 {
3988 DPRINT1(
"RxConstructNetRoot failed Ctxt: %p, VNet: %p, Status: %lx, Condition: %d\n", RxContext, VNetRoot,
Status, VNetRoot->
Condition);
3990
3991 RxContext->Create.pNetRoot =
NULL;
3992 RxContext->Create.pVNetRoot =
NULL;
3993 }
3994 else
3995 {
3997
3999
4000 Stack = RxContext->CurrentIrpSp;
4002 {
4005 }
4006 }
4007 }
4009 {
4011 {
4013 {
4016 }
4017 }
4018 }
4020
4021 DPRINT(
"RxFindOrCreateConnections() = Status: %x\n",
Status);
4023}
#define OBJ_NAME_PATH_SEPARATOR
_Inout_ PFCB _Inout_ PUNICODE_STRING RemainingName
#define RxDereferenceNetRoot(NetRoot, LockHoldingState)
struct _SRV_CALL * PSRV_CALL
#define RxTransitionVNetRoot(V, C)
#define RxWaitForStableSrvCall(S, R)
#define RxReferenceVNetRoot(VNetRoot)
#define RxWaitForStableNetRoot(N, R)
#define RxReferenceSrvCall(SrvCall)
#define RxDereferenceVNetRoot(VNetRoot, LockHoldingState)
#define RxDereferenceSrvCall(SrvCall, LockHoldingState)
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock IN PNDIS_RW_LOCK IN PLOCK_STATE LockState
#define FILE_CREATE_TREE_CONNECTION
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
struct _MRX_NET_ROOT_ * PMRX_NET_ROOT
struct _MRX_V_NET_ROOT_ * PMRX_V_NET_ROOT
struct _MRX_SRV_CALL_ * PMRX_SRV_CALL
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define STATUS_BAD_NETWORK_NAME
#define STATUS_CONNECTION_ACTIVE
#define RxIsPrefixTableLockAcquired(T)
#define RxAcquirePrefixTableLockExclusive(T, W)
#define RxReleasePrefixTableLock(T)
VOID RxExclusivePrefixTableLockToShared(PRX_PREFIX_TABLE Table)
PV_NET_ROOT RxCreateVNetRoot(IN PRX_CONTEXT RxContext, IN PNET_ROOT NetRoot, IN PUNICODE_STRING CanonicalName, IN PUNICODE_STRING LocalNetRootName, IN PUNICODE_STRING FilePath, IN PRX_CONNECTION_ID RxConnectionId)
VOID RxExtractServerName(IN PUNICODE_STRING FilePathName, OUT PUNICODE_STRING SrvCallName, OUT PUNICODE_STRING RestOfName)
PNET_ROOT RxCreateNetRoot(IN PSRV_CALL SrvCall, IN PUNICODE_STRING Name, IN ULONG NetRootFlags, IN PRX_CONNECTION_ID OPTIONAL RxConnectionId)
BOOLEAN RxFinalizeNetRoot(OUT PNET_ROOT ThisNetRoot, IN BOOLEAN RecursiveFinalize, IN BOOLEAN ForceFinalize)
PVOID RxPrefixTableLookupName(IN PRX_PREFIX_TABLE ThisTable, IN PUNICODE_STRING CanonicalName, OUT PUNICODE_STRING RemainingName, IN PRX_CONNECTION_ID ConnectionId)
PSRV_CALL RxCreateSrvCall(IN PRX_CONTEXT RxContext, IN PUNICODE_STRING Name, IN PUNICODE_STRING InnerNamePrefix OPTIONAL, IN PRX_CONNECTION_ID RxConnectionId)
NTSTATUS RxConstructNetRoot(IN PRX_CONTEXT RxContext, IN PSRV_CALL SrvCall, IN PNET_ROOT NetRoot, IN PV_NET_ROOT VirtualNetRoot, OUT PLOCK_HOLDING_STATE LockHoldingState)
NTSTATUS RxConstructSrvCall(IN PRX_CONTEXT RxContext, IN PSRV_CALL SrvCall, OUT PLOCK_HOLDING_STATE LockHoldingState)
#define RDBSS_NTC_NETROOT
#define RDBSS_NTC_SRVCALL
#define RDBSS_NTC_V_NETROOT
RX_BLOCK_CONDITION Condition
RX_BLOCK_CONDITION Condition
RX_BLOCK_CONDITION Condition
#define STATUS_UNSUCCESSFUL
#define STATUS_OBJECT_NAME_INVALID
#define STATUS_INSUFFICIENT_RESOURCES
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack