VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/ws2def.h

最後變更 在這個檔案是 53206,由 vboxsync 提交於 10 年 前

Devices/vmsvga: header fixes

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 4.3 KB
 
1/*
2 * Copyright (C) 2009 Robert Shearman
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19/*
20 * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
21 * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
22 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
23 * a choice of LGPL license versions is made available with the language indicating
24 * that LGPLv2 or any later version may be used, or where a choice of which version
25 * of the LGPL is applied is otherwise unspecified.
26 */
27
28#ifndef _WS2DEF_
29#define _WS2DEF_
30
31#include <inaddr.h>
32
33#ifdef USE_WS_PREFIX
34#define WS(x) WS_##x
35#else
36#define WS(x) x
37#endif
38
39#ifndef __CSADDR_DEFINED__
40#define __CSADDR_DEFINED__
41
42typedef struct _SOCKET_ADDRESS {
43 LPSOCKADDR lpSockaddr;
44 INT iSockaddrLength;
45} SOCKET_ADDRESS, *PSOCKET_ADDRESS, *LPSOCKET_ADDRESS;
46
47typedef struct _CSADDR_INFO {
48 SOCKET_ADDRESS LocalAddr;
49 SOCKET_ADDRESS RemoteAddr;
50 INT iSocketType;
51 INT iProtocol;
52} CSADDR_INFO, *PCSADDR_INFO, *LPCSADDR_INFO;
53#endif
54
55#ifdef USE_WS_PREFIX
56#define WS__SS_MAXSIZE 128
57#define WS__SS_ALIGNSIZE (sizeof(__int64))
58#define WS__SS_PAD1SIZE (WS__SS_ALIGNSIZE - sizeof(short))
59#define WS__SS_PAD2SIZE (WS__SS_MAXSIZE - 2 * WS__SS_ALIGNSIZE)
60#else
61#define _SS_MAXSIZE 128
62#define _SS_ALIGNSIZE (sizeof(__int64))
63#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(short))
64#define _SS_PAD2SIZE (_SS_MAXSIZE - 2 * _SS_ALIGNSIZE)
65#endif
66
67typedef struct WS(sockaddr_storage) {
68 short ss_family;
69 char __ss_pad1[WS(_SS_PAD1SIZE)];
70 __int64 DECLSPEC_ALIGN(8) __ss_align;
71 char __ss_pad2[WS(_SS_PAD2SIZE)];
72} SOCKADDR_STORAGE, *PSOCKADDR_STORAGE, *LPSOCKADDR_STORAGE;
73
74/*socket address list */
75typedef struct _SOCKET_ADDRESS_LIST {
76 INT iAddressCount;
77 SOCKET_ADDRESS Address[1];
78} SOCKET_ADDRESS_LIST, *LPSOCKET_ADDRESS_LIST;
79
80typedef enum {
81 ScopeLevelInterface = 1,
82 ScopeLevelLink = 2,
83 ScopeLevelSubnet = 3,
84 ScopeLevelAdmin = 4,
85 ScopeLevelSite = 5,
86 ScopeLevelOrganization = 8,
87 ScopeLevelGlobal = 14
88} SCOPE_LEVEL;
89
90typedef struct _WSABUF
91{
92 ULONG len;
93 CHAR* buf;
94} WSABUF, *LPWSABUF;
95
96typedef struct _WSAMSG {
97 LPSOCKADDR name;
98 INT namelen;
99 LPWSABUF lpBuffers;
100 DWORD dwBufferCount;
101 WSABUF Control;
102 DWORD dwFlags;
103} WSAMSG, *PWSAMSG, *LPWSAMSG;
104
105/*
106 * Macros for retrieving control message data returned by WSARecvMsg()
107 */
108#define WSA_CMSG_DATA(cmsg) ((UCHAR*)((WSACMSGHDR*)(cmsg)+1))
109#define WSA_CMSG_FIRSTHDR(mhdr) ((mhdr)->Control.len >= sizeof(WSACMSGHDR) ? (WSACMSGHDR *) (mhdr)->Control.buf : (WSACMSGHDR *) 0)
110#define WSA_CMSG_ALIGN(len) (((len) + sizeof(SIZE_T) - 1) & ~(sizeof(SIZE_T) - 1))
111/*
112 * Next Header: If the response is too short (or the next message in the response
113 * is too short) then return NULL, otherwise return the next control message.
114 */
115#define WSA_CMSG_NXTHDR(mhdr,cmsg) \
116 (!(cmsg) ? WSA_CMSG_FIRSTHDR(mhdr) : \
117 ((mhdr)->Control.len < sizeof(WSACMSGHDR) ? NULL : \
118 (((unsigned char*)(((WSACMSGHDR*)((unsigned char*)cmsg + WSA_CMSG_ALIGN(cmsg->cmsg_len)))+1) > ((unsigned char*)(mhdr)->Control.buf + (mhdr)->Control.len)) ? NULL : \
119 (((unsigned char*)cmsg + WSA_CMSG_ALIGN(cmsg->cmsg_len)+WSA_CMSG_ALIGN(((WSACMSGHDR*)((unsigned char*)cmsg + WSA_CMSG_ALIGN(cmsg->cmsg_len)))->cmsg_len) > ((unsigned char*)(mhdr)->Control.buf + (mhdr)->Control.len)) ? NULL : \
120 (WSACMSGHDR*)((unsigned char*)cmsg + WSA_CMSG_ALIGN(cmsg->cmsg_len))))))
121
122#endif /* _WS2DEF_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette