get_system_directory.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright 2016 Klemens D. Morgenstern
  3. *
  4. * Distributed under the Boost Software License, Version 1.0.
  5. * See http://www.boost.org/LICENSE_1_0.txt
  6. */
  7. #ifndef BOOST_WINAPI_GET_SYSTEM_DIRECTORY_HPP_INCLUDED_
  8. #define BOOST_WINAPI_GET_SYSTEM_DIRECTORY_HPP_INCLUDED_
  9. #include <boost/winapi/basic_types.hpp>
  10. #ifdef BOOST_HAS_PRAGMA_ONCE
  11. #pragma once
  12. #endif
  13. #if BOOST_WINAPI_PARTITION_DESKTOP
  14. #include <boost/winapi/detail/header.hpp>
  15. #if !defined( BOOST_USE_WINDOWS_H )
  16. extern "C" {
  17. #if !defined( BOOST_NO_ANSI_APIS )
  18. BOOST_WINAPI_IMPORT boost::winapi::UINT_ BOOST_WINAPI_WINAPI_CC
  19. GetSystemDirectoryA(
  20. boost::winapi::LPSTR_ lpBuffer,
  21. boost::winapi::UINT_ uSize);
  22. #endif
  23. BOOST_WINAPI_IMPORT boost::winapi::UINT_ BOOST_WINAPI_WINAPI_CC
  24. GetSystemDirectoryW(
  25. boost::winapi::LPWSTR_ lpBuffer,
  26. boost::winapi::UINT_ uSize);
  27. } // extern "C"
  28. #endif
  29. namespace boost {
  30. namespace winapi {
  31. #if !defined( BOOST_NO_ANSI_APIS )
  32. using ::GetSystemDirectoryA;
  33. #endif
  34. using ::GetSystemDirectoryW;
  35. #if !defined( BOOST_NO_ANSI_APIS )
  36. BOOST_FORCEINLINE UINT_ get_system_directory(LPSTR_ lpBuffer, UINT_ uSize)
  37. {
  38. return ::GetSystemDirectoryA(lpBuffer, uSize);
  39. }
  40. #endif
  41. BOOST_FORCEINLINE UINT_ get_system_directory(LPWSTR_ lpBuffer, UINT_ uSize)
  42. {
  43. return ::GetSystemDirectoryW(lpBuffer, uSize);
  44. }
  45. }
  46. }
  47. #include <boost/winapi/detail/footer.hpp>
  48. #endif // BOOST_WINAPI_PARTITION_DESKTOP
  49. #endif // BOOST_WINAPI_GET_SYSTEM_DIRECTORY_HPP_INCLUDED_