ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

ndr_stubless.h
Go to the documentation of this file.
00001 /*
00002  * NDR -Oi,-Oif,-Oicf Interpreter
00003  *
00004  * Copyright 2007 Robert Shearman (for CodeWeavers)
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00019  */
00020 
00021 #include "ndrtypes.h"
00022 
00023 /* there can't be any alignment with the structures in this file */
00024 #include "pshpack1.h"
00025 
00026 typedef struct _NDR_PROC_HEADER
00027 {
00028     /* type of handle to use:
00029      * RPC_FC_BIND_EXPLICIT = 0 - Explicit handle.
00030      *   Handle is passed as a parameter to the function.
00031      *   Indicates that explicit handle information follows the header,
00032      *   which actually describes the handle.
00033      * RPC_FC_BIND_GENERIC = 31 - Implicit handle with custom binding routines
00034      *   (MIDL_STUB_DESC::IMPLICIT_HANDLE_INFO::pGenericBindingInfo)
00035      * RPC_FC_BIND_PRIMITIVE = 32 - Implicit handle using handle_t created by
00036      *   calling application
00037      * RPC_FC_AUTO_HANDLE = 33 - Automatic handle
00038      * RPC_FC_CALLBACK_HANDLE = 34 - undocumented
00039      */
00040     unsigned char handle_type;
00041 
00042     /* procedure flags:
00043      * Oi_FULL_PTR_USED = 0x01 - A full pointer can have the value NULL and can
00044      *   change during the call from NULL to non-NULL and supports aliasing
00045      *   and cycles. Indicates that the NdrFullPointerXlatInit function
00046      *   should be called.
00047      * Oi_RPCSS_ALLOC_USED = 0x02 - Use RpcSS allocate/free routines instead of
00048      *   normal allocate/free routines
00049      * Oi_OBJECT_PROC = 0x04 - Indicates a procedure that is part of an OLE
00050      *   interface, rather than a DCE RPC interface.
00051      * Oi_HAS_RPCFLAGS = 0x08 - Indicates that the rpc_flags element is
00052      *   present in the header.
00053      * Oi_HAS_COMM_OR_FAULT = 0x20 - If Oi_OBJECT_PROC not present only then
00054      *   indicates that the procedure has the comm_status or fault_status
00055      *   MIDL attribute.
00056      * Oi_OBJ_USE_V2_INTERPRETER = 0x20 - If Oi_OBJECT_PROC present only
00057      *   then indicates that the format string is in -Oif or -Oicf format
00058      * Oi_USE_NEW_INIT_ROUTINES = 0x40 - Use NdrXInitializeNew instead of
00059      *   NdrXInitialize?
00060      */
00061     unsigned char Oi_flags;
00062 
00063     /* the zero-based index of the procedure */
00064     unsigned short proc_num;
00065 
00066     /* total size of all parameters on the stack, including any "this"
00067      * pointer and/or return value */
00068     unsigned short stack_size;
00069 } NDR_PROC_HEADER;
00070 
00071 /* same as above struct except additional element rpc_flags */
00072 typedef struct _NDR_PROC_HEADER_RPC
00073 {
00074     unsigned char handle_type;
00075     unsigned char Oi_flags;
00076 
00077     /*
00078      * RPCF_Idempotent = 0x0001 - [idempotent] MIDL attribute
00079      * RPCF_Broadcast = 0x0002 - [broadcast] MIDL attribute
00080      * RPCF_Maybe = 0x0004 - [maybe] MIDL attribute
00081      * Reserved = 0x0008 - 0x0080
00082      * RPCF_Message = 0x0100 - [message] MIDL attribute
00083      * Reserved = 0x0200 - 0x1000
00084      * RPCF_InputSynchronous = 0x2000 - unknown
00085      * RPCF_Asynchronous = 0x4000 - [async] MIDL attribute
00086      * Reserved = 0x8000
00087      */
00088     unsigned int rpc_flags;
00089     unsigned short proc_num;
00090     unsigned short stack_size;
00091 
00092 } NDR_PROC_HEADER_RPC;
00093 
00094 typedef struct _NDR_PROC_PARTIAL_OIF_HEADER
00095 {
00096     /* the pre-computed client buffer size so that interpreter can skip all
00097      * or some (if the flag RPC_FC_PROC_OI2F_CLTMUSTSIZE is specified) of the
00098      * sizing pass */
00099     unsigned short constant_client_buffer_size;
00100 
00101     /* the pre-computed server buffer size so that interpreter can skip all
00102      * or some (if the flag RPC_FC_PROC_OI2F_SRVMUSTSIZE is specified) of the
00103      * sizing pass */
00104     unsigned short constant_server_buffer_size;
00105 
00106     INTERPRETER_OPT_FLAGS Oi2Flags;
00107 
00108     /* number of params */
00109     unsigned char number_of_params;
00110 } NDR_PROC_PARTIAL_OIF_HEADER;
00111 
00112 typedef struct _NDR_PARAM_OI_BASETYPE
00113 {
00114     /* parameter direction. One of:
00115      * FC_IN_PARAM_BASETYPE = 0x4e - an in param
00116      * FC_RETURN_PARAM_BASETYPE = 0x53 - a return param
00117      */
00118     unsigned char param_direction;
00119 
00120     /* One of: FC_BYTE,FC_CHAR,FC_SMALL,FC_USMALL,FC_WCHAR,FC_SHORT,FC_USHORT,
00121      * FC_LONG,FC_ULONG,FC_FLOAT,FC_HYPER,FC_DOUBLE,FC_ENUM16,FC_ENUM32,
00122      * FC_ERROR_STATUS_T,FC_INT3264,FC_UINT3264 */
00123     unsigned char type_format_char;
00124 } NDR_PARAM_OI_BASETYPE;
00125 
00126 typedef struct _NDR_PARAM_OI_OTHER
00127 {
00128     /* One of:
00129      * FC_IN_PARAM = 0x4d - An in param
00130      * FC_IN_OUT_PARAM = 0x50 - An in/out param
00131      * FC_OUT_PARAM = 0x51 - An out param
00132      * FC_RETURN_PARAM = 0x52 - A return value
00133      * FC_IN_PARAM_NO_FREE_INST = 0x4f - A param for which no freeing is done
00134      */
00135     unsigned char param_direction;
00136 
00137     /* Size of param on stack in NUMBERS OF INTS */
00138     unsigned char stack_size;
00139 
00140     /* offset in the type format string table */
00141     unsigned short type_offset;
00142 } NDR_PARAM_OI_OTHER;
00143 
00144 typedef struct
00145 {
00146     PARAM_ATTRIBUTES attr;
00147     /* the offset on the calling stack where the parameter is located */
00148     unsigned short stack_offset;
00149     union
00150     {
00151         /* see NDR_PARAM_OI_BASETYPE::type_format_char */
00152         unsigned char type_format_char;
00153         /* offset into the provided type format string where the type for this
00154          * parameter starts */
00155         unsigned short type_offset;
00156     } u;
00157 } NDR_PARAM_OIF;
00158 
00159 /* explicit handle description for FC_BIND_PRIMITIVE type */
00160 typedef struct _NDR_EHD_PRIMITIVE
00161 {
00162     /* FC_BIND_PRIMITIVE */
00163     unsigned char handle_type;
00164 
00165     /* is the handle passed in via a pointer? */
00166     unsigned char flag;
00167 
00168     /* offset from the beginning of the stack to the handle in bytes */
00169     unsigned short offset;
00170 } NDR_EHD_PRIMITIVE;
00171 
00172 /* explicit handle description for FC_BIND_GENERIC type */
00173 typedef struct _NDR_EHD_GENERIC
00174 {
00175     /* FC_BIND_GENERIC */
00176     unsigned char handle_type;
00177 
00178     /* upper 4bits is a flag indicating whether the handle is passed in
00179      * via a pointer. lower 4bits is the size of the user defined generic
00180      * handle type. the size must be less than or equal to the machine
00181      * register size */
00182     unsigned char flag_and_size;
00183 
00184     /* offset from the beginning of the stack to the handle in bytes */
00185     unsigned short offset;
00186 
00187     /* the index into the aGenericBindingRoutinesPairs field of MIDL_STUB_DESC
00188      * giving the bind and unbind routines for the handle */
00189     unsigned char binding_routine_pair_index;
00190 
00191     /* FC_PAD */
00192     unsigned char unused;
00193 } NDR_EHD_GENERIC;
00194 
00195 /* explicit handle description for FC_BIND_CONTEXT type */
00196 typedef struct _NDR_EHD_CONTEXT
00197 {
00198     /* FC_BIND_CONTEXT */
00199     unsigned char handle_type;
00200 
00201     /* Any of the following flags:
00202      * NDR_CONTEXT_HANDLE_CANNOT_BE_NULL = 0x01
00203      * NDR_CONTEXT_HANDLE_SERIALIZE = 0x02
00204      * NDR_CONTEXT_HANDLE_NO_SERIALIZE = 0x04
00205      * NDR_STRICT_CONTEXT_HANDLE = 0x08
00206      * HANDLE_PARAM_IS_OUT = 0x20
00207      * HANDLE_PARAM_IS_RETURN = 0x21
00208      * HANDLE_PARAM_IS_IN = 0x40
00209      * HANDLE_PARAM_IS_VIA_PTR = 0x80
00210      */
00211     unsigned char flags;
00212 
00213     /* offset from the beginning of the stack to the handle in bytes */
00214     unsigned short offset;
00215 
00216     /* zero-based index on rundown routine in apfnNdrRundownRoutines field
00217      * of MIDL_STUB_DESC */
00218     unsigned char context_rundown_routine_index;
00219 
00220     /* varies depending on NDR version used.
00221      * V1: zero-based index into parameters
00222      * V2: zero-based index into handles that are parameters */
00223     unsigned char param_num;
00224 } NDR_EHD_CONTEXT;
00225 
00226 #include "poppack.h"
00227 
00228 enum stubless_phase
00229 {
00230     STUBLESS_UNMARSHAL,
00231     STUBLESS_INITOUT,
00232     STUBLESS_CALLSERVER,
00233     STUBLESS_CALCSIZE,
00234     STUBLESS_GETBUFFER,
00235     STUBLESS_MARSHAL,
00236     STUBLESS_FREE
00237 };
00238 
00239 LONG_PTR CDECL ndr_client_call( PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat,
00240                                 void **stack_top, void **fpu_stack ) DECLSPEC_HIDDEN;
00241 LONG_PTR CDECL ndr_async_client_call( PMIDL_STUB_DESC pStubDesc, PFORMAT_STRING pFormat,
00242                                       void **stack_top ) DECLSPEC_HIDDEN;
00243 void client_do_args( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat, enum stubless_phase phase,
00244                      void **fpu_args, unsigned short number_of_params, unsigned char *pRetVal ) DECLSPEC_HIDDEN;
00245 PFORMAT_STRING convert_old_args( PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat,
00246                                  unsigned int stack_size, BOOL object_proc,
00247                                  void *buffer, unsigned int size, unsigned int *count ) DECLSPEC_HIDDEN;
00248 RPC_STATUS NdrpCompleteAsyncClientCall(RPC_ASYNC_STATE *pAsync, void *Reply) DECLSPEC_HIDDEN;

Generated on Sun May 27 2012 04:26:03 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.