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
fe6c2516
Commit
fe6c2516
authored
Aug 12, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netapi32: Avoid process heap allocations.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d327527c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
49 deletions
+77
-49
netapi32.c
dlls/netapi32/netapi32.c
+24
-2
unixlib.c
dlls/netapi32/unixlib.c
+51
-45
unixlib.h
dlls/netapi32/unixlib.h
+2
-2
No files found.
dlls/netapi32/netapi32.c
View file @
fe6c2516
...
...
@@ -183,7 +183,18 @@ NET_API_STATUS WINAPI NetServerGetInfo(LMSTR servername, DWORD level, LPBYTE* bu
if
(
!
local
)
{
if
(
samba_init
())
return
samba_funcs
->
server_getinfo
(
servername
,
level
,
bufptr
);
if
(
samba_init
())
{
ULONG
size
=
1024
;
for
(;;)
{
if
(
!
(
*
bufptr
=
malloc
(
size
)))
return
ERROR_OUTOFMEMORY
;
ret
=
samba_funcs
->
server_getinfo
(
servername
,
level
,
*
bufptr
,
&
size
);
if
(
ret
)
free
(
*
bufptr
);
if
(
ret
!=
ERROR_INSUFFICIENT_BUFFER
)
return
ret
;
}
}
FIXME
(
"remote computers not supported
\n
"
);
return
ERROR_INVALID_LEVEL
;
}
...
...
@@ -964,7 +975,18 @@ NET_API_STATUS WINAPI NetWkstaGetInfo( LMSTR servername, DWORD level,
if
(
!
local
)
{
if
(
samba_init
())
return
samba_funcs
->
wksta_getinfo
(
servername
,
level
,
bufptr
);
if
(
samba_init
())
{
ULONG
size
=
1024
;
for
(;;)
{
if
(
!
(
*
bufptr
=
malloc
(
size
)))
return
ERROR_OUTOFMEMORY
;
ret
=
samba_funcs
->
wksta_getinfo
(
servername
,
level
,
*
bufptr
,
&
size
);
if
(
ret
)
free
(
*
bufptr
);
if
(
ret
!=
ERROR_INSUFFICIENT_BUFFER
)
return
ret
;
}
}
FIXME
(
"remote computers not supported
\n
"
);
return
ERROR_INVALID_LEVEL
;
}
...
...
dlls/netapi32/unixlib.c
View file @
fe6c2516
This diff is collapsed.
Click to expand it.
dlls/netapi32/unixlib.h
View file @
fe6c2516
...
...
@@ -20,10 +20,10 @@
struct
samba_funcs
{
NET_API_STATUS
(
WINAPI
*
server_getinfo
)(
const
WCHAR
*
server
,
DWORD
level
,
BYTE
**
buffer
);
NET_API_STATUS
(
WINAPI
*
server_getinfo
)(
const
WCHAR
*
server
,
DWORD
level
,
void
*
buffer
,
ULONG
*
size
);
NET_API_STATUS
(
WINAPI
*
share_add
)(
const
WCHAR
*
server
,
DWORD
level
,
const
BYTE
*
buffer
,
DWORD
*
err
);
NET_API_STATUS
(
WINAPI
*
share_del
)(
const
WCHAR
*
server
,
const
WCHAR
*
share
,
DWORD
reserved
);
NET_API_STATUS
(
WINAPI
*
wksta_getinfo
)(
const
WCHAR
*
server
,
DWORD
level
,
BYTE
**
buffer
);
NET_API_STATUS
(
WINAPI
*
wksta_getinfo
)(
const
WCHAR
*
server
,
DWORD
level
,
void
*
buffer
,
ULONG
*
size
);
NET_API_STATUS
(
WINAPI
*
change_password
)(
const
WCHAR
*
domain
,
const
WCHAR
*
user
,
const
WCHAR
*
old
,
const
WCHAR
*
new
);
};
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