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 / inout / inout_c.c next >
C/C++ Source or Header  |  1998-03-30  |  6KB  |  227 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:05:44 1998
  6.  */
  7. /* Compiler settings for inout.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 "inout.h"
  19.  
  20. #define TYPE_FORMAT_STRING_SIZE   9                                 
  21. #define PROC_FORMAT_STRING_SIZE   15                                
  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: inout, ver. 1.0,
  40.    GUID={0x6E3B5060,0xCA46,0x1067,{0xB3,0x1A,0x00,0xDD,0x01,0x06,0x62,0xDA}} */
  41.  
  42. handle_t inout_IfHandle;
  43.  
  44.  
  45. static const RPC_CLIENT_INTERFACE inout___RpcClientInterface =
  46.     {
  47.     sizeof(RPC_CLIENT_INTERFACE),
  48.     {{0x6E3B5060,0xCA46,0x1067,{0xB3,0x1A,0x00,0xDD,0x01,0x06,0x62,0xDA}},{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 inout_ClientIfHandle = (RPC_IF_HANDLE)& inout___RpcClientInterface;
  58.  
  59. extern const MIDL_STUB_DESC inout_StubDesc;
  60.  
  61. static RPC_BINDING_HANDLE inout__MIDL_AutoBindHandle;
  62.  
  63.  
  64. void InOutProc( 
  65.     /* [in] */ short s1,
  66.     /* [out][in] */ short __RPC_FAR *ps2,
  67.     /* [out] */ float __RPC_FAR *pf3)
  68. {
  69.  
  70.     RPC_BINDING_HANDLE _Handle    =    0;
  71.     
  72.     RPC_MESSAGE _RpcMessage;
  73.     
  74.     MIDL_STUB_MESSAGE _StubMsg;
  75.     
  76.     RpcTryFinally
  77.         {
  78.         NdrClientInitializeNew(
  79.                           ( PRPC_MESSAGE  )&_RpcMessage,
  80.                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  81.                           ( PMIDL_STUB_DESC  )&inout_StubDesc,
  82.                           0);
  83.         
  84.         
  85.         _Handle = inout_IfHandle;
  86.         
  87.         
  88.         _StubMsg.BufferLength = 2U + 2U;
  89.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  90.         
  91.         *(( short __RPC_FAR * )_StubMsg.Buffer)++ = s1;
  92.         
  93.         *(( short __RPC_FAR * )_StubMsg.Buffer)++ = *ps2;
  94.         
  95.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  96.         
  97.         if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  98.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  99.         
  100.         *ps2 = *(( short __RPC_FAR * )_StubMsg.Buffer)++;
  101.         
  102.         _StubMsg.Buffer += 2;
  103.         *pf3 = *(( float __RPC_FAR * )_StubMsg.Buffer)++;
  104.         
  105.         }
  106.     RpcFinally
  107.         {
  108.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  109.         
  110.         }
  111.     RpcEndFinally
  112.     
  113. }
  114.  
  115.  
  116. void Shutdown( void)
  117. {
  118.  
  119.     RPC_BINDING_HANDLE _Handle    =    0;
  120.     
  121.     RPC_MESSAGE _RpcMessage;
  122.     
  123.     MIDL_STUB_MESSAGE _StubMsg;
  124.     
  125.     RpcTryFinally
  126.         {
  127.         NdrClientInitializeNew(
  128.                           ( PRPC_MESSAGE  )&_RpcMessage,
  129.                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  130.                           ( PMIDL_STUB_DESC  )&inout_StubDesc,
  131.                           1);
  132.         
  133.         
  134.         _Handle = inout_IfHandle;
  135.         
  136.         
  137.         _StubMsg.BufferLength = 0U;
  138.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  139.         
  140.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  141.         
  142.         }
  143.     RpcFinally
  144.         {
  145.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  146.         
  147.         }
  148.     RpcEndFinally
  149.     
  150. }
  151.  
  152.  
  153. static const MIDL_STUB_DESC inout_StubDesc = 
  154.     {
  155.     (void __RPC_FAR *)& inout___RpcClientInterface,
  156.     MIDL_user_allocate,
  157.     MIDL_user_free,
  158.     &inout_IfHandle,
  159.     0,
  160.     0,
  161.     0,
  162.     0,
  163.     __MIDL_TypeFormatString.Format,
  164.     0, /* -error bounds_check flag */
  165.     0x10001, /* Ndr library version */
  166.     0,
  167.     0x303006e, /* MIDL Version 3.3.110 */
  168.     0,
  169.     0,
  170.     0,  /* Reserved1 */
  171.     0,  /* Reserved2 */
  172.     0,  /* Reserved3 */
  173.     0,  /* Reserved4 */
  174.     0   /* Reserved5 */
  175.     };
  176.  
  177. #if !defined(__RPC_WIN32__)
  178. #error  Invalid build platform for this stub.
  179. #endif
  180.  
  181. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  182.     {
  183.         0,
  184.         {
  185.             0x4e,        /* FC_IN_PARAM_BASETYPE */
  186.             0x6,        /* FC_SHORT */
  187. /*  2 */    
  188.             0x50,        /* FC_IN_OUT_PARAM */
  189. #ifndef _ALPHA_
  190.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  191. #else
  192.             0x2,        /* Alpha Stack size = 2 */
  193. #endif
  194. /*  4 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  195. /*  6 */    
  196.             0x51,        /* FC_OUT_PARAM */
  197. #ifndef _ALPHA_
  198.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  199. #else
  200.             0x2,        /* Alpha Stack size = 2 */
  201. #endif
  202. /*  8 */    NdrFcShort( 0x4 ),    /* Type Offset=4 */
  203. /* 10 */    0x5b,        /* FC_END */
  204.             0x5c,        /* FC_PAD */
  205. /* 12 */    0x5b,        /* FC_END */
  206.             0x5c,        /* FC_PAD */
  207.  
  208.             0x0
  209.         }
  210.     };
  211.  
  212. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  213.     {
  214.         0,
  215.         {
  216.             0x11, 0x8,    /* FC_RP [simple_pointer] */
  217. /*  2 */    0x6,        /* FC_SHORT */
  218.             0x5c,        /* FC_PAD */
  219. /*  4 */    
  220.             0x11, 0xc,    /* FC_RP [alloced_on_stack] [simple_pointer] */
  221. /*  6 */    0xa,        /* FC_FLOAT */
  222.             0x5c,        /* FC_PAD */
  223.  
  224.             0x0
  225.         }
  226.     };
  227.