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.

69 lines
1.6 KiB

  1. typedef enum
  2. {
  3. AUTH_PUBLIC = 0,
  4. AUTH_USER = 1,
  5. AUTH_ADMIN = 2,
  6. AUTH_MAX = 99
  7. }
  8. AUTHLEVEL;
  9. typedef struct
  10. {
  11. PWSTR wszExt;
  12. PWSTR wszPath;
  13. }
  14. EXTMAP, *PEXTMAP;
  15. typedef struct
  16. {
  17. int iURLLen;
  18. PSTR pszURL;
  19. int iPathLen;
  20. PWSTR wszPath;
  21. DWORD dwPermissions;
  22. AUTHLEVEL AuthLevel;
  23. SCRIPT_TYPE ScriptType; // Does vroot physical path map to an ASP or ISAPI?
  24. WCHAR *wszUserList;
  25. BOOL bRootDir;
  26. int nExtensions;
  27. PEXTMAP pExtMap;
  28. }
  29. VROOTINFO, *PVROOTINFO;
  30. class CVRoots
  31. {
  32. CRITICAL_SECTION m_csVroot;
  33. int m_nVRoots;
  34. PVROOTINFO m_pVRoots;
  35. BOOL LoadExtensionMap (PVROOTINFO pvr, HKEY rootreg);
  36. VOID FreeExtensionMap (PVROOTINFO pvr);
  37. BOOL FindExtInURL (PSTR pszInputURL, PSTR *ppszStart, PSTR *ppszEnd);
  38. PVROOTINFO MatchVRoot(PCSTR pszInputURL, int iInputLen);
  39. BOOL FillVRoot(PVROOTINFO pvr, LPWSTR wszURL, LPWSTR wszPath);
  40. BOOL Init(VOID);
  41. VOID Cleanup(VOID);
  42. VOID Sort(VOID);
  43. public:
  44. CVRoots() { ZEROMEM(this); Init(); }
  45. ~CVRoots() { Cleanup(); }
  46. DWORD Count()
  47. {
  48. DWORD cVRoots;
  49. EnterCriticalSection(&m_csVroot);
  50. cVRoots = m_nVRoots;
  51. LeaveCriticalSection(&m_csVroot);
  52. return cVRoots;
  53. }
  54. BOOL AddVRoot(LPWSTR szUrl, LPWSTR szPath);
  55. BOOL RemoveVRoot(LPWSTR szUrl);
  56. PWSTR URLAtoPathW(PSTR pszInputURL, PDWORD pdwPerm=0,
  57. AUTHLEVEL* pAuthLevel=0, SCRIPT_TYPE *pScriptType=0,
  58. PSTR *ppszPathInfo=0, WCHAR **ppwszUserList=0);
  59. PWSTR MapExtToPath (PSTR pszInputURL, PSTR *ppszEndOfURL);
  60. };