get_system_directory.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. #if !defined( BOOST_USE_WINDOWS_H )
  15. extern "C" {
  16. #if !defined( BOOST_NO_ANSI_APIS )
  17. BOOST_SYMBOL_IMPORT boost::winapi::UINT_ BOOST_WINAPI_WINAPI_CC
  18. GetSystemDirectoryA(
  19. boost::winapi::LPSTR_ lpBuffer,
  20. boost::winapi::UINT_ uSize);
  21. #endif
  22. BOOST_SYMBOL_IMPORT boost::winapi::UINT_ BOOST_WINAPI_WINAPI_CC
  23. GetSystemDirectoryW(
  24. boost::winapi::LPWSTR_ lpBuffer,
  25. boost::winapi::UINT_ uSize);
  26. } // extern "C"
  27. #endif
  28. namespace boost {
  29. namespace winapi {
  30. #if !defined( BOOST_NO_ANSI_APIS )
  31. using ::GetSystemDirectoryA;
  32. #endif
  33. using ::GetSystemDirectoryW;
  34. #if !defined( BOOST_NO_ANSI_APIS )
  35. BOOST_FORCEINLINE UINT_ get_system_directory(LPSTR_ lpBuffer, UINT_ uSize)
  36. {
  37. return ::GetSystemDirectoryA(lpBuffer, uSize);
  38. }
  39. #endif
  40. BOOST_FORCEINLINE UINT_ get_system_directory(LPWSTR_ lpBuffer, UINT_ uSize)
  41. {
  42. return ::GetSystemDirectoryW(lpBuffer, uSize);
  43. }
  44. }
  45. }
  46. #endif // BOOST_WINAPI_PARTITION_DESKTOP
  47. #endif // BOOST_WINAPI_GET_SYSTEM_DIRECTORY_HPP_INCLUDED_