PRB: _getdcwd() Returns the Root Directory Under Win32s (98286)
The information in this article applies to:
- Microsoft Win32s 1.3c
- Microsoft Win32s 1.1
- Microsoft Win32s 1.2
- Microsoft Win32s 1.3
- Microsoft Win32s 1.30a
This article was previously published under Q98286 SYMPTOMS
In the following code segment, _getdcwd() always returns the root:
_getdcwd( 3, cBuf, MAX_PATH );
MessageBox( hWnd, cBuf, "Drive 3 <C drive>", MB_OK );
Also, in the following code segment, _chdrive() and _getcwd() always return
the root:
_chdrive( 3 );
_getcwd( cBuf, MAX_PATH );
MessageBox( hWnd, cbuf, "Drive 3 <C drive>", MB_OK );
CAUSE
When a Win32-based application starts on Win32s, the root is set as the
current directory for any drive except the default drive.
RESOLUTION
The following code fragments work as expected under Win32s:
_getdcwd( 0, cBuf, MAX_PATH );
MessageBox( hWnd, cBuf, "Drive 0 <default drive>", MB_OK );
-or-
GetCurrentDirectory( sizeof (cBuf), cBuf );
MessageBox( hWnd, cBuf, "SCD", MB_OK );
Modification Type: | Major | Last Reviewed: | 3/16/2004 |
---|
Keywords: | KB98286 |
---|
|