ReactOS 0.4.15-dev-7953-g1f49173
epmp.c File Reference
#include "epm_s.h"
#include "wine/debug.h"
#include "wine/list.h"
Include dependency graph for epmp.c:

Go to the source code of this file.

Classes

struct  registered_ept_entry
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ole)
 
static void delete_registered_ept_entry (struct registered_ept_entry *entry)
 
static struct registered_ept_entryfind_ept_entry (const RPC_SYNTAX_IDENTIFIER *iface, const RPC_SYNTAX_IDENTIFIER *syntax, const char *protseq, const char *endpoint, const char *address, const UUID *object)
 
void __RPC_USER ept_lookup_handle_t_rundown (ept_lookup_handle_t entry_handle)
 
void __cdecl ept_insert (handle_t h, unsigned32 num_ents, ept_entry_t entries[], boolean32 replace, error_status_t *status)
 
void __cdecl ept_delete (handle_t h, unsigned32 num_ents, ept_entry_t entries[], error_status_t *status)
 
void __cdecl ept_lookup (handle_t h, unsigned32 inquiry_type, uuid_p_t object, rpc_if_id_p_t interface_id, unsigned32 vers_option, ept_lookup_handle_t *entry_handle, unsigned32 max_ents, unsigned32 *num_ents, ept_entry_t entries[], error_status_t *status)
 
void __cdecl ept_map (handle_t h, uuid_p_t object, twr_p_t map_tower, ept_lookup_handle_t *entry_handle, unsigned32 max_towers, unsigned32 *num_towers, twr_p_t *towers, error_status_t *status)
 
void __cdecl ept_lookup_handle_free (handle_t h, ept_lookup_handle_t *entry_handle, error_status_t *status)
 
void __cdecl ept_inq_object (handle_t h, GUID *ept_object, error_status_t *status)
 
void __cdecl ept_mgmt_delete (handle_t h, boolean32 object_speced, uuid_p_t object, twr_p_t tower, error_status_t *status)
 

Variables

static struct list registered_ept_entry_list = LIST_INIT(registered_ept_entry_list)
 
static CRITICAL_SECTION csEpm = { &critsect_debug, -1, 0, 0, 0, 0 }
 
static CRITICAL_SECTION_DEBUG critsect_debug
 
static const UUID nil_object
 

Function Documentation

◆ delete_registered_ept_entry()

static void delete_registered_ept_entry ( struct registered_ept_entry entry)
static

Definition at line 54 of file epmp.c.

55{
56 I_RpcFree(entry->protseq);
57 I_RpcFree(entry->endpoint);
58 I_RpcFree(entry->address);
59 list_remove(&entry->entry);
61}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
uint32_t entry
Definition: isohybrid.c:63
void WINAPI I_RpcFree(void *Object)
Definition: rpcrt4_main.c:724

Referenced by ept_delete(), and ept_insert().

◆ ept_delete()

void __cdecl ept_delete ( handle_t  h,
unsigned32  num_ents,
ept_entry_t  entries[],
error_status_t status 
)

Definition at line 142 of file epmp.c.

146{
148 RPC_STATUS rpc_status;
149
150 *status = RPC_S_OK;
151
152 WINE_TRACE("(%p, %u, %p, %p)\n", h, num_ents, entries, status);
153
155
156 for (i = 0; i < num_ents; i++)
157 {
160 char *protseq;
161 char *endpoint;
162 char *address;
163 rpc_status = TowerExplode(entries[i].tower, &iface, &syntax, &protseq,
164 &endpoint, &address);
165 if (rpc_status != RPC_S_OK)
166 break;
167 entry = find_ept_entry(&iface, &syntax, protseq, endpoint, address, &entries[i].object);
168
172
173 if (entry)
175 else
176 {
178 break;
179 }
180 }
181
183}
static struct registered_ept_entry * find_ept_entry(const RPC_SYNTAX_IDENTIFIER *iface, const RPC_SYNTAX_IDENTIFIER *syntax, const char *protseq, const char *endpoint, const char *address, const UUID *object)
Definition: epmp.c:63
static void delete_registered_ept_entry(struct registered_ept_entry *entry)
Definition: epmp.c:54
static CRITICAL_SECTION csEpm
Definition: epmp.c:42
GLuint address
Definition: glext.h:9393
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int unsigned32
Definition: rpc.c:43
RPC_STATUS WINAPI TowerExplode(const twr_t *tower, PRPC_SYNTAX_IDENTIFIER object, PRPC_SYNTAX_IDENTIFIER syntax, char **protseq, char **endpoint, char **address)
Definition: rpc_epmap.c:524
#define RPC_S_OK
Definition: rpcnterr.h:22
long RPC_STATUS
Definition: rpc.h:52
#define WINE_TRACE
Definition: debug.h:354
Definition: nis.h:10
Definition: epmp.c:29
RPC_SYNTAX_IDENTIFIER iface
Definition: epmp.c:32
char * protseq
Definition: epmp.c:34
char * endpoint
Definition: epmp.c:35
RPC_SYNTAX_IDENTIFIER syntax
Definition: epmp.c:33
Definition: ps.c:97
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define EPT_S_NOT_REGISTERED
Definition: winerror.h:1061

