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.

257 lines
7.9 KiB

  1. //**********************************************************************
  2. // File name: ISPCSV.H
  3. //
  4. // Definition of CISPCSV
  5. //
  6. // Copyright (c) 1992 - 1996 Microsoft Corporation. All rights reserved.
  7. //**********************************************************************
  8. #if !defined( _ISPCSV_H_ )
  9. #define _ISPCSV_H_
  10. #define MAX_GUID 50
  11. #define MAX_ISP_NAME 100
  12. #define TEMP_BUFFER_LENGTH 1024
  13. #define NUM_ISPCSV_FIELDS 14
  14. class CISPCSV
  15. {
  16. private:
  17. int iISPLogoIndex;
  18. // The following members represent the content of a single line from the CSV file.
  19. int iSpecialVal; // if bIsSpecial is TRUE, then 0 = NO Offers and -1 = OLS offer
  20. BOOL bCNS;
  21. BOOL bIsSpecial; // If true, then CNS value was "special"
  22. BOOL bSecureConnection;
  23. WORD wOfferID;
  24. DWORD dwCfgFlag;
  25. DWORD dwRequiredUserInputFlags;
  26. TCHAR m_szISPLogoPath [MAX_PATH];
  27. TCHAR m_szISPTierLogoPath [MAX_PATH];
  28. TCHAR m_szISPTeaserPath [MAX_PATH];
  29. TCHAR m_szISPMarketingHTMPath [MAX_PATH];
  30. TCHAR m_szISPFilePath [MAX_PATH];
  31. TCHAR m_szISPName [MAX_ISP_NAME];
  32. TCHAR m_szCNSIconPath [MAX_PATH];
  33. TCHAR m_szBillingFormPath [MAX_PATH];
  34. TCHAR m_szPayCSVPath [MAX_PATH];
  35. TCHAR m_szOfferGUID [MAX_GUID];
  36. TCHAR m_szMir [MAX_ISP_NAME];
  37. WORD wLCID;
  38. HICON hbmTierIcon;
  39. IStorage *m_lpStgHistory; // Pointer to stuctured storage object
  40. // for storing page history information
  41. IStorage *m_lpStgIspPages; // Pointer to stuctured storage object
  42. // that will be used to track the ISP page cache
  43. public:
  44. CISPCSV(void)
  45. {
  46. memset(this, 0, sizeof(CISPCSV));
  47. // Allocate a temporary structured storage object
  48. StgCreateDocfile(NULL,
  49. STGM_DIRECT |
  50. STGM_READWRITE |
  51. STGM_SHARE_EXCLUSIVE |
  52. STGM_DELETEONRELEASE |
  53. STGM_CREATE,
  54. 0,
  55. &m_lpStgHistory);
  56. // Attempt to allocate a new storage object for the page cache
  57. StgCreateDocfile(NULL,
  58. STGM_DIRECT |
  59. STGM_READWRITE |
  60. STGM_SHARE_EXCLUSIVE |
  61. STGM_DELETEONRELEASE |
  62. STGM_CREATE,
  63. 0,
  64. &m_lpStgIspPages);
  65. }
  66. ~CISPCSV(void);
  67. HRESULT ReadOneLine (CCSVFile far *pcCSVFile);
  68. HRESULT ReadFirstLine (CCSVFile far *pcCSVFile);
  69. HRESULT DisplayHTML (LPTSTR szFile);
  70. HRESULT DisplayTextWithISPName (HWND hDlgCtrl, int iMsgString, TCHAR* pszExtra);
  71. void StripQuotes (LPSTR lpszDst, LPSTR lpszSrc);
  72. BOOL ReadDW (DWORD far *pdw, CCSVFile far *pcCSVFile);
  73. BOOL ReadW (WORD far *pw, CCSVFile far *pcCSVFile);
  74. BOOL ReadWEx (WORD far *pw, CCSVFile far *pcCSVFile); //Accepts -1 as a valid number. currently this is used for LCID, since all langs has a LDID == -1
  75. BOOL ReadB (BYTE far *pb, CCSVFile far *pcCSVFile);
  76. BOOL ReadBOOL (BOOL far *pbool, CCSVFile far *pcCSVFile);
  77. BOOL ReadSPECIAL (BOOL far *pbool, BOOL far *pbIsSpecial, int far *pInt, CCSVFile far *pcCSVFile);
  78. BOOL ReadSZ (LPSTR psz, DWORD dwSize, CCSVFile far *pcCSVFile);
  79. BOOL ReadToEOL (CCSVFile far *pcCSVFile);
  80. BOOL ValidateFile (TCHAR* pszFile);
  81. void MakeCompleteURL (LPTSTR lpszURL, LPTSTR lpszSRC);
  82. // Functions for managing IPersistHistory streams
  83. HRESULT SaveHistory(BSTR bstrStreamName);
  84. HRESULT LoadHistory(BSTR bstrStreamName);
  85. // HRESULT DeleteHistory(BSTR bstrStreamName);
  86. // functions for managing the ISP Page cache
  87. HRESULT GetCacheFileNameFromPageID(BSTR bstrPageID, LPTSTR lpszCacheFile, ULONG cbszCacheFile);
  88. void CleanupISPPageCache(BOOL bReleaseStorage);
  89. HRESULT CopyFiletoISPPageCache(BSTR bstrPageID, LPTSTR lpszTempFile);
  90. LPTSTR get_szISPLogoPath(void)
  91. {
  92. return m_szISPLogoPath;
  93. }
  94. LPTSTR get_szISPTierLogoPath(void)
  95. {
  96. return m_szISPTierLogoPath;
  97. }
  98. void set_ISPTierLogoIcon(HICON hIcon)
  99. {
  100. hbmTierIcon = hIcon;
  101. }
  102. HICON get_ISPTierLogoIcon(void)
  103. {
  104. return hbmTierIcon;
  105. }
  106. LPTSTR get_szISPTeaserPath(void)
  107. {
  108. return m_szISPTeaserPath;
  109. }
  110. LPTSTR get_szISPMarketingHTMPath(void)
  111. {
  112. return m_szISPMarketingHTMPath;
  113. }
  114. DWORD get_dwCFGFlag()
  115. {
  116. return dwCfgFlag;
  117. }
  118. void set_dwCFGFlag(DWORD dwNewCfgFlag)
  119. {
  120. dwCfgFlag = dwNewCfgFlag;
  121. }
  122. DWORD get_dwRequiredUserInputFlags()
  123. {
  124. return dwRequiredUserInputFlags;
  125. }
  126. void set_dwRequiredUserInputFlags(DWORD dwFlags)
  127. {
  128. dwRequiredUserInputFlags = dwFlags;
  129. }
  130. void set_szBillingFormPath(TCHAR* pszFile)
  131. {
  132. lstrcpy(m_szBillingFormPath, pszFile);
  133. }
  134. LPTSTR get_szBillingFormPath(void)
  135. {
  136. return m_szBillingFormPath;
  137. }
  138. void set_ISPLogoImageIndex(int iImage)
  139. {
  140. iISPLogoIndex = iImage;
  141. }
  142. void set_szISPName(TCHAR* pszName)
  143. {
  144. lstrcpy(m_szISPName, pszName);
  145. }
  146. LPTSTR get_szISPName()
  147. {
  148. return m_szISPName;
  149. }
  150. int get_ISPLogoIndex()
  151. {
  152. return iISPLogoIndex;
  153. }
  154. void set_bCNS(BOOL bVal)
  155. {
  156. bCNS = bVal;
  157. }
  158. BOOL get_bCNS()
  159. {
  160. return bCNS;
  161. }
  162. void set_bIsSpecial(BOOL bVal)
  163. {
  164. bIsSpecial = bVal;
  165. }
  166. BOOL get_bIsSpecial()
  167. {
  168. return bIsSpecial;
  169. }
  170. int get_iSpecial()
  171. {
  172. return iSpecialVal;
  173. }
  174. void set_szPayCSVPath(TCHAR* pszFile)
  175. {
  176. lstrcpy(m_szPayCSVPath, pszFile);
  177. }
  178. LPTSTR get_szPayCSVPath()
  179. {
  180. return m_szPayCSVPath;
  181. }
  182. void set_szISPFilePath(TCHAR* pszFile)
  183. {
  184. lstrcpy(m_szISPFilePath, pszFile);
  185. }
  186. LPTSTR get_szISPFilePath()
  187. {
  188. return m_szISPFilePath;
  189. }
  190. LPTSTR get_szOfferGUID()
  191. {
  192. return m_szOfferGUID;
  193. }
  194. WORD get_wOfferID()
  195. {
  196. return wOfferID;
  197. }
  198. LPTSTR get_szMir()
  199. {
  200. return m_szMir;
  201. }
  202. WORD get_wLCID()
  203. {
  204. return wLCID;
  205. }
  206. };
  207. #endif