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.

89 lines
2.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 2000
  6. //
  7. // File: listfile.h
  8. //
  9. //--------------------------------------------------------------------------
  10. #ifndef __CSCPIN_LISTFILE_H_
  11. #define __CSCPIN_LISTFILE_H_
  12. //
  13. // Class to walk a double-nul terminated list of strings.
  14. // Used together with class CDblNulStr.
  15. //
  16. class CDblNulStrIter
  17. {
  18. public:
  19. explicit CDblNulStrIter(LPCTSTR psz = NULL)
  20. : m_pszStart(psz),
  21. m_pszCurrent(psz) { }
  22. void Reset(void) const
  23. { m_pszCurrent = m_pszStart; }
  24. bool Next(LPCTSTR *ppsz) const;
  25. private:
  26. LPCTSTR m_pszStart;
  27. mutable LPCTSTR m_pszCurrent;
  28. };
  29. class CListFile
  30. {
  31. public:
  32. CListFile(LPCTSTR pszFile);
  33. ~CListFile(void);
  34. HRESULT GetFilesToPin(CDblNulStrIter *pIter);
  35. HRESULT GetFilesToUnpin(CDblNulStrIter *pIter);
  36. HRESULT GetFilesDefault(CDblNulStrIter *pIter);
  37. private:
  38. TCHAR m_szFile[MAX_PATH];
  39. LPTSTR m_pszFilesToPin;
  40. LPTSTR m_pszFilesToUnpin;
  41. LPTSTR m_pszFilesDefault;
  42. DWORD
  43. _ReadString(
  44. LPCTSTR pszAppName, // May be NULL.
  45. LPCTSTR pszKeyName, // May be NULL.
  46. LPCTSTR pszDefault,
  47. LPTSTR *ppszResult);
  48. DWORD
  49. _ReadSectionItemNames(
  50. LPCTSTR pszSection,
  51. LPTSTR *ppszItemNames,
  52. bool *pbEmpty = NULL);
  53. DWORD
  54. _ReadItemValue(
  55. LPCTSTR pszSection,
  56. LPCTSTR pszItemName,
  57. LPTSTR *ppszItemValue);
  58. DWORD
  59. _ReadPathsToPin(
  60. LPTSTR *ppszNames,
  61. bool *pbEmpty = NULL);
  62. DWORD
  63. _ReadPathsToUnpin(
  64. LPWSTR *ppszNames,
  65. bool *pbEmpty = NULL);
  66. DWORD
  67. _ReadPathsDefault(
  68. LPWSTR *ppszNames,
  69. bool *pbEmpty = NULL);
  70. };
  71. #endif // __CSCPIN_LISTFILE_H_