home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / com / dcom / drawserv / drawserv_p.c < prev    next >
C/C++ Source or Header  |  1998-04-02  |  9KB  |  340 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 11:54:06 1998
  6.  */
  7. /* Compiler settings for DrawServ.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 "DrawServ.h"
  27.  
  28. #define TYPE_FORMAT_STRING_SIZE   1                                 
  29. #define PROC_FORMAT_STRING_SIZE   13                                
  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: IDrawServ, ver. 0.0,
  57.    GUID={0x330E9E75,0xDF48,0x11CF,{0x8E,0x2C,0x00,0xA0,0xC9,0x0D,0xC9,0x4B}} */
  58.  
  59.  
  60. extern const MIDL_STUB_DESC Object_StubDesc;
  61.  
  62.  
  63. #pragma code_seg(".orpc")
  64.  
  65. HRESULT STDMETHODCALLTYPE IDrawServ_Draw_Proxy( 
  66.     IDrawServ __RPC_FAR * This,
  67.     /* [in] */ long x1,
  68.     /* [in] */ long y1,
  69.     /* [in] */ long x2,
  70.     /* [in] */ long y2,
  71.     /* [in] */ unsigned long col)
  72. {
  73.  
  74.     HRESULT _RetVal;
  75.     
  76.     RPC_MESSAGE _RpcMessage;
  77.     
  78.     MIDL_STUB_MESSAGE _StubMsg;
  79.     
  80.     RpcTryExcept
  81.         {
  82.         NdrProxyInitialize(
  83.                       ( void __RPC_FAR *  )This,
  84.                       ( PRPC_MESSAGE  )&_RpcMessage,
  85.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  86.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  87.                       7);
  88.         
  89.         
  90.         
  91.         RpcTryFinally
  92.             {
  93.             
  94.             _StubMsg.BufferLength = 4U + 4U + 4U + 4U + 4U;
  95.             NdrProxyGetBuffer(This, &_StubMsg);
  96.             *(( long __RPC_FAR * )_StubMsg.Buffer)++ = x1;
  97.             
  98.             *(( long __RPC_FAR * )_StubMsg.Buffer)++ = y1;
  99.             
  100.             *(( long __RPC_FAR * )_StubMsg.Buffer)++ = x2;
  101.             
  102.             *(( long __RPC_FAR * )_StubMsg.Buffer)++ = y2;
  103.             
  104.             *(( unsigned long __RPC_FAR * )_StubMsg.Buffer)++ = col;
  105.             
  106.             NdrProxySendReceive(This, &_StubMsg);
  107.             
  108.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  109.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  110.             
  111.             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
  112.             
  113.             }
  114.         RpcFinally
  115.             {
  116.             NdrProxyFreeBuffer(This, &_StubMsg);
  117.             
  118.             }
  119.         RpcEndFinally
  120.         
  121.         }
  122.     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
  123.         {
  124.         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
  125.         }
  126.     RpcEndExcept
  127.     return _RetVal;
  128. }
  129.  
  130. void __RPC_STUB IDrawServ_Draw_Stub(
  131.     IRpcStubBuffer *This,
  132.     IRpcChannelBuffer *_pRpcChannelBuffer,
  133.     PRPC_MESSAGE _pRpcMessage,
  134.     DWORD *_pdwStubPhase)
  135. {
  136.     HRESULT _RetVal;
  137.     MIDL_STUB_MESSAGE _StubMsg;
  138.     unsigned long col;
  139.     long x1;
  140.     long x2;
  141.     long y1;
  142.     long y2;
  143.     
  144. NdrStubInitialize(
  145.                      _pRpcMessage,
  146.                      &_StubMsg,
  147.                      &Object_StubDesc,
  148.                      _pRpcChannelBuffer);
  149.     RpcTryFinally
  150.         {
  151.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  152.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  153.         
  154.         x1 = *(( long __RPC_FAR * )_StubMsg.Buffer)++;
  155.         
  156.         y1 = *(( long __RPC_FAR * )_StubMsg.Buffer)++;
  157.         
  158.         x2 = *(( long __RPC_FAR * )_StubMsg.Buffer)++;
  159.         
  160.         y2 = *(( long __RPC_FAR * )_StubMsg.Buffer)++;
  161.         
  162.         col = *(( unsigned long __RPC_FAR * )_StubMsg.Buffer)++;
  163.         
  164.         
  165.         *_pdwStubPhase = STUB_CALL_SERVER;
  166.         _RetVal = (((IDrawServ *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> Draw(
  167.         (IDrawServ *) ((CStdStubBuffer *)This)->pvServerObject,
  168.         x1,
  169.         y1,
  170.         x2,
  171.         y2,
  172.         col);
  173.         
  174.         *_pdwStubPhase = STUB_MARSHAL;
  175.         
  176.         _StubMsg.BufferLength = 4U;
  177.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  178.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  179.         
  180.         }
  181.     RpcFinally
  182.         {
  183.         }
  184.     RpcEndFinally
  185.     _pRpcMessage->BufferLength = 
  186.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  187.     
  188. }
  189.  
  190.  
  191. static const MIDL_STUB_DESC Object_StubDesc = 
  192.     {
  193.     0,
  194.     NdrOleAllocate,
  195.     NdrOleFree,
  196.     0,
  197.     0,
  198.     0,
  199.     0,
  200.     0,
  201.     __MIDL_TypeFormatString.Format,
  202.     0, /* -error bounds_check flag */
  203.     0x20000, /* Ndr library version */
  204.     0,
  205.     0x303006e, /* MIDL Version 3.3.110 */
  206.     0,
  207.     0,
  208.     0,  /* Reserved1 */
  209.     0,  /* Reserved2 */
  210.     0,  /* Reserved3 */
  211.     0,  /* Reserved4 */
  212.     0   /* Reserved5 */
  213.     };
  214.  
  215. CINTERFACE_PROXY_VTABLE(8) _IDrawServProxyVtbl = 
  216. {
  217.     &IID_IDrawServ,
  218.     IUnknown_QueryInterface_Proxy,
  219.     IUnknown_AddRef_Proxy,
  220.     IUnknown_Release_Proxy ,
  221.     0 /* IDispatch_GetTypeInfoCount_Proxy */ ,
  222.     0 /* IDispatch_GetTypeInfo_Proxy */ ,
  223.     0 /* IDispatch_GetIDsOfNames_Proxy */ ,
  224.     0 /* IDispatch_Invoke_Proxy */ ,
  225.     IDrawServ_Draw_Proxy
  226. };
  227.  
  228.  
  229. static const PRPC_STUB_FUNCTION IDrawServ_table[] =
  230. {
  231.     STUB_FORWARDING_FUNCTION,
  232.     STUB_FORWARDING_FUNCTION,
  233.     STUB_FORWARDING_FUNCTION,
  234.     STUB_FORWARDING_FUNCTION,
  235.     IDrawServ_Draw_Stub
  236. };
  237.  
  238. CInterfaceStubVtbl _IDrawServStubVtbl =
  239. {
  240.     &IID_IDrawServ,
  241.     0,
  242.     8,
  243.     &IDrawServ_table[-3],
  244.     CStdStubBuffer_DELEGATING_METHODS
  245. };
  246.  
  247. #pragma data_seg(".rdata")
  248.  
  249. #if !defined(__RPC_WIN32__)
  250. #error  Invalid build platform for this stub.
  251. #endif
  252.  
  253. #if !(TARGET_IS_NT40_OR_LATER)
  254. #error You need a Windows NT 4.0 or later to run this stub because it uses these features:
  255. #error   more than 32 methods in the interface.
  256. #error However, your C/C++ compilation flags indicate you intend to run this app on earlier systems.
  257. #error This app will die there with the RPC_X_WRONG_STUB_VERSION error.
  258. #endif
  259.  
  260.  
  261. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  262.     {
  263.         0,
  264.         {
  265.             0x4e,        /* FC_IN_PARAM_BASETYPE */
  266.             0x8,        /* FC_LONG */
  267. /*  2 */    0x4e,        /* FC_IN_PARAM_BASETYPE */
  268.             0x8,        /* FC_LONG */
  269. /*  4 */    0x4e,        /* FC_IN_PARAM_BASETYPE */
  270.             0x8,        /* FC_LONG */
  271. /*  6 */    0x4e,        /* FC_IN_PARAM_BASETYPE */
  272.             0x8,        /* FC_LONG */
  273. /*  8 */    0x4e,        /* FC_IN_PARAM_BASETYPE */
  274.             0x8,        /* FC_LONG */
  275. /* 10 */    0x53,        /* FC_RETURN_PARAM_BASETYPE */
  276.             0x8,        /* FC_LONG */
  277.  
  278.             0x0
  279.         }
  280.     };
  281.  
  282. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  283.     {
  284.         0,
  285.         {
  286.  
  287.             0x0
  288.         }
  289.     };
  290.  
  291. const CInterfaceProxyVtbl * _DrawServ_ProxyVtblList[] = 
  292. {
  293.     ( CInterfaceProxyVtbl *) &_IDrawServProxyVtbl,
  294.     0
  295. };
  296.  
  297. const CInterfaceStubVtbl * _DrawServ_StubVtblList[] = 
  298. {
  299.     ( CInterfaceStubVtbl *) &_IDrawServStubVtbl,
  300.     0
  301. };
  302.  
  303. PCInterfaceName const _DrawServ_InterfaceNamesList[] = 
  304. {
  305.     "IDrawServ",
  306.     0
  307. };
  308.  
  309. const IID *  _DrawServ_BaseIIDList[] = 
  310. {
  311.     &IID_IDispatch,
  312.     0
  313. };
  314.  
  315.  
  316. #define _DrawServ_CHECK_IID(n)    IID_GENERIC_CHECK_IID( _DrawServ, pIID, n)
  317.  
  318. int __stdcall _DrawServ_IID_Lookup( const IID * pIID, int * pIndex )
  319. {
  320.     
  321.     if(!_DrawServ_CHECK_IID(0))
  322.         {
  323.         *pIndex = 0;
  324.         return 1;
  325.         }
  326.  
  327.     return 0;
  328. }
  329.  
  330. const ExtendedProxyFileInfo DrawServ_ProxyFileInfo = 
  331. {
  332.     (PCInterfaceProxyVtblList *) & _DrawServ_ProxyVtblList,
  333.     (PCInterfaceStubVtblList *) & _DrawServ_StubVtblList,
  334.     (const PCInterfaceName * ) & _DrawServ_InterfaceNamesList,
  335.     (const IID ** ) & _DrawServ_BaseIIDList,
  336.     & _DrawServ_IID_Lookup, 
  337.     1,
  338.     1
  339. };
  340.