Skip to content

Commit 8a684e8

Browse files
[RPCSS] Sync to wine-10.0
1 parent 5e2be5b commit 8a684e8

File tree

9 files changed

+235
-86
lines changed

9 files changed

+235
-86
lines changed

base/services/rpcss/CMakeLists.txt

Lines changed: 6 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,11 @@ 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)
19+
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
1720
add_executable(rpcss ${SOURCE} rpcss.rc)
1821

1922
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")

base/services/rpcss/epm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "epm_s.h"

base/services/rpcss/epmp.c

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

21-
#include "epm_s.h"
21+
#include "epm.h"
2222

2323
#include "wine/debug.h"
2424
#include "wine/list.h"
@@ -57,7 +57,7 @@ static void delete_registered_ept_entry(struct registered_ept_entry *entry)
5757
I_RpcFree(entry->endpoint);
5858
I_RpcFree(entry->address);
5959
list_remove(&entry->entry);
60-
HeapFree(GetProcessHeap(), 0, entry);
60+
free(entry);
6161
}
6262

6363
static struct registered_ept_entry *find_ept_entry(
@@ -98,15 +98,15 @@ void __cdecl ept_insert(handle_t h,
9898
unsigned32 i;
9999
RPC_STATUS rpc_status;
100100

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

103103
*status = RPC_S_OK;
104104

105105
EnterCriticalSection(&csEpm);
106106

107107
for (i = 0; i < num_ents; i++)
108108
{
109-
struct registered_ept_entry *entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*entry));
109+
struct registered_ept_entry *entry = malloc(sizeof(*entry));
110110
if (!entry)
111111
{
112112
/* FIXME: cleanup code to delete added entries */
@@ -119,9 +119,9 @@ void __cdecl ept_insert(handle_t h,
119119
&entry->address);
120120
if (rpc_status != RPC_S_OK)
121121
{
122-
WINE_WARN("TowerExplode failed %u\n", rpc_status);
122+
WINE_WARN("TowerExplode failed %lu\n", rpc_status);
123123
*status = rpc_status;
124-
HeapFree(GetProcessHeap(), 0, entry);
124+
free(entry);
125125
break; /* FIXME: more cleanup? */
126126
}
127127

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

150150
*status = RPC_S_OK;
151151

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

154154
EnterCriticalSection(&csEpm);
155155

@@ -215,7 +215,7 @@ void __cdecl ept_map(handle_t h,
215215
*status = RPC_S_OK;
216216
*num_towers = 0;
217217

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

221221
rpc_status = TowerExplode(map_tower, &iface, &syntax, &protseq,
@@ -282,7 +282,7 @@ void __cdecl ept_mgmt_delete(handle_t h,
282282
twr_p_t tower,
283283
error_status_t *status)
284284
{
285-
WINE_FIXME("(%p, %d, %p, %p, %p): stub\n", h, object_speced, object, tower, status);
285+
WINE_FIXME("(%p, %ld, %p, %p, %p): stub\n", h, object_speced, object, tower, status);
286286

287287
*status = EPT_S_CANT_PERFORM_OP;
288288
}

base/services/rpcss/irot.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "irot_s.h"

base/services/rpcss/irotp.c

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

28-
#include "irot_s.h"
28+
#include "irot.h"
2929

3030
#include "wine/list.h"
3131
#include "wine/debug.h"
@@ -61,10 +61,10 @@ static inline void rot_entry_release(struct rot_entry *rot_entry)
6161
{
6262
if (!InterlockedDecrement(&rot_entry->refs))
6363
{
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);
64+
free(rot_entry->object);
65+
free(rot_entry->moniker);
66+
free(rot_entry->moniker_data);
67+
free(rot_entry);
6868
}
6969
}
7070

@@ -84,16 +84,15 @@ HRESULT __cdecl IrotRegister(
8484

8585
if (grfFlags & ~(ROTFLAGS_REGISTRATIONKEEPSALIVE|ROTFLAGS_ALLOWANYCLIENT))
8686
{
87-
WINE_ERR("Invalid grfFlags: 0x%08x\n", grfFlags & ~(ROTFLAGS_REGISTRATIONKEEPSALIVE|ROTFLAGS_ALLOWANYCLIENT));
87+
WINE_ERR("Invalid grfFlags: 0x%08lx\n", grfFlags & ~(ROTFLAGS_REGISTRATIONKEEPSALIVE|ROTFLAGS_ALLOWANYCLIENT));
8888
return E_INVALIDARG;
8989
}
9090

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

9594
rot_entry->refs = 1;
96-
rot_entry->object = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(InterfaceData, abData[obj->ulCntData]));
95+
rot_entry->object = malloc(FIELD_OFFSET(InterfaceData, abData[obj->ulCntData]));
9796
if (!rot_entry->object)
9897
{
9998
rot_entry_release(rot_entry);
@@ -104,7 +103,7 @@ HRESULT __cdecl IrotRegister(
104103

105104
rot_entry->last_modified = *time;
106105

107-
rot_entry->moniker = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(InterfaceData, abData[mk->ulCntData]));
106+
rot_entry->moniker = malloc(FIELD_OFFSET(InterfaceData, abData[mk->ulCntData]));
108107
if (!rot_entry->moniker)
109108
{
110109
rot_entry_release(rot_entry);
@@ -113,8 +112,7 @@ HRESULT __cdecl IrotRegister(
113112
rot_entry->moniker->ulCntData = mk->ulCntData;
114113
memcpy(&rot_entry->moniker->abData, mk->abData, mk->ulCntData);
115114

116-
rot_entry->moniker_data = HeapAlloc(GetProcessHeap(), 0, FIELD_OFFSET(MonikerComparisonData, abData[data->ulCntData]));
117-
if (!rot_entry->moniker_data)
115+
if (!(rot_entry->moniker_data = malloc(FIELD_OFFSET(MonikerComparisonData, abData[data->ulCntData]))))
118116
{
119117
rot_entry_release(rot_entry);
120118
return E_OUTOFMEMORY;
@@ -132,7 +130,7 @@ HRESULT __cdecl IrotRegister(
132130
!memcmp(&data->abData, &existing_rot_entry->moniker_data->abData, data->ulCntData))
133131
{
134132
hr = MK_S_MONIKERALREADYREGISTERED;
135-
WINE_TRACE("moniker already registered with cookie %d\n", existing_rot_entry->cookie);
133+
WINE_TRACE("moniker already registered with cookie %ld\n", existing_rot_entry->cookie);
136134
break;
137135
}
138136
}
@@ -157,7 +155,7 @@ HRESULT __cdecl IrotRevoke(
157155
{
158156
struct rot_entry *rot_entry;
159157

160-
WINE_TRACE("%d\n", cookie);
158+
WINE_TRACE("%ld\n", cookie);
161159

162160
EnterCriticalSection(&csRunningObjectTable);
163161
LIST_FOR_EACH_ENTRY(rot_entry, &RunningObjectTable, struct rot_entry, entry)
@@ -269,7 +267,7 @@ HRESULT __cdecl IrotNoteChangeTime(
269267
{
270268
struct rot_entry *rot_entry;
271269

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

274272
EnterCriticalSection(&csRunningObjectTable);
275273
LIST_FOR_EACH_ENTRY(rot_entry, &RunningObjectTable, struct rot_entry, entry)
@@ -370,10 +368,10 @@ void __RPC_USER IrotContextHandle_rundown(IrotContextHandle ctxt_handle)
370368

371369
void * __RPC_USER MIDL_user_allocate(SIZE_T size)
372370
{
373-
return HeapAlloc(GetProcessHeap(), 0, size);
371+
return I_RpcAllocate(size);
374372
}
375373

376374
void __RPC_USER MIDL_user_free(void * p)
377375
{
378-
HeapFree(GetProcessHeap(), 0, p);
376+
I_RpcFree(p);
379377
}

base/services/rpcss/irpcss.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "irpcss_s.h"

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: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@
55
#include <stdarg.h>
66

77
#define WIN32_NO_STATUS
8-
#define _INC_WINDOWS
9-
#define COM_NO_WINDOWS_H
10-
11-
#define NONAMELESSUNION
12-
#define NONAMELESSSTRUCT
8+
#define COBJMACROS
139

1410
#include <windef.h>
1511
#include <winbase.h>
1612

1713
#include <irot_s.h>
1814
#include <epm_s.h>
15+
#include <irpcss_s.h>
1916

2017
#include <wine/list.h>
2118

0 commit comments

Comments
 (0)