Boost.Nowide
windows.hpp
1 //
2 // Copyright (c) 2012 Artyom Beilis (Tonkikh)
3 // Copyright (c) 2022 Alexander Grund
4 //
5 // Distributed under the Boost Software License, Version 1.0. (See
6 // accompanying file LICENSE or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 //
9 #ifndef BOOST_NOWIDE_WINDOWS_HPP_INCLUDED
10 #define BOOST_NOWIDE_WINDOWS_HPP_INCLUDED
11 
12 #ifdef BOOST_USE_WINDOWS_H
13 #include <windows.h>
14 // (Usually) included by windows.h
15 #include <shellapi.h>
16 #else
17 
18 // When BOOST_USE_WINDOWS_H is not defined we declare the function prototypes to avoid including windows.h
19 
20 extern "C" {
21 
22 // From windows.h
23 
24 __declspec(dllimport) wchar_t* __stdcall GetEnvironmentStringsW(void);
25 __declspec(dllimport) int __stdcall FreeEnvironmentStringsW(wchar_t*);
26 __declspec(dllimport) wchar_t* __stdcall GetCommandLineW(void);
27 __declspec(dllimport) unsigned long __stdcall GetLastError();
28 __declspec(dllimport) void* __stdcall LocalFree(void*);
29 __declspec(dllimport) int __stdcall SetEnvironmentVariableW(const wchar_t*, const wchar_t*);
30 __declspec(dllimport) unsigned long __stdcall GetEnvironmentVariableW(const wchar_t*, wchar_t*, unsigned long);
31 
32 // From shellapi.h
33 
34 __declspec(dllimport) wchar_t** __stdcall CommandLineToArgvW(const wchar_t*, int*);
35 }
36 
37 #endif
38 
39 #endif