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_s.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-30  |  5.3 KB  |  207 lines

  1. /* this ALWAYS GENERATED file contains the RPC server 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. #include "nhello.h"
  15.  
  16. #define TYPE_FORMAT_STRING_SIZE   5                                 
  17. #define PROC_FORMAT_STRING_SIZE   13                                
  18.  
  19. typedef struct _MIDL_TYPE_FORMAT_STRING
  20.     {
  21.     short          Pad;
  22.     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
  23.     } MIDL_TYPE_FORMAT_STRING;
  24.  
  25. typedef struct _MIDL_PROC_FORMAT_STRING
  26.     {
  27.     short          Pad;
  28.     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
  29.     } MIDL_PROC_FORMAT_STRING;
  30.  
  31. extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
  32. extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
  33.  
  34. /* Standard interface: nhello, ver. 1.0,
  35.    GUID={0x5D6E4DA0,0x0D21,0x1068,{0x94,0xB1,0x00,0xDD,0x01,0x06,0x62,0xDA}} */
  36.  
  37.  
  38. extern RPC_DISPATCH_TABLE nhello_v1_0_DispatchTable;
  39.  
  40. static const RPC_SERVER_INTERFACE nhello___RpcServerInterface =
  41.     {
  42.     sizeof(RPC_SERVER_INTERFACE),
  43.     {{0x5D6E4DA0,0x0D21,0x1068,{0x94,0xB1,0x00,0xDD,0x01,0x06,0x62,0xDA}},{1,0}},
  44.     {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},
  45.     &nhello_v1_0_DispatchTable,
  46.     0,
  47.     0,
  48.     0,
  49.     0,
  50.     0
  51.     };
  52. RPC_IF_HANDLE nhello_v1_0_s_ifspec = (RPC_IF_HANDLE)& nhello___RpcServerInterface;
  53.  
  54. extern const MIDL_STUB_DESC nhello_StubDesc;
  55.  
  56. void __RPC_STUB
  57. nhello_HelloProc(
  58.     PRPC_MESSAGE _pRpcMessage )
  59. {
  60.     MIDL_STUB_MESSAGE _StubMsg;
  61.     handle_t nBinding;
  62.     unsigned char __RPC_FAR *pszString;
  63.     RPC_STATUS _Status;
  64.     
  65.     ((void)(_Status));
  66.     NdrServerInitializeNew(
  67.                           _pRpcMessage,
  68.                           &_StubMsg,
  69.                           &nhello_StubDesc);
  70.     
  71.     nBinding = _pRpcMessage->Handle;
  72.     ( unsigned char __RPC_FAR * )pszString = 0;
  73.     RpcTryFinally
  74.         {
  75.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  76.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  77.         
  78.         NdrConformantStringUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  79.                                        (unsigned char __RPC_FAR * __RPC_FAR *)&pszString,
  80.                                        (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[2],
  81.                                        (unsigned char)0 );
  82.         
  83.         
  84.         HelloProc(nBinding,pszString);
  85.         
  86.         }
  87.     RpcFinally
  88.         {
  89.         }
  90.     RpcEndFinally
  91.     _pRpcMessage->BufferLength = 
  92.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  93.     
  94. }
  95.  
  96. void __RPC_STUB
  97. nhello_Shutdown(
  98.     PRPC_MESSAGE _pRpcMessage )
  99. {
  100.     MIDL_STUB_MESSAGE _StubMsg;
  101.     handle_t nBinding;
  102.     RPC_STATUS _Status;
  103.     
  104.     ((void)(_Status));
  105.     NdrServerInitializeNew(
  106.                           _pRpcMessage,
  107.                           &_StubMsg,
  108.                           &nhello_StubDesc);
  109.     
  110.     nBinding = _pRpcMessage->Handle;
  111.     RpcTryFinally
  112.         {
  113.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  114.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
  115.         
  116.         
  117.         Shutdown(nBinding);
  118.         
  119.         }
  120.     RpcFinally
  121.         {
  122.         }
  123.     RpcEndFinally
  124.     _pRpcMessage->BufferLength = 
  125.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  126.     
  127. }
  128.  
  129.  
  130. static const MIDL_STUB_DESC nhello_StubDesc = 
  131.     {
  132.     (void __RPC_FAR *)& nhello___RpcServerInterface,
  133.     MIDL_user_allocate,
  134.     MIDL_user_free,
  135.     0,
  136.     0,
  137.     0,
  138.     0,
  139.     0,
  140.     __MIDL_TypeFormatString.Format,
  141.     0, /* -error bounds_check flag */
  142.     0x10001, /* Ndr library version */
  143.     0,
  144.     0x303006e, /* MIDL Version 3.3.110 */
  145.     0,
  146.     0,
  147.     0,  /* Reserved1 */
  148.     0,  /* Reserved2 */
  149.     0,  /* Reserved3 */
  150.     0,  /* Reserved4 */
  151.     0   /* Reserved5 */
  152.     };
  153.  
  154. static RPC_DISPATCH_FUNCTION nhello_table[] =
  155.     {
  156.     nhello_HelloProc,
  157.     nhello_Shutdown,
  158.     0
  159.     };
  160. RPC_DISPATCH_TABLE nhello_v1_0_DispatchTable = 
  161.     {
  162.     2,
  163.     nhello_table
  164.     };
  165.  
  166. #if !defined(__RPC_WIN32__)
  167. #error  Invalid build platform for this stub.
  168. #endif
  169.  
  170. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  171.     {
  172.         0,
  173.         {
  174.             0x4e,        /* FC_IN_PARAM_BASETYPE */
  175.             0xf,        /* FC_IGNORE */
  176. /*  2 */    
  177.             0x4d,        /* FC_IN_PARAM */
  178. #ifndef _ALPHA_
  179.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  180. #else
  181.             0x2,        /* Alpha Stack size = 2 */
  182. #endif
  183. /*  4 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  184. /*  6 */    0x5b,        /* FC_END */
  185.             0x5c,        /* FC_PAD */
  186. /*  8 */    0x4e,        /* FC_IN_PARAM_BASETYPE */
  187.             0xf,        /* FC_IGNORE */
  188. /* 10 */    0x5b,        /* FC_END */
  189.             0x5c,        /* FC_PAD */
  190.  
  191.             0x0
  192.         }
  193.     };
  194.  
  195. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  196.     {
  197.         0,
  198.         {
  199.             0x11, 0x8,    /* FC_RP [simple_pointer] */
  200. /*  2 */    
  201.             0x22,        /* FC_C_CSTRING */
  202.             0x5c,        /* FC_PAD */
  203.  
  204.             0x0
  205.         }
  206.     };
  207.