- Timestamp:
- Nov 8, 1999, 2:43:13 PM (26 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/Fileio.cpp
r1570 r1628 1 /* $Id: Fileio.cpp,v 1.1 3 1999-11-03 17:12:20 phallerExp $ */1 /* $Id: Fileio.cpp,v 1.14 1999-11-08 13:43:11 sandervl Exp $ */ 2 2 3 3 /* … … 30 30 #include "oslibdos.h" 31 31 32 33 32 ODINDEBUGCHANNEL(KERNEL32-FILEIO) 34 33 … … 360 359 nrbyteswritten, 361 360 lpOverlapped)); 362 }363 //******************************************************************************364 //******************************************************************************365 ODINFUNCTION6(DWORD, SearchPathA,366 LPCSTR, lpszPath,367 LPCSTR, lpszFile,368 LPCSTR, lpszExtension,369 DWORD, cchReturnBuffer,370 LPSTR, lpszReturnBuffer,371 LPSTR *, plpszFilePart)372 {373 LPSTR lpszFilePart;374 375 // @@@PH 1999/11/03 ANV.EXE seems to pass in NULL here, looks like376 // windows ignores that behaviour altough it's undocumented.377 if (plpszFilePart == NULL)378 plpszFilePart = &lpszFilePart; // just provide a valid pointer379 380 return O32_SearchPath(lpszPath,381 lpszFile,382 lpszExtension,383 cchReturnBuffer,384 lpszReturnBuffer,385 plpszFilePart);386 }387 //******************************************************************************388 //******************************************************************************389 ODINFUNCTION6(DWORD, SearchPathW,390 LPCWSTR, lpszPath,391 LPCWSTR, lpszFileName,392 LPCWSTR, lpszExtension,393 DWORD, cchReturnBufferLength,394 LPWSTR, lpszReturnBuffer,395 LPWSTR *, plpszFilePart)396 {397 char *asciipath,398 *asciifile,399 *asciiext,400 *asciibuffer,401 *asciipart;402 DWORD rc;403 404 asciibuffer = (char *)malloc(cchReturnBufferLength+1);405 asciipath = UnicodeToAsciiString((LPWSTR)lpszPath);406 asciifile = UnicodeToAsciiString((LPWSTR)lpszFileName);407 asciiext = UnicodeToAsciiString((LPWSTR)lpszExtension);408 rc = ODIN_SearchPathA(asciipath,409 asciifile,410 asciiext,411 cchReturnBufferLength,412 asciibuffer,413 &asciipart);414 415 if(rc)416 {417 AsciiToUnicode(asciibuffer, lpszReturnBuffer);418 *plpszFilePart = lpszReturnBuffer + ((int)asciipart - (int)asciibuffer);419 }420 421 FreeAsciiString(asciiext);422 FreeAsciiString(asciifile);423 FreeAsciiString(asciipath);424 free(asciibuffer);425 return(rc);426 361 } 427 362 //****************************************************************************** -
trunk/src/kernel32/HandleManager.cpp
r1472 r1628 1 /* $Id: HandleManager.cpp,v 1.2 1 1999-10-27 10:08:32 phallerExp $ */1 /* $Id: HandleManager.cpp,v 1.22 1999-11-08 13:43:11 sandervl Exp $ */ 2 2 3 3 /* … … 1137 1137 { 1138 1138 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1139 return (INVALID_HANDLE_ERROR); /* signal failure */1139 return FILE_TYPE_UNKNOWN; /* signal failure */ 1140 1140 } 1141 1141 … … 1216 1216 { 1217 1217 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1218 return (INVALID_HANDLE_ERROR); /* signal failure */1218 return FALSE; /* signal failure */ 1219 1219 } 1220 1220 … … 1250 1250 { 1251 1251 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1252 return (INVALID_HANDLE_ERROR); /* signal failure */1252 return FALSE; /* signal failure */ 1253 1253 } 1254 1254 … … 1286 1286 { 1287 1287 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1288 return (INVALID_HANDLE_ERROR); /* signal failure */1288 return FALSE; /* signal failure */ 1289 1289 } 1290 1290 … … 1400 1400 { 1401 1401 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1402 return (INVALID_HANDLE_ERROR); /* signal failure */1402 return FALSE; /* signal failure */ 1403 1403 } 1404 1404 … … 1442 1442 { 1443 1443 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1444 return (INVALID_HANDLE_ERROR); /* signal failure */1444 return FALSE; /* signal failure */ 1445 1445 } 1446 1446 … … 1485 1485 { 1486 1486 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1487 return (INVALID_HANDLE_ERROR); /* signal failure */1487 return FALSE; /* signal failure */ 1488 1488 } 1489 1489 … … 1527 1527 { 1528 1528 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1529 return (INVALID_HANDLE_ERROR); /* signal failure */1529 return FALSE; /* signal failure */ 1530 1530 } 1531 1531 … … 1566 1566 { 1567 1567 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1568 return (INVALID_HANDLE_ERROR); /* signal failure */1568 return WAIT_FAILED; /* signal failure */ 1569 1569 } 1570 1570 … … 1604 1604 { 1605 1605 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1606 return (INVALID_HANDLE_ERROR); /* signal failure */1606 return WAIT_FAILED; /* signal failure */ 1607 1607 } 1608 1608 … … 1639 1639 { 1640 1640 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1641 return (INVALID_HANDLE_ERROR); /* signal failure */1641 return FALSE; /* signal failure */ 1642 1642 } 1643 1643 … … 1675 1675 { 1676 1676 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1677 return (INVALID_HANDLE_ERROR); /* signal failure */1677 return FALSE; /* signal failure */ 1678 1678 } 1679 1679 … … 1711 1711 { 1712 1712 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1713 return (INVALID_HANDLE_ERROR); /* signal failure */1713 return FALSE; /* signal failure */ 1714 1714 } 1715 1715 … … 1744 1744 { 1745 1745 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1746 return (INVALID_HANDLE_ERROR); /* signal failure */1746 return FALSE; /* signal failure */ 1747 1747 } 1748 1748 … … 1777 1777 { 1778 1778 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1779 return (INVALID_HANDLE_ERROR); /* signal failure */1779 return FALSE; /* signal failure */ 1780 1780 } 1781 1781 … … 1810 1810 { 1811 1811 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 1812 return (INVALID_HANDLE_ERROR); /* signal failure */1812 return FALSE; /* signal failure */ 1813 1813 } 1814 1814 … … 1850 1850 { 1851 1851 SetLastError(ERROR_NOT_ENOUGH_MEMORY); /* use this as error message */ 1852 return (INVALID_HANDLE_VALUE); /* signal error */1852 return 0; /* signal error */ 1853 1853 } 1854 1854 … … 1881 1881 TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE; 1882 1882 SetLastError(rc); /* Hehe, OS/2 and NT are pretty compatible :) */ 1883 return (INVALID_HANDLE_VALUE); /* signal error */1883 return 0; /* signal error */ 1884 1884 } 1885 1885 else … … 1919 1919 { 1920 1920 SetLastError(ERROR_NOT_ENOUGH_MEMORY); /* use this as error message */ 1921 return (INVALID_HANDLE_VALUE); /* signal error */1921 return 0; /* signal error */ 1922 1922 } 1923 1923 … … 1949 1949 TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE; 1950 1950 SetLastError(rc); /* Hehe, OS/2 and NT are pretty compatible :) */ 1951 return (INVALID_HANDLE_VALUE); /* signal error */1951 return 0; /* signal error */ 1952 1952 } 1953 1953 else … … 1987 1987 { 1988 1988 SetLastError(ERROR_NOT_ENOUGH_MEMORY); /* use this as error message */ 1989 return (INVALID_HANDLE_VALUE); /* signal error */1989 return 0; /* signal error */ 1990 1990 } 1991 1991 … … 2016 2016 TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE; 2017 2017 SetLastError(rc); /* Hehe, OS/2 and NT are pretty compatible :) */ 2018 return (INVALID_HANDLE_VALUE); /* signal error */2018 return 0; /* signal error */ 2019 2019 } 2020 2020 else … … 2054 2054 { 2055 2055 SetLastError(ERROR_NOT_ENOUGH_MEMORY); /* use this as error message */ 2056 return (INVALID_HANDLE_VALUE); /* signal error */2056 return 0; /* signal error */ 2057 2057 } 2058 2058 … … 2083 2083 TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE; 2084 2084 SetLastError(rc); /* Hehe, OS/2 and NT are pretty compatible :) */ 2085 return (INVALID_HANDLE_VALUE); /* signal error */2085 return 0; /* signal error */ 2086 2086 } 2087 2087 else … … 2116 2116 2117 2117 2118 pDeviceHandler = HMGlobals.pHM Event; /* device is predefined */2118 pDeviceHandler = HMGlobals.pHMSemaphore; /* device is predefined */ 2119 2119 2120 2120 iIndexNew = _HMHandleGetFree(); /* get free handle */ … … 2122 2122 { 2123 2123 SetLastError(ERROR_NOT_ENOUGH_MEMORY); /* use this as error message */ 2124 return (INVALID_HANDLE_VALUE); /* signal error */2124 return 0; /* signal error */ 2125 2125 } 2126 2126 … … 2153 2153 TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE; 2154 2154 SetLastError(rc); /* Hehe, OS/2 and NT are pretty compatible :) */ 2155 return (INVALID_HANDLE_VALUE); /* signal error*/2155 return 0; /* signal failure */ 2156 2156 } 2157 2157 else … … 2185 2185 2186 2186 2187 pDeviceHandler = HMGlobals.pHM Mutex; /* device is predefined */2187 pDeviceHandler = HMGlobals.pHMSemaphore; /* device is predefined */ 2188 2188 2189 2189 iIndexNew = _HMHandleGetFree(); /* get free handle */ … … 2191 2191 { 2192 2192 SetLastError(ERROR_NOT_ENOUGH_MEMORY); /* use this as error message */ 2193 return (INVALID_HANDLE_VALUE); /* signal error */2193 return 0; /* signal error */ 2194 2194 } 2195 2195 … … 2220 2220 TabWin32Handles[iIndexNew].hmHandleData.hHMHandle = INVALID_HANDLE_VALUE; 2221 2221 SetLastError(rc); /* Hehe, OS/2 and NT are pretty compatible :) */ 2222 return (INVALID_HANDLE_VALUE); /* signal error*/2222 return 0; /* signal failure */ 2223 2223 } 2224 2224 else … … 2254 2254 { 2255 2255 SetLastError(ERROR_INVALID_HANDLE); /* set win32 error information */ 2256 return (INVALID_HANDLE_ERROR); /* signal failure */2256 return 0; /* signal failure */ 2257 2257 } 2258 2258 else … … 2300 2300 { 2301 2301 SetLastError(ERROR_NOT_ENOUGH_MEMORY); /* use this as error message */ 2302 return (INVALID_HANDLE_VALUE); /* signal error */2302 return 0; /* signal error */ 2303 2303 } 2304 2304 -
trunk/src/kernel32/KERNEL32.CPP
r1490 r1628 1 /* $Id: KERNEL32.CPP,v 1.2 6 1999-10-28 12:01:11sandervl Exp $ */1 /* $Id: KERNEL32.CPP,v 1.27 1999-11-08 13:43:12 sandervl Exp $ */ 2 2 3 3 /* … … 470 470 VOID WIN32API Sleep(DWORD arg1) 471 471 { 472 dprintf(("KERNEL32: Sleep %d\n", arg1));472 // dprintf(("KERNEL32: Sleep %d\n", arg1)); 473 473 O32_Sleep(arg1); 474 474 } -
trunk/src/kernel32/directory.cpp
r1490 r1628 1 /* $Id: directory.cpp,v 1. 8 1999-10-28 12:01:12 sandervl Exp $ */1 /* $Id: directory.cpp,v 1.9 1999-11-08 13:43:12 sandervl Exp $ */ 2 2 3 3 /* … … 6 6 * Copyright 1998 Sander van Leeuwen 7 7 * 8 * Parts based on Wine code (991031) (files\directory.c) 9 * 10 * DOS directories functions 11 * 12 * Copyright 1995 Alexandre Julliard 8 13 * 9 14 * Project Odin Software License can be found in LICENSE.TXT … … 24 29 #include <options.h> 25 30 #include "initterm.h" 31 #include <win\file.h> 32 #include <string.h> 33 #include "oslibdos.h" 26 34 27 35 ODINDEBUGCHANNEL(KERNEL32-DIRECTORY) 28 36 37 38 static char DIR_Windows[MAX_PATHNAME_LEN]; 39 static char DIR_System[MAX_PATHNAME_LEN]; 40 41 //****************************************************************************** 42 //****************************************************************************** 43 void InitDirectories() 44 { 45 GetWindowsDirectoryA((LPSTR)&DIR_Windows, sizeof(DIR_Windows)); 46 GetSystemDirectoryA((LPSTR)&DIR_System, sizeof(DIR_System)); 47 } 29 48 30 49 /***************************************************************************** … … 130 149 PSECURITY_ATTRIBUTES,arg2) 131 150 { 151 dprintf(("CreateDirectory %s", arg1)); 132 152 return O32_CreateDirectory(arg1, arg2); 133 153 } … … 342 362 } 343 363 364 /*********************************************************************** 365 * DIR_TryModulePath 366 * 367 * Helper function for DIR_SearchPath. 368 */ 369 static BOOL DIR_TryModulePath( LPCSTR name, char *full_name ) 370 { 371 char buffer[OFS_MAXPATHNAME]; 372 LPSTR p; 373 374 if (!GetModuleFileNameA( 0, buffer, sizeof(buffer) )) 375 buffer[0]='\0'; 376 377 if (!(p = strrchr( buffer, '\\' ))) return FALSE; 378 if (sizeof(buffer) - (++p - buffer) <= strlen(name)) return FALSE; 379 strcpy( p, name ); 380 381 return OSLibDosSearchPath(OSLIB_SEARCHFILE, NULL, buffer, full_name, MAX_PATHNAME_LEN); 382 } 383 384 385 /*********************************************************************** 386 * DIR_SearchPath 387 * 388 * Implementation of SearchPath32A. 'win32' specifies whether the search 389 * order is Win16 (module path last) or Win32 (module path first). 390 * 391 * FIXME: should return long path names. 392 */ 393 DWORD DIR_SearchPath( LPCSTR path, LPCSTR name, LPCSTR ext, 394 char *full_name ) 395 { 396 DWORD len; 397 LPCSTR p; 398 LPSTR tmp = NULL; 399 BOOL ret = TRUE; 400 401 /* First check the supplied parameters */ 402 403 p = strrchr( name, '.' ); 404 if (p && !strchr( p, '/' ) && !strchr( p, '\\' )) 405 ext = NULL; /* Ignore the specified extension */ 406 if ((*name && (name[1] == ':')) || 407 strchr( name, '/' ) || strchr( name, '\\' )) 408 path = NULL; /* Ignore path if name already contains a path */ 409 if (path && !*path) path = NULL; /* Ignore empty path */ 410 411 len = strlen(name); 412 if (ext) len += strlen(ext); 413 if (path) len += strlen(path) + 1; 414 415 /* Allocate a buffer for the file name and extension */ 416 417 if (path || ext) 418 { 419 if (!(tmp = (LPSTR)HeapAlloc( GetProcessHeap(), 0, len + 1 ))) 420 { 421 SetLastError( ERROR_OUTOFMEMORY ); 422 return 0; 423 } 424 if (path) 425 { 426 strcpy( tmp, path ); 427 strcat( tmp, "\\" ); 428 strcat( tmp, name ); 429 } 430 else strcpy( tmp, name ); 431 if (ext) strcat( tmp, ext ); 432 name = tmp; 433 } 434 435 /* If we have an explicit path, everything's easy */ 436 437 if (path || (*name && (name[1] == ':')) || 438 strchr( name, '/' ) || strchr( name, '\\' )) 439 { 440 ret = OSLibDosSearchPath(OSLIB_SEARCHFILE, NULL, (LPSTR)name, full_name, MAX_PATHNAME_LEN); 441 goto done; 442 } 443 444 /* Try the path of the current executable (for Win32 search order) */ 445 if (DIR_TryModulePath( name, full_name )) goto done; 446 447 /* Try the current directory */ 448 if (OSLibDosSearchPath(OSLIB_SEARCHCURDIR, NULL, (LPSTR)name, full_name, MAX_PATHNAME_LEN)) 449 goto done; 450 451 /* Try the Windows system directory */ 452 if (OSLibDosSearchPath(OSLIB_SEARCHDIR, (LPSTR)&DIR_System, (LPSTR)name, full_name, MAX_PATHNAME_LEN)) 453 goto done; 454 455 /* Try the Windows directory */ 456 if (OSLibDosSearchPath(OSLIB_SEARCHDIR, (LPSTR)&DIR_Windows, (LPSTR)name, full_name, MAX_PATHNAME_LEN)) 457 goto done; 458 459 /* Try all directories in path */ 460 ret = OSLibDosSearchPath(OSLIB_SEARCHENV, "PATH", (LPSTR)name, full_name, MAX_PATHNAME_LEN); 461 462 done: 463 if (tmp) HeapFree( GetProcessHeap(), 0, tmp ); 464 return ret; 465 } 466 467 468 /*********************************************************************** 469 * SearchPath32A [KERNEL32.447] 470 * 471 * Searches for a specified file in the search path. 472 * 473 * PARAMS 474 * path [I] Path to search 475 * name [I] Filename to search for. 476 * ext [I] File extension to append to file name. The first 477 * character must be a period. This parameter is 478 * specified only if the filename given does not 479 * contain an extension. 480 * buflen [I] size of buffer, in characters 481 * buffer [O] buffer for found filename 482 * lastpart [O] address of pointer to last used character in 483 * buffer (the final '\') 484 * 485 * RETURNS 486 * Success: length of string copied into buffer, not including 487 * terminating null character. If the filename found is 488 * longer than the length of the buffer, the length of the 489 * filename is returned. 490 * Failure: Zero 491 * 492 * NOTES 493 * Should call SetLastError(but currently doesn't). 494 */ 495 DWORD WINAPI SearchPathA(LPCSTR path, LPCSTR name, LPCSTR ext, DWORD buflen, 496 LPSTR buffer, LPSTR *lastpart ) 497 { 498 char full_name[MAX_PATHNAME_LEN]; 499 500 if (!DIR_SearchPath( path, name, ext, (LPSTR)full_name )) return 0; 501 lstrcpynA( buffer, (LPSTR)full_name, buflen-1); 502 buffer[buflen-2] = 0; 503 SetLastError(0); 504 return strlen(buffer); 505 } 506 507 508 /*********************************************************************** 509 * SearchPath32W (KERNEL32.448) 510 */ 511 DWORD WINAPI SearchPathW(LPCWSTR path, LPCWSTR name, LPCWSTR ext, 512 DWORD buflen, LPWSTR buffer, LPWSTR *lastpart ) 513 { 514 char full_name[MAX_PATHNAME_LEN]; 515 516 LPSTR pathA = HEAP_strdupWtoA( GetProcessHeap(), 0, path ); 517 LPSTR nameA = HEAP_strdupWtoA( GetProcessHeap(), 0, name ); 518 LPSTR extA = HEAP_strdupWtoA( GetProcessHeap(), 0, ext ); 519 DWORD ret = DIR_SearchPath( pathA, nameA, extA, (LPSTR)full_name ); 520 HeapFree( GetProcessHeap(), 0, extA ); 521 HeapFree( GetProcessHeap(), 0, nameA ); 522 HeapFree( GetProcessHeap(), 0, pathA ); 523 if (!ret) return 0; 524 525 lstrcpynAtoW( buffer, full_name, buflen-1 ); 526 buffer[buflen-2] = 0; 527 SetLastError(0); 528 return strlen(full_name); 529 } -
trunk/src/kernel32/initterm.cpp
r1539 r1628 1 /* $Id: initterm.cpp,v 1.2 0 1999-11-01 19:03:03sandervl Exp $ */1 /* $Id: initterm.cpp,v 1.21 1999-11-08 13:43:12 sandervl Exp $ */ 2 2 3 3 /* … … 43 43 #include <heapshared.h> 44 44 #include "mmap.h" 45 #include "fileio.h" 45 46 46 47 /*-------------------------------------------------------------------*/ … … 131 132 HMInitialize(); /* store standard handles within HandleManager */ 132 133 PROFILE_LoadOdinIni(); 134 InitDirectories(); 133 135 break; 134 136 } -
trunk/src/kernel32/makefile
r1492 r1628 1 # $Id: makefile,v 1.5 1 1999-10-28 15:22:09sandervl Exp $1 # $Id: makefile,v 1.52 1999-11-08 13:43:12 sandervl Exp $ 2 2 3 3 # … … 97 97 directory.obj: directory.cpp \ 98 98 $(PDWIN32_INCLUDE)\unicode.h \ 99 initterm.h 99 initterm.h directory.h oslibdos.h 100 100 101 101 disk.obj: disk.cpp \ … … 111 111 112 112 fileio.obj: fileio.cpp \ 113 $(PDWIN32_INCLUDE)\unicode.h 113 $(PDWIN32_INCLUDE)\unicode.h 114 114 115 115 thread.OBJ: \ … … 135 135 os2heap.h 136 136 137 initterm.OBJ: .\initterm.cpp initterm.h $(PDWIN32_INCLUDE)\heapshared.h mmap.h 137 initterm.OBJ: .\initterm.cpp initterm.h $(PDWIN32_INCLUDE)\heapshared.h mmap.h directory.h 138 138 139 139 thunk.OBJ: \ -
trunk/src/kernel32/oslibdos.cpp
r1432 r1628 1 /* $Id: oslibdos.cpp,v 1. 5 1999-10-24 22:51:22 sandervl Exp $ */1 /* $Id: oslibdos.cpp,v 1.6 1999-11-08 13:43:12 sandervl Exp $ */ 2 2 3 3 /* … … 263 263 return TRUE; 264 264 } 265 //****************************************************************************** 266 //****************************************************************************** 267 268 #define OSLIB_SEARCHDIR 1 269 #define OSLIB_SEARCHCURDIR 2 270 #define OSLIB_SEARCHFILE 3 271 #define OSLIB_SEARCHENV 4 272 273 DWORD OSLibDosSearchPath(DWORD cmd, char *path, char *name, char *full_name, 274 DWORD length_fullname) 275 { 276 switch(cmd) { 277 case OSLIB_SEARCHDIR: 278 if(DosSearchPath(SEARCH_IGNORENETERRS, path, 279 name, full_name, length_fullname) != 0) { 280 return 0; 281 } 282 return strlen(full_name); 283 284 285 case OSLIB_SEARCHCURDIR: 286 if(DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_CUR_DIRECTORY, path, 287 name, full_name, length_fullname) != 0) { 288 return 0; 289 } 290 return strlen(full_name); 291 292 case OSLIB_SEARCHFILE: 293 { 294 FILESTATUS3 fileinfo; 295 296 if(DosQueryPathInfo(name, FIL_STANDARD, &fileinfo, sizeof(fileinfo)) != 0) { 297 return 0; 298 } 299 strncpy(full_name, name, length_fullname); 300 return strlen(full_name); 301 } 302 303 case OSLIB_SEARCHENV: 304 { 305 char *env = getenv(path); 306 if(env == NULL) 307 return 0; 308 309 while(*env != '=') env++; 310 env++; 311 while(*env == ' ') env++; 312 if(DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT, env, 313 name, full_name, length_fullname) != 0) { 314 return 0; 315 } 316 return strlen(full_name); 317 } 318 } 319 return 0; 320 } 321 //****************************************************************************** 322 //****************************************************************************** -
trunk/src/kernel32/oslibdos.h
r1432 r1628 1 /* $Id: oslibdos.h,v 1. 5 1999-10-24 22:51:22 sandervl Exp $ */1 /* $Id: oslibdos.h,v 1.6 1999-11-08 13:43:12 sandervl Exp $ */ 2 2 3 3 /* … … 22 22 DWORD OSLibDosGetNamedSharedMem(LPVOID *lplpMemAddr, LPSTR name); 23 23 24 BOOL OSLibDosGetFileAttributesEx( PSZpszName, ULONG ulDummy, PVOID pBuffer);24 BOOL OSLibDosGetFileAttributesEx(LPSTR pszName, ULONG ulDummy, PVOID pBuffer); 25 25 26 26 #define OSLIB_NOERROR 0 … … 73 73 DWORD OSLibDosSetFilePtr(DWORD hFile, DWORD offset, DWORD method); 74 74 75 #define OSLIB_SEARCHDIR 1 76 #define OSLIB_SEARCHCURDIR 2 77 #define OSLIB_SEARCHFILE 3 78 #define OSLIB_SEARCHENV 4 79 80 DWORD OSLibDosSearchPath(DWORD cmd, char *path, char *name, char *full_name, DWORD length_fullname); 81 75 82 #endif -
trunk/src/kernel32/thread.cpp
r1310 r1628 1 /* $Id: thread.cpp,v 1.1 6 1999-10-15 11:36:13 phallerExp $ */1 /* $Id: thread.cpp,v 1.17 1999-11-08 13:43:13 sandervl Exp $ */ 2 2 3 3 /* … … 214 214 thdb->entry_arg = (void *)userdata; 215 215 216 //Note: The Win32 exception structure referenced by FS:[0] is the same 217 // in OS/2 218 OS2SetExceptionHandler((void *)&exceptFrame); 219 216 220 SetWin32TIB(); 217 221 WinExe->tlsAttachThread(); //setup TLS structure of main exe … … 219 223 Win32DllBase::attachThreadToAllDlls(); //send DLL_THREAD_ATTACH message to all dlls 220 224 221 //Note: The Win32 exception structure references by FS:[0] is the same222 // in OS/2223 OS2SetExceptionHandler((void *)&exceptFrame);224 225 rc = winthread(userdata); 225 OS2UnsetExceptionHandler((void *)&exceptFrame);226 226 227 227 Win32DllBase::detachThreadFromAllDlls(); //send DLL_THREAD_DETACH message to all dlls … … 229 229 WinExe->tlsDetachThread(); //destroy TLS structure of main exe 230 230 DestroyTIB(); 231 OS2UnsetExceptionHandler((void *)&exceptFrame); 232 231 233 return rc; 232 234 }
Note:
See TracChangeset
for help on using the changeset viewer.