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.

63 lines
1.6 KiB

  1. #if !defined(_FUSION_SXS_CRESOURCESTREAM_H_INCLUDED_)
  2. #define _FUSION_SXS_CRESOURCESTREAM_H_INCLUDED_
  3. /*++
  4. Copyright (c) Microsoft Corporation
  5. Module Name:
  6. filestream.cpp
  7. Abstract:
  8. Minimal implementation of IStream over a Windows PE/COFF resource.
  9. Author:
  10. Jay Krell (a-JayK, JayKrell) May 2000
  11. Revision History:
  12. --*/
  13. #pragma once
  14. #include "cmemorystream.h"
  15. #include "fusionhandle.h"
  16. #include "sxsp.h"
  17. class CResourceStream : public CMemoryStream
  18. {
  19. typedef CMemoryStream Base;
  20. public:
  21. CResourceStream() { }
  22. // NOTE the order of type/name is 1) as you might expect 2) consistent with
  23. // FindResourceEx, 3) INconsistent with FindResource
  24. // RT_* are actually of type PCWSTR
  25. BOOL Initialize(PCWSTR file, PCWSTR type, PCWSTR name, WORD language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL));
  26. BOOL Initialize(PCWSTR file, PCWSTR type);
  27. /*
  28. feel free to add more overloads that take, say
  29. HMODULE, HRSRC, HGLOBAL
  30. */
  31. // Override so that we can get times from the open file...
  32. HRESULT __stdcall Stat(STATSTG *pstatstg, DWORD grfStatFlag);
  33. virtual ~CResourceStream() { }
  34. private: // intentionally not implemented
  35. CResourceStream(const CResourceStream&);
  36. void operator=(const CResourceStream&);
  37. BOOL InitializeAlreadyOpen(
  38. PCWSTR type,
  39. PCWSTR name,
  40. LANGID language = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL)
  41. );
  42. CDynamicLinkLibrary m_dll;
  43. CStringBuffer m_buffFilePath;
  44. };
  45. #endif // !defined(_FUSION_SXS_CRESOURCESTREAM_H_INCLUDED_)