- Timestamp:
- Dec 2, 1999, 5:12:24 PM (26 years ago)
- Location:
- trunk/src/wsock32/new
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wsock32/new/relaywin.cpp
r1942 r1943 1 /* $Id: relaywin.cpp,v 1. 5 1999-12-02 16:01:45achimha Exp $ */1 /* $Id: relaywin.cpp,v 1.6 1999-12-02 16:12:23 achimha Exp $ */ 2 2 3 3 /* … … 216 216 /* we need to convert the hostent structure here */ 217 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); 218 hostent *OS2Hostent = (hostent*)pHM->pvUserData1; 219 short h_addrtype = (short)OS2Hostent->h_addrtype; 220 WinHostent->h_addrtype = h_addrtype; 221 short h_length = (short)OS2Hostent->h_length; 222 WinHostent->h_length = h_length; 223 char **h_addr_list = OS2Hostent->h_addr_list; 224 WinHostent->h_addr_list = h_addr_list; 229 225 //TODO: the size of OS/2 hostent is 4 bytes bigger so the original buffer *might* be too small 230 226 -
trunk/src/wsock32/new/wsock32.cpp
r1940 r1943 1 /* $Id: wsock32.cpp,v 1. 9 1999-12-02 15:22:05achimha Exp $ */1 /* $Id: wsock32.cpp,v 1.10 1999-12-02 16:12:24 achimha Exp $ */ 2 2 3 3 /* … … 1272 1272 HWND hwndOS2 = Win32ToOS2Handle(hWnd); 1273 1273 ULONG ulNewID; 1274 char *OS2Hostent = (char*)malloc(MAXGETHOSTSTRUCT);1275 1274 1276 1275 if (hwndRelay == NULL) // already initialized ? … … 1285 1284 else 1286 1285 // add entry to list, we need to store both our temp buffer and the apps buffer 1287 ulNewID = RelayAlloc(hWnd, wMsg, ASYNCREQUEST_GETHOSTBYNAME, buf , OS2Hostent);1286 ulNewID = RelayAlloc(hWnd, wMsg, ASYNCREQUEST_GETHOSTBYNAME, buf); 1288 1287 1289 1288 // call pmwsock function, will fill our temp buffer … … 1291 1290 ulNewID, 1292 1291 name, 1293 OS2Hostent,1292 buf, 1294 1293 buflen); 1295 1294
Note:
See TracChangeset
for help on using the changeset viewer.