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 / yield / yield_c.c < prev    next >
C/C++ Source or Header  |  1998-03-30  |  5KB  |  192 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:40 1998
  6.  */
  7. /* Compiler settings for yield.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 "yield.h"
  19.  
  20. #define TYPE_FORMAT_STRING_SIZE   1                                 
  21. #define PROC_FORMAT_STRING_SIZE   7                                 
  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: yield, ver. 1.0,
  40.    GUID={0x87A118A0,0x11DB,0x1068,{0x94,0xB2,0x00,0xDD,0x01,0x06,0x62,0xDA}} */
  41.  
  42. handle_t hYield;
  43.  
  44.  
  45. static const RPC_CLIENT_INTERFACE yield___RpcClientInterface =
  46.     {
  47.     sizeof(RPC_CLIENT_INTERFACE),
  48.     {{0x87A118A0,0x11DB,0x1068,{0x94,0xB2,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 yield_ClientIfHandle = (RPC_IF_HANDLE)& yield___RpcClientInterface;
  58.  
  59. extern const MIDL_STUB_DESC yield_StubDesc;
  60.  
  61. static RPC_BINDING_HANDLE yield__MIDL_AutoBindHandle;
  62.  
  63.  
  64. void YieldProc( 
  65.     /* [in] */ short cSeconds)
  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  )&yield_StubDesc,
  80.                           0);
  81.         
  82.         
  83.         _Handle = hYield;
  84.         
  85.         
  86.         _StubMsg.BufferLength = 2U;
  87.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  88.         
  89.         *(( short __RPC_FAR * )_StubMsg.Buffer)++ = cSeconds;
  90.         
  91.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  92.         
  93.         }
  94.     RpcFinally
  95.         {
  96.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  97.         
  98.         }
  99.     RpcEndFinally
  100.     
  101. }
  102.  
  103.  
  104. void Shutdown( void)
  105. {
  106.  
  107.     RPC_BINDING_HANDLE _Handle    =    0;
  108.     
  109.     RPC_MESSAGE _RpcMessage;
  110.     
  111.     MIDL_STUB_MESSAGE _StubMsg;
  112.     
  113.     RpcTryFinally
  114.         {
  115.         NdrClientInitializeNew(
  116.                           ( PRPC_MESSAGE  )&_RpcMessage,
  117.                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  118.                           ( PMIDL_STUB_DESC  )&yield_StubDesc,
  119.                           1);
  120.         
  121.         
  122.         _Handle = hYield;
  123.         
  124.         
  125.         _StubMsg.BufferLength = 0U;
  126.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  127.         
  128.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  129.         
  130.         }
  131.     RpcFinally
  132.         {
  133.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  134.         
  135.         }
  136.     RpcEndFinally
  137.     
  138. }
  139.  
  140.  
  141. static const MIDL_STUB_DESC yield_StubDesc = 
  142.     {
  143.     (void __RPC_FAR *)& yield___RpcClientInterface,
  144.     MIDL_user_allocate,
  145.     MIDL_user_free,
  146.     &hYield,
  147.     0,
  148.     0,
  149.     0,
  150.     0,
  151.     __MIDL_TypeFormatString.Format,
  152.     0, /* -error bounds_check flag */
  153.     0x10001, /* Ndr library version */
  154.     0,
  155.     0x303006e, /* MIDL Version 3.3.110 */
  156.     0,
  157.     0,
  158.     0,  /* Reserved1 */
  159.     0,  /* Reserved2 */
  160.     0,  /* Reserved3 */
  161.     0,  /* Reserved4 */
  162.     0   /* Reserved5 */
  163.     };
  164.  
  165. #if !defined(__RPC_WIN32__)
  166. #error  Invalid build platform for this stub.
  167. #endif
  168.  
  169. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  170.     {
  171.         0,
  172.         {
  173.             0x4e,        /* FC_IN_PARAM_BASETYPE */
  174.             0x6,        /* FC_SHORT */
  175. /*  2 */    0x5b,        /* FC_END */
  176.             0x5c,        /* FC_PAD */
  177. /*  4 */    0x5b,        /* FC_END */
  178.             0x5c,        /* FC_PAD */
  179.  
  180.             0x0
  181.         }
  182.     };
  183.  
  184. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  185.     {
  186.         0,
  187.         {
  188.  
  189.             0x0
  190.         }
  191.     };
  192.