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.

81 lines
2.0 KiB

  1. //+--------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1996.
  5. //
  6. // File: funcs.hxx
  7. //
  8. // Contents: Header for funcs.cxx
  9. //
  10. //---------------------------------------------------------------
  11. #ifndef __FUNCS_HXX__
  12. #define __FUNCS_HXX__
  13. #include "dfmsp.hxx"
  14. class CDirectStream;
  15. SCODE VerifyPerms(DWORD grfMode);
  16. WCHAR * __cdecl wcsdup(WCHAR const *pwcs);
  17. SCODE DeleteIStorageContents(IStorage *pstg);
  18. SCODE CopyStreamToStream(CDirectStream *pstFrom, CDirectStream *pstTo);
  19. SCODE NameInSNB(CDfName const *dfn, SNBW snb);
  20. // For non-Unicode builds, we verify strings before converting them
  21. // to wide character strings, so there's no need to recheck them.
  22. #ifdef _UNICODE
  23. SCODE CheckWName(WCHAR const *pwcsName);
  24. #define CheckName(pwcsName) CheckWName(pwcsName)
  25. SCODE ValidateSNBW(SNBW snb);
  26. #else // validation done in ascii layer already
  27. #define CheckName(pwcsName) (S_OK)
  28. #define CheckWName(pwcsName) (S_OK)
  29. #define ValidateSNBW(x) (S_OK)
  30. #endif
  31. //+-------------------------------------------------------------------------
  32. //
  33. // Function: VerifyStatFlag
  34. //
  35. // Synopsis: verify Stat flag
  36. //
  37. // Arguments: [grfStatFlag] - stat flag
  38. //
  39. // Returns: S_OK or STG_E_INVALIDFLAG
  40. //
  41. //--------------------------------------------------------------------------
  42. inline SCODE VerifyStatFlag(DWORD grfStatFlag)
  43. {
  44. SCODE sc = S_OK;
  45. if ((grfStatFlag & ~STATFLAG_NONAME) != 0)
  46. sc = STG_E_INVALIDFLAG;
  47. return(sc);
  48. }
  49. //+-------------------------------------------------------------------------
  50. //
  51. // Function: VerifyMoveFlags
  52. //
  53. // Synopsis: verify Move flag
  54. //
  55. // Arguments: [grfMoveFlag] - stat flag
  56. //
  57. // Returns: S_OK or STG_E_INVALIDFLAG
  58. //
  59. //--------------------------------------------------------------------------
  60. inline SCODE VerifyMoveFlags(DWORD grfMoveFlag)
  61. {
  62. SCODE sc = S_OK;
  63. if ((grfMoveFlag & ~STGMOVE_COPY) != 0)
  64. sc = STG_E_INVALIDFLAG;
  65. return(sc);
  66. }
  67. #endif