home *** CD-ROM | disk | FTP | other *** search
/ ActiveX Programming Unleashed CD / AXU.iso / source / chap03 / lst33 / lst33_p.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-19  |  9.4 KB  |  336 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 19 15:36:37 1996
  6.  */
  7. /* Compiler settings for lst33.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 "lst33.h"
  15.  
  16. #define TYPE_FORMAT_STRING_SIZE   13                                
  17. #define PROC_FORMAT_STRING_SIZE   11                                
  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: ILst33, ver. 0.0,
  41.    GUID={0xE1DC1531,0x1250,0x11D0,{0xA6,0xAB,0x00,0xAA,0x00,0x60,0x25,0x53}} */
  42.  
  43.  
  44. extern const MIDL_STUB_DESC Object_StubDesc;
  45.  
  46.  
  47. #pragma code_seg(".orpc")
  48.  
  49. HRESULT STDMETHODCALLTYPE ILst33_Lower_Proxy( 
  50.     ILst33 __RPC_FAR * This,
  51.     /* [string][in] */ LPSTR inputString,
  52.     /* [string][out] */ LPSTR __RPC_FAR *pOutputString)
  53. {
  54.  
  55.     HRESULT _RetVal;
  56.     
  57.     RPC_MESSAGE _RpcMessage;
  58.     
  59.     MIDL_STUB_MESSAGE _StubMsg;
  60.     
  61.     *pOutputString = 0;
  62.     RpcTryExcept
  63.         {
  64.         RpcTryFinally
  65.             {
  66.             NdrProxyInitialize(
  67.                       ( void __RPC_FAR *  )This,
  68.                       ( PRPC_MESSAGE  )&_RpcMessage,
  69.                       ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  70.                       ( PMIDL_STUB_DESC  )&Object_StubDesc,
  71.                       3);
  72.             
  73.             
  74.             
  75.             
  76.             _StubMsg.BufferLength = 12U;
  77.             NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  78.                                            (unsigned char __RPC_FAR *)inputString,
  79.                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2] );
  80.             
  81.             NdrProxyGetBuffer(This, &_StubMsg);
  82.             NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  83.                                          (unsigned char __RPC_FAR *)inputString,
  84.                                          (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2] );
  85.             
  86.             NdrProxySendReceive(This, &_StubMsg);
  87.             
  88.             if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  89.                 NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  90.             
  91.             NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  92.                                   (unsigned char __RPC_FAR * __RPC_FAR *)&pOutputString,
  93.                                   (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[4],
  94.                                   (unsigned char)0 );
  95.             
  96.             _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
  97.             _RetVal = *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++;
  98.             
  99.             }
  100.         RpcFinally
  101.             {
  102.             NdrProxyFreeBuffer(This, &_StubMsg);
  103.             
  104.             }
  105.         RpcEndFinally
  106.         
  107.         }
  108.     RpcExcept(_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)
  109.         {
  110.         NdrClearOutParameters(
  111.                          ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  112.                          ( PFORMAT_STRING  )&__MIDL_TypeFormatString.Format[4],
  113.                          ( void __RPC_FAR * )pOutputString);
  114.         _RetVal = NdrProxyErrorHandler(RpcExceptionCode());
  115.         }
  116.     RpcEndExcept
  117.     return _RetVal;
  118. }
  119.  
  120. void __RPC_STUB ILst33_Lower_Stub(
  121.     IRpcStubBuffer *This,
  122.     IRpcChannelBuffer *_pRpcChannelBuffer,
  123.     PRPC_MESSAGE _pRpcMessage,
  124.     DWORD *_pdwStubPhase)
  125. {
  126.     LPSTR _M4;
  127.     HRESULT _RetVal;
  128.     MIDL_STUB_MESSAGE _StubMsg;
  129.     LPSTR inputString;
  130.     LPSTR __RPC_FAR *pOutputString;
  131.     
  132. NdrStubInitialize(
  133.                      _pRpcMessage,
  134.                      &_StubMsg,
  135.                      &Object_StubDesc,
  136.                      _pRpcChannelBuffer);
  137.     inputString = 0;
  138.     pOutputString = 0;
  139.     RpcTryFinally
  140.         {
  141.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  142.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  143.         
  144.         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  145.                                        (unsigned char __RPC_FAR * __RPC_FAR *)&inputString,
  146.                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2],
  147.                                        (unsigned char)0 );
  148.         
  149.         pOutputString = &_M4;
  150.         _M4 = 0;
  151.         
  152.         *_pdwStubPhase = STUB_CALL_SERVER;
  153.         _RetVal = (((ILst33 *) ((CStdStubBuffer *)This)->pvServerObject)->lpVtbl) -> Lower(
  154.          (ILst33 *) ((CStdStubBuffer *)This)->pvServerObject,
  155.          inputString,
  156.          pOutputString);
  157.         
  158.         *_pdwStubPhase = STUB_MARSHAL;
  159.         
  160.         _StubMsg.BufferLength = 16U + 11U;
  161.         NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  162.                               (unsigned char __RPC_FAR *)pOutputString,
  163.                               (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[4] );
  164.         
  165.         _StubMsg.BufferLength += 16;
  166.         
  167.         NdrStubGetBuffer(This, _pRpcChannelBuffer, &_StubMsg);
  168.         NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  169.                             (unsigned char __RPC_FAR *)pOutputString,
  170.                             (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[4] );
  171.         
  172.         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 3) & ~ 0x3);
  173.         *(( HRESULT __RPC_FAR * )_StubMsg.Buffer)++ = _RetVal;
  174.         
  175.         }
  176.     RpcFinally
  177.         {
  178.         NdrPointerFree( &_StubMsg,
  179.                         (unsigned char __RPC_FAR *)pOutputString,
  180.                         &__MIDL_TypeFormatString.Format[4] );
  181.         
  182.         }
  183.     RpcEndFinally
  184.     _pRpcMessage->BufferLength = 
  185.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  186.     
  187. }
  188.  
  189.  
  190. static const MIDL_STUB_DESC Object_StubDesc = 
  191.     {
  192.     0,
  193.     NdrOleAllocate,
  194.     NdrOleFree,
  195.     0,
  196.     0,
  197.     0,
  198.     0,
  199.     0,
  200.     __MIDL_TypeFormatString.Format,
  201.     0, /* -error bounds_check flag */
  202.     0x10001, /* Ndr library version */
  203.     0,
  204.     0x3000029, /* MIDL Version 3.0.41 */
  205.     0,
  206.     0,
  207.     0,  /* Reserved1 */
  208.     0,  /* Reserved2 */
  209.     0,  /* Reserved3 */
  210.     0,  /* Reserved4 */
  211.     0   /* Reserved5 */
  212.     };
  213.  
  214. const CINTERFACE_PROXY_VTABLE(4) _ILst33ProxyVtbl = 
  215. {
  216.     &IID_ILst33,
  217.     IUnknown_QueryInterface_Proxy,
  218.     IUnknown_AddRef_Proxy,
  219.     IUnknown_Release_Proxy ,
  220.     ILst33_Lower_Proxy
  221. };
  222.  
  223.  
  224. static const PRPC_STUB_FUNCTION ILst33_table[] =
  225. {
  226.     ILst33_Lower_Stub
  227. };
  228.  
  229. const CInterfaceStubVtbl _ILst33StubVtbl =
  230. {
  231.     &IID_ILst33,
  232.     0,
  233.     4,
  234.     &ILst33_table[-3],
  235.     CStdStubBuffer_METHODS
  236. };
  237.  
  238. #pragma data_seg(".rdata")
  239.  
  240. #if !defined(__RPC_WIN32__)
  241. #error  Invalid build platform for this stub.
  242. #endif
  243.  
  244.  
  245. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  246.     {
  247.         0,
  248.         {
  249.             
  250.             0x4d,        /* FC_IN_PARAM */
  251. #ifndef _ALPHA_
  252.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  253. #else
  254.             0x2,        /* Alpha Stack size = 2 */
  255. #endif
  256. /*  2 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  257. /*  4 */    
  258.             0x51,        /* FC_OUT_PARAM */
  259. #ifndef _ALPHA_
  260.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  261. #else
  262.             0x2,        /* Alpha Stack size = 2 */
  263. #endif
  264. /*  6 */    NdrFcShort( 0x4 ),    /* Type Offset=4 */
  265. /*  8 */    0x53,        /* FC_RETURN_PARAM_BASETYPE */
  266.             0x8,        /* FC_LONG */
  267.  
  268.             0x0
  269.         }
  270.     };
  271.  
  272. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  273.     {
  274.         0,
  275.         {
  276.             0x11, 0x8,    /* FC_RP [simple_pointer] */
  277. /*  2 */    
  278.             0x22,        /* FC_C_CSTRING */
  279.             0x5c,        /* FC_PAD */
  280. /*  4 */    
  281.             0x11, 0x14,    /* FC_RP [alloced_on_stack] */
  282. /*  6 */    NdrFcShort( 0x2 ),    /* Offset= 2 (8) */
  283. /*  8 */    
  284.             0x13, 0x8,    /* FC_OP [simple_pointer] */
  285. /* 10 */    
  286.             0x22,        /* FC_C_CSTRING */
  287.             0x5c,        /* FC_PAD */
  288.  
  289.             0x0
  290.         }
  291.     };
  292.  
  293. const CInterfaceProxyVtbl * _lst33_ProxyVtblList[] = 
  294. {
  295.     ( CInterfaceProxyVtbl *) &_ILst33ProxyVtbl,
  296.     0
  297. };
  298.  
  299. const CInterfaceStubVtbl * _lst33_StubVtblList[] = 
  300. {
  301.     ( CInterfaceStubVtbl *) &_ILst33StubVtbl,
  302.     0
  303. };
  304.  
  305. PCInterfaceName const _lst33_InterfaceNamesList[] = 
  306. {
  307.     "ILst33",
  308.     0
  309. };
  310.  
  311.  
  312. #define _lst33_CHECK_IID(n)    IID_GENERIC_CHECK_IID( _lst33, pIID, n)
  313.  
  314. int __stdcall _lst33_IID_Lookup( const IID * pIID, int * pIndex )
  315. {
  316.     
  317.     if(!_lst33_CHECK_IID(0))
  318.         {
  319.         *pIndex = 0;
  320.         return 1;
  321.         }
  322.  
  323.     return 0;
  324. }
  325.  
  326. const ExtendedProxyFileInfo lst33_ProxyFileInfo = 
  327. {
  328.     (PCInterfaceProxyVtblList *) & _lst33_ProxyVtblList,
  329.     (PCInterfaceStubVtblList *) & _lst33_StubVtblList,
  330.     (const PCInterfaceName * ) & _lst33_InterfaceNamesList,
  331.     0, // no delegation
  332.     & _lst33_IID_Lookup, 
  333.     1,
  334.     1
  335. };
  336.