Changeset 21880 for branches/gcc-kmk/src
- Timestamp:
- Dec 13, 2011, 12:08:07 PM (14 years ago)
- Location:
- branches/gcc-kmk/src
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gcc-kmk/src/Makefile.kmk
r21878 r21880 44 44 include $(PATH_SUB_CURRENT)/ctl3d32/Makefile.kmk 45 45 include $(PATH_SUB_CURRENT)/dciman32/Makefile.kmk 46 include $(PATH_SUB_CURRENT)/ws2_32/Makefile.kmk 46 47 47 48 include $(FILE_KBUILD_SUB_FOOTER) -
branches/gcc-kmk/src/ws2_32/dbglocal.cpp
r5664 r21880 17 17 18 18 USHORT DbgEnabled[DBG_MAXFILES]; 19 c har*DbgFileNames[DBG_MAXFILES] =19 const char *DbgFileNames[DBG_MAXFILES] = 20 20 { 21 21 "initterm", -
branches/gcc-kmk/src/ws2_32/initterm.cpp
r21727 r21880 1 1 /* $Id: initterm.cpp,v 1.3 2001-10-13 18:50:52 sandervl Exp $ 2 2 * 3 * DLL entry point3 * WS2_32 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 _Resource_PEResTab; 45 } 27 // Win32 resource table (produced by wrc) 28 extern DWORD ws2_32_PEResTab; 29 46 30 static HMODULE dllHandle = 0; 47 31 48 //******************************************************************************49 //******************************************************************************50 32 BOOL WINAPI OdinLibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad) 51 33 { 52 switch (fdwReason)53 {54 case DLL_PROCESS_ATTACH:55 return TRUE;34 switch (fdwReason) 35 { 36 case DLL_PROCESS_ATTACH: 37 return TRUE; 56 38 57 case DLL_THREAD_ATTACH:58 case DLL_THREAD_DETACH:59 return TRUE;39 case DLL_THREAD_ATTACH: 40 case DLL_THREAD_DETACH: 41 return TRUE; 60 42 61 case DLL_PROCESS_DETACH: 62 ctordtorTerm(); 63 return TRUE; 64 } 65 return FALSE; 43 case DLL_PROCESS_DETACH: 44 #ifdef __IBMC__ 45 ctordtorTerm(); 46 #endif 47 return TRUE; 48 } 49 return FALSE; 66 50 } 67 /****************************************************************************/ 68 /* _DLL_InitTerm is the function that gets called by the operating system */ 69 /* loader when it loads and frees this DLL for each process that accesses */ 70 /* this DLL. However, it only gets called the first time the DLL is loaded */ 71 /* and the last time it is freed for a particular process. The system */ 72 /* linkage convention MUST be used because the operating system loader is */ 73 /* calling this function. */ 74 /****************************************************************************/ 75 ULONG SYSTEM _DLL_InitTerm(ULONG hModule, ULONG ulFlag) 51 52 ULONG SYSTEM DLL_InitWS2_32(ULONG hModule) 76 53 { 77 size_t i; 78 APIRET rc; 54 ParseLogStatus(); 79 55 80 /*-------------------------------------------------------------------------*/ 81 /* If ulFlag is zero then the DLL is being loaded so initialization should */ 82 /* be performed. If ulFlag is 1 then the DLL is being freed so */ 83 /* termination should be performed. */ 84 /*-------------------------------------------------------------------------*/ 56 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 85 57 86 switch (ulFlag) {87 case 0 :88 ctordtorInit();58 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&ws2_32_PEResTab); 59 if(dllHandle == 0) 60 return -1; 89 61 90 ParseLogStatus(); 62 return 0; 63 } 91 64 92 CheckVersionFromHMOD(PE2LX_VERSION, hModule); /*PLF Wed 98-03-18 05:28:48*/ 65 void SYSTEM DLL_TermWS2_32(ULONG hModule) 66 { 67 if (dllHandle) 68 UnregisterLxDll(dllHandle); 69 } 93 70 94 dllHandle = RegisterLxDll(hModule, OdinLibMain, (PVOID)&_Resource_PEResTab); 95 if(dllHandle == 0) 96 return 0UL; 71 ULONG SYSTEM DLL_Init(ULONG hModule) 72 { 73 if (DLL_InitDefault(hModule) == -1) 74 return -1; 75 return DLL_InitWS2_32(hModule); 76 } 97 77 98 break; 99 case 1 : 100 if(dllHandle) { 101 UnregisterLxDll(dllHandle); 102 } 103 break; 104 default : 105 return 0UL; 106 } 107 108 /***********************************************************/ 109 /* A non-zero value must be returned to indicate success. */ 110 /***********************************************************/ 111 return 1UL; 78 void SYSTEM DLL_Term(ULONG hModule) 79 { 80 DLL_TermWS2_32(hModule); 81 DLL_TermDefault(hModule); 112 82 } 113 //******************************************************************************114 //****************************************************************************** -
branches/gcc-kmk/src/ws2_32/protocol.cpp
r8055 r21880 28 28 #include <wchar.h> 29 29 30 #ifdef __EMX__ 31 // EMX currently lacks POSIX swprintf, use snwprinf from NTDLL 32 #include <minivcrt.h> 33 #endif 34 30 35 //#include "nspapi.h" 31 36 … … 291 296 // recalculate LANA -> iProtocol 292 297 lpBuffer->iProtocol = pBinding->pLANA->encLANA; 293 298 299 #ifdef __EMX__ 300 snwprintf(szBuf, 301 256, // sizeof szBuf 302 pBinding->pProtocol->szProtocol, 303 pBinding->pLANA->lpszGUID, 304 pBinding->pLANA->LANA); 305 #else 294 306 swprintf((wchar_t*)szBuf, 295 307 256, // sizeof szBuf … … 297 309 pBinding->pLANA->lpszGUID, 298 310 pBinding->pLANA->LANA); 299 311 #endif 312 300 313 lpProtName = szBuf; 301 314 } -
branches/gcc-kmk/src/ws2_32/ws2_32.def
r21552 r21880 18 18 19 19 EXPORTS 20 accept = _accept@12@121 bind = _bind@12@222 closesocket = _closesocket@4@323 connect = _connect@12@424 getpeername = _getpeername@12@525 getsockname = _getsockname@12@626 getsockopt = _WS2getsockopt@20@727 htonl = _htonl@4@828 htons = _htons@4@929 ioctlsocket = _ioctlsocket@12@1030 inet_addr = _inet_addr@4@1131 inet_ntoa = _inet_ntoa@4@1232 listen = _listen@8@1333 ntohl = _ntohl@4@1434 ntohs = _ntohs@4@1535 recv = _recv@16@1636 recvfrom = _recvfrom@24@1737 select = _select@20@1838 send = _send@16@1939 sendto = _sendto@24@2040 setsockopt = _WS2setsockopt@20@2141 shutdown = _shutdown@8@2242 socket = _socket@12@2320 accept = "_accept@12" @1 21 bind = "_bind@12" @2 22 closesocket = "_closesocket@4" @3 23 connect = "_connect@12" @4 24 getpeername = "_getpeername@12" @5 25 getsockname = "_getsockname@12" @6 26 getsockopt = "_WS2getsockopt@20" @7 27 htonl = "_htonl@4" @8 28 htons = "_htons@4" @9 29 ioctlsocket = "_ioctlsocket@12" @10 30 inet_addr = "_inet_addr@4" @11 31 inet_ntoa = "_inet_ntoa@4" @12 32 listen = "_listen@8" @13 33 ntohl = "_ntohl@4" @14 34 ntohs = "_ntohs@4" @15 35 recv = "_recv@16" @16 36 recvfrom = "_recvfrom@24" @17 37 select = "_select@20" @18 38 send = "_send@16" @19 39 sendto = "_sendto@24" @20 40 setsockopt = "_WS2setsockopt@20" @21 41 shutdown = "_shutdown@8" @22 42 socket = "_socket@12" @23 43 43 44 44 ; WSApSetPostRoutine @24 45 45 ; WPUCompleteOverlappedRequest @25 46 WSAAccept = _WSAAccept@20@2647 WSAAddressToStringA = _WSAAddressToStringA@20@2746 WSAAccept = "_WSAAccept@20" @26 47 WSAAddressToStringA = "_WSAAddressToStringA@20" @27 48 48 ; WSAAddressToStringW @28 49 49 50 WSACloseEvent = _WSACloseEvent@4@2950 WSACloseEvent = "_WSACloseEvent@4" @29 51 51 ; WSAConnect @30 52 WSACreateEvent = _WSACreateEvent@0@3152 WSACreateEvent = "_WSACreateEvent@0" @31 53 53 ; WSADuplicateSocketA @32 54 54 ; WSADuplicateSocketW @33 55 55 ; WSAEnumNameSpaceProvidersA @34 56 56 ; WSAEnumNameSpaceProvidersW @35 57 WSAEnumNetworkEvents = _WSAEnumNetworkEvents@12@3658 WSAEnumProtocolsA = _WSAEnumProtocolsA@12@3759 WSAEnumProtocolsW = _WSAEnumProtocolsW@12@3860 WSAEventSelect = _WSAEventSelect@12@3957 WSAEnumNetworkEvents = "_WSAEnumNetworkEvents@12" @36 58 WSAEnumProtocolsA = "_WSAEnumProtocolsA@12" @37 59 WSAEnumProtocolsW = "_WSAEnumProtocolsW@12" @38 60 WSAEventSelect = "_WSAEventSelect@12" @39 61 61 62 62 ; WSAGetOverlappedResult @40 … … 70 70 ; WSAInstallServiceClassA @48 71 71 ; WSAInstallServiceClassW @49 72 WSAIoctl = _WSAIoctl@36@5072 WSAIoctl = "_WSAIoctl@36" @50 73 73 74 gethostbyaddr = _gethostbyaddr@12@5175 gethostbyname = _gethostbyname@4@5276 gethostname = _gethostname@8@5777 getprotobyname = _getprotobyname@4@5378 getprotobynumber = _getprotobynumber@4@5479 getservbyname = _getservbyname@8@5580 getservbyport = _getservbyport@8@5674 gethostbyaddr = "_gethostbyaddr@12" @51 75 gethostbyname = "_gethostbyname@4" @52 76 gethostname = "_gethostname@8" @57 77 getprotobyname = "_getprotobyname@4" @53 78 getprotobynumber = "_getprotobynumber@4" @54 79 getservbyname = "_getservbyname@8" @55 80 getservbyport = "_getservbyport@8" @56 81 81 82 82 ; WSAJoinLeaf @58 83 WSALookupServiceBeginA = _WSALookupServiceBeginA@12@5984 WSALookupServiceBeginW = _WSALookupServiceBeginW@12@6083 WSALookupServiceBeginA = "_WSALookupServiceBeginA@12" @59 84 WSALookupServiceBeginW = "_WSALookupServiceBeginW@12" @60 85 85 ; WSALookupServiceEnd @61 86 86 ; WSALookupServiceNextA @62 … … 89 89 ; WSANtohs @65 90 90 ; WSAProviderConfigChange @66 91 WSARecv = _WSARecv@28@6791 WSARecv = "_WSARecv@28" @67 92 92 ; WSARecvDisconnect @68 93 WSARecvFrom = _WSARecvFrom@36@6993 WSARecvFrom = "_WSARecvFrom@36" @69 94 94 ; WSARemoveServiceClass @70 95 WSAResetEvent = _ResetEvent@4@7196 WSASend = _WSASend@28@7297 WSASendDisconnect = _WSASendDisconnect@8@7398 WSASendTo = _WSASendTo@36@7499 WSASetEvent = _WSASetEvent@4@7595 WSAResetEvent = "_ResetEvent@4" @71 96 WSASend = "_WSASend@28" @72 97 WSASendDisconnect = "_WSASendDisconnect@8" @73 98 WSASendTo = "_WSASendTo@36" @74 99 WSASetEvent = "_WSASetEvent@4" @75 100 100 ; WSASetServiceA @76 101 101 ; WSASetServiceW @77 102 WSASocketA = _WSASocketA@24@78103 WSASocketW = _WSASocketW@24@79102 WSASocketA = "_WSASocketA@24" @78 103 WSASocketW = "_WSASocketW@24" @79 104 104 ; WSAStringToAddressA @80 105 105 ; WSAStringToAddressW @81 106 WSAWaitForMultipleEvents = _WaitForMultipleObjectsEx@20@82106 WSAWaitForMultipleEvents = "_WaitForMultipleObjectsEx@20" @82 107 107 ; WSCDeinstallProvider @83 108 108 ; WSCEnableNSProvider @84 … … 115 115 ; WSCWriteProviderOrder @91 116 116 117 WSAAsyncSelect = _WSAAsyncSelect@16@101118 WSAAsyncGetHostByAddr = _WSAAsyncGetHostByAddr@28@102119 WSAAsyncGetHostByName = _WSAAsyncGetHostByName@20@103120 WSAAsyncGetProtoByNumber = _WSAAsyncGetProtoByNumber@20@104121 WSAAsyncGetProtoByName = _WSAAsyncGetProtoByName@20@105122 WSAAsyncGetServByPort = _WSAAsyncGetServByPort@24@106123 WSAAsyncGetServByName = _WSAAsyncGetServByName@24@107124 WSACancelAsyncRequest = _WSACancelAsyncRequest@4@108125 WSASetBlockingHook = _WSASetBlockingHook@4@109126 WSAUnhookBlockingHook = _WSAUnhookBlockingHook@0@110127 WSAGetLastError = _WSAGetLastError@0@111128 WSASetLastError = _WSASetLastError@4@112129 WSACancelBlockingCall = _WSACancelBlockingCall@0@113130 WSAIsBlocking = _WSAIsBlocking@0@114131 WSAStartup = _WSAStartup@8@115132 WSACleanup = _WSACleanup@0@116133 __WSAFDIsSet = ___WSAFDIsSet@8@151117 WSAAsyncSelect = "_WSAAsyncSelect@16" @101 118 WSAAsyncGetHostByAddr = "_WSAAsyncGetHostByAddr@28" @102 119 WSAAsyncGetHostByName = "_WSAAsyncGetHostByName@20" @103 120 WSAAsyncGetProtoByNumber = "_WSAAsyncGetProtoByNumber@20" @104 121 WSAAsyncGetProtoByName = "_WSAAsyncGetProtoByName@20" @105 122 WSAAsyncGetServByPort = "_WSAAsyncGetServByPort@24" @106 123 WSAAsyncGetServByName = "_WSAAsyncGetServByName@24" @107 124 WSACancelAsyncRequest = "_WSACancelAsyncRequest@4" @108 125 WSASetBlockingHook = "_WSASetBlockingHook@4" @109 126 WSAUnhookBlockingHook = "_WSAUnhookBlockingHook@0" @110 127 WSAGetLastError = "_WSAGetLastError@0" @111 128 WSASetLastError = "_WSASetLastError@4" @112 129 WSACancelBlockingCall = "_WSACancelBlockingCall@0" @113 130 WSAIsBlocking = "_WSAIsBlocking@0" @114 131 WSAStartup = "_WSAStartup@8" @115 132 WSACleanup = "_WSACleanup@0" @116 133 __WSAFDIsSet = "___WSAFDIsSet@8" @151 134 134 135 135 ; WEP @500
Note:
See TracChangeset
for help on using the changeset viewer.