Changeset 2042 for trunk/src/kernel32/KERNEL32.CPP
- Timestamp:
- Dec 9, 1999, 12:01:09 PM (26 years ago)
- File:
-
- 1 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 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.