#include <stdarg.h>
#include <stdlib.h>
#include "windef.h"
#include "winbase.h"
#include "rpc.h"
#include "rpcndr.h"
#include "wine/debug.h"
Go to the source code of this file.
|
| | WINE_DEFAULT_DEBUG_CHANNEL (rpc) |
| |
| PFULL_PTR_XLAT_TABLES WINAPI | NdrFullPointerXlatInit (ULONG NumberOfPointers, XLAT_SIDE XlatSide) |
| |
| void WINAPI | NdrFullPointerXlatFree (PFULL_PTR_XLAT_TABLES pXlatTables) |
| |
| static void | expand_pointer_table_if_necessary (PFULL_PTR_XLAT_TABLES pXlatTables, ULONG RefId) |
| |
| int WINAPI | NdrFullPointerQueryPointer (PFULL_PTR_XLAT_TABLES pXlatTables, void *pPointer, unsigned char QueryType, ULONG *pRefId) |
| |
| int WINAPI | NdrFullPointerQueryRefId (PFULL_PTR_XLAT_TABLES pXlatTables, ULONG RefId, unsigned char QueryType, void **ppPointer) |
| |
| void WINAPI | NdrFullPointerInsertRefId (PFULL_PTR_XLAT_TABLES pXlatTables, ULONG RefId, void *pPointer) |
| |
| int WINAPI | NdrFullPointerFree (PFULL_PTR_XLAT_TABLES pXlatTables, void *Pointer) |
| |
◆ expand_pointer_table_if_necessary()
Definition at line 85 of file ndr_fullpointer.c.
86{
88 {
89#ifdef __REACTOS__
90 void* ptrNew;
92 if (!ptrNew)
93 {
94 ERR(
"Couldn't reallocate RefIdToPointer.XlatTable from %lu to %lu entries\n",
97 }
99 if (ptrNew)
100 {
102 if (!ptrNew)
103 {
104 ERR(
"Couldn't reallocate RefIdToPointer.StateTable from %lu to %lu entries\n",
107 }
109 }
110#else
115#endif
117 {
118#ifdef __REACTOS__
123#endif
125 return;
126 }
128 (RefId * 2 - pXlatTables->
RefIdToPointer.NumberOfEntries) *
sizeof(
void *));
132 }
133}
struct _FULL_PTR_XLAT_TABLES::@3417 RefIdToPointer
Referenced by NdrFullPointerInsertRefId(), NdrFullPointerQueryPointer(), and NdrFullPointerQueryRefId().
◆ NdrFullPointerFree()
Definition at line 240 of file ndr_fullpointer.c.
241{
246
247 TRACE(
"(%p, %p)\n", pXlatTables, Pointer);
248
249 if (!Pointer)
250 return 1;
251
252
253 for (
i = 0;
i <
sizeof(Pointer);
i++)
254 Hash = (
Hash * 3) ^ ((
unsigned char *)&Pointer)[
i];
255
257 for (; XlatTableEntry; XlatTableEntry = XlatTableEntry->
Next)
258 if (Pointer == XlatTableEntry->
Pointer)
259 {
260 if (XlatTableEntry->
State & 0x20)
261 return 0;
262 XlatTableEntry->
State |= 0x20;
263 RefId = XlatTableEntry->
RefId;
264 break;
265 }
266
267 if (!XlatTableEntry)
268 return 0;
269
271 {
273 return 1;
274 }
275
276 return 0;
277}
static int Hash(const char *)
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
struct _FULL_PTR_TO_REFID_ELEMENT * Next
struct _FULL_PTR_XLAT_TABLES::@3418 PointerToRefId
Referenced by PointerFree(), and test_fullpointer_xlat().
◆ NdrFullPointerInsertRefId()
Definition at line 214 of file ndr_fullpointer.c.
216{
220
221 TRACE(
"(%p, 0x%lx, %p)\n", pXlatTables, RefId, pPointer);
222
223
224 for (
i = 0;
i <
sizeof(pPointer);
i++)
225 Hash = (
Hash * 3) ^ ((
unsigned char *)&pPointer)[
i];
226
227 XlatTableEntry =
malloc(
sizeof(*XlatTableEntry));
229 XlatTableEntry->
Pointer = pPointer;
230 XlatTableEntry->
RefId = RefId;
231 XlatTableEntry->
State = 0;
233
234
238}
static void expand_pointer_table_if_necessary(PFULL_PTR_XLAT_TABLES pXlatTables, ULONG RefId)
Referenced by PointerUnmarshall(), and test_fullpointer_xlat().
◆ NdrFullPointerQueryPointer()
Definition at line 135 of file ndr_fullpointer.c.
138{
142
143 TRACE(
"(%p, %p, %d, %p)\n", pXlatTables, pPointer,
QueryType, pRefId);
144
145 if (!pPointer)
146 {
147 *pRefId = 0;
148 return 1;
149 }
150
151
152 for (
i = 0;
i <
sizeof(pPointer);
i++)
153 Hash = (
Hash * 3) ^ ((
unsigned char *)&pPointer)[
i];
154
156 for (; XlatTableEntry; XlatTableEntry = XlatTableEntry->
Next)
157 if (pPointer == XlatTableEntry->
Pointer)
158 {
159 *pRefId = XlatTableEntry->
RefId;
161 return 1;
163 return 0;
164 }
165
166 XlatTableEntry =
malloc(
sizeof(*XlatTableEntry));
168 XlatTableEntry->
Pointer = pPointer;
172
173
176 {
179 }
180
181 return 0;
182}
_Must_inspect_result_ _In_ KTMOBJECT_TYPE QueryType
Referenced by PointerBufferSize(), PointerMarshall(), and test_fullpointer_xlat().
◆ NdrFullPointerQueryRefId()
◆ NdrFullPointerXlatFree()
◆ NdrFullPointerXlatInit()
◆ WINE_DEFAULT_DEBUG_CHANNEL()
| WINE_DEFAULT_DEBUG_CHANNEL |
( |
rpc |
| ) |
|