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 / ikoala / ikoala_p.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-30  |  12.2 KB  |  465 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:23 1998
  6.  */
  7. /* Compiler settings for ikoala.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 "ikoala.h"
  27.  
  28. #define TYPE_FORMAT_STRING_SIZE   1                                 
  29. #define PROC_FORMAT_STRING_SIZE   7                                 
  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: IKoala, ver. 0.0,
  53.    GUID={0x0002114b,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 IKoala_ClimbEucalyptusTree_Proxy( 
  62.     IKoala __RPC_FAR * This,
  63.     /* [in] */ short iTree)
  64. {
  65.  
  66.     HRESULT _RetVal;
  67.     
  68.     RPC_MESSAGE _RpcMessage;
  69.     
  70.     MIDL_STUB_MESSAGE _StubMsg;
  71.     
  72.     RpcTryExcept
  73.         {
  74.         NdrProxyInitialize(
  75.                       ( void __RPC_FAR *  )This,
  76.                       ( PRPC_MESSAGE  )&_RpcMessage,
  77.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  78.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  79.                       3);
  80.         
  81.         
  82.         
  83.         RpcTryFinally
  84.             {
  85.             
  86.             _StubMsg.BufferLength = 2U;
  87.             NdrProxyGetBuffer(This, &_StubMsg);
  88.             *(( short __RPC_FAR * )_StubMsg.Buffer)++ = iTree;
  89.             
  90.             NdrProxySendReceive(This, &_StubMsg);
  91.             
  92.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  93.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  94.             
  95.             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
  96.             
  97.             }
  98.         RpcFinally
  99.             {
  100.             NdrProxyFreeBuffer(This, &_StubMsg);
  101.             
  102.             }
  103.         RpcEndFinally
  104.         
  105.         }
  106.     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
  107.         {
  108.         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
  109.         }
  110.     RpcEndExcept
  111.     return _RetVal;
  112. }
  113.  
  114. void __RPC_STUB IKoala_ClimbEucalyptusTree_Stub(
  115.     IRpcStubBuffer *This,
  116.     IRpcChannelBuffer *_pRpcChannelBuffer,
  117.     PRPC_MESSAGE _pRpcMessage,
  118.     DWORD *_pdwStubPhase)
  119. {
  120.     HRESULT _RetVal;
  121.     MIDL_STUB_MESSAGE _StubMsg;
  122.     short iTree;
  123.     
  124. NdrStubInitialize(
  125.                      _pRpcMessage,
  126.                      &_StubMsg,
  127.                      &Object_StubDesc,
  128.                      _pRpcChannelBuffer);
  129.     RpcTryFinally
  130.         {
  131.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  132.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  133.         
  134.         iTree = *(( short __RPC_FAR * )_StubMsg.Buffer)++;
  135.         
  136.         
  137.         *_pdwStubPhase = STUB_CALL_SERVER;
  138.         _RetVal = (((IKoala *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> ClimbEucalyptusTree((IKoala *) ((CStdStubBuffer *)This)->pvServerObject,iTree);
  139.         
  140.         *_pdwStubPhase = STUB_MARSHAL;
  141.         
  142.         _StubMsg.BufferLength = 4U;
  143.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  144.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  145.         
  146.         }
  147.     RpcFinally
  148.         {
  149.         }
  150.     RpcEndFinally
  151.     _pRpcMessage->BufferLength = 
  152.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  153.     
  154. }
  155.  
  156.  
  157. HRESULT STDMETHODCALLTYPE IKoala_PouchOpensDown_Proxy( 
  158.     IKoala __RPC_FAR * This)
  159. {
  160.  
  161.     HRESULT _RetVal;
  162.     
  163.     RPC_MESSAGE _RpcMessage;
  164.     
  165.     MIDL_STUB_MESSAGE _StubMsg;
  166.     
  167.     RpcTryExcept
  168.         {
  169.         NdrProxyInitialize(
  170.                       ( void __RPC_FAR *  )This,
  171.                       ( PRPC_MESSAGE  )&_RpcMessage,
  172.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  173.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  174.                       4);
  175.         
  176.         
  177.         
  178.         RpcTryFinally
  179.             {
  180.             
  181.             _StubMsg.BufferLength = 0U;
  182.             NdrProxyGetBuffer(This, &_StubMsg);
  183.             NdrProxySendReceive(This, &_StubMsg);
  184.             
  185.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  186.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[4] );
  187.             
  188.             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
  189.             
  190.             }
  191.         RpcFinally
  192.             {
  193.             NdrProxyFreeBuffer(This, &_StubMsg);
  194.             
  195.             }
  196.         RpcEndFinally
  197.         
  198.         }
  199.     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
  200.         {
  201.         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
  202.         }
  203.     RpcEndExcept
  204.     return _RetVal;
  205. }
  206.  
  207. void __RPC_STUB IKoala_PouchOpensDown_Stub(
  208.     IRpcStubBuffer *This,
  209.     IRpcChannelBuffer *_pRpcChannelBuffer,
  210.     PRPC_MESSAGE _pRpcMessage,
  211.     DWORD *_pdwStubPhase)
  212. {
  213.     HRESULT _RetVal;
  214.     MIDL_STUB_MESSAGE _StubMsg;
  215.     
  216. NdrStubInitialize(
  217.                      _pRpcMessage,
  218.                      &_StubMsg,
  219.                      &Object_StubDesc,
  220.                      _pRpcChannelBuffer);
  221.     RpcTryFinally
  222.         {
  223.         
  224.         *_pdwStubPhase = STUB_CALL_SERVER;
  225.         _RetVal = (((IKoala *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> PouchOpensDown((IKoala *) ((CStdStubBuffer *)This)->pvServerObject);
  226.         
  227.         *_pdwStubPhase = STUB_MARSHAL;
  228.         
  229.         _StubMsg.BufferLength = 4U;
  230.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  231.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  232.         
  233.         }
  234.     RpcFinally
  235.         {
  236.         }
  237.     RpcEndFinally
  238.     _pRpcMessage->BufferLength = 
  239.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  240.     
  241. }
  242.  
  243.  
  244. HRESULT STDMETHODCALLTYPE IKoala_SleepAfterEating_Proxy( 
  245.     IKoala __RPC_FAR * This,
  246.     /* [in] */ short cMinutes)
  247. {
  248.  
  249.     HRESULT _RetVal;
  250.     
  251.     RPC_MESSAGE _RpcMessage;
  252.     
  253.     MIDL_STUB_MESSAGE _StubMsg;
  254.     
  255.     RpcTryExcept
  256.         {
  257.         NdrProxyInitialize(
  258.                       ( void __RPC_FAR *  )This,
  259.                       ( PRPC_MESSAGE  )&_RpcMessage,
  260.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  261.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  262.                       5);
  263.         
  264.         
  265.         
  266.         RpcTryFinally
  267.             {
  268.             
  269.             _StubMsg.BufferLength = 2U;
  270.             NdrProxyGetBuffer(This, &_StubMsg);
  271.             *(( short __RPC_FAR * )_StubMsg.Buffer)++ = cMinutes;
  272.             
  273.             NdrProxySendReceive(This, &_StubMsg);
  274.             
  275.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  276.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  277.             
  278.             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
  279.             
  280.             }
  281.         RpcFinally
  282.             {
  283.             NdrProxyFreeBuffer(This, &_StubMsg);
  284.             
  285.             }
  286.         RpcEndFinally
  287.         
  288.         }
  289.     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
  290.         {
  291.         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
  292.         }
  293.     RpcEndExcept
  294.     return _RetVal;
  295. }
  296.  
  297. void __RPC_STUB IKoala_SleepAfterEating_Stub(
  298.     IRpcStubBuffer *This,
  299.     IRpcChannelBuffer *_pRpcChannelBuffer,
  300.     PRPC_MESSAGE _pRpcMessage,
  301.     DWORD *_pdwStubPhase)
  302. {
  303.     HRESULT _RetVal;
  304.     MIDL_STUB_MESSAGE _StubMsg;
  305.     short cMinutes;
  306.     
  307. NdrStubInitialize(
  308.                      _pRpcMessage,
  309.                      &_StubMsg,
  310.                      &Object_StubDesc,
  311.                      _pRpcChannelBuffer);
  312.     RpcTryFinally
  313.         {
  314.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  315.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  316.         
  317.         cMinutes = *(( short __RPC_FAR * )_StubMsg.Buffer)++;
  318.         
  319.         
  320.         *_pdwStubPhase = STUB_CALL_SERVER;
  321.         _RetVal = (((IKoala *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> SleepAfterEating((IKoala *) ((CStdStubBuffer *)This)->pvServerObject,cMinutes);
  322.         
  323.         *_pdwStubPhase = STUB_MARSHAL;
  324.         
  325.         _StubMsg.BufferLength = 4U;
  326.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  327.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  328.         
  329.         }
  330.     RpcFinally
  331.         {
  332.         }
  333.     RpcEndFinally
  334.     _pRpcMessage->BufferLength = 
  335.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  336.     
  337. }
  338.  
  339.  
  340. static const MIDL_STUB_DESC Object_StubDesc = 
  341.     {
  342.     0,
  343.     NdrOleAllocate,
  344.     NdrOleFree,
  345.     0,
  346.     0,
  347.     0,
  348.     0,
  349.     0,
  350.     __MIDL_TypeFormatString.Format,
  351.     0, /* -error bounds_check flag */
  352.     0x10001, /* Ndr library version */
  353.     0,
  354.     0x303006e, /* MIDL Version 3.3.110 */
  355.     0,
  356.     0,
  357.     0,  /* Reserved1 */
  358.     0,  /* Reserved2 */
  359.     0,  /* Reserved3 */
  360.     0,  /* Reserved4 */
  361.     0   /* Reserved5 */
  362.     };
  363.  
  364. const CINTERFACE_PROXY_VTABLE(6) _IKoalaProxyVtbl = 
  365. {
  366.     &IID_IKoala,
  367.     IUnknown_QueryInterface_Proxy,
  368.     IUnknown_AddRef_Proxy,
  369.     IUnknown_Release_Proxy ,
  370.     IKoala_ClimbEucalyptusTree_Proxy ,
  371.     IKoala_PouchOpensDown_Proxy ,
  372.     IKoala_SleepAfterEating_Proxy
  373. };
  374.  
  375.  
  376. static const PRPC_STUB_FUNCTION IKoala_table[] =
  377. {
  378.     IKoala_ClimbEucalyptusTree_Stub,
  379.     IKoala_PouchOpensDown_Stub,
  380.     IKoala_SleepAfterEating_Stub
  381. };
  382.  
  383. const CInterfaceStubVtbl _IKoalaStubVtbl =
  384. {
  385.     &IID_IKoala,
  386.     0,
  387.     6,
  388.     &IKoala_table[-3],
  389.     CStdStubBuffer_METHODS
  390. };
  391.  
  392. #pragma data_seg(".rdata")
  393.  
  394. #if !defined(__RPC_WIN32__)
  395. #error  Invalid build platform for this stub.
  396. #endif
  397.  
  398. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  399.     {
  400.         0,
  401.         {
  402.             0x4e,        /* FC_IN_PARAM_BASETYPE */
  403.             0x6,        /* FC_SHORT */
  404. /*  2 */    0x53,        /* FC_RETURN_PARAM_BASETYPE */
  405.             0x8,        /* FC_LONG */
  406. /*  4 */    0x53,        /* FC_RETURN_PARAM_BASETYPE */
  407.             0x8,        /* FC_LONG */
  408.  
  409.             0x0
  410.         }
  411.     };
  412.  
  413. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  414.     {
  415.         0,
  416.         {
  417.  
  418.             0x0
  419.         }
  420.     };
  421.  
  422. const CInterfaceProxyVtbl * _ikoala_ProxyVtblList[] = 
  423. {
  424.     ( CInterfaceProxyVtbl *) &_IKoalaProxyVtbl,
  425.     0
  426. };
  427.  
  428. const CInterfaceStubVtbl * _ikoala_StubVtblList[] = 
  429. {
  430.     ( CInterfaceStubVtbl *) &_IKoalaStubVtbl,
  431.     0
  432. };
  433.  
  434. PCInterfaceName const _ikoala_InterfaceNamesList[] = 
  435. {
  436.     "IKoala",
  437.     0
  438. };
  439.  
  440.  
  441. #define _ikoala_CHECK_IID(n)    IID_GENERIC_CHECK_IID( _ikoala, pIID, n)
  442.  
  443. int __stdcall _ikoala_IID_Lookup( const IID * pIID, int * pIndex )
  444. {
  445.     
  446.     if(!_ikoala_CHECK_IID(0))
  447.         {
  448.         *pIndex = 0;
  449.         return 1;
  450.         }
  451.  
  452.     return 0;
  453. }
  454.  
  455. const ExtendedProxyFileInfo ikoala_ProxyFileInfo = 
  456. {
  457.     (PCInterfaceProxyVtblList *) & _ikoala_ProxyVtblList,
  458.     (PCInterfaceStubVtblList *) & _ikoala_StubVtblList,
  459.     (const PCInterfaceName * ) & _ikoala_InterfaceNamesList,
  460.     0, // no delegation
  461.     & _ikoala_IID_Lookup, 
  462.     1,
  463.     1
  464. };
  465.