OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004--2005, Google Inc. | 3 * Copyright 2004--2005, Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 29 matching lines...) Expand all Loading... |
40 // Add defines that we use if we are compiling against older sdks | 40 // Add defines that we use if we are compiling against older sdks |
41 #define SECURITY_MANDATORY_MEDIUM_RID (0x00002000L) | 41 #define SECURITY_MANDATORY_MEDIUM_RID (0x00002000L) |
42 #define TokenIntegrityLevel static_cast<TOKEN_INFORMATION_CLASS>(0x19) | 42 #define TokenIntegrityLevel static_cast<TOKEN_INFORMATION_CLASS>(0x19) |
43 typedef struct _TOKEN_MANDATORY_LABEL { | 43 typedef struct _TOKEN_MANDATORY_LABEL { |
44 SID_AND_ATTRIBUTES Label; | 44 SID_AND_ATTRIBUTES Label; |
45 } TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL; | 45 } TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL; |
46 #endif // SECURITY_MANDATORY_LABEL_AUTHORITY | 46 #endif // SECURITY_MANDATORY_LABEL_AUTHORITY |
47 | 47 |
48 #undef SetPort | 48 #undef SetPort |
49 | 49 |
50 #include <stdlib.h> | |
51 #include <string> | 50 #include <string> |
52 | 51 |
53 #include "talk/base/stringutils.h" | 52 #include "talk/base/stringutils.h" |
54 #include "talk/base/basictypes.h" | 53 #include "talk/base/basictypes.h" |
55 | 54 |
56 // This is to remove the dependency to ws2_32.dll especially for chrome, | |
57 // where we don't load the ws2_32.dll in the render process. | |
58 // This is correct only on little-endian machines. | |
59 #define ntohl(x) _byteswap_ulong(x) | |
60 #define ntohs(x) _byteswap_ushort(x) | |
61 #define htonl(x) _byteswap_ulong(x) | |
62 #define htons(x) _byteswap_ushort(x) | |
63 | |
64 namespace talk_base { | 55 namespace talk_base { |
65 | 56 |
66 const char* win32_inet_ntop(int af, const void *src, char* dst, socklen_t size); | 57 const char* win32_inet_ntop(int af, const void *src, char* dst, socklen_t size); |
67 int win32_inet_pton(int af, const char* src, void *dst); | 58 int win32_inet_pton(int af, const char* src, void *dst); |
68 | 59 |
69 /////////////////////////////////////////////////////////////////////////////// | 60 /////////////////////////////////////////////////////////////////////////////// |
70 | 61 |
71 inline std::wstring ToUtf16(const char* utf8, size_t len) { | 62 inline std::wstring ToUtf16(const char* utf8, size_t len) { |
72 int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, len, NULL, 0); | 63 int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, len, NULL, 0); |
73 wchar_t* ws = STACK_ARRAY(wchar_t, len16); | 64 wchar_t* ws = STACK_ARRAY(wchar_t, len16); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 124 } |
134 | 125 |
135 bool AdjustCurrentProcessPrivilege(const TCHAR* privilege, bool to_enable); | 126 bool AdjustCurrentProcessPrivilege(const TCHAR* privilege, bool to_enable); |
136 | 127 |
137 /////////////////////////////////////////////////////////////////////////////// | 128 /////////////////////////////////////////////////////////////////////////////// |
138 | 129 |
139 } // namespace talk_base | 130 } // namespace talk_base |
140 | 131 |
141 #endif // WIN32 | 132 #endif // WIN32 |
142 #endif // TALK_BASE_WIN32_H_ | 133 #endif // TALK_BASE_WIN32_H_ |
OLD | NEW |