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.

127 lines
2.6 KiB

  1. /*
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. fsp_vol.c
  5. Abstract:
  6. This module contains the entry points for the AFP volume APIs. The API
  7. dispatcher calls these. These are all callable from FSP.
  8. Author:
  9. Jameel Hyder (microsoft!jameelh)
  10. Revision History:
  11. 10 Dec 1992 Initial Version
  12. Notes: Tab stop: 4
  13. --*/
  14. #define FILENUM FILE_FSP_VOL
  15. #include <afp.h>
  16. #include <gendisp.h>
  17. #ifdef ALLOC_PRAGMA
  18. #pragma alloc_text( PAGE, AfpFspDispOpenVol)
  19. #endif
  20. /*** AfpFspDispOpenVol
  21. *
  22. * This routine implements the AfpOpenVol API.
  23. *
  24. * The request packet is represented below.
  25. *
  26. * sda_ReqBlock DWORD Bitmap
  27. * sda_Name1 ANSI_STRING VolName
  28. * sda_Name2 ANSI_STRING VolPassword OPTIONAL
  29. */
  30. AFPSTATUS FASTCALL
  31. AfpFspDispOpenVol(
  32. IN PSDA pSda
  33. )
  34. {
  35. AFPSTATUS Status;
  36. struct _RequestPacket
  37. {
  38. DWORD _Bitmap;
  39. };
  40. PAGED_CODE( );
  41. DBGPRINT(DBG_COMP_AFPAPI_VOL, DBG_LEVEL_INFO,
  42. ("AfpFspDispOpenVol: Entered\n"));
  43. ASSERT (pSda->sda_ReplyBuf != NULL);
  44. if ((Status = AfpConnectionOpen(pSda, &pSda->sda_Name1, &pSda->sda_Name2,
  45. pReqPkt->_Bitmap, pSda->sda_ReplyBuf)) != AFP_ERR_NONE)
  46. {
  47. AfpFreeReplyBuf(pSda, FALSE);
  48. }
  49. return Status;
  50. }
  51. /*** AfpFspDispGetVolParms
  52. *
  53. * This routine implements the AfpGetVolParms API, at task level. We need to
  54. * come to this routine if DiskQuota is enabled on the volume because we have
  55. * to be at task level to query quota info
  56. *
  57. * The request packet is represented below.
  58. *
  59. * sda_ReqBlock DWORD VolId
  60. * sda_ReqBlock DWORD Bitmap
  61. */
  62. AFPSTATUS FASTCALL
  63. AfpFspDispGetVolParms(
  64. IN PSDA pSda
  65. )
  66. {
  67. AFPSTATUS Status = AFP_ERR_PARAM;
  68. PVOLDESC pVolDesc;
  69. struct _RequestPacket
  70. {
  71. PCONNDESC _pConnDesc;
  72. DWORD _Bitmap;
  73. };
  74. DBGPRINT(DBG_COMP_AFPAPI_VOL, DBG_LEVEL_INFO,
  75. ("AfpFspDispGetVolParms: Entered\n"));
  76. ASSERT(KeGetCurrentIrql() != DISPATCH_LEVEL);
  77. ASSERT(VALID_CONNDESC(pReqPkt->_pConnDesc) &&
  78. VALID_VOLDESC(pReqPkt->_pConnDesc->cds_pVolDesc));
  79. pVolDesc = pReqPkt->_pConnDesc->cds_pVolDesc;
  80. ASSERT(pVolDesc->vds_Flags & VOLUME_DISKQUOTA_ENABLED);
  81. pSda->sda_ReplySize = AfpVolumeGetParmsReplyLength(
  82. pReqPkt->_Bitmap,
  83. pVolDesc->vds_MacName.Length);
  84. if ((Status = AfpAllocReplyBuf(pSda)) == AFP_ERR_NONE)
  85. {
  86. if (AfpConnectionReferenceByPointer(pReqPkt->_pConnDesc) != NULL)
  87. {
  88. afpUpdateDiskQuotaInfo(pReqPkt->_pConnDesc);
  89. }
  90. AfpVolumePackParms(pSda, pVolDesc, pReqPkt->_Bitmap, pSda->sda_ReplyBuf);
  91. }
  92. return Status;
  93. }
  94.