- Timestamp:
- Mar 17, 2000, 5:07:53 PM (25 years ago)
- Location:
- trunk/src/wsock32
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wsock32/makefile
r3031 r3139 1 # $Id: makefile,v 1.2 0 2000-03-06 23:39:20 birdExp $1 # $Id: makefile,v 1.21 2000-03-17 16:06:42 sandervl Exp $ 2 2 3 3 # … … 28 28 $(OBJDIR)\relaywin.obj \ 29 29 $(OBJDIR)\wsock32rsrc.obj \ 30 $(PDWIN32_LIB)/dllentry.obj 30 $(OBJDIR)\initterm.obj \ 31 #$(OBJDIR)\async.obj \ 32 #$(OBJDIR)\asyncthread.obj \ 33 $(OBJDIR)\dbglocal.obj 31 34 32 35 -
trunk/src/wsock32/relaywin.cpp
r3107 r3139 42 42 #include <win32api.h> 43 43 #include "wsock32.h" 44 #include <vmutex.h> 45 46 #define DBG_LOCALLOG DBG_relaywin 47 #include "dbglocal.h" 44 48 45 49 ODINDEBUGCHANNEL(WSOCK32-RELAYWIN) … … 56 60 static char* ODIN_WSOCK_RELAY_CLASS = "ODIN_WSOCK_RELAY"; 57 61 static HWND hwndRelay = NULLHANDLE; 58 62 static HAB hab; 63 static VMutex relayMutex; 59 64 60 65 /***************************************************************************** … … 80 85 ULONG ulCounter; 81 86 82 for (ulCounter = 0; 83 ulCounter < MAX_ASYNC_SOCKETS; 84 ulCounter++) 85 if ( (arrHwndMsgPair[ulCounter].hwnd == 0) || // slot free? 86 ( (fSingleRequestPerWindow == TRUE) && // more than one request 87 // per window ? 87 relayMutex.enter(); 88 for(ulCounter = 0; ulCounter < MAX_ASYNC_SOCKETS; ulCounter++) 89 { 90 if ( (arrHwndMsgPair[ulCounter].hwnd == 0) || // slot free? 91 ( (fSingleRequestPerWindow == TRUE) && // more than one request per window? 88 92 (arrHwndMsgPair[ulCounter].hwnd == hwnd) ) ) // same window? 89 { 90 // occupy slot 91 arrHwndMsgPair[ulCounter].hwnd = hwnd; 92 arrHwndMsgPair[ulCounter].ulMsg = ulMsg; 93 arrHwndMsgPair[ulCounter].ulRequestType = ulRequestType; 94 arrHwndMsgPair[ulCounter].pvUserData1 = pvUserData1; 95 arrHwndMsgPair[ulCounter].pvUserData2 = pvUserData2; 96 arrHwndMsgPair[ulCounter].pvUserData3 = pvUserData3; 97 return ulCounter + 1; // return "id" 98 } 99 93 { 94 // occupy slot 95 arrHwndMsgPair[ulCounter].hwnd = hwnd; 96 arrHwndMsgPair[ulCounter].ulMsg = ulMsg; 97 arrHwndMsgPair[ulCounter].ulRequestType = ulRequestType; 98 arrHwndMsgPair[ulCounter].pvUserData1 = pvUserData1; 99 arrHwndMsgPair[ulCounter].pvUserData2 = pvUserData2; 100 arrHwndMsgPair[ulCounter].pvUserData3 = pvUserData3; 101 relayMutex.leave(); 102 return ulCounter + 1; // return "id" 103 } 104 } 105 relayMutex.leave(); 100 106 return -1; // not found 101 107 } … … 120 126 return -1; // error 121 127 128 relayMutex.enter(); 122 129 arrHwndMsgPair[ulID-1].hwnd = 0; // mark free 123 130 arrHwndMsgPair[ulID-1].ulMsg = 0; … … 126 133 arrHwndMsgPair[ulID-1].pvUserData2 = 0; 127 134 arrHwndMsgPair[ulID-1].pvUserData3 = 0; 135 relayMutex.leave(); 128 136 129 137 return 0; // OK … … 147 155 ULONG ulCounter; 148 156 149 for (ulCounter = 0; 150 ulCounter < MAX_ASYNC_SOCKETS; 151 ulCounter++) 152 if ( arrHwndMsgPair[ulCounter].hwnd == hwnd ) // same window? 153 { 154 arrHwndMsgPair[ulCounter].hwnd = 0; // free slot 155 return 0; // OK 156 } 157 157 relayMutex.enter(); 158 for(ulCounter = 0; ulCounter < MAX_ASYNC_SOCKETS; ulCounter++) 159 { 160 if ( arrHwndMsgPair[ulCounter].hwnd == hwnd ) // same window? 161 { 162 arrHwndMsgPair[ulCounter].hwnd = 0; // free slot 163 arrHwndMsgPair[ulCounter].ulMsg = 0; 164 arrHwndMsgPair[ulCounter].ulRequestType = 0; 165 arrHwndMsgPair[ulCounter].pvUserData1 = 0; 166 arrHwndMsgPair[ulCounter].pvUserData2 = 0; 167 arrHwndMsgPair[ulCounter].pvUserData3 = 0; 168 relayMutex.leave(); 169 return 0; // OK 170 } 171 } 172 relayMutex.leave(); 173 dprintf(("RelayFreeByHwnd: window %x not found!", hwnd)); 158 174 return -1; // not found 159 175 } … … 216 232 rc = SHORT1FROMMP(mp2); /* asynchronous operation result */ 217 233 218 dprintf(("WSOCK32: RelayWindowProc, message %x for window %x with "219 "mp1 = %d and mp2 = %d (rc = %d) received\n",220 ulMsg, hwnd, mp1, mp2, rc));234 // dprintf(("WSOCK32: RelayWindowProc, message %x for window %x with " 235 // "mp1 = %d and mp2 = %d (rc = %d) (time = %x) received\n", 236 // ulMsg, hwnd, mp1, mp2, rc, WinQueryMsgTime(hab))); 221 237 222 238 /* check request type for special handling */ … … 228 244 case ASYNCREQUEST_SELECT: 229 245 { 230 dprintf(("WSOCK32:RelayWindowProc, AsyncSelect notification \n"));246 dprintf(("WSOCK32:RelayWindowProc, AsyncSelect notification %x %x (%d,%d) time %x\n", pHM->hwnd, pHM->ulMsg, mp1, mp2, WinQueryMsgTime(hab))); 231 247 break; 232 248 } … … 390 406 391 407 392 dprintf(("WSOCK32:RelayWinProc, Posting hwnd=%08xh, msg=%08xh, w=%08xh, l=%08xh\n",393 pHM->hwnd,394 pHM->ulMsg,395 mp1,396 mp2));408 // dprintf(("WSOCK32:RelayWinProc, Posting hwnd=%08xh, msg=%08xh, w=%08xh, l=%08xh\n", 409 // pHM->hwnd, 410 // pHM->ulMsg, 411 // mp1, 412 // mp2)); 397 413 398 414 PostMessageA(pHM->hwnd, … … 439 455 { 440 456 BOOL fSuccess; 441 HAB hab;442 457 HWND hwnd; 443 458 -
trunk/src/wsock32/wsock32.cpp
r3107 r3139 1 /* $Id: wsock32.cpp,v 1. 19 2000-03-14 14:59:43sandervl Exp $ */1 /* $Id: wsock32.cpp,v 1.20 2000-03-17 16:06:42 sandervl Exp $ */ 2 2 3 3 /* … … 51 51 #include "wsock32.h" 52 52 #include "relaywin.h" 53 #define DBG_LOCALLOG DBG_wsock32 54 #include "dbglocal.h" 53 55 54 56 … … 67 69 static HWND hwndRelay = NULL; // handle to our relay window 68 70 71 BOOL fWSAInitialized = FALSE; 69 72 70 73 /***************************************************************************** … … 1070 1073 LPWSADATA,lpWSAData) 1071 1074 { 1075 fWSAInitialized = TRUE; 1072 1076 return(WSAStartup(wVersionRequired, 1073 1077 lpWSAData)); … … 1089 1093 ODINFUNCTION0(int,OS2WSACleanup) 1090 1094 { 1095 fWSAInitialized = FALSE; 1091 1096 return(WSACleanup()); 1092 1097 } … … 1538 1543 wMsg, 1539 1544 ASYNCREQUEST_SELECT, 1540 TRUE); 1545 FALSE); //SvL: allow multiple selects -> pmwsock should fail if it not allowed 1546 // TRUE); 1541 1547 1542 1548 rc = WSAAsyncSelect(s, … … 1545 1551 lEvent); 1546 1552 1547 // iError = WSAGetLastError(); 1548 // dprintf(("res=%d, err=%d\n", 1549 // rc, 1550 // iError)); 1553 // if an error occurs, free the allocated relay entry 1554 if (rc == SOCKET_ERROR) 1555 RelayFree(ulNewID); 1556 1551 1557 return (rc); 1552 1558 } -
trunk/src/wsock32/wsock32.h
r2013 r3139 1 /* $Id: wsock32.h,v 1. 9 1999-12-07 20:25:48 achimhaExp $ */1 /* $Id: wsock32.h,v 1.10 2000-03-17 16:06:42 sandervl Exp $ */ 2 2 3 3 /* WSOCK32.H--definitions & conversions for Odin's wsock32.dll. … … 85 85 86 86 87 extern BOOL fWSAInitialized; 88 89 void WIN32API OS2WSASetLastError(int iError); 90 91 int WIN32API OS2WSAGetLastError(void); 92 93 BOOL WIN32API OS2WSAIsBlocking(void); 94 87 95 #endif /* _WINSOCK32CONST_ */ 88 96
Note:
See TracChangeset
for help on using the changeset viewer.