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.

113 lines
1.8 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. stats.c
  5. Abstract:
  6. This module contains support for the NetStatisticsGet API for the NT
  7. OS/2 server service.
  8. Author:
  9. David Treadwell (davidtr) 12-Apr-1991
  10. Revision History:
  11. --*/
  12. #include "srvsvcp.h"
  13. NET_API_STATUS NET_API_FUNCTION
  14. NetrServerStatisticsGet (
  15. IN LPTSTR ServerName,
  16. IN LPTSTR Service,
  17. IN DWORD Level,
  18. IN DWORD Options,
  19. OUT LPSTAT_SERVER_0 *InfoStruct
  20. )
  21. /*++
  22. Routine Description:
  23. This routine communicates with the server FSD to implement the
  24. server half of the NetStatisticsGet function.
  25. Arguments:
  26. None.
  27. Return Value:
  28. NET_API_STATUS - NO_ERROR or reason for failure.
  29. --*/
  30. {
  31. NET_API_STATUS error;
  32. PSERVER_REQUEST_PACKET srp;
  33. ServerName, Service;
  34. //
  35. // The only valid level is 0.
  36. //
  37. if ( Level != 0 ) {
  38. return ERROR_INVALID_LEVEL;
  39. }
  40. //
  41. // No options supported.
  42. //
  43. if ( Options != 0 ) {
  44. return ERROR_INVALID_PARAMETER;
  45. }
  46. //
  47. // Make sure that the caller has the access necessary for this
  48. // operation.
  49. //
  50. error = SsCheckAccess(
  51. &SsStatisticsSecurityObject,
  52. SRVSVC_STATISTICS_GET
  53. );
  54. if ( error != NO_ERROR ) {
  55. return ERROR_ACCESS_DENIED;
  56. }
  57. //
  58. // Set up the request packet.
  59. //
  60. srp = SsAllocateSrp( );
  61. if ( srp == NULL ) {
  62. return ERROR_NOT_ENOUGH_MEMORY;
  63. }
  64. //
  65. // Send the request to the server.
  66. //
  67. error = SsServerFsControlGetInfo(
  68. FSCTL_SRV_NET_STATISTICS_GET,
  69. srp,
  70. (PVOID *)InfoStruct,
  71. (ULONG)-1
  72. );
  73. SsFreeSrp( srp );
  74. return error;
  75. } // NetrServerStatisticsGet