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.

239 lines
5.5 KiB

  1. /*
  2. * Copyright (c) 1990-1999 Microsoft Corporation
  3. * linkinfo.h - LinkInfo ADT module description.
  4. */
  5. #ifndef __LINKINFO_H__
  6. #define __LINKINFO_H__
  7. #if _MSC_VER > 1000
  8. #pragma once
  9. #endif
  10. #ifdef __cplusplus
  11. extern "C" { /* Assume C declarations for C++. */
  12. #endif /* __cplusplus */
  13. /* Constants
  14. ************/
  15. /* Define API decoration for direct export or import of DLL functions. */
  16. #ifdef _LINKINFO_
  17. #define LINKINFOAPI
  18. #else
  19. #define LINKINFOAPI DECLSPEC_IMPORT
  20. #endif
  21. /* Types
  22. ********/
  23. /* LinkInfo structure */
  24. typedef struct _linkinfo
  25. {
  26. /* size of LinkInfo structure, including ucbSize field */
  27. UINT ucbSize;
  28. }
  29. LINKINFO;
  30. typedef LINKINFO *PLINKINFO;
  31. typedef const LINKINFO CLINKINFO;
  32. typedef const LINKINFO *PCLINKINFO;
  33. /* input flags to ResolveLinkInfo() */
  34. typedef enum _resolvelinkinfoinflags
  35. {
  36. /* Set up connection to referent. */
  37. RLI_IFL_CONNECT = 0x0001,
  38. /*
  39. * Set up temporary connection to referent. May only be set if
  40. * RLI_IFL_CONNECT is also set.
  41. */
  42. RLI_IFL_TEMPORARY = 0x0002,
  43. /* Allow interaction with user. */
  44. RLI_IFL_ALLOW_UI = 0x0004,
  45. /* Resolve to redirected local device path. */
  46. RLI_IFL_REDIRECT = 0x0008,
  47. /* Update source LinkInfo structure if necessary. */
  48. RLI_IFL_UPDATE = 0x0010,
  49. /* Search matching local devices for missing volume. */
  50. RLI_IFL_LOCAL_SEARCH = 0x0020,
  51. /* flag combinations */
  52. ALL_RLI_IFLAGS = (RLI_IFL_CONNECT |
  53. RLI_IFL_TEMPORARY |
  54. RLI_IFL_ALLOW_UI |
  55. RLI_IFL_REDIRECT |
  56. RLI_IFL_UPDATE |
  57. RLI_IFL_LOCAL_SEARCH)
  58. }
  59. RESOLVELINKINFOINFLAGS;
  60. /* output flags from ResolveLinkInfo() */
  61. typedef enum _resolvelinkinfooutflags
  62. {
  63. /*
  64. * Only set if RLI_IFL_UPDATE was set in dwInFlags. The source LinkInfo
  65. * structure needs updating, and *ppliUpdated points to an updated LinkInfo
  66. * structure.
  67. */
  68. RLI_OFL_UPDATED = 0x0001,
  69. /*
  70. * Only set if RLI_IFL_CONNECT was set in dwInFlags. A connection to a net
  71. * resource was established to resolve the LinkInfo. DisconnectLinkInfo()
  72. * should be called to shut down the connection when the caller is finished
  73. * with the remote referent. DisconnectLinkInfo() need not be called if
  74. * RLI_IFL_TEMPORARY was also set in dwInFlags.
  75. */
  76. RLI_OFL_DISCONNECT = 0x0002,
  77. /* flag combinations */
  78. ALL_RLI_OFLAGS = (RLI_OFL_UPDATED |
  79. RLI_OFL_DISCONNECT)
  80. }
  81. RESOLVELINKINFOOUTFLAGS;
  82. /* LinkInfo data types used by GetLinkInfo() */
  83. typedef enum _linkinfodatatype
  84. {
  85. /* PCDWORD - pointer to volume's serial number */
  86. LIDT_VOLUME_SERIAL_NUMBER,
  87. /* PCUINT - pointer to volume's host drive type */
  88. LIDT_DRIVE_TYPE,
  89. /* PCSTR - pointer to volume's label */
  90. LIDT_VOLUME_LABEL,
  91. /* PCSTR - pointer to local base path */
  92. LIDT_LOCAL_BASE_PATH,
  93. /* PCSTR - pointer to parent network resource's name */
  94. LIDT_NET_RESOURCE,
  95. /* PCSTR - pointer to last device redirected to parent network resource */
  96. LIDT_REDIRECTED_DEVICE,
  97. /* PCSTR - pointer to common path suffix */
  98. LIDT_COMMON_PATH_SUFFIX,
  99. /* PCDWORD - pointer to network type */
  100. LIDT_NET_TYPE,
  101. /* PCWSTR - pointer to possible unicode volume label */
  102. LIDT_VOLUME_LABELW,
  103. /* PCSTR - pointer to possible unicode parent network resource's name */
  104. LIDT_NET_RESOURCEW,
  105. /* PCSTR - pointer to possible unicode last device redirected to parent network resource */
  106. LIDT_REDIRECTED_DEVICEW,
  107. /* PCWSTR - pointer to possible unicode local base path */
  108. LIDT_LOCAL_BASE_PATHW,
  109. /* PCWSTR - pointer to possible unicode common path suffix */
  110. LIDT_COMMON_PATH_SUFFIXW
  111. }
  112. LINKINFODATATYPE;
  113. /* output flags from GetCanonicalPathInfo() */
  114. typedef enum _getcanonicalpathinfooutflags
  115. {
  116. /* The path is on a remote volume. */
  117. GCPI_OFL_REMOTE = 0x0001,
  118. /* flag combinations */
  119. ALL_GCPI_OFLAGS = GCPI_OFL_REMOTE
  120. }
  121. GETCANONICALPATHINFOOUTFLAGS;
  122. /* Prototypes
  123. *************/
  124. /* LinkInfo APIs */
  125. LINKINFOAPI BOOL WINAPI CreateLinkInfoA(LPCSTR, PLINKINFO *);
  126. LINKINFOAPI BOOL WINAPI CreateLinkInfoW(LPCWSTR, PLINKINFO *);
  127. #ifdef UNICODE
  128. #define CreateLinkInfo CreateLinkInfoW
  129. #else
  130. #define CreateLinkInfo CreateLinkInfoA
  131. #endif
  132. LINKINFOAPI void WINAPI DestroyLinkInfo(PLINKINFO);
  133. LINKINFOAPI int WINAPI CompareLinkInfoReferents(PCLINKINFO, PCLINKINFO);
  134. LINKINFOAPI int WINAPI CompareLinkInfoVolumes(PCLINKINFO, PCLINKINFO);
  135. LINKINFOAPI BOOL WINAPI ResolveLinkInfoA(PCLINKINFO, LPSTR, DWORD, HWND, PDWORD, PLINKINFO *);
  136. LINKINFOAPI BOOL WINAPI ResolveLinkInfoW(PCLINKINFO, LPWSTR, DWORD, HWND, PDWORD, PLINKINFO *);
  137. #ifdef UNICODE
  138. #define ResolveLinkInfo ResolveLinkInfoW
  139. #else
  140. #define ResolveLinkInfo ResolveLinkInfoA
  141. #endif
  142. LINKINFOAPI BOOL WINAPI DisconnectLinkInfo(PCLINKINFO);
  143. LINKINFOAPI BOOL WINAPI GetLinkInfoData(PCLINKINFO, LINKINFODATATYPE, const VOID **);
  144. LINKINFOAPI BOOL WINAPI IsValidLinkInfo(PCLINKINFO);
  145. /* canonical path APIs */
  146. LINKINFOAPI BOOL WINAPI GetCanonicalPathInfoA(LPCSTR, LPSTR, LPDWORD, LPSTR, LPSTR *);
  147. LINKINFOAPI BOOL WINAPI GetCanonicalPathInfoW(LPCWSTR, LPWSTR, LPDWORD, LPWSTR, LPWSTR *);
  148. #ifdef UNICODE
  149. #define GetCanonicalPathInfo GetCanonicalPathInfoW
  150. #else
  151. #define GetCanonicalPathInfo GetCanonicalPathInfoA
  152. #endif
  153. #ifdef __cplusplus
  154. } /* End of extern "C" {. */
  155. #endif /* __cplusplus */
  156. #endif /* ! __LINKINFO_H__ */