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 / strout / strout_c.c < prev    next >
C/C++ Source or Header  |  1998-03-30  |  7KB  |  258 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:09:11 1998
  6.  */
  7. /* Compiler settings for strout.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 <string.h>
  14. #if defined( _ALPHA_ )
  15. #include <stdarg.h>
  16. #endif
  17.  
  18. #include "strout.h"
  19.  
  20. #define TYPE_FORMAT_STRING_SIZE   43                                
  21. #define PROC_FORMAT_STRING_SIZE   13                                
  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: strout_sample, ver. 1.0,
  40.    GUID={0xcab31280,0xb996,0x11cf,{0x95,0x48,0x00,0xaa,0x00,0x37,0x4e,0x69}} */
  41.  
  42. handle_t global_strout_sample_handle;
  43.  
  44.  
  45. static const RPC_CLIENT_INTERFACE strout_sample___RpcClientInterface =
  46.     {
  47.     sizeof(RPC_CLIENT_INTERFACE),
  48.     {{0xcab31280,0xb996,0x11cf,{0x95,0x48,0x00,0xaa,0x00,0x37,0x4e,0x69}},{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 strout_sample_v1_0_c_ifspec = (RPC_IF_HANDLE)& strout_sample___RpcClientInterface;
  58.  
  59. extern const MIDL_STUB_DESC strout_sample_StubDesc;
  60.  
  61. static RPC_BINDING_HANDLE strout_sample__MIDL_AutoBindHandle;
  62.  
  63.  
  64. void GetRemoteEnv( 
  65.     /* [out][in] */ unsigned long __RPC_FAR *Lines,
  66.     /* [size_is][size_is][out] */ str __RPC_FAR *__RPC_FAR *EnvBlock)
  67. {
  68.  
  69.     RPC_BINDING_HANDLE _Handle    =    0;
  70.     
  71.     RPC_MESSAGE _RpcMessage;
  72.     
  73.     MIDL_STUB_MESSAGE _StubMsg;
  74.     
  75.     RpcTryFinally
  76.         {
  77.         NdrClientInitializeNew(
  78.                           ( PRPC_MESSAGE  )&_RpcMessage,
  79.                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  80.                           ( PMIDL_STUB_DESC  )&strout_sample_StubDesc,
  81.                           0);
  82.         
  83.         
  84.         _Handle = global_strout_sample_handle;
  85.         
  86.         
  87.         _StubMsg.BufferLength = 4U;
  88.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  89.         
  90.         *(( unsigned long __RPC_FAR * )_StubMsg.Buffer)++ = *Lines;
  91.         
  92.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  93.         
  94.         if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  95.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  96.         
  97.         *Lines = *(( unsigned long __RPC_FAR * )_StubMsg.Buffer)++;
  98.         
  99.         NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  100.                               (unsigned char __RPC_FAR * __RPC_FAR *)&EnvBlock,
  101.                               (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[4],
  102.                               (unsigned char)0 );
  103.         
  104.         }
  105.     RpcFinally
  106.         {
  107.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  108.         
  109.         }
  110.     RpcEndFinally
  111.     
  112. }
  113.  
  114.  
  115. void ShutDown( void)
  116. {
  117.  
  118.     RPC_BINDING_HANDLE _Handle    =    0;
  119.     
  120.     RPC_MESSAGE _RpcMessage;
  121.     
  122.     MIDL_STUB_MESSAGE _StubMsg;
  123.     
  124.     RpcTryFinally
  125.         {
  126.         NdrClientInitializeNew(
  127.                           ( PRPC_MESSAGE  )&_RpcMessage,
  128.                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  129.                           ( PMIDL_STUB_DESC  )&strout_sample_StubDesc,
  130.                           1);
  131.         
  132.         
  133.         _Handle = global_strout_sample_handle;
  134.         
  135.         
  136.         _StubMsg.BufferLength = 0U;
  137.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  138.         
  139.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  140.         
  141.         }
  142.     RpcFinally
  143.         {
  144.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  145.         
  146.         }
  147.     RpcEndFinally
  148.     
  149. }
  150.  
  151.  
  152. static const MIDL_STUB_DESC strout_sample_StubDesc = 
  153.     {
  154.     (void __RPC_FAR *)& strout_sample___RpcClientInterface,
  155.     MIDL_user_allocate,
  156.     MIDL_user_free,
  157.     &global_strout_sample_handle,
  158.     0,
  159.     0,
  160.     0,
  161.     0,
  162.     __MIDL_TypeFormatString.Format,
  163.     0, /* -error bounds_check flag */
  164.     0x10001, /* Ndr library version */
  165.     0,
  166.     0x303006e, /* MIDL Version 3.3.110 */
  167.     0,
  168.     0,
  169.     0,  /* Reserved1 */
  170.     0,  /* Reserved2 */
  171.     0,  /* Reserved3 */
  172.     0,  /* Reserved4 */
  173.     0   /* Reserved5 */
  174.     };
  175.  
  176. #if !defined(__RPC_WIN32__)
  177. #error  Invalid build platform for this stub.
  178. #endif
  179.  
  180. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  181.     {
  182.         0,
  183.         {
  184.             
  185.             0x50,        /* FC_IN_OUT_PARAM */
  186. #ifndef _ALPHA_
  187.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  188. #else
  189.             0x2,        /* Alpha Stack size = 2 */
  190. #endif
  191. /*  2 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  192. /*  4 */    
  193.             0x51,        /* FC_OUT_PARAM */
  194. #ifndef _ALPHA_
  195.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  196. #else
  197.             0x2,        /* Alpha Stack size = 2 */
  198. #endif
  199. /*  6 */    NdrFcShort( 0x4 ),    /* Type Offset=4 */
  200. /*  8 */    0x5b,        /* FC_END */
  201.             0x5c,        /* FC_PAD */
  202. /* 10 */    0x5b,        /* FC_END */
  203.             0x5c,        /* FC_PAD */
  204.  
  205.             0x0
  206.         }
  207.     };
  208.  
  209. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  210.     {
  211.         0,
  212.         {
  213.             0x11, 0x8,    /* FC_RP [simple_pointer] */
  214. /*  2 */    0x8,        /* FC_LONG */
  215.             0x5c,        /* FC_PAD */
  216. /*  4 */    
  217.             0x11, 0x14,    /* FC_RP [alloced_on_stack] */
  218. /*  6 */    NdrFcShort( 0x2 ),    /* Offset= 2 (8) */
  219. /*  8 */    
  220.             0x12, 0x0,    /* FC_UP */
  221. /* 10 */    NdrFcShort( 0x2 ),    /* Offset= 2 (12) */
  222. /* 12 */    
  223.             0x1b,        /* FC_CARRAY */
  224.             0x3,        /* 3 */
  225. /* 14 */    NdrFcShort( 0x4 ),    /* 4 */
  226. /* 16 */    0x29,        /* 41 */
  227.             0x54,        /* FC_DEREFERENCE */
  228. #ifndef _ALPHA_
  229. /* 18 */    NdrFcShort( 0x0 ),    /* x86, MIPS, PPC Stack size/offset = 0 */
  230. #else
  231.             NdrFcShort( 0x0 ),    /* Alpha Stack size/offset = 0 */
  232. #endif
  233. /* 20 */    
  234.             0x4b,        /* FC_PP */
  235.             0x5c,        /* FC_PAD */
  236. /* 22 */    
  237.             0x48,        /* FC_VARIABLE_REPEAT */
  238.             0x49,        /* FC_FIXED_OFFSET */
  239. /* 24 */    NdrFcShort( 0x4 ),    /* 4 */
  240. /* 26 */    NdrFcShort( 0x0 ),    /* 0 */
  241. /* 28 */    NdrFcShort( 0x1 ),    /* 1 */
  242. /* 30 */    NdrFcShort( 0x0 ),    /* 0 */
  243. /* 32 */    NdrFcShort( 0x0 ),    /* 0 */
  244. /* 34 */    0x12, 0x8,    /* FC_UP [simple_pointer] */
  245. /* 36 */    
  246.             0x22,        /* FC_C_CSTRING */
  247.             0x5c,        /* FC_PAD */
  248. /* 38 */    
  249.             0x5b,        /* FC_END */
  250.  
  251.             0x8,        /* FC_LONG */
  252. /* 40 */    0x5c,        /* FC_PAD */
  253.             0x5b,        /* FC_END */
  254.  
  255.             0x0
  256.         }
  257.     };
  258.