ReactOS 0.4.16-dev-122-g325d74c
ndr_stubless.h
Go to the documentation of this file.
1/*
2 * NDR -Oi,-Oif,-Oicf Interpreter
3 *
4 * Copyright 2007 Robert Shearman (for CodeWeavers)
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#pragma once
22
23#include "ndrtypes.h"
24
25/* there can't be any alignment with the structures in this file */
26#include "pshpack1.h"
27
28typedef struct _NDR_PROC_HEADER
29{
30 /* type of handle to use:
31 * 0 - Explicit handle.
32 * Handle is passed as a parameter to the function.
33 * Indicates that explicit handle information follows the header,
34 * which actually describes the handle.
35 * FC_BIND_GENERIC = 31 - Implicit handle with custom binding routines
36 * (MIDL_STUB_DESC::IMPLICIT_HANDLE_INFO::pGenericBindingInfo)
37 * FC_BIND_PRIMITIVE = 32 - Implicit handle using handle_t created by
38 * calling application
39 * FC_AUTO_HANDLE = 33 - Automatic handle
40 * FC_CALLBACK_HANDLE = 34 - Implicit handle used for a callback: current handle
41 * from last remote call
42 */
43 unsigned char handle_type;
44
45 /* procedure flags:
46 * Oi_FULL_PTR_USED = 0x01 - A full pointer can have the value NULL and can
47 * change during the call from NULL to non-NULL and supports aliasing
48 * and cycles. Indicates that the NdrFullPointerXlatInit function
49 * should be called.
50 * Oi_RPCSS_ALLOC_USED = 0x02 - Use RpcSS allocate/free routines instead of
51 * normal allocate/free routines
52 * Oi_OBJECT_PROC = 0x04 - Indicates a procedure that is part of an OLE
53 * interface, rather than a DCE RPC interface.
54 * Oi_HAS_RPCFLAGS = 0x08 - Indicates that the rpc_flags element is
55 * present in the header.
56 * Oi_HAS_COMM_OR_FAULT = 0x20 - If Oi_OBJECT_PROC not present only then
57 * indicates that the procedure has the comm_status or fault_status
58 * MIDL attribute.
59 * Oi_OBJ_USE_V2_INTERPRETER = 0x20 - If Oi_OBJECT_PROC present only
60 * then indicates that the format string is in -Oif or -Oicf format
61 * Oi_USE_NEW_INIT_ROUTINES = 0x40 - Use NdrXInitializeNew instead of
62 * NdrXInitialize?
63 */
64 unsigned char Oi_flags;
65
66 /* the zero-based index of the procedure */
67 unsigned short proc_num;
68
69 /* total size of all parameters on the stack, including any "this"
70 * pointer and/or return value */
71 unsigned short stack_size;
73
74/* same as above struct except additional element rpc_flags */
76{
77 unsigned char handle_type;
78 unsigned char Oi_flags;
79
80 /*
81 * RPCF_Idempotent = 0x0001 - [idempotent] MIDL attribute
82 * RPCF_Broadcast = 0x0002 - [broadcast] MIDL attribute
83 * RPCF_Maybe = 0x0004 - [maybe] MIDL attribute
84 * Reserved = 0x0008 - 0x0080
85 * RPCF_Message = 0x0100 - [message] MIDL attribute
86 * Reserved = 0x0200 - 0x1000
87 * RPCF_InputSynchronous = 0x2000 - unknown
88 * RPCF_Asynchronous = 0x4000 - [async] MIDL attribute
89 * Reserved = 0x8000
90 */
91 unsigned int rpc_flags;
92 unsigned short proc_num;
93 unsigned short stack_size;
94
96
98{
99 /* the pre-computed client buffer size so that interpreter can skip all
100 * or some (if the flag ClientMustSize is specified) of the sizing pass */
102
103 /* the pre-computed server buffer size so that interpreter can skip all
104 * or some (if the flag ServerMustSize is specified) of the sizing pass */
106
108
109 /* number of params */
110 unsigned char number_of_params;
112
114{
115 /* parameter direction. One of:
116 * FC_IN_PARAM_BASETYPE = 0x4e - an in param
117 * FC_RETURN_PARAM_BASETYPE = 0x53 - a return param
118 */
119 unsigned char param_direction;
120
121 /* One of: FC_BYTE,FC_CHAR,FC_SMALL,FC_USMALL,FC_WCHAR,FC_SHORT,FC_USHORT,
122 * FC_LONG,FC_ULONG,FC_FLOAT,FC_HYPER,FC_DOUBLE,FC_ENUM16,FC_ENUM32,
123 * FC_ERROR_STATUS_T,FC_INT3264,FC_UINT3264 */
124 unsigned char type_format_char;
126
128{
129 /* One of:
130 * FC_IN_PARAM = 0x4d - An in param
131 * FC_IN_OUT_PARAM = 0x50 - An in/out param
132 * FC_OUT_PARAM = 0x51 - An out param
133 * FC_RETURN_PARAM = 0x52 - A return value
134 * FC_IN_PARAM_NO_FREE_INST = 0x4f - A param for which no freeing is done
135 */
136 unsigned char param_direction;
137
138 /* Size of param on stack in NUMBERS OF INTS */
139 unsigned char stack_size;
140
141 /* offset in the type format string table */
142 unsigned short type_offset;
144
145typedef struct
146{
148 /* the offset on the calling stack where the parameter is located */
149 unsigned short stack_offset;
150 union
151 {
152 /* see NDR_PARAM_OI_BASETYPE::type_format_char */
153 unsigned char type_format_char;
154 /* offset into the provided type format string where the type for this
155 * parameter starts */
156 unsigned short type_offset;
157 } u;
159
160/* explicit handle description for FC_BIND_PRIMITIVE type */
161typedef struct _NDR_EHD_PRIMITIVE
162{
163 /* FC_BIND_PRIMITIVE */
164 unsigned char handle_type;
165
166 /* is the handle passed in via a pointer? */
167 unsigned char flag;
168
169 /* offset from the beginning of the stack to the handle in bytes */
170 unsigned short offset;
172
173/* explicit handle description for FC_BIND_GENERIC type */
174typedef struct _NDR_EHD_GENERIC
175{
176 /* FC_BIND_GENERIC */
177 unsigned char handle_type;
178
179 /* upper 4bits is a flag indicating whether the handle is passed in
180 * via a pointer. lower 4bits is the size of the user defined generic
181 * handle type. the size must be less than or equal to the machine
182 * register size */
183 unsigned char flag_and_size;
184
185 /* offset from the beginning of the stack to the handle in bytes */
186 unsigned short offset;
187
188 /* the index into the aGenericBindingRoutinesPairs field of MIDL_STUB_DESC
189 * giving the bind and unbind routines for the handle */
191
192 /* FC_PAD */
193 unsigned char unused;
195
196/* explicit handle description for FC_BIND_CONTEXT type */
197typedef struct _NDR_EHD_CONTEXT
198{
199 /* FC_BIND_CONTEXT */
200 unsigned char handle_type;
201
202 /* Any of the following flags:
203 * NDR_CONTEXT_HANDLE_CANNOT_BE_NULL = 0x01
204 * NDR_CONTEXT_HANDLE_SERIALIZE = 0x02
205 * NDR_CONTEXT_HANDLE_NO_SERIALIZE = 0x04
206 * NDR_STRICT_CONTEXT_HANDLE = 0x08
207 * HANDLE_PARAM_IS_RETURN = 0x10
208 * HANDLE_PARAM_IS_OUT = 0x20
209 * HANDLE_PARAM_IS_IN = 0x40
210 * HANDLE_PARAM_IS_VIA_PTR = 0x80
211 */
212 unsigned char flags;
213
214 /* offset from the beginning of the stack to the handle in bytes */
215 unsigned short offset;
216
217 /* zero-based index on rundown routine in apfnNdrRundownRoutines field
218 * of MIDL_STUB_DESC */
220
221 /* varies depending on NDR version used.
222 * V1: zero-based index into parameters
223 * V2: zero-based index into handles that are parameters */
224 unsigned char param_num;
226
227#include "poppack.h"
228
230{
236 /* size of stack */
237 unsigned short stack_size;
238 /* number of parameters. optional for client to give it to us */
239 unsigned int number_of_params;
240 /* location to put retval into */
242 /* correlation cache */
244};
245
247{
257
259 void **stack_top, void **fpu_stack ) DECLSPEC_HIDDEN;
261 void **stack_top ) DECLSPEC_HIDDEN;
262void client_do_args( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, enum stubless_phase phase,
263 void **fpu_args, unsigned short number_of_params, unsigned char *pRetVal ) DECLSPEC_HIDDEN;
265 unsigned int stack_size, BOOL object_proc,
266 void *buffer, unsigned int size, unsigned int *count ) DECLSPEC_HIDDEN;
#define DECLSPEC_HIDDEN
Definition: precomp.h:8
#define CDECL
Definition: compat.h:29
static jsval_t stack_top(script_ctx_t *ctx)
Definition: engine.c:104
unsigned int BOOL
Definition: ntddk_ex.h:94
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
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 * u
Definition: glfuncs.h:240
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
PFORMAT_STRING convert_old_args(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, unsigned int stack_size, BOOL object_proc, void *buffer, unsigned int size, unsigned int *count) DECLSPEC_HIDDEN
Definition: ndr_stubless.c:590
struct _NDR_PROC_HEADER_RPC NDR_PROC_HEADER_RPC
LONG_PTR CDECL ndr_async_client_call(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, void **stack_top) DECLSPEC_HIDDEN
RPC_STATUS NdrpCompleteAsyncServerCall(RPC_ASYNC_STATE *pAsync, void *Reply) DECLSPEC_HIDDEN
struct _NDR_EHD_CONTEXT NDR_EHD_CONTEXT
struct _NDR_PARAM_OI_OTHER NDR_PARAM_OI_OTHER
struct _NDR_PARAM_OI_BASETYPE NDR_PARAM_OI_BASETYPE
struct _NDR_EHD_PRIMITIVE NDR_EHD_PRIMITIVE
void client_do_args(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, enum stubless_phase phase, void **fpu_args, unsigned short number_of_params, unsigned char *pRetVal) DECLSPEC_HIDDEN
Definition: ndr_stubless.c:478
LONG_PTR CDECL ndr_client_call(PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat, void **stack_top, void **fpu_stack) DECLSPEC_HIDDEN
Definition: ndr_stubless.c:850
struct _NDR_PROC_HEADER NDR_PROC_HEADER
stubless_phase
Definition: ndr_stubless.h:247
@ STUBLESS_INITOUT
Definition: ndr_stubless.h:249
@ STUBLESS_GETBUFFER
Definition: ndr_stubless.h:252
@ STUBLESS_MARSHAL
Definition: ndr_stubless.h:253
@ STUBLESS_CALCSIZE
Definition: ndr_stubless.h:251
@ STUBLESS_UNMARSHAL
Definition: ndr_stubless.h:248
@ STUBLESS_CALLSERVER
Definition: ndr_stubless.h:250
@ STUBLESS_MUSTFREE
Definition: ndr_stubless.h:254
@ STUBLESS_FREE
Definition: ndr_stubless.h:255
struct _NDR_EHD_GENERIC NDR_EHD_GENERIC
struct _NDR_PROC_PARTIAL_OIF_HEADER NDR_PROC_PARTIAL_OIF_HEADER
RPC_STATUS NdrpCompleteAsyncClientCall(RPC_ASYNC_STATE *pAsync, void *Reply) DECLSPEC_HIDDEN
const unsigned char * PFORMAT_STRING
Definition: rpcndr.h:176
long RPC_STATUS
Definition: rpc.h:52
unsigned char type_format_char
Definition: ndr_stubless.h:153
unsigned short stack_offset
Definition: ndr_stubless.h:149
unsigned short type_offset
Definition: ndr_stubless.h:156
PARAM_ATTRIBUTES attr
Definition: ndr_stubless.h:147
unsigned char handle_type
Definition: ndr_stubless.h:200
unsigned char context_rundown_routine_index
Definition: ndr_stubless.h:219
unsigned char flags
Definition: ndr_stubless.h:212
unsigned char param_num
Definition: ndr_stubless.h:224
unsigned short offset
Definition: ndr_stubless.h:215
unsigned char flag_and_size
Definition: ndr_stubless.h:183
unsigned char unused
Definition: ndr_stubless.h:193
unsigned short offset
Definition: ndr_stubless.h:186
unsigned char handle_type
Definition: ndr_stubless.h:177
unsigned char binding_routine_pair_index
Definition: ndr_stubless.h:190
unsigned short offset
Definition: ndr_stubless.h:170
unsigned char handle_type
Definition: ndr_stubless.h:164
unsigned char flag
Definition: ndr_stubless.h:167
unsigned char type_format_char
Definition: ndr_stubless.h:124
unsigned char param_direction
Definition: ndr_stubless.h:119
unsigned char param_direction
Definition: ndr_stubless.h:136
unsigned char stack_size
Definition: ndr_stubless.h:139
unsigned short type_offset
Definition: ndr_stubless.h:142
unsigned char handle_type
Definition: ndr_stubless.h:77
unsigned int rpc_flags
Definition: ndr_stubless.h:91
unsigned char Oi_flags
Definition: ndr_stubless.h:78
unsigned short stack_size
Definition: ndr_stubless.h:93
unsigned short proc_num
Definition: ndr_stubless.h:92
unsigned char Oi_flags
Definition: ndr_stubless.h:64
unsigned char handle_type
Definition: ndr_stubless.h:43
unsigned short stack_size
Definition: ndr_stubless.h:71
unsigned short proc_num
Definition: ndr_stubless.h:67
unsigned short constant_client_buffer_size
Definition: ndr_stubless.h:101
INTERPRETER_OPT_FLAGS Oi2Flags
Definition: ndr_stubless.h:107
unsigned short constant_server_buffer_size
Definition: ndr_stubless.h:105
RPC_BINDING_HANDLE hBinding
Definition: ndr_stubless.h:235
MIDL_STUB_MESSAGE * pStubMsg
Definition: ndr_stubless.h:231
unsigned short stack_size
Definition: ndr_stubless.h:237
PFORMAT_STRING pHandleFormat
Definition: ndr_stubless.h:233
PFORMAT_STRING pParamFormat
Definition: ndr_stubless.h:234
ULONG_PTR NdrCorrCache[256]
Definition: ndr_stubless.h:243
unsigned int number_of_params
Definition: ndr_stubless.h:239
LONG_PTR * retval_ptr
Definition: ndr_stubless.h:241
const NDR_PROC_HEADER * pProcHeader
Definition: ndr_stubless.h:232
uint32_t ULONG_PTR
Definition: typedefs.h:65