Changeset 21865 for branches/gcc-kmk/src
- Timestamp:
- Dec 8, 2011, 2:32:54 PM (14 years ago)
- Location:
- branches/gcc-kmk/src
- Files:
-
- 2 added
- 10 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/gcc-kmk/src/Makefile.kmk
r21860 r21865 32 32 include $(PATH_SUB_CURRENT)/shlwapi/Makefile.kmk 33 33 include $(PATH_SUB_CURRENT)/shell32/Makefile.kmk 34 include $(PATH_SUB_CURRENT)/wsock32/Makefile.kmk 35 include $(PATH_SUB_CURRENT)/iphlpapi/Makefile.kmk 34 36 35 37 include $(FILE_KBUILD_SUB_FOOTER) -
branches/gcc-kmk/src/iphlpapi/iphlpapi.cpp
r21563 r21865 60 60 61 61 //We don't want to use the OS2 version directly, but the one in wsock32 62 int WIN32API O DIN_gethostname (char * name, int namelen);62 int WIN32API OS2gethostname (char * name, int namelen); 63 63 64 64 ODINDEBUGCHANNEL(IPHLPAPI-IPHLPAPI) … … 274 274 // fill pipAdapter->IpAddressList 275 275 int cIfAddresses = 0; 276 for (int j = 0; j < cAddresses; ++j) 276 int j; 277 for (j = 0; j < cAddresses; ++j) 277 278 { 278 279 #ifdef DEBUG … … 580 581 memset(pFixedInfo,0,memNeeded); 581 582 582 O DIN_gethostname(fi->HostName,128);583 OS2gethostname(fi->HostName,128); 583 584 strcpy(fi->DomainName,_res.defdname); 584 585 -
branches/gcc-kmk/src/iphlpapi/iphlpapi.def
r10066 r21865 6 6 7 7 EXPORTS 8 GetAdaptersInfo = _GetAdaptersInfo@8@179 GetNetworkParams = _GetNetworkParams@8@388 GetAdaptersInfo = "_GetAdaptersInfo@8" @17 9 GetNetworkParams = "_GetNetworkParams@8" @38 10 10 11 GetIpAddrTable = _GetIpAddrTable@12@4012 GetIfTable = _GetIfTable@12@4113 GetFriendlyIfIndex = _GetFriendlyIfIndex@4@4211 GetIpAddrTable = "_GetIpAddrTable@12" @40 12 GetIfTable = "_GetIfTable@12" @41 13 GetFriendlyIfIndex = "_GetFriendlyIfIndex@4" @42 14 14 15 ;to tell the linker to look elsewhere for this function16 _ODIN_gethostname@8 = _gethostname@8 @5017 -
branches/gcc-kmk/src/iphlpapi/iphlwrap.h
r21720 r21865 8 8 #include <netinet/tcp.h> 9 9 #include <nerrno.h> 10 11 int _System os2_ioctl (int, unsigned long, char *, int);12 10 13 11 inline int _os2_ioctl (int a, unsigned long b, char *c, int d) … … 23 21 24 22 #undef os2_ioctl 25 #define os2_ioctl _os2_ioctl 26 27 inline int _ioctl(int a, int b, char *c, int d) 28 { 29 int yyrc; 30 USHORT sel = RestoreOS2FS(); 31 32 yyrc = ioctl(a, b, c, d); 33 SetFS(sel); 34 35 return yyrc; 36 } 37 38 #undef ioctl 39 #define ioctl _ioctl 23 #define ioctl _os2_ioctl 40 24 41 25 inline int _res_init(void) -
branches/gcc-kmk/src/wsock32/asyncapi.cpp
r21656 r21865 408 408 409 409 #ifdef DEBUG_LOGGING 410 c har *pszEvent = NULL;410 const char *pszEvent = NULL; 411 411 412 412 switch(event) { -
branches/gcc-kmk/src/wsock32/dbglocal.cpp
r6375 r21865 19 19 USHORT DbgEnabledLvl2WSOCK32[DBG_MAXFILES] = {0}; 20 20 21 static c har*DbgFileNames[DBG_MAXFILES] =21 static const char *DbgFileNames[DBG_MAXFILES] = 22 22 { 23 23 "initterm", -
branches/gcc-kmk/src/wsock32/initterm.cpp
r21842 r21865 1 /* $Id: init wsock32.cpp,v 1.4 2001-10-13 18:51:08 sandervlExp $1 /* $Id: initterm.cpp,v 1.17 2001-09-05 10:26:30 bird Exp $ 2 2 * 3 * DLL entry point3 * WSOCK32 DLL entry point 4 4 * 5 5 * Copyright 1998 Sander van Leeuwen 6 6 * Copyright 1998 Peter Fitzsimmons 7 7 * 8 *9 8 * Project Odin Software License can be found in LICENSE.TXT 10 *11 9 */ 12 10 13 /*-------------------------------------------------------------*/14 /* INITERM.C -- Source for a custom dynamic link library */15 /* initialization and termination (_DLL_InitTerm) */16 /* function. */17 /* */18 /* When called to perform initialization, this sample function */19 /* gets storage for an array of integers, and initializes its */20 /* elements with random integers. At termination time, it */21 /* frees the array. Substitute your own special processing. */22 /*-------------------------------------------------------------*/23 24 25 /* Include files */26 11 #define INCL_DOSMODULEMGR 27 12 #define INCL_DOSPROCESS … … 40 25 #include "dbglocal.h" 41 26 42 extern "C" { 43 //Win32 resource table (produced by wrc) 44 extern DWORD wsock32_PEResTab; 45 } 27 // Win32 resource table (produced by wrc) 28 extern DWORD wsock32_PEResTab; 29 46 30 static HMODULE dllHandle = 0; 47 31 48 32 INT WIN32API WSACleanup(); 49 //****************************************************************************** 50 //****************************************************************************** 33 51 34 BOOL WINAPI WinsockLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) 52 35 { 53 switch (fdwReason)54 {55 case DLL_PROCESS_ATTACH:56 return TRUE;36 switch (fdwReason) 37 { 38 case DLL_PROCESS_ATTACH: 39 return TRUE; 57 40 58 case DLL_THREAD_ATTACH:59 case DLL_THREAD_DETACH:60 return TRUE;41 case DLL_THREAD_ATTACH: 42 case DLL_THREAD_DETACH: 43 return TRUE; 61 44 62 case DLL_PROCESS_DETACH:63 WSACleanup();64 return TRUE;65 }66 return FALSE;45 case DLL_PROCESS_DETACH: 46 WSACleanup(); 47 return TRUE; 48 } 49 return FALSE; 67 50 } 68 /****************************************************************************/ 69 /* _DLL_InitTerm is the function that gets called by the operating system */ 70 /* loader when it loads and frees this DLL for each process that accesses */ 71 /* this DLL. However, it only gets called the first time the DLL is loaded */ 72 /* and the last time it is freed for a particular process. The system */ 73 /* linkage convention MUST be used because the operating system loader is */ 74 /* calling this function. */ 75 /****************************************************************************/ 76 ULONG APIENTRY inittermWsock32(ULONG hModule, ULONG ulFlag) 51 52 ULONG SYSTEM DLL_InitWSock32(ULONG hModule) 77 53 { 78 size_t i; 79 APIRET rc; 54 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 80 55 81 /*-------------------------------------------------------------------------*/ 82 /* If ulFlag is zero then the DLL is being loaded so initialization should */ 83 /* be performed. If ulFlag is 1 then the DLL is being freed so */ 84 /* termination should be performed. */ 85 /*-------------------------------------------------------------------------*/ 56 ParseLogStatusWSOCK32(); 86 57 87 switch (ulFlag) {88 case 0 :89 ParseLogStatusWSOCK32();58 dllHandle = RegisterLxDll(hModule, WinsockLibMain, (PVOID)&wsock32_PEResTab); 59 if (dllHandle == 0) 60 return -1; 90 61 91 dllHandle = RegisterLxDll(hModule, WinsockLibMain, (PVOID)&wsock32_PEResTab); 92 if(dllHandle == 0) 93 return 0UL; 62 return 0; 63 } 94 64 95 break; 96 case 1 : 97 if(dllHandle) { 98 UnregisterLxDll(dllHandle); 99 } 100 break; 101 default : 102 return 0UL; 103 } 65 void SYSTEM DLL_TermWSock32(ULONG hModule) 66 { 67 if (dllHandle) 68 UnregisterLxDll(dllHandle); 69 } 104 70 105 /***********************************************************/ 106 /* A non-zero value must be returned to indicate success. */ 107 /***********************************************************/ 108 return 1UL; 71 ULONG SYSTEM DLL_Init(ULONG hModule) 72 { 73 if (DLL_InitDefault(hModule) == -1) 74 return -1; 75 return DLL_InitWSock32(hModule); 109 76 } 110 //****************************************************************************** 111 //****************************************************************************** 77 78 void SYSTEM DLL_Term(ULONG hModule) 79 { 80 DLL_TermWSock32(hModule); 81 DLL_TermDefault(hModule); 82 } -
branches/gcc-kmk/src/wsock32/socketwrap.h
r21720 r21865 118 118 #define getsockopt _getsockopt 119 119 120 inline int _ ioctl(int a, int b, char *c, int d)121 { 122 int yyrc; 123 USHORT sel = RestoreOS2FS(); 124 125 yyrc = ioctl(a, b, c, d);120 inline int _os2_ioctl(int a, int b, char *c, int d) 121 { 122 int yyrc; 123 USHORT sel = RestoreOS2FS(); 124 125 yyrc = os2_ioctl(a, b, c, d); 126 126 SetFS(sel); 127 127 … … 130 130 131 131 #undef ioctl 132 #define ioctl _ ioctl132 #define ioctl _os2_ioctl 133 133 134 134 inline int _listen(int a, int b) … … 202 202 #define removesocketfromlist _removesocketfromlist 203 203 204 inline int _ select(int *a, int b, int c, int d, long e)205 { 206 int yyrc; 207 USHORT sel = RestoreOS2FS(); 208 209 yyrc = select(a, b, c, d, e);204 inline int _os2_select(int *a, int b, int c, int d, long e) 205 { 206 int yyrc; 207 USHORT sel = RestoreOS2FS(); 208 209 yyrc = os2_select(a, b, c, d, e); 210 210 SetFS(sel); 211 211 … … 214 214 215 215 #undef select 216 #define select _ select216 #define select _os2_select 217 217 218 218 inline int _send(int a, char *b, int c, int d) -
branches/gcc-kmk/src/wsock32/wsock32.cpp
r21456 r21865 1039 1039 //****************************************************************************** 1040 1040 //****************************************************************************** 1041 c har *debugsockopt(int optname)1041 const char *debugsockopt(int optname) 1042 1042 { 1043 1043 switch(optname) { … … 1732 1732 1733 1733 localhost_address = *(unsigned long *)&addr->sin_addr; 1734 localhost.h_name = "localhost"; /* This is what the old workaround did. */1734 localhost.h_name = (char *)"localhost"; /* This is what the old workaround did. */ 1735 1735 localhost.h_addrtype = AF_INET; 1736 1736 localhost.h_length = 4; -
branches/gcc-kmk/src/wsock32/wsock32.def
r21308 r21865 10 10 IMPORTS 11 11 ; this is not in every so32dll.lib 12 winsockcleanupsockets = SO32DLL. WINSOCKCLEANUPSOCKETS12 winsockcleanupsockets = SO32DLL.38 ; WINSOCKCLEANUPSOCKETS 13 13 14 14 … … 19 19 ; ---------------------- 20 20 21 accept = _OS2accept@12@122 bind = _OS2bind@12@223 closesocket = _OS2closesocket@4@324 connect = _OS2connect@12@425 getpeername = _OS2getpeername@12@526 getsockname = _OS2getsockname@12@627 getsockopt = _OS2getsockopt@20@728 htonl = _OS2htonl@4@829 htons = _OS2htons@4@930 inet_addr = _OS2inet_addr@4@1031 inet_ntoa = _OS2inet_ntoa@4@1132 ioctlsocket = _OS2ioctlsocket@12@1233 listen = _OS2listen@8@1334 ntohl = _OS2ntohl@4@1435 ntohs = _OS2ntohs@4@1536 recv = _OS2recv@16@1637 recvfrom = _OS2recvfrom@24@1738 select = _OS2select@20@1839 send = _OS2send@16@1940 sendto = _OS2sendto@24@2041 setsockopt = _OS2setsockopt@20@2142 shutdown = _OS2shutdown@8@2243 socket = _OS2socket@12@2321 accept = "_OS2accept@12" @1 22 bind = "_OS2bind@12" @2 23 closesocket = "_OS2closesocket@4" @3 24 connect = "_OS2connect@12" @4 25 getpeername = "_OS2getpeername@12" @5 26 getsockname = "_OS2getsockname@12" @6 27 getsockopt = "_OS2getsockopt@20" @7 28 htonl = "_OS2htonl@4" @8 29 htons = "_OS2htons@4" @9 30 inet_addr = "_OS2inet_addr@4" @10 31 inet_ntoa = "_OS2inet_ntoa@4" @11 32 ioctlsocket = "_OS2ioctlsocket@12" @12 33 listen = "_OS2listen@8" @13 34 ntohl = "_OS2ntohl@4" @14 35 ntohs = "_OS2ntohs@4" @15 36 recv = "_OS2recv@16" @16 37 recvfrom = "_OS2recvfrom@24" @17 38 select = "_OS2select@20" @18 39 send = "_OS2send@16" @19 40 sendto = "_OS2sendto@24" @20 41 setsockopt = "_OS2setsockopt@20" @21 42 shutdown = "_OS2shutdown@8" @22 43 socket = "_OS2socket@12" @23 44 44 45 gethostbyaddr = _OS2gethostbyaddr@12@5146 gethostbyname = _OS2gethostbyname@4@5247 getprotobyname = _OS2getprotobyname@4@5348 getprotobynumber = _OS2getprotobynumber@4@5449 getservbyname = _OS2getservbyname@8@5550 getservbyport = _OS2getservbyport@8@5651 gethostname = _OS2gethostname@8@5745 gethostbyaddr = "_OS2gethostbyaddr@12" @51 46 gethostbyname = "_OS2gethostbyname@4" @52 47 getprotobyname = "_OS2getprotobyname@4" @53 48 getprotobynumber = "_OS2getprotobynumber@4" @54 49 getservbyname = "_OS2getservbyname@8" @55 50 getservbyport = "_OS2getservbyport@8" @56 51 gethostname = "_OS2gethostname@8" @57 52 52 53 53 ; ---------------------------- … … 55 55 ; ---------------------------- 56 56 57 WSAAsyncSelect = _WSAAsyncSelect@16@10158 WSAAsyncGetHostByAddr = _WSAAsyncGetHostByAddr@28@10259 WSAAsyncGetHostByName = _WSAAsyncGetHostByName@20@10360 WSAAsyncGetProtoByNumber = _WSAAsyncGetProtoByNumber@20@10461 WSAAsyncGetProtoByName = _WSAAsyncGetProtoByName@20@10562 WSAAsyncGetServByPort = _WSAAsyncGetServByPort@24@10663 WSAAsyncGetServByName = _WSAAsyncGetServByName@24@10764 WSACancelAsyncRequest = _WSACancelAsyncRequest@4@10865 WSASetBlockingHook = _WSASetBlockingHook@4@10966 WSAUnhookBlockingHook = _WSAUnhookBlockingHook@0@11067 WSAGetLastError = _WSAGetLastError@0@11168 WSASetLastError = _WSASetLastError@4@11269 WSACancelBlockingCall = _WSACancelBlockingCall@0@11370 WSAIsBlocking = _WSAIsBlocking@0@11471 WSAStartup = _WSAStartup@8@11572 WSACleanup = _WSACleanup@0@11673 __WSAFDIsSet = ___WSAFDIsSet@8@15157 WSAAsyncSelect = "_WSAAsyncSelect@16" @101 58 WSAAsyncGetHostByAddr = "_WSAAsyncGetHostByAddr@28" @102 59 WSAAsyncGetHostByName = "_WSAAsyncGetHostByName@20" @103 60 WSAAsyncGetProtoByNumber = "_WSAAsyncGetProtoByNumber@20" @104 61 WSAAsyncGetProtoByName = "_WSAAsyncGetProtoByName@20" @105 62 WSAAsyncGetServByPort = "_WSAAsyncGetServByPort@24" @106 63 WSAAsyncGetServByName = "_WSAAsyncGetServByName@24" @107 64 WSACancelAsyncRequest = "_WSACancelAsyncRequest@4" @108 65 WSASetBlockingHook = "_WSASetBlockingHook@4" @109 66 WSAUnhookBlockingHook = "_WSAUnhookBlockingHook@0" @110 67 WSAGetLastError = "_WSAGetLastError@0" @111 68 WSASetLastError = "_WSASetLastError@4" @112 69 WSACancelBlockingCall = "_WSACancelBlockingCall@0" @113 70 WSAIsBlocking = "_WSAIsBlocking@0" @114 71 WSAStartup = "_WSAStartup@8" @115 72 WSACleanup = "_WSACleanup@0" @116 73 __WSAFDIsSet = "___WSAFDIsSet@8" @151 74 74 75 rcmd = _OS2rcmd@24@110276 rexec = _OS2rexec@24@110377 WSARecvEx = _WSARecvEx@16@110778 s_perror = _OS2s_perror@8@110875 rcmd = "_OS2rcmd@24" @1102 76 rexec = "_OS2rexec@24" @1103 77 WSARecvEx = "_WSARecvEx@16" @1107 78 s_perror = "_OS2s_perror@8" @1108 79 79 80 80 ; ------------------- … … 116 116 ; ----------------------- 117 117 118 _OS2gethostname@8@2000118 "_OS2gethostname@8" @2000 119 119 120 120 ; functions for ws2_32 implemented here 121 WSAEventSelect = _WSAEventSelect@12@3001122 WSAEnumNetworkEvents = _WSAEnumNetworkEvents@12@3002121 WSAEventSelect = "_WSAEventSelect@12" @3001 122 WSAEnumNetworkEvents = "_WSAEnumNetworkEvents@12" @3002 -
branches/gcc-kmk/src/wsock32/wsock32.h
r21720 r21865 20 20 21 21 #include <odinwrap.h> 22 23 #ifdef __EMX__ 24 // EMX 0.6.4 and before lacks this 25 #ifndef SOCBASEERR 26 #define SOCBASEERR 0 27 #endif 28 #endif 22 29 23 30 #ifndef IP_TTL … … 128 135 typedef u_int SOCKET; 129 136 137 #ifndef FD_SETSIZE 130 138 #define FD_SETSIZE 64 139 #endif 131 140 132 141 #pragma pack(1)
Note:
See TracChangeset
for help on using the changeset viewer.