Problema con estructuras de datos y sockets
Posted: Tue May 22, 2007 1:43 pm
Tengo esta estructura de datos
Ademas wrapeada la funcion del API de windows, de esta forma
Se llama a dicha funcion pasandole el "buffer" de la estructura
Pero NO se como devolver el contenido del buffer de nuevo a la estructura.
La data :InternalBuffer solo es de lectura...
¿ Como se hace ?
Code: Select all
#define WSADESCRIPTION_LEN 256+1
#define WSASYS_STATUS_LEN 128+1
C STRUCTURE _WSAData ALIGN 4
MEMBER wVersion IS CTYPE_SHORT
MEMBER wHighVer IS CTYPE_SHORT
MEMBER szDescrip[WSADESCRIPTION_LEN] IS CTYPE_CHAR
MEMBER szSystem[WSASYS_STATUS_LEN] IS CTYPE_CHAR
MEMBER iMaxSock IS CTYPE_SHORT
MEMBER iMaxUdpDg IS CTYPE_SHORT
MEMBER lpVendor IS CTYPE_LONG
END C STRUCTURE
WSAData:=(struct _WSAData)
Code: Select all
DLL32 FUNCTION WSAStartup(n AS LONG, pStruct AS LPSTR) AS LONG PASCAL FROM "WSAStartup" LIB "wsock32.dll"
Code: Select all
cTemp:=WSAData:InternalBuffer
rc:=WSAStartup(bin2i(chr(1)+chr(1)),@cTemp)
La data :InternalBuffer solo es de lectura...
¿ Como se hace ?