home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / source / chap03 / lst32 / proxy / lower_p.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-20  |  8.3 KB  |  303 lines

  1. /* this ALWAYS GENERATED file contains the proxy stub code */
  2.  
  3.  
  4. /* File created by MIDL compiler version 2.00.0102 */
  5. /* at Fri Sep 20 18:36:01 1996
  6.  */
  7. //@@MIDL_FILE_HEADING(  )
  8.  
  9. #include "rpcproxy.h"
  10. #include "lower.h"
  11.  
  12.  
  13. extern const MIDL_FORMAT_STRING __MIDLFormatString;
  14.  
  15. extern const MIDL_FORMAT_STRING __MIDLProcFormatString;
  16.  
  17.  
  18. extern const MIDL_STUB_DESC Object_StubDesc;
  19.  
  20.  
  21. #pragma code_seg(".orpc")
  22.  
  23. HRESULT __stdcall ILowerStr_Lower_Proxy( 
  24.     ILowerStr __RPC_FAR * This,
  25.     /* [string][in] */ LPSTR inString,
  26.     /* [string][out] */ LPSTR __RPC_FAR *outString)
  27. {
  28.  
  29.     HRESULT _RetVal;
  30.     
  31.     RPC_MESSAGE _RpcMessage;
  32.     
  33.     MIDL_STUB_MESSAGE _StubMsg;
  34.     
  35.     *outString = 0;
  36.     RpcTryExcept
  37.         {
  38.         RpcTryFinally
  39.             {
  40.             NdrProxyInitialize(
  41.                       ( void __RPC_FAR *  )This,
  42.                       ( PRPC_MESSAGE  )&_RpcMessage,
  43.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  44.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  45.                       3);
  46.             
  47.             
  48.             
  49.             
  50.             _StubMsg.BufferLength = 12U;
  51.             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  52.                                            (unsigned char __RPC_FAR *)inString,
  53.                                            (PFORMAT_STRING) &__MIDLFormatString.Format[2] );
  54.             
  55.             NdrProxyGetBuffer(This, &_StubMsg);
  56.             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  57.                                          (unsigned char __RPC_FAR *)inString,
  58.                                          (PFORMAT_STRING) &__MIDLFormatString.Format[2] );
  59.             
  60.             NdrProxySendReceive(This, &_StubMsg);
  61.             
  62.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  63.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDLProcFormatString.Format[0] );
  64.             
  65.             NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  66.                                   (unsigned char __RPC_FAR * __RPC_FAR *)&outString,
  67.                                   (PFORMAT_STRING) &__MIDLFormatString.Format[4],
  68.                                   (unsigned char)0 );
  69.             
  70.             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
  71.             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
  72.             
  73.             }
  74.         RpcFinally
  75.             {
  76.             NdrProxyFreeBuffer(This, &_StubMsg);
  77.             
  78.             }
  79.         RpcEndFinally
  80.         
  81.         }
  82.     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
  83.         {
  84.         NdrClearOutParameters(
  85.                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  86.                          ( PFORMAT_STRING  )&__MIDLFormatString.Format[4],
  87.                          ( void __RPC_FAR * )outString);
  88.         _RetVal = NdrProxyErrorHandler(GetExceptionCode());
  89.         }
  90.     RpcEndExcept
  91.     return _RetVal;
  92. }
  93.  
  94. void __RPC_STUB ILowerStr_Lower_Stub(
  95.     IRpcStubBuffer *This,
  96.     IRpcChannelBuffer *_pRpcChannelBuffer,
  97.     PRPC_MESSAGE _pRpcMessage,
  98.     DWORD *_pdwStubPhase)
  99. {
  100.     LPSTR _M4;
  101.     HRESULT _RetVal;
  102.     MIDL_STUB_MESSAGE _StubMsg;
  103.     LPSTR inString;
  104.     LPSTR __RPC_FAR *outString;
  105.     
  106. NdrStubInitialize(
  107.                      _pRpcMessage,
  108.                      &_StubMsg,
  109.                      &Object_StubDesc,
  110.                      _pRpcChannelBuffer);
  111.     inString = 0;
  112.     outString = 0;
  113.     RpcTryFinally
  114.         {
  115.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  116.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDLProcFormatString.Format[0] );
  117.         
  118.         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  119.                                        (unsigned char __RPC_FAR * __RPC_FAR *)&inString,
  120.                                        (PFORMAT_STRING) &__MIDLFormatString.Format[2],
  121.                                        (unsigned char)0 );
  122.         
  123.         outString = &_M4;
  124.         _M4 = 0;
  125.         
  126.         *_pdwStubPhase = STUB_CALL_SERVER;
  127.         _RetVal = (((ILowerStr *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> Lower(
  128.          (ILowerStr *) ((CStdStubBuffer *)This)->pvServerObject,
  129.          inString,
  130.          outString);
  131.         
  132.         *_pdwStubPhase = STUB_MARSHAL;
  133.         
  134.         _StubMsg.BufferLength = 16U + 11U;
  135.         NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  136.                               (unsigned char __RPC_FAR *)outString,
  137.                               (PFORMAT_STRING) &__MIDLFormatString.Format[4] );
  138.         
  139.         _StubMsg.BufferLength += 16;
  140.         
  141.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  142.         NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  143.                             (unsigned char __RPC_FAR *)outString,
  144.                             (PFORMAT_STRING) &__MIDLFormatString.Format[4] );
  145.         
  146.         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
  147.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  148.         
  149.         }
  150.     RpcFinally
  151.         {
  152.         NdrPointerFree( &_StubMsg,
  153.                         (unsigned char __RPC_FAR *)outString,
  154.                         &__MIDLFormatString.Format[4] );
  155.         
  156.         }
  157.     RpcEndFinally
  158.     _pRpcMessage->BufferLength = 
  159.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  160.     
  161. }
  162.  
  163.  
  164. static const MIDL_STUB_DESC Object_StubDesc = 
  165.     {
  166.     0,
  167.     NdrOleAllocate,
  168.     NdrOleFree,
  169.     0,
  170.     0,
  171.     0,
  172.     0,
  173.     0,
  174.     __MIDLFormatString.Format,
  175.     0, /* -error bounds_check flag */
  176.     0x10001, /* Ndr library version */
  177.     0,
  178.     0x2000066, /* MIDL Version 2.0.102 */
  179.     0
  180.     };
  181.  
  182. const CInterfaceProxyVtbl _ILowerStrProxyVtbl = 
  183. {
  184.     &IID_ILowerStr,
  185.     IUnknown_QueryInterface_Proxy,
  186.     IUnknown_AddRef_Proxy,
  187.     IUnknown_Release_Proxy ,
  188.     ILowerStr_Lower_Proxy
  189. };
  190.  
  191.  
  192. static const PRPC_STUB_FUNCTION ILowerStr_table[] =
  193. {
  194.     ILowerStr_Lower_Stub
  195. };
  196.  
  197. const CInterfaceStubVtbl _ILowerStrStubVtbl =
  198. {
  199.     &IID_ILowerStr,
  200.     0,
  201.     4,
  202.     &ILowerStr_table[-3],
  203.     CStdStubBuffer_METHODS
  204. };
  205.  
  206. #pragma data_seg(".rdata")
  207.  
  208. #if !defined(__RPC_WIN32__)
  209. #error  Invalid build platform for this stub.
  210. #endif
  211.  
  212. static const MIDL_FORMAT_STRING __MIDLProcFormatString =
  213.     {
  214.         0,
  215.         {
  216.             
  217.             0x4d,        /* FC_IN_PARAM */
  218. #ifndef _ALPHA_
  219.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  220. #else
  221.             0x2,        /* Alpha Stack size = 2 */
  222. #endif
  223. /*  2 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  224. /*  4 */    
  225.             0x51,        /* FC_OUT_PARAM */
  226. #ifndef _ALPHA_
  227.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  228. #else
  229.             0x2,        /* Alpha Stack size = 2 */
  230. #endif
  231. /*  6 */    NdrFcShort( 0x4 ),    /* Type Offset=4 */
  232. /*  8 */    0x53,        /* FC_RETURN_PARAM_BASETYPE */
  233.             0x8,        /* FC_LONG */
  234.  
  235.             0x0
  236.         }
  237.     };
  238.  
  239. static const MIDL_FORMAT_STRING __MIDLFormatString =
  240.     {
  241.         0,
  242.         {
  243.             0x11, 0x8,    /* FC_RP [simple_pointer] */
  244. /*  2 */    
  245.             0x22,        /* FC_C_CSTRING */
  246.             0x5c,        /* FC_PAD */
  247. /*  4 */    
  248.             0x11, 0x14,    /* FC_RP [alloced_on_stack] */
  249. /*  6 */    NdrFcShort( 0x2 ),    /* Offset= 2 (8) */
  250. /*  8 */    
  251.             0x13, 0x8,    /* FC_OP [simple_pointer] */
  252. /* 10 */    
  253.             0x22,        /* FC_C_CSTRING */
  254.             0x5c,        /* FC_PAD */
  255.  
  256.             0x0
  257.         }
  258.     };
  259.  
  260. const CInterfaceProxyVtbl * _lower_ProxyVtblList[] = 
  261. {
  262.     ( CInterfaceProxyVtbl *) &_ILowerStrProxyVtbl,
  263.     0
  264. };
  265.  
  266. const CInterfaceStubVtbl * _lower_StubVtblList[] = 
  267. {
  268.     ( CInterfaceStubVtbl *) &_ILowerStrStubVtbl,
  269.     0
  270. };
  271.  
  272. PCInterfaceName const _lower_InterfaceNamesList[] = 
  273. {
  274.     "ILowerStr",
  275.     0
  276. };
  277.  
  278.  
  279. #define _lower_CHECK_IID(n)    IID_GENERIC_CHECK_IID( _lower, pIID, n)
  280.  
  281. int __stdcall _lower_IID_Lookup( const IID * pIID, int * pIndex )
  282. {
  283.     
  284.     if(!_lower_CHECK_IID(0))
  285.         {
  286.         *pIndex = 0;
  287.         return 1;
  288.         }
  289.  
  290.     return 0;
  291. }
  292.  
  293. const ExtendedProxyFileInfo lower_ProxyFileInfo = 
  294. {
  295.     (PCInterfaceProxyVtblList *) & _lower_ProxyVtblList,
  296.     (PCInterfaceStubVtblList *) & _lower_StubVtblList,
  297.     (const PCInterfaceName * ) & _lower_InterfaceNamesList,
  298.     0, // no delegation
  299.     & _lower_IID_Lookup, 
  300.     1,
  301.     1
  302. };
  303.