1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright (c) 2020 Dmitry Kozlyuk 3 */ 4 5 #ifndef _RTE_WINDOWS_H_ 6 #define _RTE_WINDOWS_H_ 7 8 /** 9 * @file Windows-specific facilities 10 * 11 * This file should be included by DPDK libraries and applications 12 * that need access to Windows API. It includes platform SDK headers 13 * in compatible order with proper options and defines error-handling macros. 14 */ 15 16 /* Disable excessive libraries. */ 17 #ifndef WIN32_LEAN_AND_MEAN 18 #define WIN32_LEAN_AND_MEAN 19 #endif 20 21 /* Must come first. */ 22 #include <windows.h> 23 24 #include <basetsd.h> 25 #include <psapi.h> 26 #include <setupapi.h> 27 #include <winioctl.h> 28 29 /* Have GUIDs defined. */ 30 #ifndef INITGUID 31 #define INITGUID 32 #endif 33 #include <initguid.h> 34 #include <devguid.h> 35 #include <rte_log.h> 36 37 /** 38 * Log GetLastError() with context, usually a Win32 API function and arguments. 39 */ 40 #define RTE_LOG_WIN32_ERR(...) \ 41 RTE_LOG(DEBUG, EAL, RTE_FMT("GetLastError()=%lu: " \ 42 RTE_FMT_HEAD(__VA_ARGS__,) "\n", GetLastError(), \ 43 RTE_FMT_TAIL(__VA_ARGS__,))) 44 45 #endif /* _RTE_WINDOWS_H_ */ 46