Skip to content

Commit 6effc6c

Browse files
[RPCSS] Sync to wine-10.0
1 parent 91f09e7 commit 6effc6c

File tree

6 files changed

+241
-82
lines changed

6 files changed

+241
-82
lines changed

base/services/rpcss/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11

22
add_rpc_files(server
33
${REACTOS_SOURCE_DIR}/sdk/include/wine/epm.idl
4-
${REACTOS_SOURCE_DIR}/sdk/include/wine/irot.idl)
4+
${REACTOS_SOURCE_DIR}/sdk/include/wine/irot.idl
5+
${REACTOS_SOURCE_DIR}/sdk/include/wine/irpcss.idl)
56

67

78
list(APPEND SOURCE
@@ -11,9 +12,10 @@ list(APPEND SOURCE
1112
setup.c
1213
precomp.h
1314
${CMAKE_CURRENT_BINARY_DIR}/epm_s.c
14-
${CMAKE_CURRENT_BINARY_DIR}/irot_s.c)
15+
${CMAKE_CURRENT_BINARY_DIR}/irot_s.c
16+
${CMAKE_CURRENT_BINARY_DIR}/irpcss_s.c)
1517

16-
include_directories(${REACTOS_BINARY_DIR}/sdk/include/reactos/wine)
18+
include_directories(${REACTOS_BINARY_DIR}/sdk/include/wine)
1719
add_executable(rpcss ${SOURCE} rpcss.rc)
1820

1921
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")

base/services/rpcss/epmp.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
1919
*/
2020

21+
#ifdef __REACTOS__
2122
#include "epm_s.h"
23+
#else
24+
#include "epm.h"
25+
#endif
2226

2327
#include "wine/debug.h"
2428
#include "wine/list.h"
@@ -57,7 +61,7 @@ static void delete_registered_ept_entry(struct registered_ept_entry *entry)
5761
I_RpcFree(entry->endpoint);
5862
I_RpcFree(entry->address);
5963
list_remove(&entry->entry);
60-
HeapFree(GetProcessHeap(), 0, entry);
64+
free(entry);
6165
}
6266

