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
7a774f75
Commit
7a774f75
authored
May 10, 2021
by
Hans Leidekker
Committed by
Alexandre Julliard
May 10, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wpcap: Use CRT memory allocators.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cf105074
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
20 deletions
+14
-20
wpcap.c
dlls/wpcap/wpcap.c
+14
-20
No files found.
dlls/wpcap/wpcap.c
View file @
7a774f75
...
...
@@ -26,7 +26,6 @@
#define USE_WS_PREFIX
#include "winsock2.h"
#include "wine/heap.h"
#include "wine/debug.h"
#include "unixlib.h"
...
...
@@ -34,22 +33,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wpcap);
const
struct
pcap_funcs
*
pcap_funcs
=
NULL
;
static
inline
WCHAR
*
heap_strdupAtoW
(
const
char
*
str
)
{
LPWSTR
ret
=
NULL
;
if
(
str
)
{
DWORD
len
;
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
ret
=
heap_alloc
(
len
*
sizeof
(
WCHAR
));
if
(
ret
)
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
);
}
return
ret
;
}
int
CDECL
wine_pcap_activate
(
void
*
handle
)
{
TRACE
(
"%p
\n
"
,
handle
);
...
...
@@ -124,6 +107,17 @@ void CDECL wine_pcap_dump( unsigned char *user, const void *hdr, const unsigned
pcap_funcs
->
dump
(
user
,
hdr
,
packet
);
}
static
inline
WCHAR
*
strdupAW
(
const
char
*
str
)
{
WCHAR
*
ret
=
NULL
;
if
(
str
)
{
int
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
NULL
,
0
);
if
((
ret
=
malloc
(
len
*
sizeof
(
WCHAR
)
)))
MultiByteToWideChar
(
CP_ACP
,
0
,
str
,
-
1
,
ret
,
len
);
}
return
ret
;
}
void
*
CDECL
wine_pcap_dump_open
(
void
*
handle
,
const
char
*
filename
)
{
void
*
dumper
;
...
...
@@ -132,15 +126,15 @@ void * CDECL wine_pcap_dump_open( void *handle, const char *filename )
TRACE
(
"%p, %s
\n
"
,
handle
,
debugstr_a
(
filename
)
);
if
(
!
(
filenameW
=
heap_strdupAto
W
(
filename
)))
return
NULL
;
if
(
!
(
filenameW
=
strdupA
W
(
filename
)))
return
NULL
;
unix_path
=
wine_get_unix_file_name
(
filenameW
);
heap_
free
(
filenameW
);
free
(
filenameW
);
if
(
!
unix_path
)
return
NULL
;
TRACE
(
"unix_path %s
\n
"
,
debugstr_a
(
unix_path
)
);
dumper
=
pcap_funcs
->
dump_open
(
handle
,
unix_path
);
heap_free
(
unix_path
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
unix_path
);
return
dumper
;
}
...
...
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