home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / inole2 / chap06 / ianimal / ianimal_p.c < prev    next >
C/C++ Source or Header  |  1998-03-30  |  23KB  |  742 lines

  1. /* this ALWAYS GENERATED file contains the proxy stub code */
  2.  
  3.  
  4. /* File created by MIDL compiler version 3.03.0110 */
  5. /* at Mon Mar 30 03:48:14 1998
  6.  */
  7. /* Compiler settings for ianimal.idl:
  8.     Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, app_config, c_ext
  9.     error checks: none
  10. */
  11. //@@MIDL_FILE_HEADING(  )
  12.  
  13.  
  14. /* verify that the <rpcproxy.h> version is high enough to compile this file*/
  15. #ifndef __REDQ_RPCPROXY_H_VERSION__
  16. #define __REQUIRED_RPCPROXY_H_VERSION__ 440
  17. #endif
  18.  
  19.  
  20. #include "rpcproxy.h"
  21. #ifndef __RPCPROXY_H_VERSION__
  22. #error this stub requires an updated version of <rpcproxy.h>
  23. #endif // __RPCPROXY_H_VERSION__
  24.  
  25.  
  26. #include "ianimal.h"
  27.  
  28. #define TYPE_FORMAT_STRING_SIZE   35                                
  29. #define PROC_FORMAT_STRING_SIZE   31                                
  30.  
  31. typedef struct _MIDL_TYPE_FORMAT_STRING
  32.     {
  33.     short          Pad;
  34.     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
  35.     } MIDL_TYPE_FORMAT_STRING;
  36.  
  37. typedef struct _MIDL_PROC_FORMAT_STRING
  38.     {
  39.     short          Pad;
  40.     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
  41.     } MIDL_PROC_FORMAT_STRING;
  42.  
  43.  
  44. extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
  45. extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
  46.  
  47.  
  48. /* Object interface: IUnknown, ver. 0.0,
  49.    GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
  50.  
  51.  
  52. /* Object interface: IAnimal, ver. 0.0,
  53.    GUID={0x0002114a,0x0000,0x0000,{0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
  54.  
  55.  
  56. extern const MIDL_STUB_DESC Object_StubDesc;
  57.  
  58.  
  59. #pragma code_seg(".orpc")
  60.  
  61. HRESULT STDMETHODCALLTYPE IAnimal_Eat_Proxy( 
  62.     IAnimal __RPC_FAR * This,
  63.     /* [in] */ LPTSTR pszFoodRecommended,
  64.     /* [out][in] */ LPTSTR pszFoodEaten,
  65.     /* [in] */ short cchEaten)
  66. {
  67.  
  68.     HRESULT _RetVal;
  69.     
  70.     RPC_MESSAGE _RpcMessage;
  71.     
  72.     MIDL_STUB_MESSAGE _StubMsg;
  73.     
  74.     RpcTryExcept
  75.         {
  76.         NdrProxyInitialize(
  77.                       ( void __RPC_FAR *  )This,
  78.                       ( PRPC_MESSAGE  )&_RpcMessage,
  79.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  80.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  81.                       3);
  82.         
  83.         
  84.         
  85.         RpcTryFinally
  86.             {
  87.             
  88.             _StubMsg.BufferLength = 12U + 14U + 4U;
  89.             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  90.                                            (unsigned char __RPC_FAR *)pszFoodRecommended,
  91.                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2] );
  92.             
  93.             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  94.                                            (unsigned char __RPC_FAR *)pszFoodEaten,
  95.                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2] );
  96.             
  97.             NdrProxyGetBuffer(This, &_StubMsg);
  98.             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  99.                                          (unsigned char __RPC_FAR *)pszFoodRecommended,
  100.                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2] );
  101.             
  102.             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  103.                                          (unsigned char __RPC_FAR *)pszFoodEaten,
  104.                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2] );
  105.             
  106.             *(( short __RPC_FAR * )_StubMsg.Buffer)++ = cchEaten;
  107.             
  108.             NdrProxySendReceive(This, &_StubMsg);
  109.             
  110.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  111.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  112.             
  113.             NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  114.                                            (unsigned char __RPC_FAR * __RPC_FAR *)&pszFoodEaten,
  115.                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2],
  116.                                            (unsigned char)0 );
  117.             
  118.             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
  119.             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
  120.             
  121.             }
  122.         RpcFinally
  123.             {
  124.             NdrProxyFreeBuffer(This, &_StubMsg);
  125.             
  126.             }
  127.         RpcEndFinally
  128.         
  129.         }
  130.     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
  131.         {
  132.         NdrClearOutParameters(
  133.                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  134.                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[0],
  135.                          ( void __RPC_FAR * )pszFoodEaten);
  136.         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
  137.         }
  138.     RpcEndExcept
  139.     return _RetVal;
  140. }
  141.  
  142. void __RPC_STUB IAnimal_Eat_Stub(
  143.     IRpcStubBuffer *This,
  144.     IRpcChannelBuffer *_pRpcChannelBuffer,
  145.     PRPC_MESSAGE _pRpcMessage,
  146.     DWORD *_pdwStubPhase)
  147. {
  148.     HRESULT _RetVal;
  149.     MIDL_STUB_MESSAGE _StubMsg;
  150.     short cchEaten;
  151.     LPTSTR pszFoodEaten;
  152.     LPTSTR pszFoodRecommended;
  153.     
  154. NdrStubInitialize(
  155.                      _pRpcMessage,
  156.                      &_StubMsg,
  157.                      &Object_StubDesc,
  158.                      _pRpcChannelBuffer);
  159.     ( LPTSTR  )pszFoodRecommended = 0;
  160.     ( LPTSTR  )pszFoodEaten = 0;
  161.     RpcTryFinally
  162.         {
  163.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  164.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  165.         
  166.         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  167.                                        (unsigned char __RPC_FAR * __RPC_FAR *)&pszFoodRecommended,
  168.                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2],
  169.                                        (unsigned char)0 );
  170.         
  171.         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  172.                                        (unsigned char __RPC_FAR * __RPC_FAR *)&pszFoodEaten,
  173.                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2],
  174.                                        (unsigned char)0 );
  175.         
  176.         cchEaten = *(( short __RPC_FAR * )_StubMsg.Buffer)++;
  177.         
  178.         
  179.         *_pdwStubPhase = STUB_CALL_SERVER;
  180.         _RetVal = (((IAnimal *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> Eat(
  181.        (IAnimal *) ((CStdStubBuffer *)This)->pvServerObject,
  182.        pszFoodRecommended,
  183.        pszFoodEaten,
  184.        cchEaten);
  185.         
  186.         *_pdwStubPhase = STUB_MARSHAL;
  187.         
  188.         _StubMsg.BufferLength = 12U + 10U;
  189.         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  190.                                        (unsigned char __RPC_FAR *)pszFoodEaten,
  191.                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2] );
  192.         
  193.         _StubMsg.BufferLength += 16;
  194.         
  195.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  196.         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  197.                                      (unsigned char __RPC_FAR *)pszFoodEaten,
  198.                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2] );
  199.         
  200.         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
  201.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  202.         
  203.         }
  204.     RpcFinally
  205.         {
  206.         }
  207.     RpcEndFinally
  208.     _pRpcMessage->BufferLength = 
  209.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  210.     
  211. }
  212.  
  213.  
  214. HRESULT STDMETHODCALLTYPE IAnimal_Sleep_Proxy( 
  215.     IAnimal __RPC_FAR * This,
  216.     /* [out][in] */ short __RPC_FAR *pcMinutes)
  217. {
  218.  
  219.     HRESULT _RetVal;
  220.     
  221.     RPC_MESSAGE _RpcMessage;
  222.     
  223.     MIDL_STUB_MESSAGE _StubMsg;
  224.     
  225.     RpcTryExcept
  226.         {
  227.         NdrProxyInitialize(
  228.                       ( void __RPC_FAR *  )This,
  229.                       ( PRPC_MESSAGE  )&_RpcMessage,
  230.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  231.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  232.                       4);
  233.         
  234.         
  235.         
  236.         RpcTryFinally
  237.             {
  238.             
  239.             _StubMsg.BufferLength = 2U;
  240.             NdrProxyGetBuffer(This, &_StubMsg);
  241.             *(( short __RPC_FAR * )_StubMsg.Buffer)++ = *pcMinutes;
  242.             
  243.             NdrProxySendReceive(This, &_StubMsg);
  244.             
  245.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  246.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[12] );
  247.             
  248.             *pcMinutes = *(( short __RPC_FAR * )_StubMsg.Buffer)++;
  249.             
  250.             _StubMsg.Buffer += 2;
  251.             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
  252.             
  253.             }
  254.         RpcFinally
  255.             {
  256.             NdrProxyFreeBuffer(This, &_StubMsg);
  257.             
  258.             }
  259.         RpcEndFinally
  260.         
  261.         }
  262.     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
  263.         {
  264.         NdrClearOutParameters(
  265.                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  266.                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[4],
  267.                          ( void __RPC_FAR * )pcMinutes);
  268.         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
  269.         }
  270.     RpcEndExcept
  271.     return _RetVal;
  272. }
  273.  
  274. void __RPC_STUB IAnimal_Sleep_Stub(
  275.     IRpcStubBuffer *This,
  276.     IRpcChannelBuffer *_pRpcChannelBuffer,
  277.     PRPC_MESSAGE _pRpcMessage,
  278.     DWORD *_pdwStubPhase)
  279. {
  280.     HRESULT _RetVal;
  281.     MIDL_STUB_MESSAGE _StubMsg;
  282.     short __RPC_FAR *pcMinutes;
  283.     
  284. NdrStubInitialize(
  285.                      _pRpcMessage,
  286.                      &_StubMsg,
  287.                      &Object_StubDesc,
  288.                      _pRpcChannelBuffer);
  289.     ( short __RPC_FAR * )pcMinutes = 0;
  290.     RpcTryFinally
  291.         {
  292.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  293.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[12] );
  294.         
  295.         pcMinutes = ( short __RPC_FAR * )_StubMsg.Buffer;
  296.         _StubMsg.Buffer += sizeof( short  );
  297.         
  298.         
  299.         *_pdwStubPhase = STUB_CALL_SERVER;
  300.         _RetVal = (((IAnimal *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> Sleep((IAnimal *) ((CStdStubBuffer *)This)->pvServerObject,pcMinutes);
  301.         
  302.         *_pdwStubPhase = STUB_MARSHAL;
  303.         
  304.         _StubMsg.BufferLength = 2U + 6U;
  305.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  306.         *(( short __RPC_FAR * )_StubMsg.Buffer)++ = *pcMinutes;
  307.         
  308.         _StubMsg.Buffer += 2;
  309.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  310.         
  311.         }
  312.     RpcFinally
  313.         {
  314.         }
  315.     RpcEndFinally
  316.     _pRpcMessage->BufferLength = 
  317.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  318.     
  319. }
  320.  
  321.  
  322. HRESULT STDMETHODCALLTYPE IAnimal_Procreate_Proxy( 
  323.     IAnimal __RPC_FAR * This,
  324.     /* [out] */ short __RPC_FAR *pcOffspring)
  325. {
  326.  
  327.     HRESULT _RetVal;
  328.     
  329.     RPC_MESSAGE _RpcMessage;
  330.     
  331.     MIDL_STUB_MESSAGE _StubMsg;
  332.     
  333.     RpcTryExcept
  334.         {
  335.         NdrProxyInitialize(
  336.                       ( void __RPC_FAR *  )This,
  337.                       ( PRPC_MESSAGE  )&_RpcMessage,
  338.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  339.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  340.                       5);
  341.         
  342.         
  343.         
  344.         RpcTryFinally
  345.             {
  346.             
  347.             _StubMsg.BufferLength = 0U;
  348.             NdrProxyGetBuffer(This, &_StubMsg);
  349.             NdrProxySendReceive(This, &_StubMsg);
  350.             
  351.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  352.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[18] );
  353.             
  354.             *pcOffspring = *(( short __RPC_FAR * )_StubMsg.Buffer)++;
  355.             
  356.             _StubMsg.Buffer += 2;
  357.             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
  358.             
  359.             }
  360.         RpcFinally
  361.             {
  362.             NdrProxyFreeBuffer(This, &_StubMsg);
  363.             
  364.             }
  365.         RpcEndFinally
  366.         
  367.         }
  368.     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
  369.         {
  370.         NdrClearOutParameters(
  371.                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  372.                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[8],
  373.                          ( void __RPC_FAR * )pcOffspring);
  374.         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
  375.         }
  376.     RpcEndExcept
  377.     return _RetVal;
  378. }
  379.  
  380. void __RPC_STUB IAnimal_Procreate_Stub(
  381.     IRpcStubBuffer *This,
  382.     IRpcChannelBuffer *_pRpcChannelBuffer,
  383.     PRPC_MESSAGE _pRpcMessage,
  384.     DWORD *_pdwStubPhase)
  385. {
  386.     short _M4;
  387.     HRESULT _RetVal;
  388.     MIDL_STUB_MESSAGE _StubMsg;
  389.     short __RPC_FAR *pcOffspring;
  390.     
  391. NdrStubInitialize(
  392.                      _pRpcMessage,
  393.                      &_StubMsg,
  394.                      &Object_StubDesc,
  395.                      _pRpcChannelBuffer);
  396.     ( short __RPC_FAR * )pcOffspring = 0;
  397.     RpcTryFinally
  398.         {
  399.         pcOffspring = &_M4;
  400.         
  401.         *_pdwStubPhase = STUB_CALL_SERVER;
  402.         _RetVal = (((IAnimal *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> Procreate((IAnimal *) ((CStdStubBuffer *)This)->pvServerObject,pcOffspring);
  403.         
  404.         *_pdwStubPhase = STUB_MARSHAL;
  405.         
  406.         _StubMsg.BufferLength = 2U + 6U;
  407.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  408.         *(( short __RPC_FAR * )_StubMsg.Buffer)++ = *pcOffspring;
  409.         
  410.         _StubMsg.Buffer += 2;
  411.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  412.         
  413.         }
  414.     RpcFinally
  415.         {
  416.         }
  417.     RpcEndFinally
  418.     _pRpcMessage->BufferLength = 
  419.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  420.     
  421. }
  422.  
  423.  
  424. HRESULT STDMETHODCALLTYPE IAnimal_WhatKindOfAnimal_Proxy( 
  425.     IAnimal __RPC_FAR * This,
  426.     /* [out] */ IID __RPC_FAR *pIID)
  427. {
  428.  
  429.     HRESULT _RetVal;
  430.     
  431.     RPC_MESSAGE _RpcMessage;
  432.     
  433.     MIDL_STUB_MESSAGE _StubMsg;
  434.     
  435.     MIDL_memset(
  436.                pIID,
  437.                0,
  438.                sizeof( IID  ));
  439.     RpcTryExcept
  440.         {
  441.         NdrProxyInitialize(
  442.                       ( void __RPC_FAR *  )This,
  443.                       ( PRPC_MESSAGE  )&_RpcMessage,
  444.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  445.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  446.                       6);
  447.         
  448.         
  449.         
  450.         RpcTryFinally
  451.             {
  452.             
  453.             _StubMsg.BufferLength = 0U;
  454.             NdrProxyGetBuffer(This, &_StubMsg);
  455.             NdrProxySendReceive(This, &_StubMsg);
  456.             
  457.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  458.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[24] );
  459.             
  460.             NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  461.                                        (unsigned char __RPC_FAR * __RPC_FAR *)&pIID,
  462.                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[22],
  463.                                        (unsigned char)0 );
  464.             
  465.             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
  466.             
  467.             }
  468.         RpcFinally
  469.             {
  470.             NdrProxyFreeBuffer(This, &_StubMsg);
  471.             
  472.             }
  473.         RpcEndFinally
  474.         
  475.         }
  476.     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
  477.         {
  478.         NdrClearOutParameters(
  479.                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  480.                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[12],
  481.                          ( void __RPC_FAR * )pIID);
  482.         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
  483.         }
  484.     RpcEndExcept
  485.     return _RetVal;
  486. }
  487.  
  488. void __RPC_STUB IAnimal_WhatKindOfAnimal_Stub(
  489.     IRpcStubBuffer *This,
  490.     IRpcChannelBuffer *_pRpcChannelBuffer,
  491.     PRPC_MESSAGE _pRpcMessage,
  492.     DWORD *_pdwStubPhase)
  493. {
  494.     HRESULT _RetVal;
  495.     MIDL_STUB_MESSAGE _StubMsg;
  496.     IID _pIIDM;
  497.     IID __RPC_FAR *pIID;
  498.     
  499. NdrStubInitialize(
  500.                      _pRpcMessage,
  501.                      &_StubMsg,
  502.                      &Object_StubDesc,
  503.                      _pRpcChannelBuffer);
  504.     ( IID __RPC_FAR * )pIID = 0;
  505.     RpcTryFinally
  506.         {
  507.         pIID = &_pIIDM;
  508.         
  509.         *_pdwStubPhase = STUB_CALL_SERVER;
  510.         _RetVal = (((IAnimal *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> WhatKindOfAnimal((IAnimal *) ((CStdStubBuffer *)This)->pvServerObject,pIID);
  511.         
  512.         *_pdwStubPhase = STUB_MARSHAL;
  513.         
  514.         _StubMsg.BufferLength = 0U + 11U;
  515.         NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  516.                                    (unsigned char __RPC_FAR *)pIID,
  517.                                    (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[22] );
  518.         
  519.         _StubMsg.BufferLength += 16;
  520.         
  521.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  522.         NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  523.                                  (unsigned char __RPC_FAR *)pIID,
  524.                                  (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[22] );
  525.         
  526.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  527.         
  528.         }
  529.     RpcFinally
  530.         {
  531.         }
  532.     RpcEndFinally
  533.     _pRpcMessage->BufferLength = 
  534.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  535.     
  536. }
  537.  
  538.  
  539. static const MIDL_STUB_DESC Object_StubDesc = 
  540.     {
  541.     0,
  542.     NdrOleAllocate,
  543.     NdrOleFree,
  544.     0,
  545.     0,
  546.     0,
  547.     0,
  548.     0,
  549.     __MIDL_TypeFormatString.Format,
  550.     0, /* -error bounds_check flag */
  551.     0x10001, /* Ndr library version */
  552.     0,
  553.     0x303006e, /* MIDL Version 3.3.110 */
  554.     0,
  555.     0,
  556.     0,  /* Reserved1 */
  557.     0,  /* Reserved2 */
  558.     0,  /* Reserved3 */
  559.     0,  /* Reserved4 */
  560.     0   /* Reserved5 */
  561.     };
  562.  
  563. const CINTERFACE_PROXY_VTABLE(7) _IAnimalProxyVtbl = 
  564. {
  565.     &IID_IAnimal,
  566.     IUnknown_QueryInterface_Proxy,
  567.     IUnknown_AddRef_Proxy,
  568.     IUnknown_Release_Proxy ,
  569.     IAnimal_Eat_Proxy ,
  570.     IAnimal_Sleep_Proxy ,
  571.     IAnimal_Procreate_Proxy ,
  572.     IAnimal_WhatKindOfAnimal_Proxy
  573. };
  574.  
  575.  
  576. static const PRPC_STUB_FUNCTION IAnimal_table[] =
  577. {
  578.     IAnimal_Eat_Stub,
  579.     IAnimal_Sleep_Stub,
  580.     IAnimal_Procreate_Stub,
  581.     IAnimal_WhatKindOfAnimal_Stub
  582. };
  583.  
  584. const CInterfaceStubVtbl _IAnimalStubVtbl =
  585. {
  586.     &IID_IAnimal,
  587.     0,
  588.     7,
  589.     &IAnimal_table[-3],
  590.     CStdStubBuffer_METHODS
  591. };
  592.  
  593. #pragma data_seg(".rdata")
  594.  
  595. #if !defined(__RPC_WIN32__)
  596. #error  Invalid build platform for this stub.
  597. #endif
  598.  
  599. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  600.     {
  601.         0,
  602.         {
  603.             
  604.             0x4d,        /* FC_IN_PARAM */
  605. #ifndef _ALPHA_
  606.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  607. #else
  608.             0x2,        /* Alpha Stack size = 2 */
  609. #endif
  610. /*  2 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  611. /*  4 */    
  612.             0x50,        /* FC_IN_OUT_PARAM */
  613. #ifndef _ALPHA_
  614.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  615. #else
  616.             0x2,        /* Alpha Stack size = 2 */
  617. #endif
  618. /*  6 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  619. /*  8 */    0x4e,        /* FC_IN_PARAM_BASETYPE */
  620.             0x6,        /* FC_SHORT */
  621. /* 10 */    0x53,        /* FC_RETURN_PARAM_BASETYPE */
  622.             0x8,        /* FC_LONG */
  623. /* 12 */    
  624.             0x50,        /* FC_IN_OUT_PARAM */
  625. #ifndef _ALPHA_
  626.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  627. #else
  628.             0x2,        /* Alpha Stack size = 2 */
  629. #endif
  630. /* 14 */    NdrFcShort( 0x4 ),    /* Type Offset=4 */
  631. /* 16 */    0x53,        /* FC_RETURN_PARAM_BASETYPE */
  632.             0x8,        /* FC_LONG */
  633. /* 18 */    
  634.             0x51,        /* FC_OUT_PARAM */
  635. #ifndef _ALPHA_
  636.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  637. #else
  638.             0x2,        /* Alpha Stack size = 2 */
  639. #endif
  640. /* 20 */    NdrFcShort( 0x8 ),    /* Type Offset=8 */
  641. /* 22 */    0x53,        /* FC_RETURN_PARAM_BASETYPE */
  642.             0x8,        /* FC_LONG */
  643. /* 24 */    
  644.             0x51,        /* FC_OUT_PARAM */
  645. #ifndef _ALPHA_
  646.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  647. #else
  648.             0x2,        /* Alpha Stack size = 2 */
  649. #endif
  650. /* 26 */    NdrFcShort( 0xc ),    /* Type Offset=12 */
  651. /* 28 */    0x53,        /* FC_RETURN_PARAM_BASETYPE */
  652.             0x8,        /* FC_LONG */
  653.  
  654.             0x0
  655.         }
  656.     };
  657.  
  658. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  659.     {
  660.         0,
  661.         {
  662.             0x11, 0x8,    /* FC_RP [simple_pointer] */
  663. /*  2 */    
  664.             0x25,        /* FC_C_WSTRING */
  665.             0x5c,        /* FC_PAD */
  666. /*  4 */    
  667.             0x11, 0x8,    /* FC_RP [simple_pointer] */
  668. /*  6 */    0x6,        /* FC_SHORT */
  669.             0x5c,        /* FC_PAD */
  670. /*  8 */    
  671.             0x11, 0xc,    /* FC_RP [alloced_on_stack] [simple_pointer] */
  672. /* 10 */    0x6,        /* FC_SHORT */
  673.             0x5c,        /* FC_PAD */
  674. /* 12 */    
  675.             0x11, 0x4,    /* FC_RP [alloced_on_stack] */
  676. /* 14 */    NdrFcShort( 0x8 ),    /* Offset= 8 (22) */
  677. /* 16 */    
  678.             0x1d,        /* FC_SMFARRAY */
  679.             0x0,        /* 0 */
  680. /* 18 */    NdrFcShort( 0x8 ),    /* 8 */
  681. /* 20 */    0x2,        /* FC_CHAR */
  682.             0x5b,        /* FC_END */
  683. /* 22 */    
  684.             0x15,        /* FC_STRUCT */
  685.             0x3,        /* 3 */
  686. /* 24 */    NdrFcShort( 0x10 ),    /* 16 */
  687. /* 26 */    0x8,        /* FC_LONG */
  688.             0x6,        /* FC_SHORT */
  689. /* 28 */    0x6,        /* FC_SHORT */
  690.             0x4c,        /* FC_EMBEDDED_COMPLEX */
  691. /* 30 */    0x0,        /* 0 */
  692.             NdrFcShort( 0xfffffff1 ),    /* Offset= -15 (16) */
  693.             0x5b,        /* FC_END */
  694.  
  695.             0x0
  696.         }
  697.     };
  698.  
  699. const CInterfaceProxyVtbl * _ianimal_ProxyVtblList[] = 
  700. {
  701.     ( CInterfaceProxyVtbl *) &_IAnimalProxyVtbl,
  702.     0
  703. };
  704.  
  705. const CInterfaceStubVtbl * _ianimal_StubVtblList[] = 
  706. {
  707.     ( CInterfaceStubVtbl *) &_IAnimalStubVtbl,
  708.     0
  709. };
  710.  
  711. PCInterfaceName const _ianimal_InterfaceNamesList[] = 
  712. {
  713.     "IAnimal",
  714.     0
  715. };
  716.  
  717.  
  718. #define _ianimal_CHECK_IID(n)    IID_GENERIC_CHECK_IID( _ianimal, pIID, n)
  719.  
  720. int __stdcall _ianimal_IID_Lookup( const IID * pIID, int * pIndex )
  721. {
  722.     
  723.     if(!_ianimal_CHECK_IID(0))
  724.         {
  725.         *pIndex = 0;
  726.         return 1;
  727.         }
  728.  
  729.     return 0;
  730. }
  731.  
  732. const ExtendedProxyFileInfo ianimal_ProxyFileInfo = 
  733. {
  734.     (PCInterfaceProxyVtblList *) & _ianimal_ProxyVtblList,
  735.     (PCInterfaceStubVtblList *) & _ianimal_StubVtblList,
  736.     (const PCInterfaceName * ) & _ianimal_InterfaceNamesList,
  737.     0, // no delegation
  738.     & _ianimal_IID_Lookup, 
  739.     1,
  740.     1
  741. };
  742.