memory.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // memory.hpp --------------------------------------------------------------//
  2. // Copyright 2010 Vicente J. Botet Escriba
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // See http://www.boost.org/LICENSE_1_0.txt
  5. #ifndef BOOST_DETAIL_WINAPI_MEMORY_HPP
  6. #define BOOST_DETAIL_WINAPI_MEMORY_HPP
  7. #include <boost/detail/winapi/basic_types.hpp>
  8. #include <boost/detail/winapi/security.hpp>
  9. #include <boost/detail/winapi/LocalFree.hpp>
  10. #ifdef BOOST_HAS_PRAGMA_ONCE
  11. #pragma once
  12. #endif
  13. namespace boost
  14. {
  15. namespace detail
  16. {
  17. namespace winapi
  18. {
  19. #if defined( BOOST_USE_WINDOWS_H )
  20. using ::CreateFileMappingA;
  21. using ::FlushViewOfFile;
  22. using ::GetProcessHeap;
  23. using ::HeapAlloc;
  24. using ::HeapFree;
  25. using ::MapViewOfFileEx;
  26. using ::OpenFileMappingA;
  27. using ::UnmapViewOfFile;
  28. #else
  29. #undef HeapAlloc
  30. extern "C" {
  31. __declspec(dllimport) void * __stdcall
  32. CreateFileMappingA (void *, SECURITY_ATTRIBUTES_*, unsigned long, unsigned long, unsigned long, const char *);
  33. __declspec(dllimport) int __stdcall
  34. FlushViewOfFile (void *, std::size_t);
  35. __declspec(dllimport) HANDLE_ __stdcall
  36. GetProcessHeap();
  37. __declspec(dllimport) void* __stdcall
  38. HeapAlloc(HANDLE_,DWORD_,SIZE_T_);
  39. __declspec(dllimport) BOOL_ __stdcall
  40. HeapFree(HANDLE_,DWORD_,LPVOID_);
  41. __declspec(dllimport) void * __stdcall
  42. MapViewOfFileEx (void *, unsigned long, unsigned long, unsigned long, std::size_t, void*);
  43. __declspec(dllimport) void * __stdcall
  44. OpenFileMappingA (unsigned long, int, const char *);
  45. __declspec(dllimport) int __stdcall
  46. UnmapViewOfFile(void *);
  47. }
  48. #endif
  49. }
  50. }
  51. }
  52. #endif // BOOST_DETAIL_WINAPI_MEMORY_HPP