mirror of
https://github.com/reactos/wine.git
synced 2025-02-06 20:19:06 +00:00
Check for non-existent directory in INT21_SetCurrentDirectory to
return a proper error when the directory is not on the current drive.
This commit is contained in:
parent
1d9672ec61
commit
225c6d2cee
@ -790,6 +790,7 @@ static BOOL INT21_SetCurrentDirectory( CONTEXT86 *context )
|
||||
{
|
||||
WCHAR dirW[MAX_PATH];
|
||||
WCHAR env_var[4];
|
||||
DWORD attr;
|
||||
char *dirA = CTX_SEG_OFF_TO_LIN(context, context->SegDs, context->Edx);
|
||||
BYTE drive = INT21_GetCurrentDrive();
|
||||
BOOL result;
|
||||
@ -799,6 +800,13 @@ static BOOL INT21_SetCurrentDirectory( CONTEXT86 *context )
|
||||
MultiByteToWideChar(CP_OEMCP, 0, dirA, -1, dirW, MAX_PATH);
|
||||
if (!GetFullPathNameW( dirW, MAX_PATH, dirW, NULL )) return FALSE;
|
||||
|
||||
attr = GetFileAttributesW( dirW );
|
||||
if (attr == INVALID_FILE_ATTRIBUTES || !(attr & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
SetLastError( ERROR_PATH_NOT_FOUND );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
env_var[0] = '=';
|
||||
env_var[1] = dirW[0];
|
||||
env_var[2] = ':';
|
||||
|
Loading…
x
Reference in New Issue
Block a user