Changeset 1940 for trunk/src/wsock32/new/relaywin.cpp
- Timestamp:
- Dec 2, 1999, 4:22:05 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wsock32/new/relaywin.cpp
r1933 r1940 1 /* $Id: relaywin.cpp,v 1. 3 1999-12-02 07:47:26 phallerExp $ */1 /* $Id: relaywin.cpp,v 1.4 1999-12-02 15:22:05 achimha Exp $ */ 2 2 3 3 /* … … 38 38 #include "relaywin.h" 39 39 40 #include <pmwsock.h> 41 #include <os2sel.h> 42 #include <wprocess.h> 43 #include <heapstring.h> 44 #include <win32wnd.h> 45 #include "wsock32.h" 46 40 47 ODINDEBUGCHANNEL(WSOCK32-RELAYWIN) 41 48 … … 53 60 54 61 // prototype for PostMessageA 55 //BOOL _Stdcall PostMessageA(HWND,UINT,WPARAM,LPARAM);56 62 BOOL __stdcall PostMessageA(HWND,UINT,ULONG,ULONG); 57 63 … … 69 75 *****************************************************************************/ 70 76 71 ULONG RelayAlloc(HWND hwnd, ULONG ulMsg) 77 ULONG RelayAlloc(HWND hwnd, ULONG ulMsg, ULONG ulRequestType, 78 PVOID pvUserData1, PVOID pvUserData2) 72 79 { 73 80 ULONG ulCounter; … … 82 89 arrHwndMsgPair[ulCounter].hwnd = hwnd; 83 90 arrHwndMsgPair[ulCounter].ulMsg = ulMsg; 91 arrHwndMsgPair[ulCounter].ulRequestType = ulRequestType; 92 arrHwndMsgPair[ulCounter].pvUserData1 = pvUserData1; 93 arrHwndMsgPair[ulCounter].pvUserData2 = pvUserData2; 84 94 return ulCounter; // return "id" 85 95 } … … 190 200 // WinDefWindowProc() 191 201 192 //@@@PH: 1999/11/31 PROBLEM193 // hwnd and ulMsg passed in have been converted by our USER32 code194 // here, we ultimatively need to translate it back.195 // under the debugger, things WORK now !:)196 197 202 pHM = RelayQuery(ulMsg); // find registered message 198 203 if (pHM != NULL) // message pair found 199 204 { 205 /* check request type for special handling */ 206 if (pHM->ulRequestType == ASYNCREQUEST_GETHOSTBYNAME) 207 { 208 dprintf(("WSOCK32:RelayWindowProc, Converting hostent for WSAAyncGetHostByName\n")); 209 /* we need to convert the hostent structure here */ 210 Whostent *WinHostent = (Whostent*)pHM->pvUserData1; 211 hostent *OS2Hostent = (hostent*)pHM->pvUserData2; 212 WinHostent->h_name = OS2Hostent->h_name; 213 WinHostent->h_aliases = OS2Hostent->h_aliases; 214 WinHostent->h_addrtype = (short)OS2Hostent->h_addrtype; 215 WinHostent->h_length = (short)OS2Hostent->h_length; 216 WinHostent->h_addr_list = OS2Hostent->h_addr_list; 217 /* free our temporary OS2 hostent buffer */ 218 //TODO: how can we free this? we will end up with a memory leak :( 219 // this memory block not only contains the hostent structure but also the strings it points to 220 // free(pHM->pvUserData2); 221 222 dprintf(("Size of Window hostent: %d, OS/2 hostent: %d, mp1: %d, mp2 %d\n", sizeof(Whostent), sizeof(hostent), mp1, mp2)); 223 224 } 225 226 dprintf(("WSOCK32:RelayWinProc, Posting %d to %d\n", pHM->ulMsg, pHM->hwnd)); 200 227 PostMessageA(pHM->hwnd, 201 228 pHM->ulMsg,
Note:
See TracChangeset
for help on using the changeset viewer.