Changeset 3375 for trunk/src/kernel32/directory.cpp
- Timestamp:
- Apr 15, 2000, 12:35:29 AM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/directory.cpp
r3347 r3375 1 /* $Id: directory.cpp,v 1.1 8 2000-04-07 19:43:46 sandervl Exp $ */1 /* $Id: directory.cpp,v 1.19 2000-04-14 22:35:26 sandervl Exp $ */ 2 2 3 3 /* … … 13 13 * 14 14 * Copyright 1995 Alexandre Julliard 15 * 16 * TODO: System/window directories should be created by install program! 15 17 * 16 18 * Project Odin Software License can be found in LICENSE.TXT … … 229 231 UINT,uSize) 230 232 { 231 LPSTR lpstrEnv = getenv("WIN32.DIR.SYSTEM"); /* query environment */ 232 CHAR buf[255]; 233 234 if (lpstrEnv != NULL) 235 { 236 if(lpBuffer) 237 lstrcpynA(lpBuffer, lpstrEnv, uSize); 238 239 return (lstrlenA(lpstrEnv)); /* return number of copies bytes */ 240 } 241 else 242 { 243 int len; 244 245 len = ODIN_PROFILE_GetOdinIniString(ODINDIRECTORIES,"SYSTEM","",buf,sizeof(buf)); 246 if (len > 2) { 247 if(buf[len-1] == '\\') { 248 buf[len-1] = 0; 249 len--; 250 } 251 if(lpBuffer) 252 lstrcpynA(lpBuffer, buf, uSize); 253 254 return len; 255 } 256 else {//SvL: Use path of kernel32.dll instead of calling Open32 api (which returns \OS2\SYSTEM) 257 lstrcpynA(buf, kernel32Path, sizeof(buf)-1); 233 char buf[255]; 234 int len; 235 236 lstrcpynA(buf, kernel32Path, sizeof(buf)-1); 258 237 len = lstrlenA(buf);; 259 238 if(buf[len-1] == '\\') { … … 264 243 lstrcpynA(lpBuffer, buf, uSize); 265 244 return len; 266 }267 }268 245 } 269 246 … … 315 292 UINT,uSize) 316 293 { 317 LPSTR lpstrEnv = getenv("WIN32.DIR.WINDOWS"); /* query environment */294 static int fWindirExists = FALSE; 318 295 CHAR buf[255]; 319 320 if (lpstrEnv != NULL) 321 { 322 if(lpBuffer) 323 lstrcpynA(lpBuffer, lpstrEnv, uSize); 324 325 return (lstrlenA(lpstrEnv)); /* return number of copies bytes */ 326 } 327 else 328 { 329 int len; 330 331 len = ODIN_PROFILE_GetOdinIniString(ODINDIRECTORIES,"WINDOWS","",buf,sizeof(buf)); 332 if (len > 2) { 333 if(buf[len-1] == '\\') { 334 buf[len-1] = 0; 335 len--; 336 } 337 if(lpBuffer) 338 lstrcpynA(lpBuffer, buf, uSize); 339 340 return len; 341 } 342 else {//SvL: Use path of kernel32.dll instead of calling Open32 api (which returns \OS2\SYSTEM) 343 296 int len; 297 298 //SvL: Use path of kernel32.dll instead of calling Open32 api (which returns \OS2\SYSTEM) 344 299 lstrcpynA(buf, kernel32Path, sizeof(buf)-1); 345 300 strcat(buf, "WIN"); 346 O32_CreateDirectory(buf, NULL); 301 if(!fWindirExists) { 302 O32_CreateDirectory(buf, NULL); 303 fWindirExists = TRUE; 304 } 347 305 348 306 len = lstrlenA(buf);; … … 354 312 lstrcpynA(lpBuffer, buf, uSize); 355 313 return len; 356 }357 }358 314 } 359 315
Note:
See TracChangeset
for help on using the changeset viewer.