Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
51b4a429
Commit
51b4a429
authored
Jun 23, 2017
by
Pierre Schweitzer
Committed by
Alexandre Julliard
Jun 23, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mpr: Properly handle the count set to -1 when enumerating connections.
Signed-off-by:
Pierre Schweitzer
<
pierre@reactos.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a76ce84f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
wnet.c
dlls/mpr/wnet.c
+10
-5
No files found.
dlls/mpr/wnet.c
View file @
51b4a429
...
...
@@ -1266,7 +1266,7 @@ static DWORD _copyStringToEnumW(const WCHAR *source, DWORD* left, void** end)
static
DWORD
_enumerateConnectedW
(
PWNetEnumerator
enumerator
,
DWORD
*
user_count
,
void
*
user_buffer
,
DWORD
*
user_size
)
{
DWORD
ret
,
index
,
count
,
size
,
i
,
left
;
DWORD
ret
,
index
,
count
,
total_count
,
size
,
i
,
left
;
void
*
end
;
NETRESOURCEW
*
curr
,
*
buffer
;
HANDLE
*
handles
;
...
...
@@ -1290,6 +1290,7 @@ static DWORD _enumerateConnectedW(PWNetEnumerator enumerator, DWORD* user_count,
curr
=
user_buffer
;
end
=
(
char
*
)
user_buffer
+
size
;
count
=
*
user_count
;
total_count
=
0
;
ret
=
WN_NO_MORE_ENTRIES
;
for
(
index
=
0
;
index
<
providerTable
->
numProviders
;
index
++
)
...
...
@@ -1309,6 +1310,7 @@ static DWORD _enumerateConnectedW(PWNetEnumerator enumerator, DWORD* user_count,
ret
=
providerTable
->
table
[
index
].
enumResource
(
handles
[
index
],
&
count
,
buffer
,
&
size
);
total_count
+=
count
;
if
(
ret
==
WN_MORE_DATA
)
break
;
...
...
@@ -1343,19 +1345,22 @@ static DWORD _enumerateConnectedW(PWNetEnumerator enumerator, DWORD* user_count,
++
curr
;
}
count
=
*
user_count
-
count
;
if
(
*
user_count
!=
-
1
)
count
=
*
user_count
-
total_count
;
else
count
=
*
user_count
;
size
=
left
;
}
if
(
ret
!=
WN_SUCCESS
||
count
==
0
)
if
(
ret
!=
WN_SUCCESS
||
total_
count
==
0
)
break
;
}
}
if
(
count
==
0
)
if
(
total_
count
==
0
)
ret
=
WN_NO_MORE_ENTRIES
;
*
user_count
=
*
user_count
-
count
;
*
user_count
=
total_
count
;
if
(
ret
!=
WN_MORE_DATA
&&
ret
!=
WN_NO_MORE_ENTRIES
)
ret
=
WN_SUCCESS
;
...
...
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