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.

238 lines
7.4 KiB

  1. #ifndef _IMPLDEF_H_
  2. #define _IMPLDEF_H_
  3. // Implementation defined items ----------------------------------------------
  4. //
  5. // The following must be DEFINED by the IMPL for use by the PARSER.
  6. //
  7. // Allow header items --------------------------------------------------------
  8. //
  9. // The impl. needs to define the following set of strings that identify the
  10. // methods supported by the impl. for particular resources.
  11. //
  12. extern const CHAR gc_szHttpBase[];
  13. extern const CHAR gc_szHttpDelete[];
  14. extern const CHAR gc_szHttpPut[];
  15. extern const CHAR gc_szHttpPost[];
  16. extern const CHAR gc_szDavCopy[];
  17. extern const CHAR gc_szDavMove[];
  18. extern const CHAR gc_szDavMkCol[];
  19. extern const CHAR gc_szDavPropfind[];
  20. extern const CHAR gc_szDavProppatch[];
  21. extern const CHAR gc_szDavLocks[];
  22. extern const CHAR gc_szDavSearch[];
  23. extern const CHAR gc_szDavNotif[];
  24. extern const CHAR gc_szDavBatchDelete[];
  25. extern const CHAR gc_szDavBatchCopy[];
  26. extern const CHAR gc_szDavBatchMove[];
  27. extern const CHAR gc_szDavBatchProppatch[];
  28. extern const CHAR gc_szDavBatchPropfind[];
  29. extern const CHAR gc_szDavPublic[];
  30. extern const CHAR gc_szCompliance[];
  31. extern const UINT gc_cbszDavPublic;
  32. // Storage paths and urls ----------------------------------------------------
  33. //
  34. // The storage path for a resource is no-different that the path as translated
  35. // by IIS. This has not always been true, and there is code in the DAV source
  36. // tree that expects the path to have some sort of a prefix.
  37. //
  38. // At the beginning of NT beta3 work, we are removing the idea that a storage
  39. // path in DAV looks any different than a storage path in IIS. This is a very
  40. // important idea. Otherwise, there could be items accessible via DAV that
  41. // are not accessible via IIS -- and visa versa.
  42. //
  43. // Keeping this in mind... There are several places where we have url's that
  44. // are a part of a DAV request that are not pre-handled for us by IIS. Some
  45. // examples are the url's in the destination header of MOVE/COPY, the url's in
  46. // the scope of a SEARCH request, and the url's embedded in "if" headers.
  47. //
  48. // There are also several instances where we may have to generate a url from
  49. // a storage path -- as in the case of location headers and XML response
  50. // references.
  51. //
  52. // The translation of those items uses only common elements. So there is no
  53. // implementation specifc work that needs to be done here.
  54. //
  55. class IMethUtilBase;
  56. class CMethUtil;
  57. typedef CMethUtil IMethUtil;
  58. // The call to be used for proper conversion to unicode
  59. //
  60. SCODE __fastcall
  61. ScConvertToWide(/* [in] */ LPCSTR pszSource,
  62. /* [in/out] */ UINT * pcchDest,
  63. /* [out] */ LPWSTR pwszDest,
  64. /* [in] */ LPCSTR pszAcceptLang,
  65. /* [in] */ BOOL fUrlConversion);
  66. // The call to be used for canonicalization of URL
  67. //
  68. SCODE __fastcall
  69. ScCanonicalizeURL( /* [in] */ LPCWSTR pwszSrc,
  70. /* [in/out] */ LPWSTR pwszDest,
  71. /* [out] */ UINT * pcch );
  72. // The call to be used for canonicalization of URL,
  73. // taking into account if it is fully qualified
  74. //
  75. SCODE __fastcall
  76. ScCanonicalizePrefixedURL( /* [in] */ LPCWSTR pwszSrc,
  77. /* [in/out] */ LPWSTR pwszDest,
  78. /* [out] */ UINT * pcch );
  79. // These are the calls to be used to normalize URL
  80. //
  81. // Normalization consists of 3 steps:
  82. // a) escaping of skinny version
  83. // b) conversion to unicode
  84. // c) canonicalization
  85. //
  86. SCODE __fastcall
  87. ScNormalizeUrl (
  88. /* [in] */ LPCWSTR pwszSourceUrl,
  89. /* [in/out] */ UINT * pcchNormalizedUrl,
  90. /* [out] */ LPWSTR pwszNormalizedUrl,
  91. /* [in] */ LPCSTR pszAcceptLang);
  92. SCODE __fastcall
  93. ScNormalizeUrl (
  94. /* [in] */ LPCSTR pszSourceUrl,
  95. /* [in/out] */ UINT * pcchNormalizedUrl,
  96. /* [out] */ LPWSTR pwszNormalizedUrl,
  97. /* [in] */ LPCSTR pszAcceptLang);
  98. SCODE __fastcall ScStoragePathFromUrl (
  99. /* [in] */ const IEcb& ecb,
  100. /* [in] */ LPCWSTR pwszUrl,
  101. /* [out] */ LPWSTR wszStgID,
  102. /* [in/out] */ UINT* pcch,
  103. /* [out] */ CVRoot** ppcvr = NULL);
  104. SCODE __fastcall ScUrlFromStoragePath (
  105. /* [in] */ const IEcbBase& ecb,
  106. /* [in] */ LPCWSTR pwszPath,
  107. /* [out] */ LPWSTR pwszUrl,
  108. /* [in/out] */ UINT * pcb,
  109. /* [in] */ LPCWSTR pwszServer = NULL);
  110. SCODE __fastcall ScUrlFromSpannedStoragePath (
  111. /* [in] */ LPCWSTR pwszPath,
  112. /* [in] */ CVRoot& vr,
  113. /* [in] */ LPWSTR pwszUrl,
  114. /* [in/out] */ UINT* pcch);
  115. // Wire urls -----------------------------------------------------------------
  116. //
  117. // A note about a wire url. IIS translate all its urls into CP_ACP. So, to
  118. // keep consistant behavior in HTTPEXT, we also keep all local urls in CP_ACP.
  119. // However, for DAVEX, we don't hold to this. We deal exclusively in CP_UTF8
  120. // style URLs.
  121. //
  122. // However, when we spit the url back out over the wire. The url must be in
  123. // UTF8. Anytime a url goes back over the wire from IIS to client, it must be
  124. // sanitized via these calls.
  125. //
  126. SCODE __fastcall ScWireUrlFromWideLocalUrl (
  127. /* [in] */ UINT cchLocal,
  128. /* [in] */ LPCWSTR pwszLocalUrl,
  129. /* [in/out] */ auto_heap_ptr<CHAR>& pszWireUrl);
  130. SCODE __fastcall ScWireUrlFromStoragePath (
  131. /* [in] */ IMethUtilBase* pmu,
  132. /* [in] */ LPCWSTR pwszStoragePath,
  133. /* [in] */ BOOL fCollection,
  134. /* [in] */ CVRoot* pcvrTranslate,
  135. /* [in/out] */ auto_heap_ptr<CHAR>& pszWireUrl);
  136. BOOL __fastcall FIsUTF8Url (/* [in] */ LPCSTR pszUrl);
  137. // Child ISAPI aux. access check ---------------------------------------------
  138. //
  139. // On both HTTPEXT and DAVEX, we have an additional stipulation that needs
  140. // satisfaction before we can hand back the source of an scriptmapped item.
  141. // We want to see if it has NT write access.
  142. // Note that among the parameters, pwszPath is used by HTTPEXT only and
  143. // pbSD is used by DAVEX only
  144. //
  145. SCODE __fastcall ScChildISAPIAccessCheck (
  146. /* [in] */ const IEcb& ecb,
  147. /* [in] */ LPCWSTR pwszPath,
  148. /* [in] */ DWORD dwAccess,
  149. /* [in] */ LPBYTE pbSD);
  150. // Supported lock types ------------------------------------------------------
  151. //
  152. // Return the supported locktype flags for the resource type. HTTPEXT only
  153. // supports documents and collections. DavEX, on the other hand, understands
  154. // structured documents.
  155. //
  156. DWORD __fastcall DwGetSupportedLockType (RESOURCE_TYPE rtResource);
  157. // Access perm hack for DAVEX ------------------------------------------------
  158. //
  159. //$SECURITY
  160. // In DAVEX only, if either a VR_USERNAME or VR_PASSWORD is set then
  161. // to avoid a security problem, shut off all access.
  162. //
  163. VOID ImplHackAccessPerms( LPCWSTR pwszVRUserName,
  164. LPCWSTR pwszVRPassword,
  165. DWORD * pdwAccessPerms );
  166. // DLL instance refcounting --------------------------------------------------
  167. //
  168. VOID AddRefImplInst();
  169. VOID ReleaseImplInst();
  170. // Exception safe DLL instance refcounting -----------------------------------
  171. //
  172. typedef enum {
  173. ADD_REF = 0,
  174. TAKE_OWNERSHIP
  175. } REF_ACTION;
  176. class safeImplInstRef
  177. {
  178. BOOL m_fRelease;
  179. // NOT IMPLEMENTED
  180. //
  181. safeImplInstRef( const safeImplInstRef& );
  182. safeImplInstRef& operator=( const safeImplInstRef& );
  183. public:
  184. // CREATORS
  185. //
  186. safeImplInstRef(REF_ACTION ra) : m_fRelease(TRUE)
  187. {
  188. if (ADD_REF == ra)
  189. AddRefImplInst();
  190. }
  191. // DESTRUCTOR
  192. //
  193. ~safeImplInstRef()
  194. {
  195. if (m_fRelease)
  196. ReleaseImplInst();
  197. }
  198. // MANIPULATOR
  199. //
  200. VOID relinquish()
  201. {
  202. m_fRelease = FALSE;
  203. }
  204. };
  205. BOOL FSucceededColonColonCheck(
  206. /* [in] */ LPCWSTR pwszURI);
  207. #endif // _IMPLDEF_H_