home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / source / chap04 / lst44 / lst44_p.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-26  |  9.6 KB  |  365 lines

  1. /* this ALWAYS GENERATED file contains the proxy stub code */
  2.  
  3.  
  4. /* File created by MIDL compiler version 3.00.41 */
  5. /* at Thu Sep 26 23:38:20 1996
  6.  */
  7. /* Compiler settings for lst44.idl:
  8.     Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext
  9.     error checks: none
  10. */
  11. //@@MIDL_FILE_HEADING(  )
  12.  
  13. #include "rpcproxy.h"
  14. #include "lst44.h"
  15.  
  16. #define TYPE_FORMAT_STRING_SIZE   39                                
  17. #define PROC_FORMAT_STRING_SIZE   7                                 
  18.  
  19. typedef struct _MIDL_TYPE_FORMAT_STRING
  20.     {
  21.     short          Pad;
  22.     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
  23.     } MIDL_TYPE_FORMAT_STRING;
  24.  
  25. typedef struct _MIDL_PROC_FORMAT_STRING
  26.     {
  27.     short          Pad;
  28.     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
  29.     } MIDL_PROC_FORMAT_STRING;
  30.  
  31.  
  32. extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
  33. extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
  34.  
  35.  
  36. /* Object interface: IUnknown, ver. 0.0,
  37.    GUID={0x00000000,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
  38.  
  39.  
  40. /* Object interface: IDispatch, ver. 0.0,
  41.    GUID={0x00020400,0x0000,0x0000,{0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46}} */
  42.  
  43.  
  44. /* Object interface: ILst44, ver. 0.0,
  45.    GUID={0xC566CC21,0x182E,0x11D0,{0xA6,0xAD,0x00,0xAA,0x00,0x60,0x25,0x53}} */
  46.  
  47.  
  48. extern const MIDL_STUB_DESC Object_StubDesc;
  49.  
  50.  
  51. #pragma code_seg(".orpc")
  52.  
  53. HRESULT STDMETHODCALLTYPE ILst44_GetMachineName_Proxy( 
  54.     ILst44 __RPC_FAR * This,
  55.     /* [retval][out] */ BSTR __RPC_FAR *retval)
  56. {
  57.  
  58.     HRESULT _RetVal;
  59.     
  60.     RPC_MESSAGE _RpcMessage;
  61.     
  62.     MIDL_STUB_MESSAGE _StubMsg;
  63.     
  64.     MIDL_memset(
  65.                retval,
  66.                0,
  67.                sizeof( BSTR  ));
  68.     RpcTryExcept
  69.         {
  70.         RpcTryFinally
  71.             {
  72.             NdrProxyInitialize(
  73.                       ( void __RPC_FAR *  )This,
  74.                       ( PRPC_MESSAGE  )&_RpcMessage,
  75.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  76.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  77.                       7);
  78.             
  79.             
  80.             
  81.             
  82.             _StubMsg.BufferLength = 0U;
  83.             NdrProxyGetBuffer(This, &_StubMsg);
  84.             NdrProxySendReceive(This, &_StubMsg);
  85.             
  86.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  87.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  88.             
  89.             NdrUserMarshalUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  90.                                       (unsigned char __RPC_FAR * __RPC_FAR *)&retval,
  91.                                       (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28],
  92.                                       (unsigned char)0 );
  93.             
  94.             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
  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.         NdrClearOutParameters(
  109.                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  110.                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[0],
  111.                          ( void __RPC_FAR * )retval);
  112.         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
  113.         }
  114.     RpcEndExcept
  115.     return _RetVal;
  116. }
  117.  
  118. void __RPC_STUB ILst44_GetMachineName_Stub(
  119.     IRpcStubBuffer *This,
  120.     IRpcChannelBuffer *_pRpcChannelBuffer,
  121.     PRPC_MESSAGE _pRpcMessage,
  122.     DWORD *_pdwStubPhase)
  123. {
  124.     BSTR _M0;
  125.     HRESULT _RetVal;
  126.     MIDL_STUB_MESSAGE _StubMsg;
  127.     BSTR __RPC_FAR *retval;
  128.     
  129. NdrStubInitialize(
  130.                      _pRpcMessage,
  131.                      &_StubMsg,
  132.                      &Object_StubDesc,
  133.                      _pRpcChannelBuffer);
  134.     retval = 0;
  135.     RpcTryFinally
  136.         {
  137.         retval = &_M0;
  138.         MIDL_memset(
  139.                retval,
  140.                0,
  141.                sizeof( BSTR  ));
  142.         
  143.         *_pdwStubPhase = STUB_CALL_SERVER;
  144.         _RetVal = (((ILst44 *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> GetMachineName((ILst44 *) ((CStdStubBuffer *)This)->pvServerObject,retval);
  145.         
  146.         *_pdwStubPhase = STUB_MARSHAL;
  147.         
  148.         _StubMsg.BufferLength = 4U + 11U;
  149.         NdrUserMarshalBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  150.                                   (unsigned char __RPC_FAR *)retval,
  151.                                   (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
  152.         
  153.         _StubMsg.BufferLength += 16;
  154.         
  155.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  156.         NdrUserMarshalMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  157.                                 (unsigned char __RPC_FAR *)retval,
  158.                                 (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[28] );
  159.         
  160.         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
  161.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  162.         
  163.         }
  164.     RpcFinally
  165.         {
  166.         NdrPointerFree( &_StubMsg,
  167.                         (unsigned char __RPC_FAR *)retval,
  168.                         &__MIDL_TypeFormatString.Format[0] );
  169.         
  170.         }
  171.     RpcEndFinally
  172.     _pRpcMessage->BufferLength = 
  173.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  174.     
  175. }
  176.  
  177. extern const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[1];
  178.  
  179. static const MIDL_STUB_DESC Object_StubDesc = 
  180.     {
  181.     0,
  182.     NdrOleAllocate,
  183.     NdrOleFree,
  184.     0,
  185.     0,
  186.     0,
  187.     0,
  188.     0,
  189.     __MIDL_TypeFormatString.Format,
  190.     0, /* -error bounds_check flag */
  191.     0x20000, /* Ndr library version */
  192.     0,
  193.     0x3000029, /* MIDL Version 3.0.41 */
  194.     0,
  195.     UserMarshalRoutines,
  196.     0,  /* Reserved1 */
  197.     0,  /* Reserved2 */
  198.     0,  /* Reserved3 */
  199.     0,  /* Reserved4 */
  200.     0   /* Reserved5 */
  201.     };
  202.  
  203. CINTERFACE_PROXY_VTABLE(8) _ILst44ProxyVtbl = 
  204. {
  205.     &IID_ILst44,
  206.     IUnknown_QueryInterface_Proxy,
  207.     IUnknown_AddRef_Proxy,
  208.     IUnknown_Release_Proxy ,
  209.     0 /* IDispatch_GetTypeInfoCount_Proxy */ ,
  210.     0 /* IDispatch_GetTypeInfo_Proxy */ ,
  211.     0 /* IDispatch_GetIDsOfNames_Proxy */ ,
  212.     0 /* IDispatch_Invoke_Proxy */ ,
  213.     ILst44_GetMachineName_Proxy
  214. };
  215.  
  216.  
  217. static const PRPC_STUB_FUNCTION ILst44_table[] =
  218. {
  219.     STUB_FORWARDING_FUNCTION,
  220.     STUB_FORWARDING_FUNCTION,
  221.     STUB_FORWARDING_FUNCTION,
  222.     STUB_FORWARDING_FUNCTION,
  223.     ILst44_GetMachineName_Stub
  224. };
  225.  
  226. CInterfaceStubVtbl _ILst44StubVtbl =
  227. {
  228.     &IID_ILst44,
  229.     0,
  230.     8,
  231.     &ILst44_table[-3],
  232.     CStdStubBuffer_DELEGATING_METHODS
  233. };
  234.  
  235. #pragma data_seg(".rdata")
  236.  
  237. static const USER_MARSHAL_ROUTINE_QUADRUPLE UserMarshalRoutines[1] = 
  238.         {
  239.             
  240.             {
  241.             BSTR_UserSize
  242.             ,BSTR_UserMarshal
  243.             ,BSTR_UserUnmarshal
  244.             ,BSTR_UserFree
  245.             }
  246.  
  247.         };
  248.  
  249.  
  250. #if !defined(__RPC_WIN32__)
  251. #error  Invalid build platform for this stub.
  252. #endif
  253.  
  254. #if !(TARGET_IS_NT40_OR_LATER)
  255. #error You need a Windows NT 4.0 or later to run this stub
  256. #endif
  257.  
  258.  
  259. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  260.     {
  261.         0,
  262.         {
  263.             
  264.             0x51,        /* FC_OUT_PARAM */
  265. #ifndef _ALPHA_
  266.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  267. #else
  268.             0x2,        /* Alpha Stack size = 2 */
  269. #endif
  270. /*  2 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  271. /*  4 */    0x53,        /* FC_RETURN_PARAM_BASETYPE */
  272.             0x8,        /* FC_LONG */
  273.  
  274.             0x0
  275.         }
  276.     };
  277.  
  278. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  279.     {
  280.         0,
  281.         {
  282.             0x11, 0x4,    /* FC_RP [alloced_on_stack] */
  283. /*  2 */    NdrFcShort( 0x1a ),    /* Offset= 26 (28) */
  284. /*  4 */    
  285.             0x13, 0x0,    /* FC_OP */
  286. /*  6 */    NdrFcShort( 0xc ),    /* Offset= 12 (18) */
  287. /*  8 */    
  288.             0x1b,        /* FC_CARRAY */
  289.             0x1,        /* 1 */
  290. /* 10 */    NdrFcShort( 0x2 ),    /* 2 */
  291. /* 12 */    0x9,        /* 9 */
  292.             0x0,        /*  */
  293. /* 14 */    NdrFcShort( 0xfffffffc ),    /* -4 */
  294. /* 16 */    0x6,        /* FC_SHORT */
  295.             0x5b,        /* FC_END */
  296. /* 18 */    
  297.             0x17,        /* FC_CSTRUCT */
  298.             0x3,        /* 3 */
  299. /* 20 */    NdrFcShort( 0x8 ),    /* 8 */
  300. /* 22 */    NdrFcShort( 0xfffffff2 ),    /* Offset= -14 (8) */
  301. /* 24 */    0x8,        /* FC_LONG */
  302.             0x8,        /* FC_LONG */
  303. /* 26 */    0x5c,        /* FC_PAD */
  304.             0x5b,        /* FC_END */
  305. /* 28 */    0xb4,        /* FC_USER_MARSHAL */
  306.             0x83,        /* 131 */
  307. /* 30 */    NdrFcShort( 0x0 ),    /* 0 */
  308. /* 32 */    NdrFcShort( 0x4 ),    /* 4 */
  309. /* 34 */    NdrFcShort( 0x0 ),    /* 0 */
  310. /* 36 */    NdrFcShort( 0xffffffe0 ),    /* Offset= -32 (4) */
  311.  
  312.             0x0
  313.         }
  314.     };
  315.  
  316. const CInterfaceProxyVtbl * _lst44_ProxyVtblList[] = 
  317. {
  318.     ( CInterfaceProxyVtbl *) &_ILst44ProxyVtbl,
  319.     0
  320. };
  321.  
  322. const CInterfaceStubVtbl * _lst44_StubVtblList[] = 
  323. {
  324.     ( CInterfaceStubVtbl *) &_ILst44StubVtbl,
  325.     0
  326. };
  327.  
  328. PCInterfaceName const _lst44_InterfaceNamesList[] = 
  329. {
  330.     "ILst44",
  331.     0
  332. };
  333.  
  334. const IID *  _lst44_BaseIIDList[] = 
  335. {
  336.     &IID_IDispatch,
  337.     0
  338. };
  339.  
  340.  
  341. #define _lst44_CHECK_IID(n)    IID_GENERIC_CHECK_IID( _lst44, pIID, n)
  342.  
  343. int __stdcall _lst44_IID_Lookup( const IID * pIID, int * pIndex )
  344. {
  345.     
  346.     if(!_lst44_CHECK_IID(0))
  347.         {
  348.         *pIndex = 0;
  349.         return 1;
  350.         }
  351.  
  352.     return 0;
  353. }
  354.  
  355. const ExtendedProxyFileInfo lst44_ProxyFileInfo = 
  356. {
  357.     (PCInterfaceProxyVtblList *) & _lst44_ProxyVtblList,
  358.     (PCInterfaceStubVtblList *) & _lst44_StubVtblList,
  359.     (const PCInterfaceName * ) & _lst44_InterfaceNamesList,
  360.     (const IID ** ) & _lst44_BaseIIDList,
  361.     & _lst44_IID_Lookup, 
  362.     1,
  363.     1
  364. };
  365.