- Timestamp:
- Dec 1, 1999, 2:13:57 AM (26 years ago)
- Location:
- trunk/src/wsock32/new
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wsock32/new/makefile
r1882 r1908 1 # $Id: makefile,v 1. 4 1999-11-29 22:31:50phaller Exp $1 # $Id: makefile,v 1.5 1999-12-01 01:10:54 phaller Exp $ 2 2 3 3 # … … 21 21 TARGET = wsock32 22 22 23 OBJS = wsock32.obj initterm.obj unknown.obj 23 OBJS = wsock32.obj initterm.obj unknown.obj relaywin.obj 24 24 25 25 all: $(TARGET).dll $(TARGET).lib … … 43 43 unknown.obj: unknown.cpp 44 44 initterm.obj: initterm.cpp 45 relaywin.obj: relaywin.cpp 45 46 46 47 -
trunk/src/wsock32/new/wsock32.cpp
r1881 r1908 1 /* $Id: wsock32.cpp,v 1. 5 1999-11-29 22:23:07phaller Exp $ */1 /* $Id: wsock32.cpp,v 1.6 1999-12-01 01:10:55 phaller Exp $ */ 2 2 3 3 /* … … 46 46 47 47 #include "wsock32.h" 48 #include "relaywin.h" 48 49 49 50 … … 590 591 int *,fromlen) 591 592 { 592 593 593 594 return(recvfrom(s, 594 595 buf, … … 795 796 xx = gethostbyaddr((char *)addr,len,type); 796 797 //PH: we assume PMWSOCK sets WSASetLastError correctly! 797 798 798 799 if(xx == NULL) 799 800 return (WHOSTENT *)NULL; … … 834 835 xx = gethostbyname((char *)name); 835 836 //PH: we assume PMWSOCK sets WSASetLastError correctly! 836 837 837 838 if(xx == NULL) 838 839 return (WHOSTENT *)NULL; … … 1341 1342 long,lEvent) 1342 1343 { 1343 int rc; 1344 int iError; 1345 HWND hwndOS2; 1346 1344 int rc; 1345 int iError; 1346 HWND hwndOS2 = Win32ToOS2Handle(hWnd); 1347 ULONG ulNewID; 1348 1349 static HWND hwndRelay; // handle to our relay window 1350 1351 if (hwndRelay == NULL) // already initialized ? 1352 hwndRelay = RelayInitialize(hwndOS2); 1353 1347 1354 /* @@@PH: our source window doesn't seem to have an anchor block. 1348 1355 Docs suggest we've missed to call WinInitialize on the 1349 1356 caller thread. 1350 1357 1351 1358 Cause however is the Open32 handle is (of course!) invalid 1352 1359 in plain PM Window Manager! -> use DAPWSOCK 1353 1360 1354 1361 Unfortunately, DAPWSOCK calls WinQueryAnchorBlock(hOpen32), too. 1355 1362 So, we're stuck until I resolve hWnd to it's valid PM 1356 1363 counterpart. 1364 1365 new problem: we've ultimately got to use PostMessageA instead 1366 anything else. => create invisible msg relay window: 1367 - hMsg = registerMessage(hWnd, wMsg) 1368 - call WSAAsyncSelect with object window handle 1369 - overwrite hWnd relay for "same handles" 1357 1370 */ 1358 1359 hwndOS2 = Win32ToOS2Handle(hWnd); 1360 1371 1372 // add event to list or remove any list entry in case of WSAAsyncSelect(hwnd,0,0) 1373 if ( (wMsg == 0) && (lEvent == 0) ) 1374 { 1375 // remove entry from list 1376 RelayFreeByHwnd(hWnd); 1377 } 1378 else 1379 // add entry to list 1380 ulNewID = RelayAlloc(hWnd, wMsg); 1381 1361 1382 rc = WSAAsyncSelect(s, 1362 hwnd OS2,1363 wMsg,1383 hwndRelay, 1384 ulNewID, 1364 1385 lEvent); 1365 1386
Note:
See TracChangeset
for help on using the changeset viewer.