Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
574eace3
Commit
574eace3
authored
Jan 08, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Return a correct name also for file objects in NtQueryObject.
parent
658dae98
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
1 deletion
+43
-1
file.c
dlls/ntdll/file.c
+1
-1
ntdll_misc.h
dlls/ntdll/ntdll_misc.h
+1
-0
om.c
dlls/ntdll/om.c
+28
-0
om.c
dlls/ntdll/tests/om.c
+13
-0
No files found.
dlls/ntdll/file.c
View file @
574eace3
...
...
@@ -1633,7 +1633,7 @@ NTSTATUS fill_stat_info( const struct stat *st, void *ptr, FILE_INFORMATION_CLAS
return
STATUS_SUCCESS
;
}
static
NTSTATUS
server_get_unix_name
(
HANDLE
handle
,
ANSI_STRING
*
unix_name
)
NTSTATUS
server_get_unix_name
(
HANDLE
handle
,
ANSI_STRING
*
unix_name
)
{
data_size_t
size
=
1024
;
NTSTATUS
ret
;
...
...
dlls/ntdll/ntdll_misc.h
View file @
574eace3
...
...
@@ -142,6 +142,7 @@ extern NTSTATUS TAPE_DeviceIoControl(HANDLE hDevice,
struct
stat
;
extern
NTSTATUS
FILE_GetNtStatus
(
void
);
extern
NTSTATUS
fill_stat_info
(
const
struct
stat
*
st
,
void
*
ptr
,
FILE_INFORMATION_CLASS
class
);
extern
NTSTATUS
server_get_unix_name
(
HANDLE
handle
,
ANSI_STRING
*
unix_name
);
extern
void
DIR_init_windows_dir
(
const
WCHAR
*
windir
,
const
WCHAR
*
sysdir
);
extern
BOOL
DIR_is_hidden_file
(
const
UNICODE_STRING
*
name
);
extern
NTSTATUS
DIR_unmount_device
(
HANDLE
handle
);
...
...
dlls/ntdll/om.c
View file @
574eace3
...
...
@@ -88,6 +88,34 @@ NTSTATUS WINAPI NtQueryObject(IN HANDLE handle,
case
ObjectNameInformation
:
{
OBJECT_NAME_INFORMATION
*
p
=
ptr
;
ANSI_STRING
unix_name
;
/* first try as a file object */
if
(
!
(
status
=
server_get_unix_name
(
handle
,
&
unix_name
)))
{
UNICODE_STRING
nt_name
;
NTSTATUS
status
;
if
(
!
(
status
=
wine_unix_to_nt_file_name
(
&
unix_name
,
&
nt_name
)))
{
if
(
sizeof
(
*
p
)
+
nt_name
.
MaximumLength
<=
len
)
{
p
->
Name
.
Buffer
=
(
WCHAR
*
)(
p
+
1
);
p
->
Name
.
Length
=
nt_name
.
Length
;
p
->
Name
.
MaximumLength
=
nt_name
.
MaximumLength
;
memcpy
(
p
->
Name
.
Buffer
,
nt_name
.
Buffer
,
nt_name
.
MaximumLength
);
}
else
status
=
STATUS_INFO_LENGTH_MISMATCH
;
if
(
used_len
)
*
used_len
=
sizeof
(
*
p
)
+
nt_name
.
MaximumLength
;
RtlFreeUnicodeString
(
&
nt_name
);
}
RtlFreeAnsiString
(
&
unix_name
);
break
;
}
else
if
(
status
!=
STATUS_OBJECT_TYPE_MISMATCH
)
break
;
/* not a file, treat as a generic object */
SERVER_START_REQ
(
get_object_info
)
{
...
...
dlls/ntdll/tests/om.c
View file @
574eace3
...
...
@@ -627,6 +627,7 @@ static void test_query_object(void)
NTSTATUS
status
;
ULONG
len
;
UNICODE_STRING
*
str
;
char
dir
[
MAX_PATH
];
handle
=
CreateEventA
(
NULL
,
FALSE
,
FALSE
,
"test_event"
);
...
...
@@ -667,6 +668,18 @@ static void test_query_object(void)
ok
(
str
->
Length
==
0
,
"unexpected len %u
\n
"
,
len
);
ok
(
str
->
Buffer
==
NULL
,
"unexpected ptr %p
\n
"
,
str
->
Buffer
);
pNtClose
(
handle
);
GetWindowsDirectoryA
(
dir
,
MAX_PATH
);
handle
=
CreateFileA
(
dir
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
OPEN_EXISTING
,
FILE_FLAG_BACKUP_SEMANTICS
,
0
);
len
=
0
;
status
=
pNtQueryObject
(
handle
,
ObjectNameInformation
,
buffer
,
sizeof
(
buffer
),
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"NtQueryObject failed %x
\n
"
,
status
);
ok
(
len
>
sizeof
(
UNICODE_STRING
),
"unexpected len %u
\n
"
,
len
);
str
=
(
UNICODE_STRING
*
)
buffer
;
ok
(
sizeof
(
UNICODE_STRING
)
+
str
->
Length
+
sizeof
(
WCHAR
)
==
len
,
"unexpected len %u
\n
"
,
len
);
trace
(
"got %s len %u
\n
"
,
wine_dbgstr_w
(
str
->
Buffer
),
len
);
pNtClose
(
handle
);
}
START_TEST
(
om
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment