On 07.09.2010 22:37, Hans Leidekker wrote:
@@ -116,6 +128,10 @@ static void InitFunctionPtrs(void) if(!secdll) secdll = LoadLibraryA("security.dll"); advapi32dll = GetModuleHandleA("advapi32.dll");
- wsockdll = LoadLibraryA("ws2_32.dll");
- if(!wsockdll)
printf("Couldn't open ws2_32.dll\n");
Why are you loading ws2_32 dynamically?
All other dlls were being loaded that way so I thought it was the way to go. Fixed.
- desc->pBuffers[0].cbBuffer = size;
- desc->pBuffers[0].pvBuffer = malloc(size);
Use HeapAlloc/Free instead of malloc/free.
Fixed.
+static int receive_data(SOCKET sock, SecBuffer *buf) +{
- unsigned received = 0;
- while(1)
- {
unsigned char *data = buf->pvBuffer;
unsigned expected = 0;
int ret;
Please stick to 4 space indentation like the rest of the file.
Oops, I thought expandtab was on, but apparently it wasn't. Fixed.
- addr.sin_family = AF_INET;
- addr.sin_addr.s_addr = htonl(0xD1558712);
- addr.sin_port = htons(443);
- ret = pconnect(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in));
- if(ret==SOCKET_ERROR)
- {
skip("Can't connect to mail.google.com\n");
return;
- }
You should properly resolve mail.google.com.
Fixed.
New patch will be submitted shortly.