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.

104 lines
4.3 KiB

  1. // --------------------------------------------------------------------------------
  2. // Oertpriv.h
  3. // Copyright (c)1993-1995 Microsoft Corporation, All Rights Reserved
  4. // Steven J. Bailey
  5. // --------------------------------------------------------------------------------
  6. #ifndef __OERTPRIV_H
  7. #define __OERTPRIV_H
  8. // --------------------------------------------------------------------------------
  9. // Stream Utilitys
  10. // --------------------------------------------------------------------------------
  11. HRESULT HrCopyStream2(LPSTREAM lpstmIn, LPSTREAM lpstmOut1, LPSTREAM lpstmOut2, ULONG *pcb);
  12. HRESULT HrCopyStreamToFile(LPSTREAM lpstm, HANDLE hFile, ULONG *pcb);
  13. BOOL CreateHGlobalFromStream(LPSTREAM pstm, HGLOBAL *phg);
  14. BOOL FDoesStreamContain8bit(LPSTREAM lpstm);
  15. // --------------------------------------------------------------------------------
  16. // FILESTREAMINFO
  17. // --------------------------------------------------------------------------------
  18. typedef struct tagFILESTREAMINFO {
  19. WCHAR szFilePath[MAX_PATH];
  20. DWORD dwDesiredAccess;
  21. DWORD dwShareMode;
  22. SECURITY_ATTRIBUTES rSecurityAttributes;
  23. DWORD dwCreationDistribution;
  24. DWORD dwFlagsAndAttributes;
  25. HANDLE hTemplateFile;
  26. } FILESTREAMINFO, *LPFILESTREAMINFO;
  27. // --------------------------------------------------------------------------------
  28. // CFileStream
  29. // --------------------------------------------------------------------------------
  30. class CFileStream : public IStream
  31. {
  32. public:
  33. // ----------------------------------------------------------------------------
  34. // Construction
  35. // ----------------------------------------------------------------------------
  36. CFileStream(void);
  37. ~CFileStream(void);
  38. // ----------------------------------------------------------------------------
  39. // IUnknown Members
  40. // ----------------------------------------------------------------------------
  41. STDMETHODIMP_(ULONG) AddRef(VOID);
  42. STDMETHODIMP_(ULONG) Release(VOID);
  43. STDMETHODIMP QueryInterface(REFIID, LPVOID*);
  44. // ----------------------------------------------------------------------------
  45. // IStream Members
  46. // ----------------------------------------------------------------------------
  47. STDMETHODIMP Read(void HUGEP_16 *, ULONG, ULONG*);
  48. STDMETHODIMP Write(const void HUGEP_16 *, ULONG, ULONG*);
  49. STDMETHODIMP Seek(LARGE_INTEGER, DWORD, ULARGE_INTEGER*);
  50. STDMETHODIMP SetSize(ULARGE_INTEGER);
  51. STDMETHODIMP CopyTo(LPSTREAM, ULARGE_INTEGER, ULARGE_INTEGER*, ULARGE_INTEGER*);
  52. STDMETHODIMP Commit(DWORD);
  53. STDMETHODIMP Revert();
  54. STDMETHODIMP LockRegion(ULARGE_INTEGER, ULARGE_INTEGER,DWORD);
  55. STDMETHODIMP UnlockRegion(ULARGE_INTEGER, ULARGE_INTEGER, DWORD);
  56. STDMETHODIMP Stat(STATSTG*, DWORD);
  57. STDMETHODIMP Clone(LPSTREAM*);
  58. // ----------------------------------------------------------------------------
  59. // CFileStream Members
  60. // ----------------------------------------------------------------------------
  61. HRESULT Open(LPFILESTREAMINFO pFileStreamInfo);
  62. void Close(void);
  63. private:
  64. // ----------------------------------------------------------------------------
  65. // Private Data
  66. // ----------------------------------------------------------------------------
  67. ULONG m_cRef;
  68. HANDLE m_hFile;
  69. FILESTREAMINFO m_rInfo;
  70. };
  71. // --------------------------------------------------------------------------------
  72. // String Utilitys
  73. // --------------------------------------------------------------------------------
  74. VOID StripUndesirables(LPTSTR psz);
  75. LPSTR PszDupLenA(LPCSTR pcszSource, ULONG nLen);
  76. BOOL FValidFileChar(CHAR c);
  77. LPWSTR PszFromANSIStreamW(UINT cp, LPSTREAM pstm);
  78. TCHAR ToUpper(TCHAR c);
  79. int IsXDigit(LPSTR psz);
  80. int IsUpper(LPSTR psz);
  81. int IsAlpha(LPSTR psz);
  82. int IsPunct(LPSTR psz);
  83. LPSTR strsave(char *);
  84. void strappend(char **, char *);
  85. BOOL FIsValidRegKeyNameA(LPSTR pwszKey);
  86. BOOL FIsValidRegKeyNameW(LPWSTR pwszKey);
  87. void ThreadAllocateTlsMsgBuffer(void);
  88. void ThreadFreeTlsMsgBuffer(void);
  89. #ifdef UNICODE
  90. #define FIsValidRegKeyName FIsValidRegKeyNameW
  91. #else
  92. #define FIsValidRegKeyName FIsValidRegKeyNameA
  93. #endif
  94. #endif // __OERTPRIV_H