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
201ed085
Commit
201ed085
authored
Jul 03, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcss: Use CRT memory allocation functions.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
7918bfc5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
21 deletions
+18
-21
epmp.c
programs/rpcss/epmp.c
+3
-3
irotp.c
programs/rpcss/irotp.c
+10
-12
rpcss_main.c
programs/rpcss/rpcss_main.c
+5
-6
No files found.
programs/rpcss/epmp.c
View file @
201ed085
...
@@ -57,7 +57,7 @@ static void delete_registered_ept_entry(struct registered_ept_entry *entry)
...
@@ -57,7 +57,7 @@ static void delete_registered_ept_entry(struct registered_ept_entry *entry)
I_RpcFree
(
entry
->
endpoint
);
I_RpcFree
(
entry
->
endpoint
);
I_RpcFree
(
entry
->
address
);
I_RpcFree
(
entry
->
address
);
list_remove
(
&
entry
->
entry
);
list_remove
(
&
entry
->
entry
);
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
free
(
entry
);
}
}
static
struct
registered_ept_entry
*
find_ept_entry
(
static
struct
registered_ept_entry
*
find_ept_entry
(
...
@@ -106,7 +106,7 @@ void __cdecl ept_insert(handle_t h,
...
@@ -106,7 +106,7 @@ void __cdecl ept_insert(handle_t h,
for
(
i
=
0
;
i
<
num_ents
;
i
++
)
for
(
i
=
0
;
i
<
num_ents
;
i
++
)
{
{
struct
registered_ept_entry
*
entry
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
entry
));
struct
registered_ept_entry
*
entry
=
malloc
(
sizeof
(
*
entry
));
if
(
!
entry
)
if
(
!
entry
)
{
{
/* FIXME: cleanup code to delete added entries */
/* FIXME: cleanup code to delete added entries */
...
@@ -121,7 +121,7 @@ void __cdecl ept_insert(handle_t h,
...
@@ -121,7 +121,7 @@ void __cdecl ept_insert(handle_t h,
{
{
WINE_WARN
(
"TowerExplode failed %lu
\n
"
,
rpc_status
);
WINE_WARN
(
"TowerExplode failed %lu
\n
"
,
rpc_status
);
*
status
=
rpc_status
;
*
status
=
rpc_status
;
HeapFree
(
GetProcessHeap
(),
0
,
entry
);
free
(
entry
);
break
;
/* FIXME: more cleanup? */
break
;
/* FIXME: more cleanup? */
}
}
...
...
programs/rpcss/irotp.c
View file @
201ed085
...
@@ -61,10 +61,10 @@ static inline void rot_entry_release(struct rot_entry *rot_entry)
...
@@ -61,10 +61,10 @@ static inline void rot_entry_release(struct rot_entry *rot_entry)
{
{
if
(
!
InterlockedDecrement
(
&
rot_entry
->
refs
))
if
(
!
InterlockedDecrement
(
&
rot_entry
->
refs
))
{
{
HeapFree
(
GetProcessHeap
(),
0
,
rot_entry
->
object
);
free
(
rot_entry
->
object
);
HeapFree
(
GetProcessHeap
(),
0
,
rot_entry
->
moniker
);
free
(
rot_entry
->
moniker
);
HeapFree
(
GetProcessHeap
(),
0
,
rot_entry
->
moniker_data
);
free
(
rot_entry
->
moniker_data
);
HeapFree
(
GetProcessHeap
(),
0
,
rot_entry
);
free
(
rot_entry
);
}
}
}
}
...
@@ -88,12 +88,11 @@ HRESULT __cdecl IrotRegister(
...
@@ -88,12 +88,11 @@ HRESULT __cdecl IrotRegister(
return
E_INVALIDARG
;
return
E_INVALIDARG
;
}
}
rot_entry
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
rot_entry
));
if
(
!
(
rot_entry
=
calloc
(
1
,
sizeof
(
*
rot_entry
))))
if
(
!
rot_entry
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
rot_entry
->
refs
=
1
;
rot_entry
->
refs
=
1
;
rot_entry
->
object
=
HeapAlloc
(
GetProcessHeap
(),
0
,
FIELD_OFFSET
(
InterfaceData
,
abData
[
obj
->
ulCntData
]));
rot_entry
->
object
=
malloc
(
FIELD_OFFSET
(
InterfaceData
,
abData
[
obj
->
ulCntData
]));
if
(
!
rot_entry
->
object
)
if
(
!
rot_entry
->
object
)
{
{
rot_entry_release
(
rot_entry
);
rot_entry_release
(
rot_entry
);
...
@@ -104,7 +103,7 @@ HRESULT __cdecl IrotRegister(
...
@@ -104,7 +103,7 @@ HRESULT __cdecl IrotRegister(
rot_entry
->
last_modified
=
*
time
;
rot_entry
->
last_modified
=
*
time
;
rot_entry
->
moniker
=
HeapAlloc
(
GetProcessHeap
(),
0
,
FIELD_OFFSET
(
InterfaceData
,
abData
[
mk
->
ulCntData
]));
rot_entry
->
moniker
=
malloc
(
FIELD_OFFSET
(
InterfaceData
,
abData
[
mk
->
ulCntData
]));
if
(
!
rot_entry
->
moniker
)
if
(
!
rot_entry
->
moniker
)
{
{
rot_entry_release
(
rot_entry
);
rot_entry_release
(
rot_entry
);
...
@@ -113,8 +112,7 @@ HRESULT __cdecl IrotRegister(
...
@@ -113,8 +112,7 @@ HRESULT __cdecl IrotRegister(
rot_entry
->
moniker
->
ulCntData
=
mk
->
ulCntData
;
rot_entry
->
moniker
->
ulCntData
=
mk
->
ulCntData
;
memcpy
(
&
rot_entry
->
moniker
->
abData
,
mk
->
abData
,
mk
->
ulCntData
);
memcpy
(
&
rot_entry
->
moniker
->
abData
,
mk
->
abData
,
mk
->
ulCntData
);
rot_entry
->
moniker_data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
FIELD_OFFSET
(
MonikerComparisonData
,
abData
[
data
->
ulCntData
]));
if
(
!
(
rot_entry
->
moniker_data
=
malloc
(
FIELD_OFFSET
(
MonikerComparisonData
,
abData
[
data
->
ulCntData
]))))
if
(
!
rot_entry
->
moniker_data
)
{
{
rot_entry_release
(
rot_entry
);
rot_entry_release
(
rot_entry
);
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
@@ -370,10 +368,10 @@ void __RPC_USER IrotContextHandle_rundown(IrotContextHandle ctxt_handle)
...
@@ -370,10 +368,10 @@ void __RPC_USER IrotContextHandle_rundown(IrotContextHandle ctxt_handle)
void
*
__RPC_USER
MIDL_user_allocate
(
SIZE_T
size
)
void
*
__RPC_USER
MIDL_user_allocate
(
SIZE_T
size
)
{
{
return
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
return
malloc
(
size
);
}
}
void
__RPC_USER
MIDL_user_free
(
void
*
p
)
void
__RPC_USER
MIDL_user_free
(
void
*
p
)
{
{
HeapFree
(
GetProcessHeap
(),
0
,
p
);
free
(
p
);
}
}
programs/rpcss/rpcss_main.c
View file @
201ed085
...
@@ -31,7 +31,6 @@
...
@@ -31,7 +31,6 @@
#include "irpcss.h"
#include "irpcss.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/list.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
WINE_DEFAULT_DEBUG_CHANNEL
(
ole
);
...
@@ -58,14 +57,14 @@ HRESULT __cdecl irpcss_server_register(handle_t h, const GUID *clsid, unsigned i
...
@@ -58,14 +57,14 @@ HRESULT __cdecl irpcss_server_register(handle_t h, const GUID *clsid, unsigned i
struct
registered_class
*
entry
;
struct
registered_class
*
entry
;
static
LONG
next_cookie
;
static
LONG
next_cookie
;
if
(
!
(
entry
=
heap_alloc_zero
(
sizeof
(
*
entry
))))
if
(
!
(
entry
=
calloc
(
1
,
sizeof
(
*
entry
))))
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
entry
->
clsid
=
*
clsid
;
entry
->
clsid
=
*
clsid
;
entry
->
single_use
=
!
(
flags
&
(
REGCLS_MULTIPLEUSE
|
REGCLS_MULTI_SEPARATE
));
entry
->
single_use
=
!
(
flags
&
(
REGCLS_MULTIPLEUSE
|
REGCLS_MULTI_SEPARATE
));
if
(
!
(
entry
->
object
=
heap_
alloc
(
FIELD_OFFSET
(
MInterfacePointer
,
abData
[
object
->
ulCntData
]))))
if
(
!
(
entry
->
object
=
m
alloc
(
FIELD_OFFSET
(
MInterfacePointer
,
abData
[
object
->
ulCntData
]))))
{
{
heap_
free
(
entry
);
free
(
entry
);
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
entry
->
object
->
ulCntData
=
object
->
ulCntData
;
entry
->
object
->
ulCntData
=
object
->
ulCntData
;
...
@@ -82,8 +81,8 @@ HRESULT __cdecl irpcss_server_register(handle_t h, const GUID *clsid, unsigned i
...
@@ -82,8 +81,8 @@ HRESULT __cdecl irpcss_server_register(handle_t h, const GUID *clsid, unsigned i
static
void
scm_revoke_class
(
struct
registered_class
*
_class
)
static
void
scm_revoke_class
(
struct
registered_class
*
_class
)
{
{
list_remove
(
&
_class
->
entry
);
list_remove
(
&
_class
->
entry
);
heap_
free
(
_class
->
object
);
free
(
_class
->
object
);
heap_
free
(
_class
);
free
(
_class
);
}
}
HRESULT
__cdecl
irpcss_server_revoke
(
handle_t
h
,
unsigned
int
cookie
)
HRESULT
__cdecl
irpcss_server_revoke
(
handle_t
h
,
unsigned
int
cookie
)
...
...
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