henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 11 | #ifndef RTC_BASE_WIN32_H_ |
| 12 | #define RTC_BASE_WIN32_H_ |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 13 | |
Mirko Bonadei | e062385 | 2018-02-01 10:17:40 | [diff] [blame] | 14 | #ifndef WEBRTC_WIN |
| 15 | #error "Only #include this header in Windows builds" |
| 16 | #endif |
henrike@webrtc.org | f048872 | 2014-05-13 18:00:26 | [diff] [blame] | 17 | |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 18 | // Make sure we don't get min/max macros |
| 19 | #ifndef NOMINMAX |
| 20 | #define NOMINMAX |
| 21 | #endif |
| 22 | |
Nico Weber | 79bd4f1 | 2021-10-05 19:01:26 | [diff] [blame] | 23 | #include <winsock2.h> |
| 24 | |
| 25 | // Must be after winsock2.h. |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 26 | #include <windows.h> |
| 27 | |
Niels Möller | d7b9131 | 2018-05-24 09:21:34 | [diff] [blame] | 28 | typedef int socklen_t; |
| 29 | |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 30 | #ifndef SECURITY_MANDATORY_LABEL_AUTHORITY |
| 31 | // Add defines that we use if we are compiling against older sdks |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 32 | #define SECURITY_MANDATORY_MEDIUM_RID (0x00002000L) |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 33 | #define TokenIntegrityLevel static_cast<TOKEN_INFORMATION_CLASS>(0x19) |
| 34 | typedef struct _TOKEN_MANDATORY_LABEL { |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 35 | SID_AND_ATTRIBUTES Label; |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 36 | } TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL; |
| 37 | #endif // SECURITY_MANDATORY_LABEL_AUTHORITY |
| 38 | |
| 39 | #undef SetPort |
| 40 | |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 41 | namespace rtc { |
| 42 | |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 43 | const char* win32_inet_ntop(int af, const void* src, char* dst, socklen_t size); |
| 44 | int win32_inet_pton(int af, const char* src, void* dst); |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 45 | |
Henrik Kjellander | ec78f1c | 2017-06-29 05:52:50 | [diff] [blame] | 46 | } // namespace rtc |
| 47 | |
Mirko Bonadei | 92ea95e | 2017-09-15 04:47:31 | [diff] [blame] | 48 | #endif // RTC_BASE_WIN32_H_ |