From: Thomas Pfaff <tpfaff@gmx.net>
To: "Phil Frisbie, Jr." <phil@hawksoft.com>
Cc: <pthreads-win32@sourceware.cygnus.com>
Subject: Re: Thread local storage problem, and fix
Date: Mon, 27 Aug 2001 02:05:00 -0000 [thread overview]
Message-ID: <Pine.WNT.4.33.0108271059080.246-101000@algeria.intern.net> (raw)
In-Reply-To: <F0E13277A26BD311944600500454CCD034003B@antarctica.intern.net>
[-- Attachment #1: Type: text/plain, Size: 784 bytes --]
I can not reproduce your error. I have written a small test program and
regardless whether i link against ws2_32.lib or wsock32.lib WSALastError
and Win32 LastError returns the same value. I have attached it, so you can
compile it and send me its output.
Cheers,
Thomas
On Thu, 23 Aug 2001, Phil Frisbie, Jr. wrote:
> I am using Winsock 1.1 on Windows NT 4. I have not yet tried Windows
> 9x/ME or 2000.
>
> Thomas Pfaff wrote:
> >
> > On Wed, 22 Aug 2001, Phil Frisbie, Jr. wrote:
> >
> > strange,
> >
> > at least on NT4 the WSALastError equals to Win32 LastError when i used
> > Winsock2, so i did not saved it too.
> >
> > I will have a look if you tell me your platform.
> >
> > Greetings,
> >
> > Thomas
>
>
> Phil Frisbie, Jr.
> Hawk Software
> http://www.hawksoft.com
>
>
[-- Attachment #2: main.c --]
[-- Type: text/x-c, Size: 794 bytes --]
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock.h>
#include <stdio.h>
static void TlsGet( void );
static DWORD tlsIdx;
int main( void )
{
SetLastError(WSAEHOSTUNREACH);
printf("LastError %d\n", GetLastError());
printf("WSALastError %d\n", WSAGetLastError());
WSASetLastError(WSAEHOSTUNREACH);
printf("LastError %d\n", GetLastError());
printf("WSALastError %d\n", WSAGetLastError());
tlsIdx = TlsAlloc();
TlsSetValue( tlsIdx, (void *) 0x1234 );
TlsGet();
printf("LastError %d\n", GetLastError());
printf("WSALastError %d\n", WSAGetLastError());
return 0;
}
static void TlsGet( void )
{
DWORD lastError = GetLastError();
TlsGetValue(tlsIdx);
printf("LastError after TlsGetValue : %d\n", GetLastError());
SetLastError(lastError);
}
next parent reply other threads:[~2001-08-27 2:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <F0E13277A26BD311944600500454CCD034003B@antarctica.intern.net>
2001-08-27 2:05 ` Thomas Pfaff [this message]
2001-08-22 11:51 Phil Frisbie, Jr.
2001-08-22 22:46 ` Ross Johnson
2001-08-23 0:41 ` Thomas Pfaff
2001-08-23 7:43 ` Phil Frisbie, Jr.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.WNT.4.33.0108271059080.246-101000@algeria.intern.net \
--to=tpfaff@gmx.net \
--cc=phil@hawksoft.com \
--cc=pthreads-win32@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).