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 / whello / whello_c.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-30  |  5.2 KB  |  208 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:33 1998
  6.  */
  7. /* Compiler settings for whello.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 "whello.h"
  19.  
  20. #define TYPE_FORMAT_STRING_SIZE   5                                 
  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: whello, ver. 1.0,
  40.    GUID={0x2F5F6520,0xCA46,0x1067,{0xB3,0x19,0x00,0xDD,0x01,0x06,0x62,0xDA}} */
  41.  
  42. handle_t hWHello;
  43.  
  44.  
  45. static const RPC_CLIENT_INTERFACE whello___RpcClientInterface =
  46.     {
  47.     sizeof(RPC_CLIENT_INTERFACE),
  48.     {{0x2F5F6520,0xCA46,0x1067,{0xB3,0x19,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 whello_ClientIfHandle = (RPC_IF_HANDLE)& whello___RpcClientInterface;
  58.  
  59. extern const MIDL_STUB_DESC whello_StubDesc;
  60.  
  61. static RPC_BINDING_HANDLE whello__MIDL_AutoBindHandle;
  62.  
  63.  
  64. void HelloProc( 
  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  )&whello_StubDesc,
  80.                           0);
  81.         
  82.         
  83.         _Handle = hWHello;
  84.         
  85.         
  86.         _StubMsg.BufferLength = 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( void)
  111. {
  112.  
  113.     RPC_BINDING_HANDLE _Handle    =    0;
  114.     
  115.     RPC_MESSAGE _RpcMessage;
  116.     
  117.     MIDL_STUB_MESSAGE _StubMsg;
  118.     
  119.     RpcTryFinally
  120.         {
  121.         NdrClientInitializeNew(
  122.                           ( PRPC_MESSAGE  )&_RpcMessage,
  123.                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  124.                           ( PMIDL_STUB_DESC  )&whello_StubDesc,
  125.                           1);
  126.         
  127.         
  128.         _Handle = hWHello;
  129.         
  130.         
  131.         _StubMsg.BufferLength = 0U;
  132.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  133.         
  134.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  135.         
  136.         }
  137.     RpcFinally
  138.         {
  139.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  140.         
  141.         }
  142.     RpcEndFinally
  143.     
  144. }
  145.  
  146.  
  147. static const MIDL_STUB_DESC whello_StubDesc = 
  148.     {
  149.     (void __RPC_FAR *)& whello___RpcClientInterface,
  150.     MIDL_user_allocate,
  151.     MIDL_user_free,
  152.     &hWHello,
  153.     0,
  154.     0,
  155.     0,
  156.     0,
  157.     __MIDL_TypeFormatString.Format,
  158.     0, /* -error bounds_check flag */
  159.     0x10001, /* Ndr library version */
  160.     0,
  161.     0x303006e, /* MIDL Version 3.3.110 */
  162.     0,
  163.     0,
  164.     0,  /* Reserved1 */
  165.     0,  /* Reserved2 */
  166.     0,  /* Reserved3 */
  167.     0,  /* Reserved4 */
  168.     0   /* Reserved5 */
  169.     };
  170.  
  171. #if !defined(__RPC_WIN32__)
  172. #error  Invalid build platform for this stub.
  173. #endif
  174.  
  175. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  176.     {
  177.         0,
  178.         {
  179.             
  180.             0x4d,        /* FC_IN_PARAM */
  181. #ifndef _ALPHA_
  182.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  183. #else
  184.             0x2,        /* Alpha Stack size = 2 */
  185. #endif
  186. /*  2 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  187. /*  4 */    0x5b,        /* FC_END */
  188.             0x5c,        /* FC_PAD */
  189. /*  6 */    0x5b,        /* FC_END */
  190.             0x5c,        /* FC_PAD */
  191.  
  192.             0x0
  193.         }
  194.     };
  195.  
  196. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  197.     {
  198.         0,
  199.         {
  200.             0x11, 0x8,    /* FC_RP [simple_pointer] */
  201. /*  2 */    
  202.             0x22,        /* FC_C_CSTRING */
  203.             0x5c,        /* FC_PAD */
  204.  
  205.             0x0
  206.         }
  207.     };
  208.