Ignore:
Timestamp:
Dec 1, 1999, 7:40:49 PM (26 years ago)
Author:
sandervl
Message:

added GetProcessTimes + several fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/Fileio.cpp

    r1893 r1924  
    1 /* $Id: Fileio.cpp,v 1.17 1999-11-30 19:40:25 sandervl Exp $ */
     1/* $Id: Fileio.cpp,v 1.18 1999-12-01 18:40:47 sandervl Exp $ */
    22
    33/*
     
    9494  rc = FindFirstFileA(astring, &wfda);
    9595
    96   // convert back the result structure
    97   memcpy(arg2,
    98          &wfda,
    99          sizeof(WIN32_FIND_DATAA));
    100 
    101   lstrcpynAtoW (arg2->cFileName,
    102                 wfda.cFileName,
    103                 sizeof(wfda.cFileName));
    104 
    105   lstrcpynAtoW (arg2->cAlternateFileName,
    106                 wfda.cAlternateFileName,
    107                 sizeof(wfda.cAlternateFileName));
    108 
     96  if(rc == -1) {
     97        memset(arg2, 0, sizeof(WIN32_FIND_DATAW));
     98  }
     99  else {
     100        // convert back the result structure
     101        memcpy(arg2,
     102                 &wfda,
     103                 sizeof(WIN32_FIND_DATAA));
     104       
     105        lstrcpynAtoW (arg2->cFileName,
     106                      wfda.cFileName,
     107                      sizeof(wfda.cFileName));
     108       
     109        lstrcpynAtoW (arg2->cAlternateFileName,
     110                      wfda.cAlternateFileName,
     111                      sizeof(wfda.cAlternateFileName));
     112  }     
    109113  FreeAsciiString(astring);
    110114  return(rc);
     
    119123}
    120124//******************************************************************************
    121 //TODO: convert string in WIN32_FIND_DATAW * structure
    122125//******************************************************************************
    123126ODINFUNCTION2(BOOL, FindNextFileW,
     
    130133  rc = FindNextFileA(arg1, &wfda);
    131134
    132   // convert back the result structure
    133   memcpy(arg2,
    134          &wfda,
    135          sizeof(WIN32_FIND_DATAA));
    136 
    137   lstrcpynAtoW (arg2->cFileName,
    138                 wfda.cFileName,
    139                 sizeof(wfda.cFileName));
    140 
    141   lstrcpynAtoW (arg2->cAlternateFileName,
    142                 wfda.cAlternateFileName,
    143                 sizeof(wfda.cAlternateFileName));
    144 
     135  if(rc == 0) {
     136        memset(arg2, 0, sizeof(WIN32_FIND_DATAW));
     137  }
     138  else {
     139        // convert back the result structure
     140        memcpy(arg2,
     141               &wfda,
     142               sizeof(WIN32_FIND_DATAA));
     143
     144        lstrcpynAtoW (arg2->cFileName,
     145                      wfda.cFileName,
     146                      sizeof(wfda.cFileName));
     147
     148        lstrcpynAtoW (arg2->cAlternateFileName,
     149                      wfda.cAlternateFileName,
     150                      sizeof(wfda.cAlternateFileName));
     151  }
    145152  return rc;
    146153}
Note: See TracChangeset for help on using the changeset viewer.