Leaked source code of windows server 2003
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.

172 lines
3.5 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. locks.c
  5. Abstract:
  6. This module implements the mini redirector call down routines pertaining to locks
  7. of file system objects.
  8. Author:
  9. Balan Sethu Raman [SethuR] 7-March-1995
  10. Revision History:
  11. --*/
  12. #include "precomp.h"
  13. #pragma hdrstop
  14. #pragma warning(error:4101) // Unreferenced local variable
  15. //
  16. // The local debug trace level
  17. //
  18. #define Dbg (DEBUG_TRACE_LOCKCTRL)
  19. NTSTATUS
  20. UMRxLocks(
  21. IN PRX_CONTEXT RxContext)
  22. /*++
  23. Routine Description:
  24. This routine handles network requests for filelocks
  25. Arguments:
  26. RxContext - the RDBSS context
  27. Return Value:
  28. RXSTATUS - The return status for the operation
  29. --*/
  30. {
  31. NTSTATUS Status = STATUS_SUCCESS;
  32. RxCaptureFcb;
  33. PMRX_SRV_OPEN SrvOpen = RxContext->pRelevantSrvOpen;
  34. PAGED_CODE();
  35. RxDbgTrace(+1, Dbg, ("UMRxLocks\n", 0 ));
  36. IF_DEBUG {
  37. RxCaptureFobx;
  38. ASSERT (capFobx != NULL);
  39. ASSERT (capFobx->pSrvOpen == RxContext->pRelevantSrvOpen); //ok
  40. }
  41. Status = STATUS_NOT_IMPLEMENTED;
  42. RxDbgTrace(-1, Dbg, ("UMRxLocks exit with status=%08lx\n", Status ));
  43. return(Status);
  44. }
  45. #if 0
  46. NTSTATUS
  47. UMRxUnlockRoutine (
  48. IN PRX_CONTEXT RxContext,
  49. IN PFILE_LOCK_INFO LockInfo
  50. )
  51. /*++
  52. Routine Description:
  53. This routine is called from the RDBSS whenever the fsrtl lock package calls the rdbss unlock routine.
  54. CODE.IMPROVEMENT what should really happen is that this should only be called for unlockall and unlockbykey;
  55. the other cases should be handled in the rdbss.
  56. Arguments:
  57. Context - the RxContext associated with this request
  58. LockInfo - gives information about the particular range being unlocked
  59. Return Value:
  60. RXSTATUS - The return status for the operation
  61. --*/
  62. {
  63. PLOWIO_CONTEXT LowIoContext = &RxContext->LowIoContext;
  64. switch (LowIoContext->Operation) {
  65. case LOWIO_OP_SHAREDLOCK:
  66. case LOWIO_OP_EXCLUSIVELOCK:
  67. case LOWIO_OP_UNLOCK:
  68. return STATUS_SUCCESS;
  69. case LOWIO_OP_UNLOCKALL:
  70. case LOWIO_OP_UNLOCKALLBYKEY:
  71. default:
  72. return STATUS_NOT_IMPLEMENTED;
  73. }
  74. }
  75. #endif
  76. NTSTATUS
  77. UMRxCompleteBufferingStateChangeRequest(
  78. IN OUT PRX_CONTEXT RxContext,
  79. IN OUT PMRX_SRV_OPEN SrvOpen,
  80. IN PVOID pContext
  81. )
  82. /*++
  83. Routine Description:
  84. This routine is called to assert the locks that the wrapper has buffered. currently, it is synchronous!
  85. Arguments:
  86. RxContext - the open instance
  87. SrvOpen - tells which fcb is to be used. CODE.IMPROVEMENT this param is redundant if the rxcontext is filled out completely
  88. Return Value:
  89. RXSTATUS - The return status for the operation
  90. --*/
  91. {
  92. NTSTATUS Status;
  93. PMRX_FCB Fcb = SrvOpen->pFcb;
  94. PUMRX_SRV_OPEN umrxSrvOpen = UMRxGetSrvOpenExtension(SrvOpen);
  95. PAGED_CODE();
  96. RxDbgTrace(+1, Dbg, ("UMRxCompleteBufferingStateChangeRequest\n", 0 ));
  97. ASSERT( NodeType(SrvOpen) == RDBSS_NTC_SRVOPEN );
  98. RxDbgTrace(0,Dbg,("-->Context %lx\n",pContext));
  99. Status = STATUS_SUCCESS;
  100. RxDbgTrace(-1, Dbg, ("UMRxAssertBufferedFileLocks exit with status=%08lx\n", Status ));
  101. return(Status);
  102. }
  103. NTSTATUS
  104. UMRxIsLockRealizable (
  105. IN OUT PMRX_FCB pFcb,
  106. IN PLARGE_INTEGER ByteOffset,
  107. IN PLARGE_INTEGER Length,
  108. IN ULONG LowIoLockFlags
  109. )
  110. {
  111. PAGED_CODE();
  112. return(STATUS_SUCCESS);
  113. }
  114.