Changeset 2042 for trunk/src


Ignore:
Timestamp:
Dec 9, 1999, 12:01:09 PM (26 years ago)
Author:
sandervl
Message:

Ported ExpandEnvironmentStringsA/W (Wine: 991114)

Location:
trunk/src/kernel32
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/KERNEL32.CPP

    r1898 r2042  
    1 /* $Id: KERNEL32.CPP,v 1.37 1999-11-30 20:19:34 sandervl Exp $ */
     1/* $Id: KERNEL32.CPP,v 1.38 1999-12-09 11:00:40 sandervl Exp $ */
    22
    33/*
     
    175175  dprintf(("KERNEL32:  GetACP\n"));
    176176  return(O32_GetACP());
    177 }
    178 //******************************************************************************
    179 //******************************************************************************
    180 //******************************************************************************
    181 //******************************************************************************
    182 LPWSTR WIN32API GetEnvironmentStringsW(VOID)
    183 {
    184  char *envstrings = (char *)O32_GetEnvironmentStrings();
    185  char *tmp;
    186  LPWSTR wenvstrings;
    187  int len, i;
    188 
    189   dprintf(("KERNEL32:  GetEnvironmentStringsW\n"));
    190 
    191   if(envstrings == NULL)
    192     return(NULL);
    193 
    194   tmp = envstrings;
    195   len = 0;
    196   while(*tmp != 0)
    197   {
    198     len += strlen(tmp)+1;
    199     tmp = envstrings + len;
    200   }
    201   len++;        //terminating 0
    202   wenvstrings = (LPWSTR)malloc(len*sizeof(WCHAR));
    203   for(i=0;
    204       i<len;
    205       i++)
    206   {
    207      wenvstrings[i] = envstrings[i];
    208   }
    209   return(wenvstrings);
    210 }
    211 //******************************************************************************
    212 //******************************************************************************
    213 BOOL WIN32API FreeEnvironmentStringsA(LPSTR envstrings)
    214 {
    215   dprintf(("KERNEL32:  FreeEnvironmentStringsA\n"));
    216   return(TRUE);
    217 }
    218 //******************************************************************************
    219 //******************************************************************************
    220 BOOL WIN32API FreeEnvironmentStringsW(LPWSTR envstrings)
    221 {
    222   dprintf(("KERNEL32:  FreeEnvironmentStringsW\n"));
    223   free(envstrings);
    224   return(TRUE);
    225177}
    226178//******************************************************************************
     
    314266}
    315267//******************************************************************************
    316 //******************************************************************************
    317 BOOL WIN32API SetEnvironmentVariableA(LPCSTR arg1, LPCSTR arg2)
    318 {
    319     dprintf(("KERNEL32:  SetEnvironmentVariable %s to %s\n", arg1, arg2));
    320     return O32_SetEnvironmentVariable(arg1, arg2);
    321 }
    322 //******************************************************************************
    323 //******************************************************************************
    324 BOOL WIN32API SetEnvironmentVariableW(LPCWSTR lpName, LPCWSTR lpValue)
    325 {
    326  char *asciiname, *asciivalue;
    327  BOOL  rc;
    328 
    329     dprintf(("KERNEL32:  OS2SetEnvironmentVariableW\n"));
    330     asciiname  = UnicodeToAsciiString((LPWSTR)lpName);
    331     asciivalue = UnicodeToAsciiString((LPWSTR)lpValue);
    332     rc = O32_SetEnvironmentVariable(asciiname, asciivalue);
    333     FreeAsciiString(asciivalue);
    334     FreeAsciiString(asciiname);
    335     return(rc);
    336 }
    337 //******************************************************************************
    338268VOID WIN32API GlobalMemoryStatus( MEMORYSTATUS *arg1)
    339269{
     
    348278    dprintf(("dwAvailVirtual  %X\n", arg1->dwAvailVirtual));
    349279}
    350 //******************************************************************************
    351 //******************************************************************************
    352 DWORD WIN32API GetEnvironmentVariableA(LPCSTR arg1, LPSTR arg2, DWORD  arg3)
    353 {
    354     dprintf(("KERNEL32:  GetEnvironmentVariable %s\n", arg1));
    355     return O32_GetEnvironmentVariable(arg1, arg2, arg3);
    356 }
    357 //******************************************************************************
    358 //******************************************************************************
    359 DWORD WIN32API GetEnvironmentVariableW(LPCWSTR lpName, LPWSTR lpBuffer,
    360                                        DWORD nSize)
    361 {
    362   char *astring, *asciibuffer;
    363   DWORD rc;
    364 
    365     dprintf(("KERNEL32:  OS2GetEnvironmentVariableW\n"));
    366     asciibuffer = (char *)malloc(nSize+1);
    367     *asciibuffer = 0;
    368     astring     = UnicodeToAsciiString((LPWSTR)lpName);
    369 
    370     rc = O32_GetEnvironmentVariable(astring, asciibuffer, nSize);
    371     AsciiToUnicode(asciibuffer, lpBuffer);
    372     FreeAsciiString(astring);
    373     free(asciibuffer);
    374     return(rc);
    375 }
    376280VOID WIN32API Sleep(DWORD arg1)
    377281{
     
    464368    dprintf(("KERNEL32:  OS2FatalExit\n"));
    465369    O32_FatalExit(arg1);
    466 }
    467 //******************************************************************************
    468 //******************************************************************************
    469 LPSTR WIN32API GetEnvironmentStringsA(void)
    470 {
    471     dprintf(("KERNEL32:  OS2GetEnvironmentStringsA\n"));
    472     return (LPSTR) O32_GetEnvironmentStrings();
    473370}
    474371//******************************************************************************
  • trunk/src/kernel32/makefile

    r2032 r2042  
    1 # $Id: makefile,v 1.67 1999-12-09 00:52:20 sandervl Exp $
     1# $Id: makefile,v 1.68 1999-12-09 11:00:40 sandervl Exp $
    22
    33#
     
    3535LFILE.OBJ NPIPE.OBJ oslibdos.obj oslibmisc.obj MISC.OBJ EXCEPTUTIL.OBJ \
    3636LANG.OBJ ICCIO.OBJ MAP.OBJ WIN32UTIL.OBJ heap.OBJ heapstring.obj \
    37 os2heap.OBJ vmutex.OBJ initterm.OBJ handlemanager.OBJ \
     37os2heap.OBJ vmutex.OBJ initterm.OBJ handlemanager.OBJ environ.obj \
    3838hmdevice.obj hmopen32.obj hmobjects.obj hmevent.obj hmmutex.obj hmcomm.obj \
    3939hmsemaphore.obj wprocess.OBJ conprop.OBJ conprop2.obj winimagelx.obj \
     
    390390cpu.obj: cpu.cpp cpuhlp.h
    391391cpuhlp.obj: cpuhlp.asm
     392environ.obj: environ.cpp $(PDWIN32_INCLUDE)\misc.h
    392393
    393394clean:
  • trunk/src/kernel32/stubs.cpp

    r1924 r2042  
    1 /* $Id: stubs.cpp,v 1.11 1999-12-01 18:40:48 sandervl Exp $ */
     1/* $Id: stubs.cpp,v 1.12 1999-12-09 11:00:40 sandervl Exp $ */
    22
    33/*
     
    15471547}
    15481548
    1549 /*****************************************************************************
    1550  * Name      : DWORD WIN32API ExpandEnvironmentStringsA
    1551  * Purpose   : The ExpandEnvironmentStringsA function expands environment-variable
    1552  *             strings and replaces them with their defined values.
    1553  * Parameters: LPCSTR lpSrc  pointer to string with environment variables
    1554  *             LPSTR lpDst   pointer to string with expanded environment variables
    1555  *             DWORD nSize   maximum characters in expanded string
    1556  * Variables :
    1557  * Result    : If the function succeeds, the return value is the number of
    1558  *             characters stored in the destination buffer. If the number of
    1559  *             characters is greater than the size of the destination buffer,
    1560  *             the return value is the size of the buffer required to hold
    1561  *             the expanded strings.
    1562  *             If the function fails, the return value is zero
    1563  * Remark    :
    1564  * Status    : UNTESTED STUB
    1565  *
    1566  * Author    : Markus Montkowski [Tha, 1998/05/21 20:57]
    1567  *****************************************************************************/
    1568 
    1569 DWORD WIN32API ExpandEnvironmentStringsA(LPCSTR lpSrc,LPSTR lpDst,DWORD nSize)
    1570 {
    1571 
    1572   dprintf(("KERNEL32:ExpandEnvironmentStringsA(%08x,%08x,%08x) not implemented\n",
    1573            lpSrc, lpDst, nSize
    1574           ));
    1575 
    1576   return (0);
    1577 }
    1578 
    1579 /*****************************************************************************
    1580  * Name      : DWORD WIN32API ExpandEnvironmentStringsW
    1581  * Purpose   : The ExpandEnvironmentStringsA function expands environment-variable
    1582  *             strings and replaces them with their defined values.
    1583  * Parameters: LPCWSTR lpSrc  pointer to string with environment variables
    1584  *             LPWSTR lpDst   pointer to string with expanded environment variables
    1585  *             DWORD nSize   maximum characters in expanded string
    1586  * Variables :
    1587  * Result    : If the function succeeds, the return value is the number of
    1588  *             characters stored in the destination buffer. If the number of
    1589  *             characters is greater than the size of the destination buffer,
    1590  *             the return value is the size of the buffer required to hold
    1591  *             the expanded strings.
    1592  *             If the function fails, the return value is zero
    1593  * Remark    :
    1594  * Status    : UNTESTED STUB
    1595  *
    1596  * Author    : Markus Montkowski [Tha, 1998/05/21 20:57]
    1597  *****************************************************************************/
    1598 
    1599 DWORD WIN32API ExpandEnvironmentStringsW(LPCWSTR lpSrc,
    1600                                             LPWSTR lpDst,
    1601                                             DWORD nSize)
    1602 {
    1603 
    1604   dprintf(("KERNEL32:ExpandEnvironmentStringsW(%08x,%08x,%08x) not implemented\n",
    1605            lpSrc, lpDst, nSize
    1606           ));
    1607 
    1608   return (0);
    1609 }
    16101549
    16111550/*****************************************************************************
Note: See TracChangeset for help on using the changeset viewer.