Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ae8a9b8

Browse files
committed
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.
1 parent acf7aa6 commit ae8a9b8

File tree

1 file changed

+6
-28
lines changed

1 file changed

+6
-28
lines changed

src/interfaces/libpq/fe-misc.c

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
*
2727
* IDENTIFICATION
28-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.64 2001/11/28 19:40:29 tgl Exp $
28+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.65 2001/12/03 00:28:24 tgl Exp $
2929
*
3030
*-------------------------------------------------------------------------
3131
*/
@@ -856,18 +856,17 @@ libpq_gettext(const char *msgid)
856856
/*
857857
* strerror replacement for windows:
858858
*
859-
* We don't know a fix for win9x yet, but this should work for nt4 and win2k.
860-
* If you can verify this working on win9x or have a solution, let us know, ok?
859+
* This works on WIN2000 and newer, but we don't know where to find WinSock
860+
* error strings on older Windows flavors. If you know, clue us in.
861861
*/
862862
const char *
863863
winsock_strerror(int eno)
864864
{
865865
static char err_buf[512];
866-
#define WSSE_MAXLEN (sizeof(err_buf)-1-13) /* 13 == " (0x00000000)" */
867-
HINSTANCE netmsgModule;
866+
#define WSSE_MAXLEN (sizeof(err_buf)-1-13) /* 13 for " (0x00000000)" */
868867
int length;
869868

870-
/* First try the "system table", this works on Win2k pro */
869+
/* First try the "system table", this works on Win2k and up */
871870

872871
if (FormatMessage(
873872
FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,
@@ -879,28 +878,7 @@ winsock_strerror(int eno)
879878
NULL))
880879
goto WSSE_GOODEXIT;
881880

882-
/* That didn't work, let's try the netmsg.dll */
883-
884-
netmsgModule = LoadLibraryEx("netmsg.dll",
885-
NULL,
886-
LOAD_LIBRARY_AS_DATAFILE);
887-
888-
if (netmsgModule != NULL)
889-
{
890-
if (FormatMessage(
891-
FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_HMODULE,
892-
netmsgModule,
893-
eno,
894-
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
895-
err_buf,
896-
WSSE_MAXLEN,
897-
NULL))
898-
{
899-
FreeLibrary(netmsgModule);
900-
goto WSSE_GOODEXIT;
901-
}
902-
FreeLibrary(netmsgModule);
903-
}
881+
/* Insert other possible lookup methods here ... */
904882

905883
/* Everything failed, just tell the user that we don't know the desc */
906884

0 commit comments

Comments
 (0)