Changeset 4473 for trunk/src/kernel32
- Timestamp:
- Oct 10, 2000, 12:51:19 AM (25 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/directory.cpp
r4445 r4473 1 /* $Id: directory.cpp,v 1.3 1 2000-10-06 15:16:03sandervl Exp $ */1 /* $Id: directory.cpp,v 1.32 2000-10-09 22:51:17 sandervl Exp $ */ 2 2 3 3 /* … … 103 103 * Variables : 104 104 * Result : 105 * Remark : 105 * Remark : returned length is number of characters required or used for current dir 106 * *excluding* terminator 106 107 * Status : 107 108 * … … 114 115 UINT rc; 115 116 116 rc = O 32_GetCurrentDirectory(nBufferLength, lpBuffer);117 if(rc ) {118 dprintf(("CurrentDirectory = %s", lpBuffer));117 rc = OSLibDosQueryDir(nBufferLength, lpBuffer); 118 if(rc && rc < nBufferLength) { 119 dprintf(("CurrentDirectory = %s (%d)", lpBuffer, rc)); 119 120 } 121 else dprintf(("CurrentDirectory returned %d", rc)); 120 122 return rc; 121 123 } -
trunk/src/kernel32/oslibdos.cpp
r4372 r4473 1 /* $Id: oslibdos.cpp,v 1.4 7 2000-10-02 13:38:56sandervl Exp $ */1 /* $Id: oslibdos.cpp,v 1.48 2000-10-09 22:51:18 sandervl Exp $ */ 2 2 /* 3 3 * Wrappers for OS/2 Dos* API … … 2041 2041 return rc; 2042 2042 } 2043 //****************************************************************************** 2044 //returned length is number of characters required or used for current dir 2045 //*excluding* terminator 2046 //****************************************************************************** 2047 ULONG OSLibDosQueryDir(DWORD length, LPSTR lpszCurDir) 2048 { 2049 ULONG drivemap, currentdisk, len; 2050 char *lpszCurDriveAndDir = lpszCurDir +3; 2051 APIRET rc; 2052 2053 len = (length > 3) ? length - 3 : 0; 2054 2055 rc = DosQueryCurrentDir(0, lpszCurDriveAndDir, &len); 2056 if(rc != ERROR_BUFFER_OVERFLOW) 2057 { 2058 if(rc) 2059 { 2060 SetLastError(error2WinError(rc,ERROR_INVALID_PARAMETER)); 2061 return 0; 2062 } 2063 len = strlen(lpszCurDriveAndDir) + 3; 2064 2065 // Dir returned by DosQueryCurDir doesn't include drive, so add it 2066 DosQueryCurrentDisk(¤tdisk, &drivemap); 2067 2068 if(isupper(lpszCurDir[3])) { 2069 lpszCurDir[0] = (char)('A' - 1 + currentdisk); 2070 } 2071 else lpszCurDir[0] = (char)('a' - 1 + currentdisk); 2072 2073 lpszCurDir[1] = ':'; 2074 lpszCurDir[2] = '\\'; 2075 } 2076 else len += 3; // + 3 since DosQueryCurDir doesn't include drive 2077 return len; 2078 } 2079 //****************************************************************************** 2080 //****************************************************************************** -
trunk/src/kernel32/oslibdos.h
r4319 r4473 1 /* $Id: oslibdos.h,v 1.2 4 2000-09-25 04:35:00 phallerExp $ */1 /* $Id: oslibdos.h,v 1.25 2000-10-09 22:51:19 sandervl Exp $ */ 2 2 3 3 /* … … 284 284 285 285 ULONG OSLibDosQueryModuleName(ULONG hModule, int cchName, char *pszName); 286 ULONG OSLibDosQueryDir(DWORD length, LPSTR lpszCurDir);
Note:
See TracChangeset
for help on using the changeset viewer.