Ignore:
Timestamp:
Oct 20, 1999, 10:09:05 AM (26 years ago)
Author:
sandervl
Message:

Odin ini changes

File:
1 edited

Legend:

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

    r1076 r1370  
    1 /* $Id: directory.cpp,v 1.5 1999-09-28 01:17:01 phaller Exp $ */
     1/* $Id: directory.cpp,v 1.6 1999-10-20 08:09:04 sandervl Exp $ */
    22
    33/*
     
    2222#include <unicode.h>
    2323#include <heapstring.h>
     24#include <options.h>
    2425
    2526
     
    170171 *****************************************************************************/
    171172
    172 ODINFUNCTION2(UINT,GetSystemDirectoryA,LPSTR,arg1,
    173                                        UINT, arg2)
     173ODINFUNCTION2(UINT,GetSystemDirectoryA,LPSTR,lpBuffer,
     174                                       UINT,uSize)
    174175{
    175176  LPSTR lpstrEnv = getenv("WIN32.DIR.SYSTEM");          /* query environment */
     
    177178  if (lpstrEnv != NULL)
    178179  {
    179     lstrcpynA(arg1,                   /* copy environment variable to buffer */
     180    lstrcpynA(lpBuffer,                   /* copy environment variable to buffer */
    180181              lpstrEnv,
    181               arg2);
    182     return (lstrlenA(arg1));                /* return number of copies bytes */
     182              uSize);
     183    return (lstrlenA(lpBuffer));                /* return number of copies bytes */
     184  } else
     185  {
     186    int len;
     187
     188    len = PROFILE_GetOdinIniString(ODINDIRECTORIES,"SYSTEM","",lpBuffer,uSize);
     189    if (len > 2) return len;
     190    else
     191                               /* if no override by environment is available */
     192      return O32_GetSystemDirectory(lpBuffer,uSize);
    183193  }
    184   else
    185                                /* if no override by environment is available */
    186     return O32_GetSystemDirectory(arg1, arg2);
    187194}
    188195
     
    225232 *****************************************************************************/
    226233
    227 ODINFUNCTION2(UINT,GetWindowsDirectoryA,LPSTR,arg1,
    228                                         UINT, arg2)
     234ODINFUNCTION2(UINT,GetWindowsDirectoryA,LPSTR,lpBuffer,
     235                                        UINT,uSize)
    229236{
    230237  LPSTR lpstrEnv = getenv("WIN32.DIR.WINDOWS");         /* query environment */
     
    232239  if (lpstrEnv != NULL)
    233240  {
    234     lstrcpynA(arg1,                   /* copy environment variable to buffer */
     241    lstrcpynA(lpBuffer,                   /* copy environment variable to buffer */
    235242              lpstrEnv,
    236               arg2);
    237     return (lstrlenA(arg1));                /* return number of copies bytes */
     243              uSize);
     244    return (lstrlenA(lpBuffer));                /* return number of copies bytes */
     245  } else
     246  {
     247    int len;
     248
     249    len = PROFILE_GetOdinIniString(ODINDIRECTORIES,"WINDOWS","",lpBuffer,uSize);
     250    if (len > 2) return len;
     251    else
     252
     253                               /* if no override by environment is available */
     254      return O32_GetWindowsDirectory(lpBuffer,uSize);
    238255  }
    239   else
    240                                /* if no override by environment is available */
    241     return O32_GetWindowsDirectory(arg1,
    242                                    arg2);
    243256}
    244257
Note: See TracChangeset for help on using the changeset viewer.