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.

178 lines
7.8 KiB

  1. HRESULT GetStrFromAttribute(IXMLDOMNode *pdn, LPCTSTR pszAttribute, LPTSTR pszBuffer, int cch);
  2. HRESULT SetAttributeFromStr(IXMLDOMNode *pdn, LPCTSTR pszAttribute, LPCTSTR pszValue);
  3. HRESULT GetIntFromAttribute(IXMLDOMNode *pdn, LPCTSTR pszAttribute, int *piValue);
  4. HRESULT CreateElement(IXMLDOMDocument *pdoc, LPCTSTR pszName, VARIANT *pvar, IXMLDOMElement **ppdelResult);
  5. HRESULT CreateAndAppendElement(IXMLDOMDocument *pdoc, IXMLDOMNode *pdnParent, LPCTSTR pszName, VARIANT *pvar, IXMLDOMElement **ppdelOut);
  6. void SpewXML(IUnknown *punk);
  7. HRESULT GetURLFromElement(IXMLDOMNode *pdn, LPCTSTR pszElement, LPTSTR pszBuffer, int cch);
  8. DWORD SHWNetGetConnection(LPCWSTR lpLocalName, LPCTSTR lpRemoteName, LPDWORD lpnLength);
  9. // used to communicate between the transfer logic and the main page.
  10. #define PWM_UPDATE WM_APP+1
  11. #define PWM_TRANSFERCOMPLETE WM_APP+2
  12. #define PWM_UPDATEICON WM_APP+3
  13. // transfer manifest information, this is used to communicate between the site and the publishing
  14. // wizard to move the files between the local storage and the site.
  15. // <transfermanfiest>
  16. // <folderlist>
  17. // <folder destination="xyz"/>
  18. // </folderlist>
  19. // <filelist [usesfolders=-1]/>
  20. // <file id=x source="path" size="xyz" destination="xyz" extension=".jpg">
  21. // [<resize cx=<width> cy=<height> quality=<0-100>>]
  22. // <metadata>
  23. // <imageproperty id=""></imageproperty>
  24. // </metadata>
  25. // <post href="href" name="<name section>" [verb=""] [filename="filename"]
  26. // <formdata name="<name section>"></formdata>
  27. // </post>
  28. // </filelist>
  29. // <uploadinfo friendlyname="site name">
  30. // <target [username="username"] href="http://www.diz.com</target"/>
  31. // <netplace filename="filename" comment="link comment" href="http:/www.diz.com"/>
  32. // <htmlui href="href://toopenwhenwizardcloses"/>
  33. // <successpage href="http://www.diz.com/uploadok.htm"/>
  34. // <favorite href="http://somesite.com" filename="" comment=""/>
  35. // <failurepage href="http://www.diz.com/uploadok.htm/">
  36. // </uploadinfo>
  37. // </transfermanifest>
  38. #define ELEMENT_TRANSFERMANIFEST L"transfermanifest"
  39. #define ELEMENT_FOLDERS L"folderlist"
  40. #define ELEMENT_FOLDER L"folder"
  41. #define ATTRIBUTE_DESTINATION L"destination"
  42. #define ELEMENT_FILES L"filelist"
  43. #define ATTRIBUTE_HASFOLDERS L"usesfolders"
  44. #define ELEMENT_FILE L"file"
  45. #define ATTRIBUTE_ID L"id"
  46. #define ATTRIBUTE_EXTENSION L"extension"
  47. #define ATTRIBUTE_CONTENTTYPE L"contenttype"
  48. #define ATTRIBUTE_SIZE L"size"
  49. #define ATTRIBUTE_SOURCE L"source"
  50. #define ATTRIBUTE_DESTINATION L"destination"
  51. #define ELEMENT_METADATA L"metadata"
  52. #define ELEMENT_IMAGEDATA L"imageproperty"
  53. #define ATTRIBUTE_ID L"id"
  54. #define ELEMENT_RESIZE L"resize"
  55. #define ATTRIBUTE_CX L"cx"
  56. #define ATTRIBUTE_CY L"cy"
  57. #define ATTRIBUTE_QUALITY L"quality"
  58. #define ELEMENT_POSTDATA L"post"
  59. #define ATTRIBUTE_HREF L"href"
  60. #define ATTRIBUTE_VERB L"verb"
  61. #define ATTRIBUTE_NAME L"name"
  62. #define ATTRIBUTE_FILENAME L"filename"
  63. #define ELEMENT_FORMDATA L"formdata"
  64. #define ATTRIBUTE_NAME L"name"
  65. #define ELEMENT_UPLOADINFO L"uploadinfo"
  66. #define ATTRIBUTE_FRIENDLYNAME L"friendlyname"
  67. #define ELEMENT_TARGET L"target"
  68. #define ATTRIBUTE_HREF L"href"
  69. #define ATTRIBUTE_USERNAME L"username"
  70. #define ELEMENT_NETPLACE L"netplace"
  71. #define ATTRIBUTE_HREF L"href"
  72. #define ATTRIBUTE_FILENAME L"filename"
  73. #define ATTRIBUTE_COMMENT L"comment"
  74. #define ELEMENT_HTMLUI L"htmlui"
  75. #define ATTRIBUTE_HREF L"href"
  76. #define ELEMENT_PUBLISHWIZARD L"publishwizard"
  77. #define ATTRIBUTE_HREF L"href"
  78. #define ELEMENT_SUCCESSPAGE L"successpage"
  79. #define ATTRIBUTE_HREF L"href"
  80. #define ELEMENT_FAILUREPAGE L"failurepage"
  81. #define ATTRIBUTE_HREF L"href"
  82. #define ELEMENT_CANCELLEDPAGE L"cancelledpage"
  83. #define ATTRIBUTE_HREF L"href"
  84. #define ELEMENT_FAVORITE L"favorite"
  85. #define ATTRIBUTE_HREF L"href"
  86. #define ATTRIBUTE_NAME L"name"
  87. #define ATTRIBUTE_COMMENT L"comment"
  88. // xpaths for common items
  89. #define XPATH_MANIFEST ELEMENT_TRANSFERMANIFEST
  90. #define XPATH_FOLDERSROOT ELEMENT_TRANSFERMANIFEST L"/" ELEMENT_FOLDERS
  91. #define XPATH_FILESROOT ELEMENT_TRANSFERMANIFEST L"/" ELEMENT_FILES
  92. #define XPATH_ALLFILESTOUPLOAD ELEMENT_TRANSFERMANIFEST L"/" ELEMENT_FILES L"/" ELEMENT_FILE
  93. #define XPATH_UPLOADINFO ELEMENT_TRANSFERMANIFEST L"/" ELEMENT_UPLOADINFO
  94. #define XPATH_UPLOADTARGET ELEMENT_TRANSFERMANIFEST L"/" ELEMENT_UPLOADINFO L"/" ELEMENT_TARGET
  95. #define XPATH_PUBLISHWIZARD ELEMENT_TRANSFERMANIFEST L"/" ELEMENT_PUBLISHWIZARD
  96. // stuff relating to the file transfer engine
  97. typedef struct
  98. {
  99. HWND hwnd; // parent HWND for any messages / dialogs
  100. DWORD dwFlags; // flags from original wizard ::SetOptions
  101. BOOL fUsePost; // use post to transfer the bits
  102. TCHAR szSiteName[MAX_PATH]; // site name - shown in wizard
  103. TCHAR szSiteURL[MAX_PATH]; // site URL - opened in the browser
  104. TCHAR szFileTarget[INTERNET_MAX_URL_LENGTH]; // destination for file copy
  105. TCHAR szLinkTarget[INTERNET_MAX_URL_LENGTH]; // destination for favorites link etc
  106. TCHAR szLinkName[MAX_PATH];
  107. TCHAR szLinkDesc[MAX_PATH];
  108. } TRANSFERINFO;
  109. typedef struct
  110. {
  111. VARIANT varName; // name of the form value
  112. VARIANT varValue; // its value
  113. } FORMDATA;
  114. typedef struct
  115. {
  116. BOOL fResizeOnUpload; // this item should be resized
  117. LPITEMIDLIST pidl; // pidl of the item we are posting
  118. TCHAR szFilename[MAX_PATH]; // filename to associate with the object
  119. TCHAR szVerb[10]; // verb used for transfer
  120. TCHAR szName[MAX_PATH]; // name for the object we are posting
  121. TCHAR szURL[INTERNET_MAX_URL_LENGTH]; // destination for file copy
  122. CDSA<FORMDATA> dsaFormData; // form data for extra information published
  123. int cxResize; // height and width of item for resizing
  124. int cyResize;
  125. int iQuality;
  126. IShellItem *psi; // shell item for each of the objects
  127. IStream *pstrm; // posting stream (for file bits)
  128. STATSTG ststg; // stat of the file
  129. } TRANSFERITEM;
  130. // post engines which handle the transfer of files accordingly
  131. int _FreeTransferItems(TRANSFERITEM *pti, void *pvState = NULL);
  132. HRESULT PublishViaCopyEngine(TRANSFERINFO *pti, CDPA<TRANSFERITEM> *pdpaItems, ITransferAdviseSink *ptas);
  133. HRESULT PublishViaPost(TRANSFERINFO *pti, CDPA<TRANSFERITEM> *pdpaItems, ITransferAdviseSink *ptas);