Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: third_party/twisted_8_1/twisted/internet/iocpreactor/iocpsupport/winsock_pointers.c

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 /* Copyright (c) 2008 Twisted Matrix Laboratories.
2 * See LICENSE for details.
3 */
4
5
6 #include<winsock2.h>
7 #include<assert.h>
8 #include<stdio.h>
9 #include<stdlib.h>
10
11 #ifndef WSAID_CONNECTEX
12 #define WSAID_CONNECTEX {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74 ,0x06,0x3e}}
13 #endif
14 #ifndef WSAID_GETACCEPTEXSOCKADDRS
15 #define WSAID_GETACCEPTEXSOCKADDRS {0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x8 0,0x5f,0x48,0xa1,0x92}}
16 #endif
17 #ifndef WSAID_ACCEPTEX
18 #define WSAID_ACCEPTEX {0xb5367df1,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48, 0xa1,0x92}}
19 #endif
20 /*#ifndef WSAID_TRANSMITFILE
21 #define WSAID_TRANSMITFILE {0xb5367df0,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0 x48,0xa1,0x92}}
22 #endif*/
23
24
25 void *lpAcceptEx, *lpGetAcceptExSockaddrs, *lpConnectEx, *lpTransmitFile;
26
27 int initPointer(SOCKET s, void **fun, GUID guid) {
28 int res;
29 DWORD bytes;
30
31 *fun = NULL;
32 res = WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER,
33 &guid, sizeof(guid),
34 fun, sizeof(fun),
35 &bytes, NULL, NULL);
36 return !res;
37 }
38
39 int initWinsockPointers() {
40 SOCKET s = socket(AF_INET, SOCK_STREAM, 0);
41 /* I hate C */
42 GUID guid1 = WSAID_ACCEPTEX;
43 GUID guid2 = WSAID_GETACCEPTEXSOCKADDRS;
44 GUID guid3 = WSAID_CONNECTEX;
45 /*GUID guid4 = WSAID_TRANSMITFILE;*/
46 if (!s) {
47 return 0;
48 }
49 if (!initPointer(s, &lpAcceptEx, guid1))
50 {
51 return 0;
52 }
53 if (!initPointer(s, &lpGetAcceptExSockaddrs, guid2)) {
54 return 0;
55 }
56 if (!initPointer(s, &lpConnectEx, guid3)) {
57 return 0;
58 };
59 /*initPointer(s, &lpTransmitFile, guid4);*/
60 return 1;
61 }
62
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698