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
0c7dcd90
Commit
0c7dcd90
authored
Apr 12, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Return the required length from NtQueryDirectoryObject().
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
967ef0bf
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
10 deletions
+15
-10
om.c
dlls/ntdll/tests/om.c
+1
-1
sync.c
dlls/ntdll/unix/sync.c
+3
-3
server_protocol.h
include/wine/server_protocol.h
+2
-2
directory.c
server/directory.c
+4
-2
protocol.def
server/protocol.def
+1
-0
request.h
server/request.h
+2
-1
trace.c
server/trace.c
+2
-1
No files found.
dlls/ntdll/tests/om.c
View file @
0c7dcd90
...
...
@@ -2638,7 +2638,7 @@ static void test_query_directory(void)
memset
(
buffer
,
0xcc
,
sizeof
(
buffer
)
);
status
=
NtQueryDirectoryObject
(
dir
,
info
,
needed_size
-
1
,
TRUE
,
TRUE
,
&
context
,
&
size
);
ok
(
status
==
STATUS_BUFFER_TOO_SMALL
,
"got %#lx
\n
"
,
status
);
todo_wine
ok
(
size
==
needed_size
,
"expected size %lu, got %lu
\n
"
,
needed_size
,
size
);
ok
(
size
==
needed_size
,
"expected size %lu, got %lu
\n
"
,
needed_size
,
size
);
status
=
NtQueryDirectoryObject
(
dir
,
info
,
sizeof
(
buffer
),
TRUE
,
TRUE
,
&
context
,
NULL
);
ok
(
!
status
,
"got %#lx
\n
"
,
status
);
...
...
dlls/ntdll/unix/sync.c
View file @
0c7dcd90
...
...
@@ -1125,10 +1125,10 @@ NTSTATUS WINAPI NtQueryDirectoryObject( HANDLE handle, DIRECTORY_BASIC_INFORMATI
buffer
->
ObjectName
.
Buffer
[
buffer
->
ObjectName
.
Length
/
sizeof
(
WCHAR
)]
=
0
;
buffer
->
ObjectTypeName
.
Buffer
[
buffer
->
ObjectTypeName
.
Length
/
sizeof
(
WCHAR
)]
=
0
;
*
context
=
index
+
1
;
if
(
ret_size
)
*
ret_size
=
buffer
->
ObjectName
.
MaximumLength
+
buffer
->
ObjectTypeName
.
MaximumLength
+
sizeof
(
*
buffer
);
}
if
(
ret_size
&&
(
!
ret
||
ret
==
STATUS_BUFFER_TOO_SMALL
))
*
ret_size
=
sizeof
(
*
buffer
)
+
reply
->
total_len
+
2
*
sizeof
(
WCHAR
);
}
SERVER_END_REQ
;
}
...
...
include/wine/server_protocol.h
View file @
0c7dcd90
...
...
@@ -4646,10 +4646,10 @@ struct get_directory_entry_request
struct
get_directory_entry_reply
{
struct
reply_header
__header
;
data_size_t
total_len
;
data_size_t
name_len
;
/* VARARG(name,unicode_str,name_len); */
/* VARARG(type,unicode_str); */
char
__pad_12
[
4
];
};
...
...
@@ -6286,7 +6286,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 7
49
#define SERVER_PROTOCOL_VERSION 7
50
/* ### protocol_version end ### */
...
...
server/directory.c
View file @
0c7dcd90
...
...
@@ -546,9 +546,11 @@ DECL_HANDLER(get_directory_entry)
const
struct
unicode_str
*
type_name
=
&
obj
->
ops
->
type
->
name
;
const
WCHAR
*
name
=
get_object_name
(
obj
,
&
name_len
);
if
(
name_len
+
type_name
->
len
<=
get_reply_max_size
())
reply
->
total_len
=
name_len
+
type_name
->
len
;
if
(
reply
->
total_len
<=
get_reply_max_size
())
{
void
*
ptr
=
set_reply_data_size
(
name_len
+
type_name
->
len
);
void
*
ptr
=
set_reply_data_size
(
reply
->
total_
len
);
if
(
ptr
)
{
reply
->
name_len
=
name_len
;
...
...
server/protocol.def
View file @
0c7dcd90
...
...
@@ -3275,6 +3275,7 @@ struct handle_info
obj_handle_t handle; /* handle to the directory */
unsigned int index; /* entry index */
@REPLY
data_size_t total_len; /* total length needed for strings */
data_size_t name_len; /* length of the entry name in bytes */
VARARG(name,unicode_str,name_len); /* entry name */
VARARG(type,unicode_str); /* entry type */
...
...
server/request.h
View file @
0c7dcd90
...
...
@@ -2011,7 +2011,8 @@ C_ASSERT( sizeof(struct open_directory_reply) == 16 );
C_ASSERT
(
FIELD_OFFSET
(
struct
get_directory_entry_request
,
handle
)
==
12
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_directory_entry_request
,
index
)
==
16
);
C_ASSERT
(
sizeof
(
struct
get_directory_entry_request
)
==
24
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_directory_entry_reply
,
name_len
)
==
8
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_directory_entry_reply
,
total_len
)
==
8
);
C_ASSERT
(
FIELD_OFFSET
(
struct
get_directory_entry_reply
,
name_len
)
==
12
);
C_ASSERT
(
sizeof
(
struct
get_directory_entry_reply
)
==
16
);
C_ASSERT
(
FIELD_OFFSET
(
struct
create_symlink_request
,
access
)
==
12
);
C_ASSERT
(
sizeof
(
struct
create_symlink_request
)
==
16
);
...
...
server/trace.c
View file @
0c7dcd90
...
...
@@ -3978,7 +3978,8 @@ static void dump_get_directory_entry_request( const struct get_directory_entry_r
static
void
dump_get_directory_entry_reply
(
const
struct
get_directory_entry_reply
*
req
)
{
fprintf
(
stderr
,
" name_len=%u"
,
req
->
name_len
);
fprintf
(
stderr
,
" total_len=%u"
,
req
->
total_len
);
fprintf
(
stderr
,
", name_len=%u"
,
req
->
name_len
);
dump_varargs_unicode_str
(
", name="
,
min
(
cur_size
,
req
->
name_len
)
);
dump_varargs_unicode_str
(
", type="
,
cur_size
);
}
...
...
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