◆ ept_inq_object()

void __cdecl ept_inq_object ( handle_t  h,
GUID ept_object,
error_status_t status 
)

Definition at line 270 of file epmp.c.

273{
274 WINE_FIXME("(%p, %p, %p): stub\n", h, ept_object, status);
275
277}
#define WINE_FIXME
Definition: debug.h:366
#define EPT_S_CANT_PERFORM_OP
Definition: winerror.h:1060

◆ ept_insert()

void __cdecl ept_insert ( handle_t  h,
unsigned32  num_ents,
ept_entry_t  entries[],
boolean32  replace,
error_status_t status 
)

Definition at line 92 of file epmp.c.

97{
99 RPC_STATUS rpc_status;
100
101 WINE_TRACE("(%p, %u, %p, %u, %p)\n", h, num_ents, entries, replace, status);
102
103 *status = RPC_S_OK;
104
106
107 for (i = 0; i < num_ents; i++)
108 {
109 struct registered_ept_entry *entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*entry));
110 if (!entry)
111 {
112 /* FIXME: cleanup code to delete added entries */
114 break;
115 }
116 memcpy(entry->annotation, entries[i].annotation, sizeof(entries[i].annotation));
117 rpc_status = TowerExplode(entries[i].tower, &entry->iface, &entry->syntax,
118 &entry->protseq, &entry->endpoint,
119 &entry->address);
120 if (rpc_status != RPC_S_OK)
121 {
122 WINE_WARN("TowerExplode failed %u\n", rpc_status);
123 *status = rpc_status;
125 break; /* FIXME: more cleanup? */
126 }
127
128 entry->object = entries[i].object;
129
130 if (replace)
131 {
132 /* FIXME: correct find algorithm */
133 struct registered_ept_entry *old_entry = find_ept_entry(&entry->iface, &entry->syntax, entry->protseq, entry->endpoint, entry->address, &entry->object);
134 if (old_entry) delete_registered_ept_entry(old_entry);
135 }
137 }
138
140}
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
#define HeapAlloc
Definition: compat.h:733
static struct list registered_ept_entry_list
Definition: epmp.c:40
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
INT replace(TCHAR source[MAX_PATH], TCHAR dest[MAX_PATH], DWORD dwFlags, BOOL *doMore)
Definition: replace.c:47
#define WINE_WARN
Definition: debug.h:360

Referenced by epm_register(), and RpcEpUnregister().

◆ ept_lookup()

void __cdecl ept_lookup ( handle_t  h,
unsigned32  inquiry_type,
uuid_p_t  object,
rpc_if_id_p_t  interface_id,
unsigned32  vers_option,
ept_lookup_handle_t *  entry_handle,
unsigned32  max_ents,
unsigned32 num_ents,
ept_entry_t  entries[],
error_status_t status 
)

Definition at line 185 of file epmp.c.

195{
196 WINE_FIXME("(%p, %p, %p): stub\n", h, entry_handle, status);
197
199}

◆ ept_lookup_handle_free()

void __cdecl ept_lookup_handle_free ( handle_t  h,
ept_lookup_handle_t *  entry_handle,
error_status_t status 
)

Definition at line 261 of file epmp.c.

264{
265 WINE_FIXME("(%p, %p, %p): stub\n", h, entry_handle, status);
266
268}

◆ ept_lookup_handle_t_rundown()

void __RPC_USER ept_lookup_handle_t_rundown ( ept_lookup_handle_t  entry_handle)

Definition at line 87 of file epmp.c.

88{
89 WINE_FIXME("%p\n", entry_handle);
90}

◆ ept_map()

void __cdecl ept_map ( handle_t  h,
uuid_p_t  object,
twr_p_t  map_tower,
ept_lookup_handle_t *  entry_handle,
unsigned32  max_towers,
unsigned32 num_towers,
twr_p_t towers,
error_status_t status 
)

Definition at line 201 of file epmp.c.

