home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / netds / rpc / data / xmit / xmit_c.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-30  |  7.5 KB  |  273 lines

  1. /* this ALWAYS GENERATED file contains the RPC client stubs */
  2.  
  3.  
  4. /* File created by MIDL compiler version 3.03.0110 */
  5. /* at Mon Mar 30 03:06:10 1998
  6.  */
  7. /* Compiler settings for xmit.idl:
  8.     Os (OptLev=s), W1, Zp8, env=Win32, ms_ext, c_ext, oldnames
  9.     error checks: none
  10. */
  11. //@@MIDL_FILE_HEADING(  )
  12.  
  13. #include <string.h>
  14. #if defined( _ALPHA_ )
  15. #include <stdarg.h>
  16. #endif
  17.  
  18. #include "xmit.h"
  19.  
  20. #define TYPE_FORMAT_STRING_SIZE   33                                
  21. #define PROC_FORMAT_STRING_SIZE   9                                 
  22.  
  23. typedef struct _MIDL_TYPE_FORMAT_STRING
  24.     {
  25.     short          Pad;
  26.     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
  27.     } MIDL_TYPE_FORMAT_STRING;
  28.  
  29. typedef struct _MIDL_PROC_FORMAT_STRING
  30.     {
  31.     short          Pad;
  32.     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
  33.     } MIDL_PROC_FORMAT_STRING;
  34.  
  35.  
  36. extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
  37. extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
  38.  
  39. /* Standard interface: xmit, ver. 1.0,
  40.    GUID={0x56BF67C0,0x6503,0x1068,{0xBF,0x67,0x00,0xDD,0x01,0x0F,0xBF,0x25}} */
  41.  
  42. handle_t hXmit;
  43.  
  44.  
  45. static const RPC_CLIENT_INTERFACE xmit___RpcClientInterface =
  46.     {
  47.     sizeof(RPC_CLIENT_INTERFACE),
  48.     {{0x56BF67C0,0x6503,0x1068,{0xBF,0x67,0x00,0xDD,0x01,0x0F,0xBF,0x25}},{1,0}},
  49.     {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},
  50.     0,
  51.     0,
  52.     0,
  53.     0,
  54.     0,
  55.     0
  56.     };
  57. RPC_IF_HANDLE xmit_ClientIfHandle = (RPC_IF_HANDLE)& xmit___RpcClientInterface;
  58.  
  59. extern const MIDL_STUB_DESC xmit_StubDesc;
  60.  
  61. static RPC_BINDING_HANDLE xmit__MIDL_AutoBindHandle;
  62.  
  63.  
  64. void ModifyListProc( 
  65.     /* [out][in] */ DOUBLE_LINK_TYPE __RPC_FAR *pHead)
  66. {
  67.  
  68.     RPC_BINDING_HANDLE _Handle    =    0;
  69.     
  70.     RPC_MESSAGE _RpcMessage;
  71.     
  72.     MIDL_STUB_MESSAGE _StubMsg;
  73.     
  74.     RpcTryFinally
  75.         {
  76.         NdrClientInitializeNew(
  77.                           ( PRPC_MESSAGE  )&_RpcMessage,
  78.                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  79.                           ( PMIDL_STUB_DESC  )&xmit_StubDesc,
  80.                           0);
  81.         
  82.         
  83.         _Handle = hXmit;
  84.         
  85.         
  86.         _StubMsg.BufferLength = 0U;
  87.         NdrXmitOrRepAsBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  88.                                   (unsigned char __RPC_FAR *)pHead,
  89.                                   (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[22] );
  90.         
  91.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  92.         
  93.         NdrXmitOrRepAsMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  94.                                 (unsigned char __RPC_FAR *)pHead,
  95.                                 (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[22] );
  96.         
  97.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  98.         
  99.         if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  100.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  101.         
  102.         NdrXmitOrRepAsUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  103.                                   (unsigned char __RPC_FAR * __RPC_FAR *)&pHead,
  104.                                   (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[22],
  105.                                   (unsigned char)0 );
  106.         
  107.         }
  108.     RpcFinally
  109.         {
  110.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  111.         
  112.         }
  113.     RpcEndFinally
  114.     
  115. }
  116.  
  117.  
  118. void Shutdown( void)
  119. {
  120.  
  121.     RPC_BINDING_HANDLE _Handle    =    0;
  122.     
  123.     RPC_MESSAGE _RpcMessage;
  124.     
  125.     MIDL_STUB_MESSAGE _StubMsg;
  126.     
  127.     RpcTryFinally
  128.         {
  129.         NdrClientInitializeNew(
  130.                           ( PRPC_MESSAGE  )&_RpcMessage,
  131.                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  132.                           ( PMIDL_STUB_DESC  )&xmit_StubDesc,
  133.                           1);
  134.         
  135.         
  136.         _Handle = hXmit;
  137.         
  138.         
  139.         _StubMsg.BufferLength = 0U;
  140.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  141.         
  142.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  143.         
  144.         }
  145.     RpcFinally
  146.         {
  147.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  148.         
  149.         }
  150.     RpcEndFinally
  151.     
  152. }
  153.  
  154. extern const XMIT_ROUTINE_QUINTUPLE TransmitAsRoutines[1];
  155.  
  156. static const MIDL_STUB_DESC xmit_StubDesc = 
  157.     {
  158.     (void __RPC_FAR *)& xmit___RpcClientInterface,
  159.     MIDL_user_allocate,
  160.     MIDL_user_free,
  161.     &hXmit,
  162.     0,
  163.     0,
  164.     0,
  165.     TransmitAsRoutines,
  166.     __MIDL_TypeFormatString.Format,
  167.     0, /* -error bounds_check flag */
  168.     0x10001, /* Ndr library version */
  169.     0,
  170.     0x303006e, /* MIDL Version 3.3.110 */
  171.     0,
  172.     0,
  173.     0,  /* Reserved1 */
  174.     0,  /* Reserved2 */
  175.     0,  /* Reserved3 */
  176.     0,  /* Reserved4 */
  177.     0   /* Reserved5 */
  178.     };
  179.  
  180. NDR_SHAREABLE void __RPC_USER
  181. DOUBLE_LINK_TYPE_XmitTranslateToXmit( PMIDL_STUB_MESSAGE pStubMsg )
  182. {
  183.     DOUBLE_LINK_TYPE_to_xmit( (DOUBLE_LINK_TYPE __RPC_FAR *) pStubMsg->pPresentedType, 
  184.         (DOUBLE_XMIT_TYPE __RPC_FAR * __RPC_FAR *) &pStubMsg->pTransmitType );
  185. }
  186. NDR_SHAREABLE void __RPC_USER
  187. DOUBLE_LINK_TYPE_XmitTranslateFromXmit( PMIDL_STUB_MESSAGE pStubMsg )
  188. {
  189.     DOUBLE_LINK_TYPE_from_xmit( (DOUBLE_XMIT_TYPE __RPC_FAR *) pStubMsg->pTransmitType, 
  190.         (DOUBLE_LINK_TYPE __RPC_FAR *) pStubMsg->pPresentedType ); 
  191. }
  192. NDR_SHAREABLE void __RPC_USER
  193. DOUBLE_LINK_TYPE_XmitFreeXmit( PMIDL_STUB_MESSAGE pStubMsg )
  194. {
  195.     DOUBLE_LINK_TYPE_free_xmit( (DOUBLE_XMIT_TYPE __RPC_FAR *) pStubMsg->pTransmitType );
  196. }
  197. NDR_SHAREABLE void __RPC_USER
  198. DOUBLE_LINK_TYPE_XmitFreeInst( PMIDL_STUB_MESSAGE pStubMsg )
  199. {
  200.     DOUBLE_LINK_TYPE_free_inst( (DOUBLE_LINK_TYPE __RPC_FAR *) pStubMsg->pPresentedType ); 
  201. }
  202.  
  203. static const XMIT_ROUTINE_QUINTUPLE TransmitAsRoutines[1] = 
  204.         {
  205.             
  206.             {
  207.             DOUBLE_LINK_TYPE_XmitTranslateToXmit
  208.             ,DOUBLE_LINK_TYPE_XmitTranslateFromXmit
  209.             ,DOUBLE_LINK_TYPE_XmitFreeXmit
  210.             ,DOUBLE_LINK_TYPE_XmitFreeInst
  211.             }
  212.  
  213.         };
  214.  
  215.  
  216. #if !defined(__RPC_WIN32__)
  217. #error  Invalid build platform for this stub.
  218. #endif
  219.  
  220. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  221.     {
  222.         0,
  223.         {
  224.             
  225.             0x50,        /* FC_IN_OUT_PARAM */
  226. #ifndef _ALPHA_
  227.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  228. #else
  229.             0x2,        /* Alpha Stack size = 2 */
  230. #endif
  231. /*  2 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  232. /*  4 */    0x5b,        /* FC_END */
  233.             0x5c,        /* FC_PAD */
  234. /*  6 */    0x5b,        /* FC_END */
  235.             0x5c,        /* FC_PAD */
  236.  
  237.             0x0
  238.         }
  239.     };
  240.  
  241. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  242.     {
  243.         0,
  244.         {
  245.             0x11, 0x0,    /* FC_RP */
  246. /*  2 */    NdrFcShort( 0x14 ),    /* Offset= 20 (22) */
  247. /*  4 */    
  248.             0x1b,        /* FC_CARRAY */
  249.             0x1,        /* 1 */
  250. /*  6 */    NdrFcShort( 0x2 ),    /* 2 */
  251. /*  8 */    0x6,        /* 6 */
  252.             0x0,        /*  */
  253. /* 10 */    NdrFcShort( 0xfffffffe ),    /* -2 */
  254. /* 12 */    0x6,        /* FC_SHORT */
  255.             0x5b,        /* FC_END */
  256. /* 14 */    
  257.             0x17,        /* FC_CSTRUCT */
  258.             0x1,        /* 1 */
  259. /* 16 */    NdrFcShort( 0x2 ),    /* 2 */
  260. /* 18 */    NdrFcShort( 0xfffffff2 ),    /* Offset= -14 (4) */
  261. /* 20 */    0x6,        /* FC_SHORT */
  262.             0x5b,        /* FC_END */
  263. /* 22 */    0x2d,        /* FC_TRANSMIT_AS */
  264.             0x21,        /* 33 */
  265. /* 24 */    NdrFcShort( 0x0 ),    /* 0 */
  266. /* 26 */    NdrFcShort( 0xc ),    /* 12 */
  267. /* 28 */    NdrFcShort( 0x0 ),    /* 0 */
  268. /* 30 */    NdrFcShort( 0xfffffff0 ),    /* Offset= -16 (14) */
  269.  
  270.             0x0
  271.         }
  272.     };
  273.