Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
4.5 KiB

  1. /*++ BUILD Version: 0009 // Increment this if a change has global effects
  2. Copyright (c) 1987-1993 Microsoft Corporation
  3. Module Name:
  4. srvcall.c
  5. Abstract:
  6. This module implements the routines for handling the creation/manipulation of
  7. server entries in the connection engine database. It also contains the routines
  8. for parsing the negotiate response from the server.
  9. Author:
  10. Balan Sethu Raman (SethuR) 06-Mar-95 Created
  11. --*/
  12. #include "precomp.h"
  13. #pragma hdrstop
  14. RXDT_DefineCategory(SRVCALL);
  15. #define Dbg (DEBUG_TRACE_SRVCALL)
  16. NTSTATUS
  17. MRxProxyCreateSrvCall(
  18. PMRX_SRV_CALL pSrvCall,
  19. PMRX_SRVCALL_CALLBACK_CONTEXT pCallbackContext)
  20. /*++
  21. Routine Description:
  22. This routine just rejects any MRxCreateSrvCalls that come down.
  23. Arguments:
  24. RxContext - Supplies the context of the original create/ioctl
  25. CallBackContext - the call back context in RDBSS for continuation.
  26. Return Value:
  27. RXSTATUS - The return status for the operation
  28. Notes:
  29. --*/
  30. {
  31. PMRX_SRVCALL_CALLBACK_CONTEXT SCCBC = pCallbackContext;
  32. PMRX_SRVCALLDOWN_STRUCTURE SrvCalldownStructure = (PMRX_SRVCALLDOWN_STRUCTURE)(pCallbackContext->SrvCalldownStructure);
  33. ASSERT( pSrvCall );
  34. ASSERT( NodeType(pSrvCall) == RDBSS_NTC_SRVCALL );
  35. SCCBC->Status = (STATUS_BAD_NETWORK_PATH);
  36. SrvCalldownStructure->CallBack(SCCBC);
  37. return STATUS_PENDING;
  38. }
  39. NTSTATUS
  40. MRxProxyFinalizeSrvCall(
  41. PMRX_SRV_CALL pSrvCall,
  42. BOOLEAN Force)
  43. /*++
  44. Routine Description:
  45. This routine destroys a given server call instance
  46. Arguments:
  47. pSrvCall - the server call instance to be disconnected.
  48. Force - TRUE if a disconnection is to be enforced immediately.
  49. Return Value:
  50. RXSTATUS - The return status for the operation
  51. --*/
  52. {
  53. NTSTATUS Status = STATUS_SUCCESS;
  54. #if 0
  55. PPROXYCEDB_SERVER_ENTRY pServerEntry;
  56. pServerEntry = ProxyCeGetAssociatedServerEntry(pSrvCall);
  57. if (pServerEntry != NULL) {
  58. ProxyCeAcquireResource();
  59. ASSERT(pServerEntry->pRdbssSrvCall == pSrvCall);
  60. pServerEntry->pRdbssSrvCall = NULL;
  61. ProxyCeDereferenceServerEntry(pServerEntry);
  62. ProxyCeReleaseResource();
  63. }
  64. #endif //0
  65. pSrvCall->Context = NULL;
  66. return Status;
  67. }
  68. NTSTATUS
  69. MRxProxySrvCallWinnerNotify(
  70. IN PMRX_SRV_CALL pSrvCall,
  71. IN BOOLEAN ThisMinirdrIsTheWinner,
  72. IN OUT PVOID pSrvCallContext)
  73. /*++
  74. Routine Description:
  75. This routine finalizes the mini rdr context associated with an RDBSS Server call instance
  76. Arguments:
  77. pSrvCall - the Server Call
  78. ThisMinirdrIsTheWinner - TRUE if this mini rdr is the choosen one.
  79. pSrvCallContext - the server call context created by the mini redirector.
  80. Return Value:
  81. RXSTATUS - The return status for the operation
  82. Notes:
  83. The two phase construction protocol for Server calls is required because of parallel
  84. initiation of a number of mini redirectors. The RDBSS finalizes the particular mini
  85. redirector to be used in communicating with a given server based on quality of
  86. service criterion.
  87. --*/
  88. {
  89. NTSTATUS Status = STATUS_SUCCESS;
  90. //PPROXYCEDB_SERVER_ENTRY pServerEntry;
  91. //pServerEntry = (PPROXYCEDB_SERVER_ENTRY)pSrvCallContext;
  92. #if 0
  93. if (!ThisMinirdrIsTheWinner) {
  94. // Some other mini rdr has been choosen to connect to the server. Destroy
  95. // the data structures created for this mini redirector.
  96. ProxyCeUpdateServerEntryState(pServerEntry,PROXYCEDB_MARKED_FOR_DELETION);
  97. ProxyCeDereferenceServerEntry(pServerEntry);
  98. } else {
  99. pSrvCall->Context = pServerEntry;
  100. pSrvCall->Flags |= SRVCALL_FLAG_CASE_INSENSITIVE_NETROOTS | SRVCALL_FLAG_CASE_INSENSITIVE_FILENAMES;
  101. //check for loopback.....BUGBUG.ALA.RDR1
  102. //since servers now respond to multiple names.....this doesn't really cut it....
  103. {
  104. UNICODE_STRING ServerName;
  105. BOOLEAN CaseInsensitive = TRUE;
  106. ASSERT (pServerEntry->pRdbssSrvCall == pSrvCall);
  107. //DbgPrint("ServerName is %wZ\n", pSrvCall->pSrvCallName);
  108. //DbgPrint("ComputerName is %wZ\n", &ProxyCeContext.ComputerName);
  109. ServerName = *pSrvCall->pSrvCallName;
  110. ServerName.Buffer++; ServerName.Length -= sizeof(WCHAR);
  111. if (RtlEqualUnicodeString(&ServerName,&ProxyCeContext.ComputerName,CaseInsensitive)) {
  112. //DbgPrint("LOOPBACK!!!!!\n");
  113. pServerEntry->Server.IsLoopBack = TRUE;
  114. }
  115. }
  116. }
  117. #endif //0
  118. return STATUS_SUCCESS;
  119. }
  120.