Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / usr / lib / python2.7 / dist-packages / twisted / internet / iocpreactor / iocpsupport / | server ip : 104.21.89.46 your ip : 172.69.58.73 H O M E |
Filename | /usr/lib/python2.7/dist-packages/twisted/internet/iocpreactor/iocpsupport/winsock_pointers.c |
Size | 1.6 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 27-Apr-2025 09:56 |
Last modified | 19-Mar-2008 00:35 |
Last accessed | 07-Jul-2025 23:59 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
/* Copyright (c) 2008 Twisted Matrix Laboratories.
* See LICENSE for details.
*/
#include<winsock2.h>
#include<assert.h>
#include<stdio.h>
#include<stdlib.h>
#ifndef WSAID_CONNECTEX
#define WSAID_CONNECTEX {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}}
#endif
#ifndef WSAID_GETACCEPTEXSOCKADDRS
#define WSAID_GETACCEPTEXSOCKADDRS {0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
#endif
#ifndef WSAID_ACCEPTEX
#define WSAID_ACCEPTEX {0xb5367df1,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
#endif
/*#ifndef WSAID_TRANSMITFILE
#define WSAID_TRANSMITFILE {0xb5367df0,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
#endif*/
void *lpAcceptEx, *lpGetAcceptExSockaddrs, *lpConnectEx, *lpTransmitFile;
int initPointer(SOCKET s, void **fun, GUID guid) {
int res;
DWORD bytes;
*fun = NULL;
res = WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER,
&guid, sizeof(guid),
fun, sizeof(fun),
&bytes, NULL, NULL);
return !res;
}
int initWinsockPointers() {
SOCKET s = socket(AF_INET, SOCK_STREAM, 0);
/* I hate C */
GUID guid1 = WSAID_ACCEPTEX;
GUID guid2 = WSAID_GETACCEPTEXSOCKADDRS;
GUID guid3 = WSAID_CONNECTEX;
/*GUID guid4 = WSAID_TRANSMITFILE;*/
if (!s) {
return 0;
}
if (!initPointer(s, &lpAcceptEx, guid1))
{
return 0;
}
if (!initPointer(s, &lpGetAcceptExSockaddrs, guid2)) {
return 0;
}
if (!initPointer(s, &lpConnectEx, guid3)) {
return 0;
};
/*initPointer(s, &lpTransmitFile, guid4);*/
return 1;
}
* See LICENSE for details.
*/
#include<winsock2.h>
#include<assert.h>
#include<stdio.h>
#include<stdlib.h>
#ifndef WSAID_CONNECTEX
#define WSAID_CONNECTEX {0x25a207b9,0xddf3,0x4660,{0x8e,0xe9,0x76,0xe5,0x8c,0x74,0x06,0x3e}}
#endif
#ifndef WSAID_GETACCEPTEXSOCKADDRS
#define WSAID_GETACCEPTEXSOCKADDRS {0xb5367df2,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
#endif
#ifndef WSAID_ACCEPTEX
#define WSAID_ACCEPTEX {0xb5367df1,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
#endif
/*#ifndef WSAID_TRANSMITFILE
#define WSAID_TRANSMITFILE {0xb5367df0,0xcbac,0x11cf,{0x95,0xca,0x00,0x80,0x5f,0x48,0xa1,0x92}}
#endif*/
void *lpAcceptEx, *lpGetAcceptExSockaddrs, *lpConnectEx, *lpTransmitFile;
int initPointer(SOCKET s, void **fun, GUID guid) {
int res;
DWORD bytes;
*fun = NULL;
res = WSAIoctl(s, SIO_GET_EXTENSION_FUNCTION_POINTER,
&guid, sizeof(guid),
fun, sizeof(fun),
&bytes, NULL, NULL);
return !res;
}
int initWinsockPointers() {
SOCKET s = socket(AF_INET, SOCK_STREAM, 0);
/* I hate C */
GUID guid1 = WSAID_ACCEPTEX;
GUID guid2 = WSAID_GETACCEPTEXSOCKADDRS;
GUID guid3 = WSAID_CONNECTEX;
/*GUID guid4 = WSAID_TRANSMITFILE;*/
if (!s) {
return 0;
}
if (!initPointer(s, &lpAcceptEx, guid1))
{
return 0;
}
if (!initPointer(s, &lpGetAcceptExSockaddrs, guid2)) {
return 0;
}
if (!initPointer(s, &lpConnectEx, guid3)) {
return 0;
};
/*initPointer(s, &lpTransmitFile, guid4);*/
return 1;
}