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.

101 lines
2.1 KiB

  1. /*++
  2. Copyright (c) 1991 Microsoft Corporation
  3. Module Name:
  4. SvcStats.c
  5. Abstract:
  6. Contains Net statistics routines for net DLL:
  7. NetStatisticsGet
  8. Author:
  9. Richard L Firth (rfirth) 12-05-1991
  10. Revision History:
  11. 21-Jan-1992 rfirth
  12. Call wrapper routines, not rpc client-side stubs
  13. 12-05-1991 rfirth
  14. Created
  15. --*/
  16. #include <windows.h>
  17. #include <lmcons.h>
  18. #include <lmstats.h>
  19. #include <lmsname.h>
  20. #include <tstring.h>
  21. #include <netstats.h> // private statistics routines in server and wksta services
  22. NET_API_STATUS
  23. NET_API_FUNCTION
  24. NetStatisticsGet(
  25. IN LPTSTR ServerName,
  26. IN LPTSTR Service,
  27. IN DWORD Level,
  28. IN DWORD Options,
  29. OUT LPBYTE* Buffer
  30. )
  31. /*++
  32. Routine Description:
  33. Returns statistics to the caller from the specified service. Only SERVER
  34. and WORKSTATION are currently supported.
  35. Arguments:
  36. ServerName - where to run this API
  37. Service - name of service to get stats from
  38. Level - of information required. MBZ
  39. Options - various flags. Currently, only bit 0 (clear) is supported
  40. Buffer - pointer to pointer to returned buffer
  41. Return Value:
  42. NET_API_STATUS
  43. Success - NERR_Success
  44. Failure - ERROR_INVALID_LEVEL
  45. Level not 0
  46. ERROR_INVALID_PARAMETER
  47. Unsupported options requested
  48. ERROR_NOT_SUPPORTED
  49. Service is not SERVER or WORKSTATION
  50. ERROR_ACCESS_DENIED
  51. Caller doesn't have necessary access rights for request
  52. --*/
  53. {
  54. //
  55. // set the caller's buffer pointer to known value. This will kill the
  56. // calling app if it gave us a bad pointer and didn't use try...except
  57. //
  58. *Buffer = NULL;
  59. //
  60. // leave other parameter validation to specific stats function
  61. //
  62. if (!STRICMP(Service, SERVICE_WORKSTATION)) {
  63. return NetWkstaStatisticsGet(ServerName, Level, Options, Buffer);
  64. } else if (!STRICMP(Service, SERVICE_SERVER)) {
  65. return NetServerStatisticsGet(ServerName, Level, Options, Buffer);
  66. } else {
  67. return ERROR_NOT_SUPPORTED;
  68. }
  69. }