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.

80 lines
3.2 KiB

  1. /* @doc
  2. *
  3. * @module XMLMiscUtils.h |
  4. *
  5. * Header file for XMLMiscUtils.cpp
  6. *
  7. * Author: Ying-ping Chen (t-ypchen)
  8. */
  9. #pragma once
  10. // @func void | XMLSetContentType | Set the content type
  11. // @rdesc None
  12. void XMLSetContentType
  13. ( CHttpResponse &httpResponse // @parm [in] the outgoing response
  14. );
  15. // @func void | GetXMLContentFromPostData | Get the XML content from the post data of a request
  16. // @syntax void GetXMLContentFromPostData(CHttpRequest &httpRequest, CStringA &cszXML);
  17. // @syntax void GetXMLContentFromPostData(CHttpRequest &httpRequest, CStringW &cwszXML);
  18. // @rdesc None
  19. void GetXMLContentFromPostData
  20. ( CHttpRequest &httpRequest, // @parm [in] the incoming request
  21. CStringA &cszXML // @parm [out] the XML content contained in the request
  22. );
  23. // Get the XML content from the post data of a request
  24. // (a thin wrapper of the previous function)
  25. void GetXMLContentFromPostData
  26. ( CHttpRequest &httpRequest,
  27. CStringW &cwszXML // @parm [out] the XML content contained in the request
  28. );
  29. // @func HRESULT | CheckRootTag | Check the root tag of the given XML document is correct or not
  30. // @rdesc Return the following values:
  31. // @flag S_OK | successful
  32. // @flag PP_E_XML_PARSE_ERROR | can't parse the XML
  33. // @flag PP_E_INVALIDREQUEST | the root tag is incorrect
  34. HRESULT CheckRootTag
  35. ( IXMLDOMDocument *pXMLDoc, // @parm [in] the XML document
  36. LPCWSTR pwszRootTag // @parm [in] the correct root tag
  37. );
  38. // @func HRESULT | CheckClientVersion | Check the client version if it is valid
  39. // @rdesc Return the following values:
  40. // @flag S_OK | successful
  41. // @flag PP_E_XML_NO_CLIENTINFO | no "ClientInfo" node in the XML document
  42. // @flag PP_E_XML_UNKNOWN_CLIENTVERSION | unknown client version
  43. HRESULT CheckClientVersion
  44. ( IXMLDOMDocument *pXMLDoc, // @parm [in] the XML document
  45. double &dVersion // @parm [out] the client version (if S_OK)
  46. );
  47. // @func HRESULT | CheckSignInNameAndDomain | Validate signinname, password, and domain, directly from the XML post
  48. // @rdesc Return the following values:
  49. // @flag S_OK | successful
  50. // @flag PP_E_XML_DOMAIN_BLANK | no domain
  51. // @flag PP_E_XML_DOMAIN_BLANK_EX | no domain (RAID 7628)
  52. // @flag PP_E_XML_NAME_AND_PASSWORD_BLANK | no member name and no password
  53. // @flag PP_E_NAME_BLANK | no member name
  54. // @flag PP_E_PASSWORD_BLANK | no password
  55. // @flag PP_E_INVALIDPARAMS | some parameter(s) too long
  56. HRESULT CheckSignInNameAndDomain
  57. ( double dClientVersion, // @parm [in] the client version
  58. IXMLDOMDocument *pXMLDoc, // @parm [in] the XML document
  59. CStringW &cwszSignInName, // @parm [out] the member name
  60. CStringW &cwszDomain, // @parm [out] the domain
  61. CStringW &cwszPassword, // @parm [out] the password of the user
  62. CStringW &cwszSignInNameComplete // @parm [out] the complete member name
  63. );
  64. // @func HRESULT | CheckIDRU | Check the id & ru
  65. // @rdesc Return the following values:
  66. // @flag S_OK | successful
  67. // @flag PP_E_INVALIDSITEID | id is invalid
  68. // @flag PP_E_INVALIDRETURNURL | id is valid but ru is not
  69. HRESULT CheckIDRU
  70. ( long &lSiteId, // @parm [out] id
  71. CPPUrl &curlRu, // @parm [out] ru
  72. bool &bReturnToSite // @parm [out] can the id & ru be used to return?
  73. );