From ae8a9b8a9f6aec5feba31f1a88385f0d2eee379f Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 3 Dec 2001 00:28:24 +0000 Subject: [PATCH] Remove code to lookup WinSock error strings in netmsg.dll; according to Magnus Hagander that DLL only contains error strings for the Net*** functions, *not* WinSock. We need to look for a workable solution for older Windows flavors ... but it won't happen for PG 7.2. --- src/interfaces/libpq/fe-misc.c | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 0372da3a8b..7e166f4a38 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -25,7 +25,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.64 2001/11/28 19:40:29 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.65 2001/12/03 00:28:24 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -856,18 +856,17 @@ libpq_gettext(const char *msgid) /* * strerror replacement for windows: * - * We don't know a fix for win9x yet, but this should work for nt4 and win2k. - * If you can verify this working on win9x or have a solution, let us know, ok? + * This works on WIN2000 and newer, but we don't know where to find WinSock + * error strings on older Windows flavors. If you know, clue us in. */ const char * winsock_strerror(int eno) { static char err_buf[512]; -#define WSSE_MAXLEN (sizeof(err_buf)-1-13) /* 13 == " (0x00000000)" */ - HINSTANCE netmsgModule; +#define WSSE_MAXLEN (sizeof(err_buf)-1-13) /* 13 for " (0x00000000)" */ int length; - /* First try the "system table", this works on Win2k pro */ + /* First try the "system table", this works on Win2k and up */ if (FormatMessage( FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, @@ -879,28 +878,7 @@ winsock_strerror(int eno) NULL)) goto WSSE_GOODEXIT; - /* That didn't work, let's try the netmsg.dll */ - - netmsgModule = LoadLibraryEx("netmsg.dll", - NULL, - LOAD_LIBRARY_AS_DATAFILE); - - if (netmsgModule != NULL) - { - if (FormatMessage( - FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_HMODULE, - netmsgModule, - eno, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - err_buf, - WSSE_MAXLEN, - NULL)) - { - FreeLibrary(netmsgModule); - goto WSSE_GOODEXIT; - } - FreeLibrary(netmsgModule); - } + /* Insert other possible lookup methods here ... */ /* Everything failed, just tell the user that we don't know the desc */ -- 2.11.0