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.

88 lines
2.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: N C M S Z . H
  7. //
  8. // Contents: Common multi-sz routines.
  9. //
  10. // Notes: Split out from ncstring.h and included by ncstring.h
  11. //
  12. // Author: shaunco 7 Jun 1998
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #ifndef _NCMSZ_H_
  17. #define _NCMSZ_H_
  18. ULONG
  19. CchOfMultiSzSafe (
  20. IN PCWSTR pmsz);
  21. ULONG
  22. CchOfMultiSzAndTermSafe (
  23. IN PCWSTR pmsz);
  24. inline ULONG
  25. CbOfMultiSzAndTermSafe (
  26. IN PCWSTR pmsz)
  27. {
  28. return CchOfMultiSzAndTermSafe (pmsz) * sizeof(WCHAR);
  29. }
  30. BOOL
  31. FGetSzPositionInMultiSzSafe (
  32. IN PCWSTR psz,
  33. IN PCWSTR pmsz,
  34. OUT DWORD* pdwIndex,
  35. OUT BOOL *pfDuplicatePresent,
  36. OUT DWORD* pcStrings);
  37. BOOL
  38. FIsSzInMultiSzSafe (
  39. IN PCWSTR psz,
  40. IN PCWSTR pmsz);
  41. // flags for HrAddSzToMultiSz and RemoveSzFromMultiSz
  42. const DWORD STRING_FLAG_ALLOW_DUPLICATES = 0x00000001;
  43. const DWORD STRING_FLAG_ENSURE_AT_FRONT = 0x00000002;
  44. const DWORD STRING_FLAG_ENSURE_AT_END = 0x00000004;
  45. const DWORD STRING_FLAG_ENSURE_AT_INDEX = 0x00000008;
  46. const DWORD STRING_FLAG_DONT_MODIFY_IF_PRESENT = 0x00000010;
  47. const DWORD STRING_FLAG_REMOVE_SINGLE = 0x00000020;
  48. const DWORD STRING_FLAG_REMOVE_ALL = 0x00000040;
  49. HRESULT
  50. HrAddSzToMultiSz (
  51. IN PCWSTR pszAddString,
  52. IN PCWSTR pmszIn,
  53. IN DWORD dwFlags,
  54. IN DWORD dwStringIndex,
  55. OUT PWSTR* ppmszOut,
  56. OUT BOOL* pfChanged);
  57. HRESULT
  58. HrCreateArrayOfStringPointersIntoMultiSz (
  59. IN PCWSTR pmszSrc,
  60. OUT UINT* pcStrings,
  61. OUT PCWSTR** papsz);
  62. VOID
  63. RemoveSzFromMultiSz (
  64. IN PCWSTR psz,
  65. IN OUT PWSTR pmsz,
  66. IN DWORD dwFlags,
  67. OUT BOOL* pfRemoved);
  68. VOID
  69. SzListToMultiSz (
  70. IN PCWSTR psz,
  71. OUT DWORD* pcb,
  72. OUT PWSTR* ppszOut);
  73. #endif // _NCMSZ_H