home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / com / dcom / drawctl / drawctl_p.c < prev    next >
C/C++ Source or Header  |  1998-04-02  |  15KB  |  547 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 Wed Feb 11 13:35:04 1998
  6.  */
  7. /* Compiler settings for DrawCtl.idl:
  8.     Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, 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 "DrawCtl.h"
  27.  
  28. #define TYPE_FORMAT_STRING_SIZE   35                                
  29. #define PROC_FORMAT_STRING_SIZE   9                                 
  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: IDispatch, ver. 0.0,
  53.    GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
  54.  
  55.  
  56. /* Object interface: IDrawCtl, ver. 0.0,
  57.    GUID={0x48DDCC1E,0x1FE0,0x11D0,{0xB9,0x1B,0x00,0x00,0x00,0x00,0x00,0x00}} */
  58.  
  59.  
  60. extern const MIDL_STUB_DESC Object_StubDesc;
  61.  
  62.  
  63. #pragma code_seg(".orpc")
  64.  
  65. HRESULT STDMETHODCALLTYPE IDrawCtl_Connect_Proxy( 
  66.     IDrawCtl __RPC_FAR * This,
  67.     /* [in] */ BSTR pMachineName)
  68. {
  69.  
  70.     HRESULT _RetVal;
  71.     
  72.     RPC_MESSAGE _RpcMessage;
  73.     
  74.     MIDL_STUB_MESSAGE _StubMsg;
  75.     
  76.     RpcTryExcept
  77.         {
  78.         NdrProxyInitialize(
  79.                       ( void __RPC_FAR *  )This,
  80.                       ( PRPC_MESSAGE  )&_RpcMessage,
  81.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  82.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  83.                       7);
  84.         
  85.         
  86.         
  87.         RpcTryFinally
  88.             {
  89.             
  90.             _StubMsg.BufferLength = 4U;
  91.             NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  92.                                       (unsigned char __RPC_FAR *)&pMachineName,
  93.                                       (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[24] );
  94.             
  95.             NdrProxyGetBuffer(This, &_StubMsg);
  96.             NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  97.                                     (unsigned char __RPC_FAR *)&pMachineName,
  98.                                     (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[24] );
  99.             
  100.             NdrProxySendReceive(This, &_StubMsg);
  101.             
  102.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  103.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  104.             
  105.             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
  106.             
  107.             }
  108.         RpcFinally
  109.             {
  110.             NdrProxyFreeBuffer(This, &_StubMsg);
  111.             
  112.             }
  113.         RpcEndFinally
  114.         
  115.         }
  116.     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
  117.         {
  118.         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
  119.         }
  120.     RpcEndExcept
  121.     return _RetVal;
  122. }
  123.  
  124. void __RPC_STUB IDrawCtl_Connect_Stub(
  125.     IRpcStubBuffer *This,
  126.     IRpcChannelBuffer *_pRpcChannelBuffer,
  127.     PRPC_MESSAGE _pRpcMessage,
  128.     DWORD *_pdwStubPhase)
  129. {
  130.     HRESULT _RetVal;
  131.     MIDL_STUB_MESSAGE _StubMsg;
  132.     void __RPC_FAR *_p_pMachineName;
  133.     BSTR pMachineName;
  134.     
  135. NdrStubInitialize(
  136.                      _pRpcMessage,
  137.                      &_StubMsg,
  138.                      &Object_StubDesc,
  139.                      _pRpcChannelBuffer);
  140.     _p_pMachineName = &pMachineName;
  141.     MIDL_memset(
  142.                _p_pMachineName,
  143.                0,
  144.                sizeof( BSTR  ));
  145.     RpcTryFinally
  146.         {
  147.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  148.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  149.         
  150.         NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  151.                                   (unsigned char __RPC_FAR * __RPC_FAR *)&_p_pMachineName,
  152.                                   (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[24],
  153.                                   (unsigned char)0 );
  154.         
  155.         
  156.         *_pdwStubPhase = STUB_CALL_SERVER;
  157.         _RetVal = (((IDrawCtl *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> Connect((IDrawCtl *) ((CStdStubBuffer *)This)->pvServerObject,pMachineName);
  158.         
  159.         *_pdwStubPhase = STUB_MARSHAL;
  160.         
  161.         _StubMsg.BufferLength = 4U;
  162.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  163.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  164.         
  165.         }
  166.     RpcFinally
  167.         {
  168.         NdrUserMarshalFree( &_StubMsg,
  169.                             (unsigned char __RPC_FAR *)&pMachineName,
  170.                             &__MIDL_TypeFormatString.Format[24] );
  171.         
  172.         }
  173.     RpcEndFinally
  174.     _pRpcMessage->BufferLength = 
  175.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  176.     
  177. }
  178.  
  179.  
  180. HRESULT STDMETHODCALLTYPE IDrawCtl_Disconnect_Proxy( 
  181.     IDrawCtl __RPC_FAR * This)
  182. {
  183.  
  184.     HRESULT _RetVal;
  185.     
  186.     RPC_MESSAGE _RpcMessage;
  187.     
  188.     MIDL_STUB_MESSAGE _StubMsg;
  189.     
  190.     RpcTryExcept
  191.         {
  192.         NdrProxyInitialize(
  193.                       ( void __RPC_FAR *  )This,
  194.                       ( PRPC_MESSAGE  )&_RpcMessage,
  195.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  196.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  197.                       8);
  198.         
  199.         
  200.         
  201.         RpcTryFinally
  202.             {
  203.             
  204.             _StubMsg.BufferLength = 0U;
  205.             NdrProxyGetBuffer(This, &_StubMsg);
  206.             NdrProxySendReceive(This, &_StubMsg);
  207.             
  208.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  209.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[6] );
  210.             
  211.             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
  212.             
  213.             }
  214.         RpcFinally
  215.             {
  216.             NdrProxyFreeBuffer(This, &_StubMsg);
  217.             
  218.             }
  219.         RpcEndFinally
  220.         
  221.         }
  222.     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
  223.         {
  224.         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
  225.         }
  226.     RpcEndExcept
  227.     return _RetVal;
  228. }
  229.  
  230. void __RPC_STUB IDrawCtl_Disconnect_Stub(
  231.     IRpcStubBuffer *This,
  232.     IRpcChannelBuffer *_pRpcChannelBuffer,
  233.     PRPC_MESSAGE _pRpcMessage,
  234.     DWORD *_pdwStubPhase)
  235. {
  236.     HRESULT _RetVal;
  237.     MIDL_STUB_MESSAGE _StubMsg;
  238.     
  239. NdrStubInitialize(
  240.                      _pRpcMessage,
  241.                      &_StubMsg,
  242.                      &Object_StubDesc,
  243.                      _pRpcChannelBuffer);
  244.     RpcTryFinally
  245.         {
  246.         
  247.         *_pdwStubPhase = STUB_CALL_SERVER;
  248.         _RetVal = (((IDrawCtl *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> Disconnect((IDrawCtl *) ((CStdStubBuffer *)This)->pvServerObject);
  249.         
  250.         *_pdwStubPhase = STUB_MARSHAL;
  251.         
  252.         _StubMsg.BufferLength = 4U;
  253.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  254.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  255.         
  256.         }
  257.     RpcFinally
  258.         {
  259.         }
  260.     RpcEndFinally
  261.     _pRpcMessage->BufferLength = 
  262.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  263.     
  264. }
  265.  
  266.  
  267. HRESULT STDMETHODCALLTYPE IDrawCtl_Clear_Proxy( 
  268.     IDrawCtl __RPC_FAR * This)
  269. {
  270.  
  271.     HRESULT _RetVal;
  272.     
  273.     RPC_MESSAGE _RpcMessage;
  274.     
  275.     MIDL_STUB_MESSAGE _StubMsg;
  276.     
  277.     RpcTryExcept
  278.         {
  279.         NdrProxyInitialize(
  280.                       ( void __RPC_FAR *  )This,
  281.                       ( PRPC_MESSAGE  )&_RpcMessage,
  282.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  283.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  284.                       9);
  285.         
  286.         
  287.         
  288.         RpcTryFinally
  289.             {
  290.             
  291.             _StubMsg.BufferLength = 0U;
  292.             NdrProxyGetBuffer(This, &_StubMsg);
  293.             NdrProxySendReceive(This, &_StubMsg);
  294.             
  295.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  296.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[6] );
  297.             
  298.             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
  299.             
  300.             }
  301.         RpcFinally
  302.             {
  303.             NdrProxyFreeBuffer(This, &_StubMsg);
  304.             
  305.             }
  306.         RpcEndFinally
  307.         
  308.         }
  309.     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
  310.         {
  311.         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
  312.         }
  313.     RpcEndExcept
  314.     return _RetVal;
  315. }
  316.  
  317. void __RPC_STUB IDrawCtl_Clear_Stub(
  318.     IRpcStubBuffer *This,
  319.     IRpcChannelBuffer *_pRpcChannelBuffer,
  320.     PRPC_MESSAGE _pRpcMessage,
  321.     DWORD *_pdwStubPhase)
  322. {
  323.     HRESULT _RetVal;
  324.     MIDL_STUB_MESSAGE _StubMsg;
  325.     
  326. NdrStubInitialize(
  327.                      _pRpcMessage,
  328.                      &_StubMsg,
  329.                      &Object_StubDesc,
  330.                      _pRpcChannelBuffer);
  331.     RpcTryFinally
  332.         {
  333.         
  334.         *_pdwStubPhase = STUB_CALL_SERVER;
  335.         _RetVal = (((IDrawCtl *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> Clear((IDrawCtl *) ((CStdStubBuffer *)This)->pvServerObject);
  336.         
  337.         *_pdwStubPhase = STUB_MARSHAL;
  338.         
  339.         _StubMsg.BufferLength = 4U;
  340.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  341.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  342.         
  343.         }
  344.     RpcFinally
  345.         {
  346.         }
  347.     RpcEndFinally
  348.     _pRpcMessage->BufferLength = 
  349.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  350.     
  351. }
  352.  
  353. extern const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[1];
  354.  
  355. static const MIDL_STUB_DESC Object_StubDesc = 
  356.     {
  357.     0,
  358.     NdrOleAllocate,
  359.     NdrOleFree,
  360.     0,
  361.     0,
  362.     0,
  363.     0,
  364.     0,
  365.     __MIDL_TypeFormatString.Format,
  366.     0, /* -error bounds_check flag */
  367.     0x20000, /* Ndr library version */
  368.     0,
  369.     0x303006e, /* MIDL Version 3.3.110 */
  370.     0,
  371.     UserMarshalRoutines,
  372.     0,  /* Reserved1 */
  373.     0,  /* Reserved2 */
  374.     0,  /* Reserved3 */
  375.     0,  /* Reserved4 */
  376.     0   /* Reserved5 */
  377.     };
  378.  
  379. CINTERFACE_PROXY_VTABLE(10) _IDrawCtlProxyVtbl = 
  380. {
  381.     &IID_IDrawCtl,
  382.     IUnknown_QueryInterface_Proxy,
  383.     IUnknown_AddRef_Proxy,
  384.     IUnknown_Release_Proxy ,
  385.     0 /* IDispatch_GetTypeInfoCount_Proxy */ ,
  386.     0 /* IDispatch_GetTypeInfo_Proxy */ ,
  387.     0 /* IDispatch_GetIDsOfNames_Proxy */ ,
  388.     0 /* IDispatch_Invoke_Proxy */ ,
  389.     IDrawCtl_Connect_Proxy ,
  390.     IDrawCtl_Disconnect_Proxy ,
  391.     IDrawCtl_Clear_Proxy
  392. };
  393.  
  394.  
  395. static const PRPC_STUB_FUNCTION IDrawCtl_table[] =
  396. {
  397.     STUB_FORWARDING_FUNCTION,
  398.     STUB_FORWARDING_FUNCTION,
  399.     STUB_FORWARDING_FUNCTION,
  400.     STUB_FORWARDING_FUNCTION,
  401.     IDrawCtl_Connect_Stub,
  402.     IDrawCtl_Disconnect_Stub,
  403.     IDrawCtl_Clear_Stub
  404. };
  405.  
  406. CInterfaceStubVtbl _IDrawCtlStubVtbl =
  407. {
  408.     &IID_IDrawCtl,
  409.     0,
  410.     10,
  411.     &IDrawCtl_table[-3],
  412.     CStdStubBuffer_DELEGATING_METHODS
  413. };
  414.  
  415. #pragma data_seg(".rdata")
  416.  
  417. static const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[1] = 
  418.         {
  419.             
  420.             {
  421.             BSTR_UserSize
  422.             ,BSTR_UserMarshal
  423.             ,BSTR_UserUnmarshal
  424.             ,BSTR_UserFree
  425.             }
  426.  
  427.         };
  428.  
  429.  
  430. #if !defined(__RPC_WIN32__)
  431. #error  Invalid build platform for this stub.
  432. #endif
  433.  
  434. #if !(TARGET_IS_NT40_OR_LATER)
  435. #error You need a Windows NT 4.0 or later to run this stub because it uses these features:
  436. #error   [wire_marshal] or [user_marshal] attribute, more than 32 methods in the interface.
  437. #error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
  438. #error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
  439. #endif
  440.  
  441.  
  442. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  443.     {
  444.         0,
  445.         {
  446.             
  447.             0x4d,        /* FC_IN_PARAM */
  448. #ifndef _ALPHA_
  449.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  450. #else
  451.             0x2,        /* Alpha Stack size = 2 */
  452. #endif
  453. /*  2 */    NdrFcShort( 0x18 ),    /* Type Offset=24 */
  454. /*  4 */    0x53,        /* FC_RETURN_PARAM_BASETYPE */
  455.             0x8,        /* FC_LONG */
  456. /*  6 */    0x53,        /* FC_RETURN_PARAM_BASETYPE */
  457.             0x8,        /* FC_LONG */
  458.  
  459.             0x0
  460.         }
  461.     };
  462.  
  463. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  464.     {
  465.         0,
  466.         {
  467.             0x12, 0x0,    /* FC_UP */
  468. /*  2 */    NdrFcShort( 0xc ),    /* Offset= 12 (14) */
  469. /*  4 */    
  470.             0x1b,        /* FC_CARRAY */
  471.             0x1,        /* 1 */
  472. /*  6 */    NdrFcShort( 0x2 ),    /* 2 */
  473. /*  8 */    0x9,        /* 9 */
  474.             0x0,        /*  */
  475. /* 10 */    NdrFcShort( 0xfffffffc ),    /* -4 */
  476. /* 12 */    0x6,        /* FC_SHORT */
  477.             0x5b,        /* FC_END */
  478. /* 14 */    
  479.             0x17,        /* FC_CSTRUCT */
  480.             0x3,        /* 3 */
  481. /* 16 */    NdrFcShort( 0x8 ),    /* 8 */
  482. /* 18 */    NdrFcShort( 0xfffffff2 ),    /* Offset= -14 (4) */
  483. /* 20 */    0x8,        /* FC_LONG */
  484.             0x8,        /* FC_LONG */
  485. /* 22 */    0x5c,        /* FC_PAD */
  486.             0x5b,        /* FC_END */
  487. /* 24 */    0xb4,        /* FC_USER_MARSHAL */
  488.             0x83,        /* 131 */
  489. /* 26 */    NdrFcShort( 0x0 ),    /* 0 */
  490. /* 28 */    NdrFcShort( 0x4 ),    /* 4 */
  491. /* 30 */    NdrFcShort( 0x0 ),    /* 0 */
  492. /* 32 */    NdrFcShort( 0xffffffe0 ),    /* Offset= -32 (0) */
  493.  
  494.             0x0
  495.         }
  496.     };
  497.  
  498. const CInterfaceProxyVtbl * _DrawCtl_ProxyVtblList[] = 
  499. {
  500.     ( CInterfaceProxyVtbl *) &_IDrawCtlProxyVtbl,
  501.     0
  502. };
  503.  
  504. const CInterfaceStubVtbl * _DrawCtl_StubVtblList[] = 
  505. {
  506.     ( CInterfaceStubVtbl *) &_IDrawCtlStubVtbl,
  507.     0
  508. };
  509.  
  510. PCInterfaceName const _DrawCtl_InterfaceNamesList[] = 
  511. {
  512.     "IDrawCtl",
  513.     0
  514. };
  515.  
  516. const IID *  _DrawCtl_BaseIIDList[] = 
  517. {
  518.     &IID_IDispatch,
  519.     0
  520. };
  521.  
  522.  
  523. #define _DrawCtl_CHECK_IID(n)    IID_GENERIC_CHECK_IID( _DrawCtl, pIID, n)
  524.  
  525. int __stdcall _DrawCtl_IID_Lookup( const IID * pIID, int * pIndex )
  526. {
  527.     
  528.     if(!_DrawCtl_CHECK_IID(0))
  529.         {
  530.         *pIndex = 0;
  531.         return 1;
  532.         }
  533.  
  534.     return 0;
  535. }
  536.  
  537. const ExtendedProxyFileInfo DrawCtl_ProxyFileInfo = 
  538. {
  539.     (PCInterfaceProxyVtblList *) & _DrawCtl_ProxyVtblList,
  540.     (PCInterfaceStubVtblList *) & _DrawCtl_StubVtblList,
  541.     (const PCInterfaceName * ) & _DrawCtl_InterfaceNamesList,
  542.     (const IID ** ) & _DrawCtl_BaseIIDList,
  543.     & _DrawCtl_IID_Lookup, 
  544.     1,
  545.     1
  546. };
  547.