heap_memory.hpp 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright 2010 Vicente J. Botet Escriba
  3. * Copyright 2015, 2017 Andrey Semashev
  4. *
  5. * Distributed under the Boost Software License, Version 1.0.
  6. * See http://www.boost.org/LICENSE_1_0.txt
  7. */
  8. #ifndef BOOST_WINAPI_HEAP_MEMORY_HPP_INCLUDED_
  9. #define BOOST_WINAPI_HEAP_MEMORY_HPP_INCLUDED_
  10. #include <boost/winapi/basic_types.hpp>
  11. #include <boost/winapi/detail/header.hpp>
  12. #ifdef BOOST_HAS_PRAGMA_ONCE
  13. #pragma once
  14. #endif
  15. #if !defined( BOOST_USE_WINDOWS_H )
  16. #undef HeapAlloc
  17. extern "C" {
  18. #if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
  19. BOOST_WINAPI_IMPORT boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC
  20. GetProcessHeaps(boost::winapi::DWORD_ NumberOfHeaps, boost::winapi::PHANDLE_ ProcessHeaps);
  21. #endif // BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
  22. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
  23. GetProcessHeap(BOOST_WINAPI_DETAIL_VOID);
  24. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::LPVOID_ BOOST_WINAPI_WINAPI_CC
  25. HeapAlloc(
  26. boost::winapi::HANDLE_ hHeap,
  27. boost::winapi::DWORD_ dwFlags,
  28. boost::winapi::SIZE_T_ dwBytes);
  29. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  30. HeapFree(
  31. boost::winapi::HANDLE_ hHeap,
  32. boost::winapi::DWORD_ dwFlags,
  33. boost::winapi::LPVOID_ lpMem);
  34. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::LPVOID_ BOOST_WINAPI_WINAPI_CC
  35. HeapReAlloc(
  36. boost::winapi::HANDLE_ hHeap,
  37. boost::winapi::DWORD_ dwFlags,
  38. boost::winapi::LPVOID_ lpMem,
  39. boost::winapi::SIZE_T_ dwBytes);
  40. #if BOOST_WINAPI_PARTITION_APP_SYSTEM
  41. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::HANDLE_ BOOST_WINAPI_WINAPI_CC
  42. HeapCreate(
  43. boost::winapi::DWORD_ flOptions,
  44. boost::winapi::SIZE_T_ dwInitialSize,
  45. boost::winapi::SIZE_T_ dwMaximumSize);
  46. BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::BOOL_ BOOST_WINAPI_WINAPI_CC
  47. HeapDestroy(boost::winapi::HANDLE_ hHeap);
  48. #endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
  49. } // extern "C"
  50. #endif // !defined( BOOST_USE_WINDOWS_H )
  51. namespace boost {
  52. namespace winapi {
  53. #if BOOST_WINAPI_PARTITION_DESKTOP_SYSTEM
  54. using ::GetProcessHeaps;
  55. #endif
  56. using ::GetProcessHeap;
  57. using ::HeapAlloc;
  58. using ::HeapFree;
  59. using ::HeapReAlloc;
  60. #if BOOST_WINAPI_PARTITION_APP_SYSTEM
  61. using ::HeapCreate;
  62. using ::HeapDestroy;
  63. #endif
  64. }
  65. }
  66. #include <boost/winapi/detail/footer.hpp>
  67. #endif // BOOST_WINAPI_HEAP_MEMORY_HPP_INCLUDED_