Changeset 1942 for trunk/src/wsock32/new/relaywin.cpp
- Timestamp:
- Dec 2, 1999, 5:01:45 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wsock32/new/relaywin.cpp
r1940 r1942 1 /* $Id: relaywin.cpp,v 1. 4 1999-12-02 15:22:05 achimha Exp $ */1 /* $Id: relaywin.cpp,v 1.5 1999-12-02 16:01:45 achimha Exp $ */ 2 2 3 3 /* … … 204 204 { 205 205 /* check request type for special handling */ 206 if (pHM->ulRequestType == ASYNCREQUEST_GETHOSTBYNAME)206 switch (pHM->ulRequestType) 207 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 208 case ASYNCREQUEST_SELECT: 209 { 210 dprintf(("WSOCK32:RelayWindowProc, AsyncSelect notification\n")); 211 } 212 case ASYNCREQUEST_GETHOSTBYNAME: 213 { 214 dprintf(("WSOCK32:RelayWindowProc, Converting hostent for " 215 "WSAAyncGetHostByName\n")); 216 /* we need to convert the hostent structure here */ 217 Whostent *WinHostent = (Whostent*)pHM->pvUserData1; 218 hostent *OS2Hostent = (hostent*)pHM->pvUserData2; 219 WinHostent->h_name = OS2Hostent->h_name; 220 WinHostent->h_aliases = OS2Hostent->h_aliases; 221 WinHostent->h_addrtype = (short)OS2Hostent->h_addrtype; 222 WinHostent->h_length = (short)OS2Hostent->h_length; 223 WinHostent->h_addr_list = OS2Hostent->h_addr_list; 224 /* free our temporary OS2 hostent buffer */ 225 //TODO: how can we free this? we will end up with a memory leak :( 226 // this memory block not only contains the hostent structure but also the strings it points to 227 // I think we should copy the strings after the Whostent into the Win32 buffer 228 // free(pHM->pvUserData2); 229 //TODO: the size of OS/2 hostent is 4 bytes bigger so the original buffer *might* be too small 230 231 } 224 232 } 225 233
Note:
See TracChangeset
for help on using the changeset viewer.