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.

80 lines
2.4 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. prefix.hxx
  7. This file contains the path prefixes as returned by the
  8. NetFileEnum2() API.
  9. The NetFileEnum2() API returns all of the *resources* remotely
  10. opened on a particular server. These resources include open
  11. files, communication queues, print queues, and named pipes.
  12. This file contains the prefixes for the various resource types,
  13. plus some useful macros for manipulating the paths returned by
  14. NetFileEnum2().
  15. FILE HISTORY:
  16. KeithMo 19-Aug-1991 Created.
  17. */
  18. #ifndef _PREFIX_HXX
  19. #define _PREFIX_HXX
  20. /*
  21. // NOTE: If any new (standard) resource types are added to
  22. // the system, the following macros must be added:
  23. //
  24. // #define foo_PREFIX "\\foo\\"
  25. // #define LEN_foo_PREFIX ( sizeof(foo_PREFIX) - sizeof(TCHAR) )
  26. //
  27. // #define IS_foo(p) (strncmpf((p), foo_PREFIX, \
  28. // LEN_foo_PREFIX) == 0 )
  29. //
  30. */
  31. //
  32. // The following prefixes are inserted at the beginning of the
  33. // pathnames returned by NetFileEnum2() for non-file resources.
  34. //
  35. #define COMM_PREFIX SZ("\\COMM\\")
  36. #define LEN_COMM_PREFIX ( sizeof(COMM_PREFIX) - sizeof(TCHAR) )
  37. #define PIPE_PREFIX SZ("\\PIPE\\")
  38. #define LEN_PIPE_PREFIX ( sizeof(PIPE_PREFIX) - sizeof(TCHAR) )
  39. #define PRINT_PREFIX SZ("\\PRINT\\")
  40. #define LEN_PRINT_PREFIX ( sizeof(PRINT_PREFIX) - sizeof(TCHAR) )
  41. //
  42. // The following macro will return TRUE if the target pathname
  43. // refers to an open file, and FALSE if the target pathname refers
  44. // to a non-file resource.
  45. //
  46. // BUGBUG: This macros assumes that *only* non-file resources have
  47. // pathnames that begin with a backslash ('\'). This is
  48. // always true for LanMan 2.x and NT Product 1, but it
  49. // might not be true for NT Product > 1.
  50. //
  51. #define IS_FILE(p) (*(p) != TCH('\\'))
  52. //
  53. // The following macros identify the various non-file resource types.
  54. //
  55. #define IS_COMM(p) (strncmpf((p), COMM_PREFIX, LEN_COMM_PREFIX ) == 0)
  56. #define IS_PIPE(p) (strncmpf((p), PIPE_PREFIX, LEN_PIPE_PREFIX ) == 0)
  57. #define IS_PRINT(p) (strncmpf((p), PRINT_PREFIX, LEN_PRINT_PREFIX) == 0)
  58. #endif // _PREFIX_HXX