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 / ns / nhello / nhello_c.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-30  |  5.3 KB  |  213 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:08:16 1998
  6.  */
  7. /* Compiler settings for nhello.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 "nhello.h"
  19.  
  20. #define TYPE_FORMAT_STRING_SIZE   5                                 
  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: nhello, ver. 1.0,
  40.    GUID={0x5D6E4DA0,0x0D21,0x1068,{0x94,0xB1,0x00,0xDD,0x01,0x06,0x62,0xDA}} */
  41.  
  42.  
  43.  
  44. static const RPC_CLIENT_INTERFACE nhello___RpcClientInterface =
  45.     {
  46.     sizeof(RPC_CLIENT_INTERFACE),
  47.     {{0x5D6E4DA0,0x0D21,0x1068,{0x94,0xB1,0x00,0xDD,0x01,0x06,0x62,0xDA}},{1,0}},
  48.     {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},
  49.     0,
  50.     0,
  51.     0,
  52.     0,
  53.     0,
  54.     0
  55.     };
  56. RPC_IF_HANDLE nhello_v1_0_c_ifspec = (RPC_IF_HANDLE)& nhello___RpcClientInterface;
  57.  
  58. extern const MIDL_STUB_DESC nhello_StubDesc;
  59.  
  60. static RPC_BINDING_HANDLE nhello__MIDL_AutoBindHandle;
  61.  
  62.  
  63. void HelloProc( 
  64.     handle_t nBinding,
  65.     /* [string][in] */ unsigned char __RPC_FAR *pszString)
  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  )&nhello_StubDesc,
  80.                           0);
  81.         
  82.         
  83.         _Handle = nBinding;
  84.         
  85.         
  86.         _StubMsg.BufferLength = 0U + 12U;
  87.         NdrConformantStringBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  88.                                        (unsigned char __RPC_FAR *)pszString,
  89.                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2] );
  90.         
  91.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  92.         
  93.         NdrConformantStringMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  94.                                      (unsigned char __RPC_FAR *)pszString,
  95.                                      (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2] );
  96.         
  97.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  98.         
  99.         }
  100.     RpcFinally
  101.         {
  102.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  103.         
  104.         }
  105.     RpcEndFinally
  106.     
  107. }
  108.  
  109.  
  110. void Shutdown( 
  111.     handle_t nBinding)
  112. {
  113.  
  114.     RPC_BINDING_HANDLE _Handle    =    0;
  115.     
  116.     RPC_MESSAGE _RpcMessage;
  117.     
  118.     MIDL_STUB_MESSAGE _StubMsg;
  119.     
  120.     RpcTryFinally
  121.         {
  122.         NdrClientInitializeNew(
  123.                           ( PRPC_MESSAGE  )&_RpcMessage,
  124.                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  125.                           ( PMIDL_STUB_DESC  )&nhello_StubDesc,
  126.                           1);
  127.         
  128.         
  129.         _Handle = nBinding;
  130.         
  131.         
  132.         _StubMsg.BufferLength = 0U;
  133.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  134.         
  135.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  136.         
  137.         }
  138.     RpcFinally
  139.         {
  140.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  141.         
  142.         }
  143.     RpcEndFinally
  144.     
  145. }
  146.  
  147.  
  148. static const MIDL_STUB_DESC nhello_StubDesc = 
  149.     {
  150.     (void __RPC_FAR *)& nhello___RpcClientInterface,
  151.     MIDL_user_allocate,
  152.     MIDL_user_free,
  153.     &nhello__MIDL_AutoBindHandle,
  154.     0,
  155.     0,
  156.     0,
  157.     0,
  158.     __MIDL_TypeFormatString.Format,
  159.     0, /* -error bounds_check flag */
  160.     0x10001, /* Ndr library version */
  161.     0,
  162.     0x303006e, /* MIDL Version 3.3.110 */
  163.     0,
  164.     0,
  165.     0,  /* Reserved1 */
  166.     0,  /* Reserved2 */
  167.     0,  /* Reserved3 */
  168.     0,  /* Reserved4 */
  169.     0   /* Reserved5 */
  170.     };
  171.  
  172. #if !defined(__RPC_WIN32__)
  173. #error  Invalid build platform for this stub.
  174. #endif
  175.  
  176. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  177.     {
  178.         0,
  179.         {
  180.             0x4e,        /* FC_IN_PARAM_BASETYPE */
  181.             0xf,        /* FC_IGNORE */
  182. /*  2 */    
  183.             0x4d,        /* FC_IN_PARAM */
  184. #ifndef _ALPHA_
  185.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  186. #else
  187.             0x2,        /* Alpha Stack size = 2 */
  188. #endif
  189. /*  4 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  190. /*  6 */    0x5b,        /* FC_END */
  191.             0x5c,        /* FC_PAD */
  192. /*  8 */    0x4e,        /* FC_IN_PARAM_BASETYPE */
  193.             0xf,        /* FC_IGNORE */
  194. /* 10 */    0x5b,        /* FC_END */
  195.             0x5c,        /* FC_PAD */
  196.  
  197.             0x0
  198.         }
  199.     };
  200.  
  201. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  202.     {
  203.         0,
  204.         {
  205.             0x11, 0x8,    /* FC_RP [simple_pointer] */
  206. /*  2 */    
  207.             0x22,        /* FC_C_CSTRING */
  208.             0x5c,        /* FC_PAD */
  209.  
  210.             0x0
  211.         }
  212.     };
  213.