1 /**************************************************************************** 2 ** 3 ** Copyright (C) 2016 The Qt Company Ltd. 4 ** Contact: https://www.qt.io/licensing/ 5 ** 6 ** This file is part of the plugins of the Qt Toolkit. 7 ** 8 ** $QT_BEGIN_LICENSE:LGPL$ 9 ** Commercial License Usage 10 ** Licensees holding valid commercial Qt licenses may use this file in 11 ** accordance with the commercial license agreement provided with the 12 ** Software or, alternatively, in accordance with the terms contained in 13 ** a written agreement between you and The Qt Company. For licensing terms 14 ** and conditions see https://www.qt.io/terms-conditions. For further 15 ** information use the contact form at https://www.qt.io/contact-us. 16 ** 17 ** GNU Lesser General Public License Usage 18 ** Alternatively, this file may be used under the terms of the GNU Lesser 19 ** General Public License version 3 as published by the Free Software 20 ** Foundation and appearing in the file LICENSE.LGPL3 included in the 21 ** packaging of this file. Please review the following information to 22 ** ensure the GNU Lesser General Public License version 3 requirements 23 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 24 ** 25 ** GNU General Public License Usage 26 ** Alternatively, this file may be used under the terms of the GNU 27 ** General Public License version 2.0 or (at your option) the GNU General 28 ** Public license version 3 or any later version approved by the KDE Free 29 ** Qt Foundation. The licenses are as published by the Free Software 30 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 31 ** included in the packaging of this file. Please review the following 32 ** information to ensure the GNU General Public License requirements will 33 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and 34 ** https://www.gnu.org/licenses/gpl-3.0.html. 35 ** 36 ** $QT_END_LICENSE$ 37 ** 38 ****************************************************************************/ 39 40 #ifndef QPLATFORMDEFS_WIN_H 41 #define QPLATFORMDEFS_WIN_H 42 43 // Since we need to include winsock2.h, we need to define WIN32_LEAN_AND_MEAN 44 // somewhere above so windows.h won't include winsock.h. 45 #include <winsock2.h> 46 #include <mswsock.h> 47 #undef interface 48 #include <wincrypt.h> 49 #include <winioctl.h> 50 51 QT_BEGIN_NAMESPACE 52 53 #ifndef NS_NLA 54 55 #define NS_NLA 15 56 57 #ifndef NLA_NAMESPACE_GUID 58 enum NLA_BLOB_DATA_TYPE { 59 NLA_RAW_DATA = 0, 60 NLA_INTERFACE = 1, 61 NLA_802_1X_LOCATION = 2, 62 NLA_CONNECTIVITY = 3, 63 NLA_ICS = 4 64 }; 65 66 enum NLA_CONNECTIVITY_TYPE { 67 NLA_NETWORK_AD_HOC = 0, 68 NLA_NETWORK_MANAGED = 1, 69 NLA_NETWORK_UNMANAGED = 2, 70 NLA_NETWORK_UNKNOWN = 3 71 }; 72 73 enum NLA_INTERNET { 74 NLA_INTERNET_UNKNOWN = 0, 75 NLA_INTERNET_NO = 1, 76 NLA_INTERNET_YES = 2 77 }; 78 79 struct NLA_BLOB { 80 struct { 81 NLA_BLOB_DATA_TYPE type; 82 DWORD dwSize; 83 DWORD nextOffset; 84 } header; 85 86 union { 87 // NLA_RAW_DATA 88 CHAR rawData[1]; 89 90 // NLA_INTERFACE 91 struct { 92 DWORD dwType; 93 DWORD dwSpeed; 94 CHAR adapterName[1]; 95 } interfaceData; 96 97 // NLA_802_1X_LOCATION 98 struct { 99 CHAR information[1]; 100 } locationData; 101 102 // NLA_CONNECTIVITY 103 struct { 104 NLA_CONNECTIVITY_TYPE type; 105 NLA_INTERNET internet; 106 } connectivity; 107 108 // NLA_ICS 109 struct { 110 struct { 111 DWORD speed; 112 DWORD type; 113 DWORD state; 114 WCHAR machineName[256]; 115 WCHAR sharedAdapterName[256]; 116 } remote; 117 } ICS; 118 } data; 119 }; 120 #endif // NLA_NAMESPACE_GUID 121 122 #endif 123 124 enum NDIS_MEDIUM { 125 NdisMedium802_3 = 0, 126 }; 127 128 enum NDIS_PHYSICAL_MEDIUM { 129 NdisPhysicalMediumWirelessLan = 1, 130 NdisPhysicalMediumBluetooth = 10, 131 NdisPhysicalMediumWiMax = 12, 132 }; 133 134 #define OID_GEN_MEDIA_SUPPORTED 0x00010103 135 #define OID_GEN_PHYSICAL_MEDIUM 0x00010202 136 137 #define IOCTL_NDIS_QUERY_GLOBAL_STATS \ 138 CTL_CODE(FILE_DEVICE_PHYSICAL_NETCARD, 0, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) 139 140 QT_END_NAMESPACE 141 142 #endif // QPLATFORMDEFS_WIN_H 143