ntdll: Return STATUS_OBJECT_NAME_INVALID in wine_nt_to_unix_file_name for prefix-only paths.
Signed-off-by: Michael Müller <michael@fds-team.de> Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
This commit is contained in:
parent
24ea49b6ab
commit
00d966cd3a
|
@ -4661,7 +4661,7 @@ static void test_GetFileAttributesExW(void)
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = GetFileAttributesExW(path1, GetFileExInfoStandard, &info);
|
ret = GetFileAttributesExW(path1, GetFileExInfoStandard, &info);
|
||||||
ok(!ret, "GetFileAttributesExW succeeded\n");
|
ok(!ret, "GetFileAttributesExW succeeded\n");
|
||||||
todo_wine ok(GetLastError() == ERROR_INVALID_NAME, "Expected error ERROR_INVALID_NAME, got %u\n", GetLastError());
|
ok(GetLastError() == ERROR_INVALID_NAME, "Expected error ERROR_INVALID_NAME, got %u\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
ret = GetFileAttributesExW(path2, GetFileExInfoStandard, &info);
|
ret = GetFileAttributesExW(path2, GetFileExInfoStandard, &info);
|
||||||
|
|
|
@ -2762,11 +2762,11 @@ static inline int get_dos_prefix_len( const UNICODE_STRING *name )
|
||||||
static const WCHAR nt_prefixW[] = {'\\','?','?','\\'};
|
static const WCHAR nt_prefixW[] = {'\\','?','?','\\'};
|
||||||
static const WCHAR dosdev_prefixW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\'};
|
static const WCHAR dosdev_prefixW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\'};
|
||||||
|
|
||||||
if (name->Length > sizeof(nt_prefixW) &&
|
if (name->Length >= sizeof(nt_prefixW) &&
|
||||||
!memcmp( name->Buffer, nt_prefixW, sizeof(nt_prefixW) ))
|
!memcmp( name->Buffer, nt_prefixW, sizeof(nt_prefixW) ))
|
||||||
return sizeof(nt_prefixW) / sizeof(WCHAR);
|
return sizeof(nt_prefixW) / sizeof(WCHAR);
|
||||||
|
|
||||||
if (name->Length > sizeof(dosdev_prefixW) &&
|
if (name->Length >= sizeof(dosdev_prefixW) &&
|
||||||
!memicmpW( name->Buffer, dosdev_prefixW, sizeof(dosdev_prefixW)/sizeof(WCHAR) ))
|
!memicmpW( name->Buffer, dosdev_prefixW, sizeof(dosdev_prefixW)/sizeof(WCHAR) ))
|
||||||
return sizeof(dosdev_prefixW) / sizeof(WCHAR);
|
return sizeof(dosdev_prefixW) / sizeof(WCHAR);
|
||||||
|
|
||||||
|
@ -3132,6 +3132,8 @@ NTSTATUS CDECL wine_nt_to_unix_file_name( const UNICODE_STRING *nameW, ANSI_STRI
|
||||||
name += pos;
|
name += pos;
|
||||||
name_len -= pos;
|
name_len -= pos;
|
||||||
|
|
||||||
|
if (!name_len) return STATUS_OBJECT_NAME_INVALID;
|
||||||
|
|
||||||
/* check for sub-directory */
|
/* check for sub-directory */
|
||||||
for (pos = 0; pos < name_len; pos++)
|
for (pos = 0; pos < name_len; pos++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -318,8 +318,8 @@ static void create_file_test(void)
|
||||||
"open %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status );
|
"open %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status );
|
||||||
|
|
||||||
status = pNtQueryFullAttributesFile( &attr, &info );
|
status = pNtQueryFullAttributesFile( &attr, &info );
|
||||||
todo_wine ok( status == STATUS_OBJECT_NAME_INVALID,
|
ok( status == STATUS_OBJECT_NAME_INVALID,
|
||||||
"query %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status );
|
"query %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status );
|
||||||
|
|
||||||
pRtlInitUnicodeString( &nameW, pathInvalidDosW );
|
pRtlInitUnicodeString( &nameW, pathInvalidDosW );
|
||||||
status = pNtCreateFile( &dir, GENERIC_READ|SYNCHRONIZE, &attr, &io, NULL, 0,
|
status = pNtCreateFile( &dir, GENERIC_READ|SYNCHRONIZE, &attr, &io, NULL, 0,
|
||||||
|
@ -329,8 +329,8 @@ static void create_file_test(void)
|
||||||
"open %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status );
|
"open %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status );
|
||||||
|
|
||||||
status = pNtQueryFullAttributesFile( &attr, &info );
|
status = pNtQueryFullAttributesFile( &attr, &info );
|
||||||
todo_wine ok( status == STATUS_OBJECT_NAME_INVALID,
|
ok( status == STATUS_OBJECT_NAME_INVALID,
|
||||||
"query %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status );
|
"query %s failed %x\n", wine_dbgstr_w(nameW.Buffer), status );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void open_file_test(void)
|
static void open_file_test(void)
|
||||||
|
|
Loading…
Reference in New Issue