209{
210 RPC_STATUS rpc_status;
211 RPC_SYNTAX_IDENTIFIER iface, syntax;
212 char *protseq;
214
215 *status = RPC_S_OK;
216 *num_towers = 0;
217
218 WINE_TRACE("(%p, %p, %p, %p, %u, %p, %p, %p)\n", h, object, map_tower,
219 entry_handle, max_towers, num_towers, towers, status);
220
221 rpc_status = TowerExplode(map_tower, &iface, &syntax, &protseq,
222 NULL, NULL);
223 if (rpc_status != RPC_S_OK)
224 {
225 *status = rpc_status;
226 return;
227 }
228
230
232 {
233 if (IsEqualGUID(&entry->iface.SyntaxGUID, &iface.SyntaxGUID) &&
234 (entry->iface.SyntaxVersion.MajorVersion == iface.SyntaxVersion.MajorVersion) &&
235 (entry->iface.SyntaxVersion.MinorVersion >= iface.SyntaxVersion.MinorVersion) &&
236 !memcmp(&entry->syntax, &syntax, sizeof(syntax)) &&
237 !strcmp(entry->protseq, protseq) &&
238 ((!object && IsEqualGUID(&entry->object, &nil_object)) || IsEqualGUID(object, &entry->object)))
239 {
240 if (*num_towers < max_towers)
241 {
242 rpc_status = TowerConstruct(&entry->iface, &entry->syntax,
243 entry->protseq, entry->endpoint,
244 entry->address,
245 &towers[*num_towers]);
246 if (rpc_status != RPC_S_OK)
247 {
248 *status = rpc_status;
249 break; /* FIXME: more cleanup? */
250 }
251 }
252 (*num_towers)++;
253 }
254 }
255
257
259}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define NULL
Definition: types.h:112
static const UUID nil_object
Definition: epmp.c:51
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
RPC_STATUS WINAPI TowerConstruct(const RPC_SYNTAX_IDENTIFIER *object, const RPC_SYNTAX_IDENTIFIER *syntax, const char *protseq, const char *endpoint, const char *address, twr_t **tower)
Definition: rpc_epmap.c:596
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
RPC_VERSION SyntaxVersion
Definition: rpcdcep.h:33
unsigned short MajorVersion
Definition: rpcdcep.h:27
unsigned short MinorVersion
Definition: rpcdcep.h:28

Referenced by RpcEpResolveBinding().

◆ ept_mgmt_delete()

void __cdecl ept_mgmt_delete ( handle_t  h,
boolean32  object_speced,
uuid_p_t  object,
twr_p_t  tower,
error_status_t status 
)

Definition at line 279 of file epmp.c.

284{
285 WINE_FIXME("(%p, %d, %p, %p, %p): stub\n", h, object_speced, object, tower, status);
286
288}

◆ find_ept_entry()

static struct registered_ept_entry * find_ept_entry ( const RPC_SYNTAX_IDENTIFIER iface,
const RPC_SYNTAX_IDENTIFIER syntax,
const char protseq,
const char endpoint,
const char address,
const UUID object 
)
static

Definition at line 63 of file epmp.c.

67{
70 {
71 if (memcmp(&entry->iface, iface, sizeof(RPC_SYNTAX_IDENTIFIER))) continue;
72 if (memcmp(&entry->syntax, syntax, sizeof(RPC_SYNTAX_IDENTIFIER))) continue;
73 if (strcmp(entry->protseq, protseq)) continue;
74 if (memcmp(&entry->object, object, sizeof(UUID))) continue;
75 WINE_TRACE("found entry with iface %d.%d %s, syntax %d.%d %s, protseq %s, object %s\n",
76 entry->iface.SyntaxVersion.MajorVersion, entry->iface.SyntaxVersion.MinorVersion,
77 wine_dbgstr_guid(&entry->iface.SyntaxGUID),
78 entry->syntax.SyntaxVersion.MajorVersion, entry->syntax.SyntaxVersion.MinorVersion,
79 wine_dbgstr_guid(&entry->syntax.SyntaxGUID), protseq,
80 wine_dbgstr_guid(&entry->object));
81 return entry;
82 }
83 WINE_TRACE("not found\n");
84 return NULL;
85}
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197

Referenced by ept_delete(), and ept_insert().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ole  )

Variable Documentation

◆ critsect_debug

CRITICAL_SECTION_DEBUG critsect_debug
static
Initial value:
=
{
0, 0, &csEpm,
0, 0, { (DWORD_PTR)(__FILE__ ": csEpm") }
}
static CRITICAL_SECTION_DEBUG critsect_debug
Definition: epmp.c:43
LIST_ENTRY ProcessLocksList
Definition: winbase.h:883
#define DWORD_PTR
Definition: treelist.c:76

Definition at line 43 of file epmp.c.

◆ csEpm

static CRITICAL_SECTION csEpm = { &critsect_debug, -1, 0, 0, 0, 0 }
static

Definition at line 42 of file epmp.c.

Referenced by ept_delete(), ept_insert(), and ept_map().

◆ nil_object

const UUID nil_object
static

Definition at line 51 of file epmp.c.

Referenced by ept_map().

◆ registered_ept_entry_list

struct list registered_ept_entry_list = LIST_INIT(registered_ept_entry_list)
static

Definition at line 40 of file epmp.c.

Referenced by ept_insert(), ept_map(), and find_ept_entry().