- Timestamp:
- Dec 9, 1999, 12:01:09 PM (26 years ago)
- 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.3 7 1999-11-30 20:19:34sandervl Exp $ */1 /* $Id: KERNEL32.CPP,v 1.38 1999-12-09 11:00:40 sandervl Exp $ */ 2 2 3 3 /* … … 175 175 dprintf(("KERNEL32: GetACP\n")); 176 176 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 0202 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);225 177 } 226 178 //****************************************************************************** … … 314 266 } 315 267 //****************************************************************************** 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 //******************************************************************************338 268 VOID WIN32API GlobalMemoryStatus( MEMORYSTATUS *arg1) 339 269 { … … 348 278 dprintf(("dwAvailVirtual %X\n", arg1->dwAvailVirtual)); 349 279 } 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 }376 280 VOID WIN32API Sleep(DWORD arg1) 377 281 { … … 464 368 dprintf(("KERNEL32: OS2FatalExit\n")); 465 369 O32_FatalExit(arg1); 466 }467 //******************************************************************************468 //******************************************************************************469 LPSTR WIN32API GetEnvironmentStringsA(void)470 {471 dprintf(("KERNEL32: OS2GetEnvironmentStringsA\n"));472 return (LPSTR) O32_GetEnvironmentStrings();473 370 } 474 371 //****************************************************************************** -
trunk/src/kernel32/makefile
r2032 r2042 1 # $Id: makefile,v 1.6 7 1999-12-09 00:52:20 sandervl Exp $1 # $Id: makefile,v 1.68 1999-12-09 11:00:40 sandervl Exp $ 2 2 3 3 # … … 35 35 LFILE.OBJ NPIPE.OBJ oslibdos.obj oslibmisc.obj MISC.OBJ EXCEPTUTIL.OBJ \ 36 36 LANG.OBJ ICCIO.OBJ MAP.OBJ WIN32UTIL.OBJ heap.OBJ heapstring.obj \ 37 os2heap.OBJ vmutex.OBJ initterm.OBJ handlemanager.OBJ \37 os2heap.OBJ vmutex.OBJ initterm.OBJ handlemanager.OBJ environ.obj \ 38 38 hmdevice.obj hmopen32.obj hmobjects.obj hmevent.obj hmmutex.obj hmcomm.obj \ 39 39 hmsemaphore.obj wprocess.OBJ conprop.OBJ conprop2.obj winimagelx.obj \ … … 390 390 cpu.obj: cpu.cpp cpuhlp.h 391 391 cpuhlp.obj: cpuhlp.asm 392 environ.obj: environ.cpp $(PDWIN32_INCLUDE)\misc.h 392 393 393 394 clean: -
trunk/src/kernel32/stubs.cpp
r1924 r2042 1 /* $Id: stubs.cpp,v 1.1 1 1999-12-01 18:40:48sandervl Exp $ */1 /* $Id: stubs.cpp,v 1.12 1999-12-09 11:00:40 sandervl Exp $ */ 2 2 3 3 /* … … 1547 1547 } 1548 1548 1549 /*****************************************************************************1550 * Name : DWORD WIN32API ExpandEnvironmentStringsA1551 * Purpose : The ExpandEnvironmentStringsA function expands environment-variable1552 * strings and replaces them with their defined values.1553 * Parameters: LPCSTR lpSrc pointer to string with environment variables1554 * LPSTR lpDst pointer to string with expanded environment variables1555 * DWORD nSize maximum characters in expanded string1556 * Variables :1557 * Result : If the function succeeds, the return value is the number of1558 * characters stored in the destination buffer. If the number of1559 * characters is greater than the size of the destination buffer,1560 * the return value is the size of the buffer required to hold1561 * the expanded strings.1562 * If the function fails, the return value is zero1563 * Remark :1564 * Status : UNTESTED STUB1565 *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, nSize1574 ));1575 1576 return (0);1577 }1578 1579 /*****************************************************************************1580 * Name : DWORD WIN32API ExpandEnvironmentStringsW1581 * Purpose : The ExpandEnvironmentStringsA function expands environment-variable1582 * strings and replaces them with their defined values.1583 * Parameters: LPCWSTR lpSrc pointer to string with environment variables1584 * LPWSTR lpDst pointer to string with expanded environment variables1585 * DWORD nSize maximum characters in expanded string1586 * Variables :1587 * Result : If the function succeeds, the return value is the number of1588 * characters stored in the destination buffer. If the number of1589 * characters is greater than the size of the destination buffer,1590 * the return value is the size of the buffer required to hold1591 * the expanded strings.1592 * If the function fails, the return value is zero1593 * Remark :1594 * Status : UNTESTED STUB1595 *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, nSize1606 ));1607 1608 return (0);1609 }1610 1549 1611 1550 /*****************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.