diff options
Diffstat (limited to 'include/iprt/win')
-rw-r--r-- | include/iprt/win/Makefile.kup | 0 | ||||
-rw-r--r-- | include/iprt/win/d3d8.h | 50 | ||||
-rw-r--r-- | include/iprt/win/d3d9.h | 49 | ||||
-rw-r--r-- | include/iprt/win/intsafe.h | 67 | ||||
-rw-r--r-- | include/iprt/win/iphlpapi.h | 40 | ||||
-rw-r--r-- | include/iprt/win/lazy-dbghelp.h | 141 | ||||
-rw-r--r-- | include/iprt/win/netioapi.h | 36 | ||||
-rw-r--r-- | include/iprt/win/ntdddisk.h | 40 | ||||
-rw-r--r-- | include/iprt/win/ntddndis.h | 40 | ||||
-rw-r--r-- | include/iprt/win/ntverp.h | 40 | ||||
-rw-r--r-- | include/iprt/win/objbase.h | 50 | ||||
-rw-r--r-- | include/iprt/win/objidl.h | 44 | ||||
-rw-r--r-- | include/iprt/win/setupapi.h | 40 | ||||
-rw-r--r-- | include/iprt/win/shlobj.h | 48 | ||||
-rw-r--r-- | include/iprt/win/shlwapi.h | 43 | ||||
-rw-r--r-- | include/iprt/win/windef.h | 55 | ||||
-rw-r--r-- | include/iprt/win/windows.h | 57 | ||||
-rw-r--r-- | include/iprt/win/winsock.h | 54 | ||||
-rw-r--r-- | include/iprt/win/winsock2.h | 54 | ||||
-rw-r--r-- | include/iprt/win/ws2tcpip.h | 44 |
20 files changed, 992 insertions, 0 deletions
diff --git a/include/iprt/win/Makefile.kup b/include/iprt/win/Makefile.kup new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/include/iprt/win/Makefile.kup diff --git a/include/iprt/win/d3d8.h b/include/iprt/win/d3d8.h new file mode 100644 index 00000000..d73303a8 --- /dev/null +++ b/include/iprt/win/d3d8.h @@ -0,0 +1,50 @@ +/** @file + * Safe way to include d3d8.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_d3d8_h +#define IPRT_INCLUDED_win_d3d8_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#ifdef _MSC_VER +# pragma warning(push) +/*# pragma warning(disable:4163)*/ +# pragma warning(disable:4668) /* warning C4668: 'WHEA_DOWNLEVEL_TYPE_NAMES' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */ +# pragma warning(disable:4255) /* warning C4255: 'ObGetFilterVersion' : no function prototype given: converting '()' to '(void)' */ +# if _MSC_VER >= 1800 /*RT_MSC_VER_VC120*/ +# pragma warning(disable:4005) /* sdk/v7.1/include/sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition */ +# endif +#endif + +#include <d3d8.h> + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + + +#endif /* !IPRT_INCLUDED_win_d3d8_h */ + diff --git a/include/iprt/win/d3d9.h b/include/iprt/win/d3d9.h new file mode 100644 index 00000000..557751e9 --- /dev/null +++ b/include/iprt/win/d3d9.h @@ -0,0 +1,49 @@ +/** @file + * Safe way to include d3d9.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_d3d9_h +#define IPRT_INCLUDED_win_d3d9_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#ifdef _MSC_VER +# pragma warning(push) +/*# pragma warning(disable:4163)*/ +# pragma warning(disable:4668) /* warning C4668: 'WHEA_DOWNLEVEL_TYPE_NAMES' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */ +# pragma warning(disable:4255) /* warning C4255: 'ObGetFilterVersion' : no function prototype given: converting '()' to '(void)' */ +# if _MSC_VER >= 1800 /*RT_MSC_VER_VC120*/ +# pragma warning(disable:4005) /* sdk/v7.1/include/sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition */ +# endif +#endif + +#include <d3d9.h> + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +#endif /* !IPRT_INCLUDED_win_d3d9_h */ + diff --git a/include/iprt/win/intsafe.h b/include/iprt/win/intsafe.h new file mode 100644 index 00000000..3d1c8eb7 --- /dev/null +++ b/include/iprt/win/intsafe.h @@ -0,0 +1,67 @@ +/** @file + * Safe way to include intsafe.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_intsafe_h +#define IPRT_INCLUDED_win_intsafe_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +/* There's a conflict between the Visual C++ 2010 stdint.h and wDK 7.1 intsafe.h + that we must to mediate here. Current approach is to use the stuff from + intsafe.h rather than the other. */ +#ifndef _INTSAFE_H_INCLUDED_ +# include <iprt/stdint.h> +# undef INT8_MIN +# undef INT16_MIN +# undef INT32_MIN +# undef INT8_MAX +# undef INT16_MAX +# undef INT32_MAX +# undef UINT8_MAX +# undef UINT16_MAX +# undef UINT32_MAX +# undef INT64_MIN +# undef INT64_MAX +# undef UINT64_MAX + +# ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable:4668) /* intsafe.h(55) : warning C4668: '__midl' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */ +# if _MSC_VER >= 1800 /*RT_MSC_VER_VC120*/ +# pragma warning(disable:4005) /* sdk/v7.1/include/sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition */ +# endif +# endif + +# include <intsafe.h> + +# ifdef _MSC_VER +# pragma warning(pop) +# endif + +#endif /* !_INTSAFE_H_INCLUDED_ */ + +#endif /* !IPRT_INCLUDED_win_intsafe_h */ + diff --git a/include/iprt/win/iphlpapi.h b/include/iprt/win/iphlpapi.h new file mode 100644 index 00000000..3b0ac009 --- /dev/null +++ b/include/iprt/win/iphlpapi.h @@ -0,0 +1,40 @@ +/** @file + * Safe way to include iphlpapi.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_iphlpapi_h +#define IPRT_INCLUDED_win_iphlpapi_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#pragma warning(push) +#pragma warning(disable:4668) /* 'NDIS_SUPPORT_NDIS6' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */ + +#include <iphlpapi.h> + +#pragma warning(pop) + +#endif /* !IPRT_INCLUDED_win_iphlpapi_h */ + diff --git a/include/iprt/win/lazy-dbghelp.h b/include/iprt/win/lazy-dbghelp.h new file mode 100644 index 00000000..4f4d0bb8 --- /dev/null +++ b/include/iprt/win/lazy-dbghelp.h @@ -0,0 +1,141 @@ +/** @file + * Symbols from dbghelp.dll, allowing us to select which one to load. + */ + +/* + * Copyright (C) 2013-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_lazy_dbghelp_h +#define IPRT_INCLUDED_win_lazy_dbghelp_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#include <iprt/ldrlazy.h> +#include <iprt/path.h> +#include <iprt/env.h> +#include <iprt/errcore.h> + + +/** + * Custom loader callback. + * @returns Module handle or NIL_RTLDRMOD. + */ +static int rtLdrLazyLoadDbgHelp(const char *pszFile, PRTLDRMOD phMod) +{ + static const struct + { + const char *pszEnv; + const char *pszSubDir; + } s_aLocations[] = + { +#ifdef RT_ARCH_AMD64 + { "ProgramFiles(x86)", "Windows Kits\\8.1\\Debuggers\\x64\\dbghelp.dll" }, + { "ProgramFiles(x86)", "Windows Kits\\8.0\\Debuggers\\x64\\dbghelp.dll" }, + { "ProgramFiles", "Debugging Tools for Windows (x64)\\dbghelp.dll" }, +#else + { "ProgramFiles", "Windows Kits\\8.1\\Debuggers\\x86\\dbghelp.dll" }, + { "ProgramFiles", "Windows Kits\\8.0\\Debuggers\\x86\\dbghelp.dll" }, + { "ProgramFiles", "Debugging Tools for Windows (x86)\\dbghelp.dll" }, +#endif /** @todo More places we should look? */ + }; + uint32_t i; + for (i = 0; i < RT_ELEMENTS(s_aLocations); i++) + { + char szPath[RTPATH_MAX]; + size_t cchPath; + int rc = RTEnvGetEx(RTENV_DEFAULT, s_aLocations[i].pszEnv, szPath, sizeof(szPath), &cchPath); + if (RT_SUCCESS(rc)) + { + rc = RTPathAppend(szPath, sizeof(szPath), s_aLocations[i].pszSubDir); + if (RT_SUCCESS(rc)) + { + rc = RTLdrLoad(szPath, phMod); + if (RT_SUCCESS(rc)) + return rc; + } + } + } + + /* Fall back on the system one, if present. */ + return RTLdrLoadSystem(pszFile, true /*fNoUnload*/, phMod); +} + +RTLDRLAZY_MODULE_EX(dbghelp, "dbghelp.dll", rtLdrLazyLoadDbgHelp); + +RTLDRLAZY_FUNC(dbghelp, BOOL, WINAPI, SymInitialize, (HANDLE a1, PCWSTR a2, BOOL a3), (a1, a2, a3), FALSE); +#undef SymInitialize +#define SymInitialize RTLDRLAZY_FUNC_NAME(dbghelp, SymInitialize) + +RTLDRLAZY_FUNC(dbghelp, BOOL, WINAPI, SymCleanup, (HANDLE a1), (a1), FALSE); +#undef SymCleanup +#define SymCleanup RTLDRLAZY_FUNC_NAME(dbghelp, SymCleanup) + +RTLDRLAZY_FUNC(dbghelp, DWORD, WINAPI, SymGetOptions, (VOID), (), 0); +#undef SymGetOptions +#define SymGetOptions RTLDRLAZY_FUNC_NAME(dbghelp, SymGetOptions) + +RTLDRLAZY_FUNC(dbghelp, DWORD, WINAPI, SymSetOptions, (DWORD a1), (a1), 0); +#undef SymSetOptions +#define SymSetOptions RTLDRLAZY_FUNC_NAME(dbghelp, SymSetOptions) + +RTLDRLAZY_FUNC(dbghelp, BOOL, WINAPI, SymRegisterCallback64, (HANDLE a1, PSYMBOL_REGISTERED_CALLBACK64 a2, ULONG64 a3), + (a1, a2, a3), FALSE); +#undef SymRegisterCallback64 +#define SymRegisterCallback64 RTLDRLAZY_FUNC_NAME(dbghelp, SymRegisterCallback64) + +RTLDRLAZY_FUNC(dbghelp, DWORD64, WINAPI, SymLoadModuleEx, + (HANDLE a1, HANDLE a2, PCSTR a3, PCSTR a4, DWORD64 a5, DWORD a6, PMODLOAD_DATA a7, DWORD a8), + (a1, a2, a3, a4, a5, a6, a7, a8), 0); +#undef SymLoadModuleEx +#define SymLoadModuleEx RTLDRLAZY_FUNC_NAME(dbghelp, SymLoadModuleEx) + +RTLDRLAZY_FUNC(dbghelp, DWORD64, WINAPI, SymLoadModuleExW, + (HANDLE a1, HANDLE a2, PCWSTR a3, PCWSTR a4, DWORD64 a5, DWORD a6, PMODLOAD_DATA a7, DWORD a8), + (a1, a2, a3, a4, a5, a6, a7, a8), 0); +#undef SymLoadModuleExW +#define SymLoadModuleExW RTLDRLAZY_FUNC_NAME(dbghelp, SymLoadModuleExW) + +RTLDRLAZY_FUNC(dbghelp, DWORD64, WINAPI, SymUnloadModule64, (HANDLE a1, DWORD64 a2), (a1, a2), 0); +#undef SymUnloadModule64 +#define SymUnloadModule64 RTLDRLAZY_FUNC_NAME(dbghelp, SymUnloadModule64) + +RTLDRLAZY_FUNC(dbghelp, BOOL, WINAPI, SymEnumSymbols, + (HANDLE a1, ULONG64 a2, PCSTR a3, PSYM_ENUMERATESYMBOLS_CALLBACK a4, PVOID a5), + (a1, a2, a3, a4, a5), FALSE); +#undef SymEnumSymbols +#define SymEnumSymbols RTLDRLAZY_FUNC_NAME(dbghelp, SymEnumSymbols) + +RTLDRLAZY_FUNC(dbghelp, BOOL, WINAPI, SymEnumLinesW, + (HANDLE a1, ULONG64 a2, PCWSTR a3, PCWSTR a4, PSYM_ENUMLINES_CALLBACKW a5, PVOID a6), + (a1, a2, a3, a4, a5, a6), FALSE); +#undef SymEnumLinesW +#define SymEnumLinesW RTLDRLAZY_FUNC_NAME(dbghelp, SymEnumLinesW) + +RTLDRLAZY_FUNC(dbghelp, BOOL, WINAPI, SymGetModuleInfo64, (HANDLE a1, DWORD64 a2, PIMAGEHLP_MODULE64 a3), (a1, a2, a3), FALSE); +#undef SymGetModuleInfo64 +#define SymGetModuleInfo64 RTLDRLAZY_FUNC_NAME(dbghelp, SymGetModuleInfo64) + + + + +#endif /* !IPRT_INCLUDED_win_lazy_dbghelp_h */ + diff --git a/include/iprt/win/netioapi.h b/include/iprt/win/netioapi.h new file mode 100644 index 00000000..54e7f8f2 --- /dev/null +++ b/include/iprt/win/netioapi.h @@ -0,0 +1,36 @@ +/** @file + * Safe way to include netioapi.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_netioapi_h +#define IPRT_INCLUDED_win_netioapi_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#include <iprt/win/ntddndis.h> /* this one has problems with -Wall */ +#include <netioapi.h> + +#endif /* !IPRT_INCLUDED_win_netioapi_h */ + diff --git a/include/iprt/win/ntdddisk.h b/include/iprt/win/ntdddisk.h new file mode 100644 index 00000000..f495e00f --- /dev/null +++ b/include/iprt/win/ntdddisk.h @@ -0,0 +1,40 @@ +/** @file + * Safe way to include ntdddisk.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_ntdddisk_h +#define IPRT_INCLUDED_win_ntdddisk_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#pragma warning(push) +#pragma warning(disable:4668) /* ntdddisk.h(137) : warning C4668: 'NTDDI_WIN2003' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */ + +#include <ntdddisk.h> + +#pragma warning(pop) + +#endif /* !IPRT_INCLUDED_win_ntdddisk_h */ + diff --git a/include/iprt/win/ntddndis.h b/include/iprt/win/ntddndis.h new file mode 100644 index 00000000..08b01d6e --- /dev/null +++ b/include/iprt/win/ntddndis.h @@ -0,0 +1,40 @@ +/** @file + * Safe way to include ntddndis.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_ntddndis_h +#define IPRT_INCLUDED_win_ntddndis_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#pragma warning(push) +#pragma warning(disable:4668) /* 'NDIS_SUPPORT_NDIS6' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */ + +#include <ntddndis.h> + +#pragma warning(pop) + +#endif /* !IPRT_INCLUDED_win_ntddndis_h */ + diff --git a/include/iprt/win/ntverp.h b/include/iprt/win/ntverp.h new file mode 100644 index 00000000..22795f2a --- /dev/null +++ b/include/iprt/win/ntverp.h @@ -0,0 +1,40 @@ +/** @file + * Safe way to include ntverp.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_ntverp_h +#define IPRT_INCLUDED_win_ntverp_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#pragma warning(push) +#pragma warning(disable:4668) /*ntverp.h(126) : warning C4668: 'OFFICIAL_BUILD' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */ + +#include <ntverp.h> + +#pragma warning(pop) + +#endif /* !IPRT_INCLUDED_win_ntverp_h */ + diff --git a/include/iprt/win/objbase.h b/include/iprt/win/objbase.h new file mode 100644 index 00000000..439c712c --- /dev/null +++ b/include/iprt/win/objbase.h @@ -0,0 +1,50 @@ +/** @file + * Safe way to include objbase.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_objbase_h +#define IPRT_INCLUDED_win_objbase_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable:4668) /* '__midl' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */ +# if !defined(__cplusplus) +# pragma warning(disable:4255) /* 'FARPROC' : no function prototype given: converting '()' to '(void)' */ +# endif +# if _MSC_VER >= 1800 /*RT_MSC_VER_VC120*/ +# pragma warning(disable:4005) /* sdk/v7.1/include/sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition */ +# endif +#endif + +#include <objbase.h> + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +#endif /* !IPRT_INCLUDED_win_objbase_h */ + diff --git a/include/iprt/win/objidl.h b/include/iprt/win/objidl.h new file mode 100644 index 00000000..808b19cf --- /dev/null +++ b/include/iprt/win/objidl.h @@ -0,0 +1,44 @@ +/** @file + * Safe way to include objidl.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_objidl_h +#define IPRT_INCLUDED_win_objidl_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#pragma warning(push) +#pragma warning(disable:4668) /* '__midl' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */ +#if _MSC_VER >= 1800 /*RT_MSC_VER_VC120*/ +# pragma warning(disable:4005) /* sdk/v7.1/include/sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition */ +# pragma warning(disable:4255) /* windef.h(227) : warning C4255: 'NEARPROC' : no function prototype given: converting '()' to '(void)' */ +#endif + +#include <objidl.h> + +#pragma warning(pop) + +#endif /* !IPRT_INCLUDED_win_objidl_h */ + diff --git a/include/iprt/win/setupapi.h b/include/iprt/win/setupapi.h new file mode 100644 index 00000000..63d6916a --- /dev/null +++ b/include/iprt/win/setupapi.h @@ -0,0 +1,40 @@ +/** @file + * Safe way to include setupapi.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_setupapi_h +#define IPRT_INCLUDED_win_setupapi_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#pragma warning(push) +#pragma warning(disable:4668) /* warning C4668: 'USE_SP_ALTPLATFORM_INFO_V1' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */ + +#include <setupapi.h> + +#pragma warning(pop) + +#endif /* !IPRT_INCLUDED_win_setupapi_h */ + diff --git a/include/iprt/win/shlobj.h b/include/iprt/win/shlobj.h new file mode 100644 index 00000000..4cd4e2aa --- /dev/null +++ b/include/iprt/win/shlobj.h @@ -0,0 +1,48 @@ +/** @file + * Safe way to include shlobj.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_shlobj_h +#define IPRT_INCLUDED_win_shlobj_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable:4668) /* warning C4668: 'USE_SP_ALTPLATFORM_INFO_V1' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */ +#endif +#if _MSC_VER >= 1800 /*RT_MSC_VER_VC120*/ +# pragma warning(disable:4005) /* sdk/v7.1/include/sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition */ +# pragma warning(disable:4255) /* windef.h(227) : warning C4255: 'NEARPROC' : no function prototype given: converting '()' to '(void)' */ +#endif + +#include <shlobj.h> + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +#endif /* !IPRT_INCLUDED_win_shlobj_h */ + diff --git a/include/iprt/win/shlwapi.h b/include/iprt/win/shlwapi.h new file mode 100644 index 00000000..188ca78c --- /dev/null +++ b/include/iprt/win/shlwapi.h @@ -0,0 +1,43 @@ +/** @file + * Safe way to include shlwapi.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_shlwapi_h +#define IPRT_INCLUDED_win_shlwapi_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#pragma warning(push) +#pragma warning(disable:4668) /* warning C4668: 'USE_SP_ALTPLATFORM_INFO_V1' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */ +#pragma warning(disable:4255) /* warning C4255: 'I_RpcMgmtEnableDedicatedThreadPool' : no function prototype given: converting '()' to '(void)' */ +#if _MSC_VER >= 1800 /*RT_MSC_VER_VC120*/ +# pragma warning(disable:4005) /* sdk/v7.1/include/sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition */ +#endif +#include <shlwapi.h> + +#pragma warning(pop) + +#endif /* !IPRT_INCLUDED_win_shlwapi_h */ + diff --git a/include/iprt/win/windef.h b/include/iprt/win/windef.h new file mode 100644 index 00000000..8b2eb5fb --- /dev/null +++ b/include/iprt/win/windef.h @@ -0,0 +1,55 @@ +/** @file + * Safe way to include windef.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_windef_h +#define IPRT_INCLUDED_win_windef_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#ifdef _MSC_VER +/* + * Unfortunately, the windef.h file in SDK 7.1 is not clean wrt warning C4668: + * basetsd.h(114) : warning C4668: '__midl' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' + * winnt.h(13017) : warning C4668: '_DBG_MEMCPY_INLINE_' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' + */ +# pragma warning(push) +# pragma warning(disable:4668) +# ifndef __cplusplus +# pragma warning(disable:4255) /* warning C4255: 'FARPROC' : no function prototype given: converting '()' to '(void)' */ +# endif +# if _MSC_VER >= 1800 /*RT_MSC_VER_VC120*/ +# pragma warning(disable:4005) /* sdk/v7.1/include/sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition */ +# endif +#endif + +#include <windef.h> + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +#endif /* !IPRT_INCLUDED_win_windef_h */ + diff --git a/include/iprt/win/windows.h b/include/iprt/win/windows.h new file mode 100644 index 00000000..0a0bdb4f --- /dev/null +++ b/include/iprt/win/windows.h @@ -0,0 +1,57 @@ +/** @file + * Safe way to include Windows.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_windows_h +#define IPRT_INCLUDED_win_windows_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#ifdef _MSC_VER +/* + * Unfortunately, the Windows.h file in SDK 7.1 is not clean wrt warning C4668: + * wincrypt.h(1848) : warning C4668: 'NTDDI_WINLH' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' + */ +# pragma warning(push) +# pragma warning(disable:4668) +# pragma warning(disable:4480) /* W10/wincrypt.h(9193) : warning C4480: nonstandard extension used: specifying underlying type for enum 'CertKeyType' */ +# if _MSC_VER >= 1800 /*RT_MSC_VER_VC120*/ +# pragma warning(disable:4005) /* sdk/v7.1/include/sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition */ +# endif +# ifndef __cplusplus +# pragma warning(disable:4255) /* warning C4255: 'FARPROC' : no function prototype given: converting '()' to '(void)' */ +# endif +#endif + +#include <Windows.h> + +#ifdef _MSC_VER +# pragma warning(pop) +/* VS2010: Something causes this to be re-enabled above and triggering errors using RT_FLEXIBLE_ARRAY. */ +# pragma warning(disable:4200) +#endif + +#endif /* !IPRT_INCLUDED_win_windows_h */ + diff --git a/include/iprt/win/winsock.h b/include/iprt/win/winsock.h new file mode 100644 index 00000000..1717637d --- /dev/null +++ b/include/iprt/win/winsock.h @@ -0,0 +1,54 @@ +/** @file + * Safe way to include winsock2.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_winsock_h +#define IPRT_INCLUDED_win_winsock_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#ifdef _MSC_VER +/* + * Unfortunately, the Windows.h file in SDK 7.1 is not clean wrt warning C4668: + * wincrypt.h(1848) : warning C4668: 'NTDDI_WINLH' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' + */ +# pragma warning(push) +# pragma warning(disable:4668) +# ifndef __cplusplus +# pragma warning(disable:4255) /* warning C4255: 'FARPROC' : no function prototype given: converting '()' to '(void)' */ +# endif +# if _MSC_VER >= 1800 /*RT_MSC_VER_VC120*/ +# pragma warning(disable:4005) /* sdk/v7.1/include/sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition */ +# endif +#endif + +#include <winsock.h> + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +#endif /* !IPRT_INCLUDED_win_winsock_h */ + diff --git a/include/iprt/win/winsock2.h b/include/iprt/win/winsock2.h new file mode 100644 index 00000000..19d30590 --- /dev/null +++ b/include/iprt/win/winsock2.h @@ -0,0 +1,54 @@ +/** @file + * Safe way to include winsock2.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_winsock2_h +#define IPRT_INCLUDED_win_winsock2_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#ifdef _MSC_VER +/* + * Unfortunately, the Windows.h file in SDK 7.1 is not clean wrt warning C4668: + * wincrypt.h(1848) : warning C4668: 'NTDDI_WINLH' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' + */ +# pragma warning(push) +# pragma warning(disable:4668) +# ifndef __cplusplus +# pragma warning(disable:4255) /* warning C4255: 'FARPROC' : no function prototype given: converting '()' to '(void)' */ +# endif +# if _MSC_VER >= 1800 /*RT_MSC_VER_VC120*/ +# pragma warning(disable:4005) /* sdk/v7.1/include/sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition */ +# endif +#endif + +#include <winsock2.h> + +#ifdef _MSC_VER +# pragma warning(pop) +#endif + +#endif /* !IPRT_INCLUDED_win_winsock2_h */ + diff --git a/include/iprt/win/ws2tcpip.h b/include/iprt/win/ws2tcpip.h new file mode 100644 index 00000000..8277844f --- /dev/null +++ b/include/iprt/win/ws2tcpip.h @@ -0,0 +1,44 @@ +/** @file + * Safe way to include ws2tcpip.h. + */ + +/* + * Copyright (C) 2016-2019 Oracle Corporation + * + * This file is part of VirtualBox Open Source Edition (OSE), as + * available from http://www.virtualbox.org. This file is free software; + * you can redistribute it and/or modify it under the terms of the GNU + * General Public License (GPL) as published by the Free Software + * Foundation, in version 2 as it comes in the "COPYING" file of the + * VirtualBox OSE distribution. VirtualBox OSE is distributed in the + * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + * + * The contents of this file may alternatively be used under the terms + * of the Common Development and Distribution License Version 1.0 + * (CDDL) only, as it comes in the "COPYING.CDDL" file of the + * VirtualBox OSE distribution, in which case the provisions of the + * CDDL are applicable instead of those of the GPL. + * + * You may elect to license modified versions of this file under the + * terms and conditions of either the GPL or the CDDL or both. + */ + +#ifndef IPRT_INCLUDED_win_ws2tcpip_h +#define IPRT_INCLUDED_win_ws2tcpip_h +#ifndef RT_WITHOUT_PRAGMA_ONCE +# pragma once +#endif + +#pragma warning(push) +#pragma warning(disable:4668) /* 'NDIS_SUPPORT_NDIS6' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' */ +#if _MSC_VER >= 1800 /*RT_MSC_VER_VC120*/ +# pragma warning(disable:4005) /* sdk/v7.1/include/sal_supp.h(57) : warning C4005: '__useHeader' : macro redefinition */ +# pragma warning(disable:4255) /* windef.h(227) : warning C4255: 'NEARPROC' : no function prototype given: converting '()' to '(void)' */ +#endif + +#include <ws2tcpip.h> + +#pragma warning(pop) + +#endif /* !IPRT_INCLUDED_win_ws2tcpip_h */ + |