Ignore:
Timestamp:
Jul 28, 2010, 8:14:30 PM (15 years ago)
Author:
dmik
Message:

Build minivcrt.lib (accessible through minivcrt.h) that aims at providing MSVCRT-specific functions such as the wide character version of _getcwd() and similar to other runtimes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/msvcrt/dir.c

    r10005 r21398  
    3131#endif
    3232
     33#ifndef __MINIVCRT__
     34
    3335#include "wine/port.h"
    3436
     
    4951
    5052WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
     53
     54#else /* !__MINIVCRT__ */
     55
     56#include "minivcrt.h"
     57#include "minivcrt_internal.h"
     58
     59#include "winternl.h"
     60#include "wine/unicode.h"
     61
     62#include <errno.h>
     63#include <stdlib.h>
     64
     65#endif /* !__MINIVCRT__ */
     66
     67#ifndef __MINIVCRT__
    5168
    5269/* INTERNAL: Translate finddata_t to PWIN32_FIND_DATAA */
     
    7087}
    7188
     89#endif /* !__MINIVCRT__ */
     90
    7291/* INTERNAL: Translate wfinddata_t to PWIN32_FIND_DATAA */
    7392static void msvcrt_wfttofd(LPWIN32_FIND_DATAW fd, struct _wfinddata_t* ft)
     
    90109}
    91110
     111#ifndef __MINIVCRT__
     112
    92113/*********************************************************************
    93114 *              _chdir (MSVCRT.@)
     
    103124}
    104125
     126#endif /* !__MINIVCRT__ */
     127
    105128/*********************************************************************
    106129 *              _wchdir (MSVCRT.@)
     
    115138  return 0;
    116139}
     140
     141#ifndef __MINIVCRT__
    117142
    118143/*********************************************************************
     
    166191}
    167192
     193#endif /* !__MINIVCRT__ */
     194
    168195/*********************************************************************
    169196 *              _wfindfirst (MSVCRT.@)
     
    185212}
    186213
     214#ifndef __MINIVCRT__
     215
    187216/*********************************************************************
    188217 *              _findnext (MSVCRT.@)
     
    194223  if (!FindNextFileA((HANDLE)hand, &find_data))
    195224  {
    196     *MSVCRT__errno() = MSVCRT_ENOENT;
     225    *MSVCRT__errno() = MSVCRT(ENOENT);
    197226    return -1;
    198227  }
     
    202231}
    203232
     233#endif /* !__MINIVCRT__ */
     234
    204235/*********************************************************************
    205236 *              _wfindnext (MSVCRT.@)
     
    211242  if (!FindNextFileW((HANDLE)hand, &find_data))
    212243  {
    213     *MSVCRT__errno() = MSVCRT_ENOENT;
     244    *MSVCRT__errno() = MSVCRT(ENOENT);
    214245    return -1;
    215246  }
     
    218249  return 0;
    219250}
     251
     252#ifndef __MINIVCRT__
    220253
    221254/*********************************************************************
     
    245278}
    246279
     280#endif /* !__MINIVCRT__ */
     281
    247282/*********************************************************************
    248283 *              _wgetcwd (MSVCRT.@)
     
    264299  if (dir_len >= size)
    265300  {
    266     *MSVCRT__errno() = MSVCRT_ERANGE;
     301    *MSVCRT__errno() = MSVCRT(ERANGE);
    267302    return NULL; /* buf too small */
    268303  }
     
    270305  return buf;
    271306}
     307
     308#ifndef __MINIVCRT__
    272309
    273310/*********************************************************************
     
    322359}
    323360
     361#endif /* !__MINIVCRT__ */
     362
    324363/*********************************************************************
    325364 *              _wgetdcwd (MSVCRT.@)
     
    342381    if (GetDriveTypeW(drivespec) < DRIVE_REMOVABLE)
    343382    {
    344       *MSVCRT__errno() = MSVCRT_EACCES;
     383      *MSVCRT__errno() = MSVCRT(EACCES);
    345384      return NULL;
    346385    }
     
    349388    if (dir_len >= size || dir_len < 1)
    350389    {
    351       *MSVCRT__errno() = MSVCRT_ERANGE;
     390      *MSVCRT__errno() = MSVCRT(ERANGE);
    352391      return NULL; /* buf too small */
    353392    }
     
    360399  return buf;
    361400}
     401
     402#ifndef __MINIVCRT__
    362403
    363404/*********************************************************************
     
    399440}
    400441
     442#endif /* !__MINIVCRT__ */
     443
    401444/*********************************************************************
    402445 *              _wmkdir (MSVCRT.@)
     
    410453}
    411454
     455#ifndef __MINIVCRT__
     456
    412457/*********************************************************************
    413458 *              _rmdir (MSVCRT.@)
     
    420465  return -1;
    421466}
     467
     468#endif /* !__MINIVCRT__ */
    422469
    423470/*********************************************************************
     
    519566  }
    520567}
     568
     569#ifndef __MINIVCRT__
    521570
    522571/* INTERNAL: Helper for _fullpath. Modified PD code from 'snippets'. */
     
    720769}
    721770
     771#endif /* !__MINIVCRT__ */
     772
    722773/*********************************************************************
    723774 *              _wmakepath (MSVCRT.@)
     
    767818}
    768819
     820#ifndef __MINIVCRT__
     821
    769822/*********************************************************************
    770823 *              _searchenv (MSVCRT.@)
     
    828881}
    829882
     883#endif /* !__MINIVCRT__ */
     884
    830885MSVCRT_wchar_t* _wfullpath(MSVCRT_wchar_t* absPath,const MSVCRT_wchar_t* relPath,MSVCRT(size_t) size)
    831886{
     
    836891
    837892   WideCharToMultiByte(CP_ACP, 0, relPath, -1, (LPSTR)asciirelPath, 280, NULL, NULL);
    838    
     893
    839894   MSVCRT__fullpath(asciiabsPath, asciirelPath, size);
    840    
     895
    841896   MultiByteToWideChar(CP_ACP, 0, asciiabsPath, -1, absPath, size);
    842897
    843    return absPath; 
    844 }
     898   return absPath;
     899}
Note: See TracChangeset for help on using the changeset viewer.