6367
static struct registered_ept_entry *find_ept_entry(
@@ -98,15 +102,15 @@ void __cdecl ept_insert(handle_t h,
98102
unsigned32 i;
99103
RPC_STATUS rpc_status;
100104

101-
WINE_TRACE("(%p, %u, %p, %u, %p)\n", h, num_ents, entries, replace, status);
105+
WINE_TRACE("(%p, %lu, %p, %lu, %p)\n", h, num_ents, entries, replace, status);
102106

103107
*status = RPC_S_OK;
104108

105109
EnterCriticalSection(&csEpm);
106110

107111
for (i = 0; i < num_ents; i++)
108112
{
109-
struct registered_ept_entry *entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*entry));
113+
struct registered_ept_entry *entry = malloc(sizeof(*entry));
110114
if (!entry)
111115
{
112116
/* FIXME: cleanup code to delete added entries */
@@ -119,9 +123,9 @@ void __cdecl ept_insert(handle_t h,
119123
&entry->address);
120124
if (rpc_status != RPC_S_OK)
121125
{
122-
WINE_WARN("TowerExplode failed %u\n", rpc_status);
126+
WINE_WARN("TowerExplode failed %lu\n", rpc_status);
123127
*status = rpc_status;
124-
HeapFree(GetProcessHeap(), 0, entry);
128+
free(entry);
125129
break; /* FIXME: more cleanup? */
126130
}
127131

@@ -149,7 +153,7 @@ void __cdecl ept_delete(handle_t h,
149153

150154
*status = RPC_S_OK;
151155

152-
WINE_TRACE("(%p, %u, %p, %p)\n", h, num_ents, entries, status);
156+
WINE_TRACE("(%p, %lu, %p, %p)\n", h, num_ents, entries, status);
153157

154158
EnterCriticalSection(&csEpm);
155159

@@ -215,7 +219,7 @@ void __cdecl ept_map(handle_t h,
215219
*status = RPC_S_OK;
216220
*num_towers = 0;
217221

218-
WINE_TRACE("(%p, %p, %p, %p, %u, %p, %p, %p)\n", h, object, map_tower,
222+
WINE_TRACE("(%p, %p, %p, %p, %lu, %p, %p, %p)\n", h, object, map_tower,
219223
entry_handle, max_towers, num_towers, towers, status);
220224

221225
rpc_status = TowerExplode(map_tower, &iface, &syntax, &protseq,
@@ -282,7 +286,7 @@ void __cdecl ept_mgmt_delete(handle_t h,
282286
twr_p_t tower,
283287
error_status_t *status)
284288
{
285-
WINE_FIXME("(%p, %d, %p, %p, %p): stub\n", h, object_speced, object, tower, status);
289+
WINE_FIXME("(%p, %ld, %p, %p, %p): stub\n", h, object_speced, object, tower, status);
286290

287291
*status = EPT_S_CANT_PERFORM_OP;
288292
}

base/services/rpcss/irotp.c

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
#include "windef.h"
2626
#include "winbase.h"
2727

28+
#ifdef __REACTOS__
2829
#include "irot_s.h"
30+
#else
31+
#include "irot.h"
32+
#endif
2933

3034
#include "wine/list.h"
3135
#include "wine/debug.h"
@@ -61,10 +65,10 @@ static inline void rot_entry_release(struct rot_entry *rot_entry)
6165
{
6266
if (!InterlockedDecrement(&rot_entry->refs))
6367
{
64-
HeapFree(GetProcessHeap(), 0, rot_entry->object);
65-
HeapFree(GetProcessHeap(), 0, rot_entry->moniker);
66-
HeapFree(GetProcessHeap(), 0, rot_entry->moniker_data);
67-
HeapFree(GetProcessHeap(), 0, rot_entry);
68+
free(rot_entry->object);
69+
free(rot_entry->moniker);
70+
free(rot_entry->moniker_data);
71+
free(rot_entry);
6872
}
6973
}
7074

@@ -84,16 +88,15 @@ HRESULT __cdecl IrotRegister(
8488

8589
if (grfFlags & ~(ROTFLAGS_REGISTRATIONKEEPSALIVE|ROTFLAGS_ALLOWANYCLIENT))
8690
{
87-
WINE_ERR("Invalid grfFlags: 0x%08x\n", grfFlags & ~(ROTFLAGS_REGISTRATIONKEEPSALIVE|ROTFLAGS_ALLOWANYCLIENT));
91+
WINE_ERR("Invalid grfFlags: 0x%08lx\n", grfFlags & ~(ROTFLAGS_REGISTRATIONKEEPSALIVE|ROTFLAGS_ALLOWANYCLIENT));
8892
return E_INVALIDARG;
8993
}
9094

91-
rot_entry = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*rot_entry));
92-
if (!rot_entry)
95+
if (!(rot_entry = calloc(1, sizeof(*rot_entry))))
9396
return E_OUTOFMEMORY;
9497

9598
rot_entry->refs = 1;
96-
rot_entry->object = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(InterfaceData, abData[obj->ulCntData]));
99+
rot_entry->object = malloc(FIELD_OFFSET(InterfaceData, abData[obj->ulCntData]));
97100
if (!rot_entry->object)
98101
{
99102
rot_entry_release(rot_entry);
@@ -104,7 +107,7 @@ HRESULT __cdecl IrotRegister(
104107

105108
rot_entry->last_modified = *time;
106109

107-
rot_entry->moniker = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(InterfaceData, abData[mk->ulCntData]));
110+
rot_entry->moniker = malloc(FIELD_OFFSET(InterfaceData, abData[mk->ulCntData]));
108111
if (!rot_entry->moniker)
109112
{
110113
rot_entry_release(rot_entry);
@@ -113,8 +116,7 @@ HRESULT __cdecl IrotRegister(
113116
rot_entry->moniker->ulCntData = mk->ulCntData;
114117
memcpy(&rot_entry->moniker->abData, mk->abData, mk->ulCntData);
115118

116-
rot_entry->moniker_data = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(MonikerComparisonData, abData[data->ulCntData]));
117-
if (!rot_entry->moniker_data)
119+
if (!(rot_entry->moniker_data = malloc(FIELD_OFFSET(MonikerComparisonData, abData[data->ulCntData]))))
118120
{
119121
rot_entry_release(rot_entry);
120122
return E_OUTOFMEMORY;
@@ -132,7 +134,7 @@ HRESULT __cdecl IrotRegister(
132134
!memcmp(&data->abData, &existing_rot_entry->moniker_data->abData, data->ulCntData))
133135
{
134136
hr = MK_S_MONIKERALREADYREGISTERED;
135-
WINE_TRACE("moniker already registered with cookie %d\n", existing_rot_entry->cookie);
137+
WINE_TRACE("moniker already registered with cookie %ld\n", existing_rot_entry->cookie);
136138
break;
137139
}
138140
}
@@ -157,7 +159,7 @@ HRESULT __cdecl IrotRevoke(
157159
{
158160
struct rot_entry *rot_entry;
159161

160-
WINE_TRACE("%d\n", cookie);
162+
WINE_TRACE("%ld\n", cookie);
161163

162164
EnterCriticalSection(&csRunningObjectTable);
163165
LIST_FOR_EACH_ENTRY(rot_entry, &RunningObjectTable, struct rot_entry, entry)
@@ -269,7 +271,7 @@ HRESULT __cdecl IrotNoteChangeTime(
269271
{
270272
struct rot_entry *rot_entry;
271273

272-
WINE_TRACE("%d %p\n", cookie, last_modified_time);
274+
WINE_TRACE("%ld %p\n", cookie, last_modified_time);
273275

274276
EnterCriticalSection(&csRunningObjectTable);
275277
LIST_FOR_EACH_ENTRY(rot_entry, &RunningObjectTable, struct rot_entry, entry)
@@ -370,10 +372,10 @@ void __RPC_USER IrotContextHandle_rundown(IrotContextHandle ctxt_handle)
370372

371373
void * __RPC_USER MIDL_user_allocate(SIZE_T size)
372374
{
373-
return HeapAlloc(GetProcessHeap(), 0, size);
375+
return I_RpcAllocate(size);
374376
}
375377

376378
void __RPC_USER MIDL_user_free(void * p)
377379
{
378-
HeapFree(GetProcessHeap(), 0, p);
380+
I_RpcFree(p);
379381
}

base/services/rpcss/irpcss.idl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright 2019 Nikolay Sivov for CodeWeavers
3+
*
4+
* This library is free software; you can redistribute it and/or
5+
* modify it under the terms of the GNU Lesser General Public
6+
* License as published by the Free Software Foundation; either
7+
* version 2.1 of the License, or (at your option) any later version.
8+
*
9+
* This library is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public
15+
* License along with this library; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17+
*/
18+
19+
#pragma makedep server
20+
21+
#include "wine/irpcss.idl"

base/services/rpcss/precomp.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,20 @@
22
#ifndef _RPCSS_PRECOMP_H_
33
#define _RPCSS_PRECOMP_H_
44

5+
56
#include <stdarg.h>
67

78
#define WIN32_NO_STATUS
8-
#define _INC_WINDOWS
9-
#define COM_NO_WINDOWS_H
10-
11-
#define NONAMELESSUNION
12-
#define NONAMELESSSTRUCT
9+
#define COBJMACROS
1310

1411
#include <windef.h>
1512
#include <winbase.h>
1613

1714
#include <irot_s.h>
1815
#include <epm_s.h>
16+
#include <irpcss_s.h>
1917

2018
#include <wine/list.h>
2119

20+
2221
#endif /* !_RPCSS_PRECOMP_H_ */

0 commit comments

Comments
 (0)