Ignore:
Timestamp:
May 2, 2000, 3:09:44 PM (25 years ago)
Author:
bird
Message:

Dirty fix to make this compile - QueryPerformanceCounter int odinwrap.h problem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wsock32/asyncapi.cpp

    r3439 r3472  
    1 /* $Id: asyncapi.cpp,v 1.6 2000-04-23 15:55:52 sandervl Exp $ */
     1/* $Id: asyncapi.cpp,v 1.7 2000-05-02 13:09:43 bird Exp $ */
    22
    33/*
     
    3131#include "dbglocal.h"
    3232
     33//kso: dirty fix to make this compile! not permanent!
     34BOOL WINAPI QueryPerformanceCounter(LARGE_INTEGER *p);
     35#define LowPart u.LowPart
     36
     37
    3338ODINDEBUGCHANNEL(WSOCK32-ASYNC)
    3439
     
    4247 int              size = 0;
    4348 int              fail = NO_ERROR;
    44  
     49
    4550   if(!pThreadParm->fCancelled)
    4651   {
     
    5964                }
    6065                else {
    61                         ret = gethostbyaddr(pThreadParm->u.gethostbyaddr.addr, 
     66                        ret = gethostbyaddr(pThreadParm->u.gethostbyaddr.addr,
    6267                                            pThreadParm->u.gethostbyaddr.len,
    6368                                            pThreadParm->u.gethostbyaddr.type);
     
    152157   if(!pThreadParm->fCancelled) {
    153158        dprintf(("WSAsyncThreadProc %x %x %x %x", pThreadParm->hwnd, pThreadParm->msg, pThreadParm->hAsyncTaskHandle, lParam));
    154         PostMessageA(pThreadParm->hwnd, pThreadParm->msg, 
     159        PostMessageA(pThreadParm->hwnd, pThreadParm->msg,
    155160                     (WPARAM)pThreadParm->hAsyncTaskHandle, lParam);
    156161   }
    157162   pThreadParm->fActive = FALSE;
    158    RemoveFromQueue(pThreadParm); 
    159 }
    160 //******************************************************************************
    161 //******************************************************************************
    162 LHANDLE WSAAsyncRequest(AsyncRequestType requesttype, HWND hwnd, int msg, char *buf, 
     163   RemoveFromQueue(pThreadParm);
     164}
     165//******************************************************************************
     166//******************************************************************************
     167LHANDLE WSAAsyncRequest(AsyncRequestType requesttype, HWND hwnd, int msg, char *buf,
    163168                        int buflen, PVOID param1, PVOID param2, PVOID param3,
    164169                        PVOID param4)
     
    303308   }
    304309   return 0;
    305 }                     
     310}
    306311//******************************************************************************
    307312//******************************************************************************
     
    315320   dprintf(("WSAAsyncGetHostByName %s", name));
    316321
    317    return WSAAsyncRequest(ASYNC_GETHOSTBYNAME, hWnd, wMsg, buf, buflen, 
     322   return WSAAsyncRequest(ASYNC_GETHOSTBYNAME, hWnd, wMsg, buf, buflen,
    318323                          (PVOID)name, 0, 0, 0);
    319324}
     
    331336   dprintf(("WSAAsyncGetHostByAddr %s", addr));
    332337
    333    return WSAAsyncRequest(ASYNC_GETHOSTBYADDR, hWnd, wMsg, buf, buflen, 
     338   return WSAAsyncRequest(ASYNC_GETHOSTBYADDR, hWnd, wMsg, buf, buflen,
    334339                          (PVOID)addr, (PVOID)len, (PVOID)type, 0);
    335340}
     
    345350   dprintf(("WSAAsyncGetProtoByName %s", name));
    346351
    347    return WSAAsyncRequest(ASYNC_GETPROTOBYNAME, hWnd, wMsg, buf, buflen, 
     352   return WSAAsyncRequest(ASYNC_GETPROTOBYNAME, hWnd, wMsg, buf, buflen,
    348353                          (PVOID)name, 0, 0, 0);
    349354}
     
    359364   dprintf(("WSAAsyncGetProtoByNumber %d", number));
    360365
    361    return WSAAsyncRequest(ASYNC_GETPROTOBYNUMBER, hWnd, wMsg, buf, buflen, 
     366   return WSAAsyncRequest(ASYNC_GETPROTOBYNUMBER, hWnd, wMsg, buf, buflen,
    362367                          (PVOID)number, 0, 0, 0);
    363368}
     
    374379   dprintf(("WSAAsyncGetServByName %s", name));
    375380
    376    return WSAAsyncRequest(ASYNC_GETSERVBYNAME, hWnd, wMsg, buf, buflen, 
     381   return WSAAsyncRequest(ASYNC_GETSERVBYNAME, hWnd, wMsg, buf, buflen,
    377382                          (PVOID)name, (PVOID)proto, 0, 0);
    378383}
     
    389394   dprintf(("WSAAsyncGetServByPort %d %s", port, proto));
    390395
    391    return WSAAsyncRequest(ASYNC_GETSERVBYPORT, hWnd, wMsg, buf, buflen, 
     396   return WSAAsyncRequest(ASYNC_GETSERVBYPORT, hWnd, wMsg, buf, buflen,
    392397                          (PVOID)port, (PVOID)proto, 0, 0);
    393398}
     
    401406
    402407   dprintf(("AsyncNotifyEvent %x %x %x %x", pThreadParm->u.asyncselect.s, pThreadParm->hwnd, pThreadParm->msg, event));
    403    PostMessageA(pThreadParm->hwnd, pThreadParm->msg, (WPARAM)pThreadParm->u.asyncselect.s, 
     408   PostMessageA(pThreadParm->hwnd, pThreadParm->msg, (WPARAM)pThreadParm->u.asyncselect.s,
    404409               (LPARAM)event);
    405410}
     
    416421 int              noread, nowrite, noexcept, state, sockoptlen, sockoptval;
    417422 int              tmp, i, lEventsPending, ret, bytesread;
    418  
     423
    419424   while(TRUE)
    420425   {
     
    464469                        selecterr += SOCBASEERR;
    465470                }
    466                 switch(selecterr) 
     471                switch(selecterr)
    467472                {
    468473                case SOCEINTR:
     
    481486                        //but can still send
    482487                        pThreadParm->u.asyncselect.lEventsPending &= ~(FD_READ | FD_ACCEPT);
    483                         goto asyncloopstart; 
     488                        goto asyncloopstart;
    484489
    485490                case SOCEINVAL:
     
    513518                                        AsyncNotifyEvent(pThreadParm, FD_CONNECT, WSAECONNREFUSED);
    514519                                }
    515                         } 
     520                        }
    516521                }
    517522                else
     
    524529        {
    525530                state = ioctl(s, FIONREAD, (CHAR *) &bytesread, sizeof(bytesread));
    526                 if(state == SOCKET_ERROR) 
     531                if(state == SOCKET_ERROR)
    527532                {
    528                         if(lEventsPending & FD_CLOSE) 
     533                        if(lEventsPending & FD_CLOSE)
    529534                        {
    530535                                dprintf(("FD_CLOSE; ioctl; socket error"));
     
    540545                        }
    541546                }
    542                 if(lEventsPending & FD_ACCEPT) 
     547                if(lEventsPending & FD_ACCEPT)
    543548                {
    544549                        sockoptlen = sizeof(sockoptlen);
     
    560565//SvL: This generates FD_CLOSE messages when the connection is just fine
    561566//     (recv executed in another thread when select returns)
    562                 else 
     567                else
    563568                if((lEventsPending & FD_CLOSE) && (state == 0 && bytesread == 0)) {
    564569                        dprintf(("FD_CLOSE; state == 0 && bytesread == 0"));
     
    573578                }
    574579        }
    575         if((pThreadParm->u.asyncselect.lEventsPending & (FD_ACCEPT|FD_CLOSE|FD_CONNECT)) == 
     580        if((pThreadParm->u.asyncselect.lEventsPending & (FD_ACCEPT|FD_CLOSE|FD_CONNECT)) ==
    576581            (lEventsPending & (FD_ACCEPT|FD_CLOSE|FD_CONNECT))) {
    577582                DosSleep(10);
     
    580585   //remove it first, then delete semaphore object
    581586   pThreadParm->fActive = FALSE;
    582    RemoveFromQueue(pThreadParm); 
     587   RemoveFromQueue(pThreadParm);
    583588   delete pThreadParm->u.asyncselect.asyncSem;
    584589   pThreadParm->u.asyncselect.asyncSem = 0;
Note: See TracChangeset for help on using the changeset viewer.