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 / mandel / mdlrpc_s.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-30  |  6.9 KB  |  252 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:06 1998
  6.  */
  7. /* Compiler settings for mdlrpc.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. #include "mdlrpc.h"
  15.  
  16. #define TYPE_FORMAT_STRING_SIZE   37                                
  17. #define PROC_FORMAT_STRING_SIZE   19                                
  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: mdlrpc, ver. 1.0,
  35.    GUID={0x5630EAA0,0xCA48,0x1067,{0xB3,0x20,0x00,0xDD,0x01,0x06,0x62,0xDA}} */
  36.  
  37.  
  38. extern RPC_DISPATCH_TABLE mdlrpc_DispatchTable;
  39.  
  40. static const RPC_SERVER_INTERFACE mdlrpc___RpcServerInterface =
  41.     {
  42.     sizeof(RPC_SERVER_INTERFACE),
  43.     {{0x5630EAA0,0xCA48,0x1067,{0xB3,0x20,0x00,0xDD,0x01,0x06,0x62,0xDA}},{1,0}},
  44.     {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},
  45.     &mdlrpc_DispatchTable,
  46.     0,
  47.     0,
  48.     0,
  49.     0,
  50.     0
  51.     };
  52. RPC_IF_HANDLE mdlrpc_ServerIfHandle = (RPC_IF_HANDLE)& mdlrpc___RpcServerInterface;
  53.  
  54. extern const MIDL_STUB_DESC mdlrpc_StubDesc;
  55.  
  56. void __RPC_STUB
  57. mdlrpc_MandelCalc(
  58.     PRPC_MESSAGE _pRpcMessage )
  59. {
  60.     LINEBUF _AM0;
  61.     MIDL_STUB_MESSAGE _StubMsg;
  62.     LINEBUF __RPC_FAR *pbBuf;
  63.     PCPOINT pcptLL;
  64.     PLONGRECT prcDraw;
  65.     double precision;
  66.     unsigned long ulThreshold;
  67.     RPC_STATUS _Status;
  68.     
  69.     ((void)(_Status));
  70.     NdrServerInitializeNew(
  71.                           _pRpcMessage,
  72.                           &_StubMsg,
  73.                           &mdlrpc_StubDesc);
  74.     
  75.     ( PCPOINT  )pcptLL = 0;
  76.     ( PLONGRECT  )prcDraw = 0;
  77.     ( LINEBUF __RPC_FAR * )pbBuf = 0;
  78.     RpcTryFinally
  79.         {
  80.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  81.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  82.         
  83.         NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  84.                                    (unsigned char __RPC_FAR * __RPC_FAR *)&pcptLL,
  85.                                    (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[4],
  86.                                    (unsigned char)0 );
  87.         
  88.         NdrSimpleStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  89.                                    (unsigned char __RPC_FAR * __RPC_FAR *)&prcDraw,
  90.                                    (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[16],
  91.                                    (unsigned char)0 );
  92.         
  93.         precision = *(( double __RPC_FAR * )_StubMsg.Buffer)++;
  94.         
  95.         ulThreshold = *(( unsigned long __RPC_FAR * )_StubMsg.Buffer)++;
  96.         
  97.         pbBuf = &_AM0;
  98.         
  99.         MandelCalc(
  100.               pcptLL,
  101.               prcDraw,
  102.               precision,
  103.               ulThreshold,
  104.               pbBuf);
  105.         
  106.         _StubMsg.BufferLength = 2400U;
  107.         _pRpcMessage->BufferLength = _StubMsg.BufferLength;
  108.         
  109.         _Status = I_RpcGetBuffer( _pRpcMessage ); 
  110.         if ( _Status )
  111.             RpcRaiseException( _Status );
  112.         
  113.         _StubMsg.Buffer = (unsigned char __RPC_FAR *) _pRpcMessage->Buffer;
  114.         
  115.         NdrFixedArrayMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  116.                                (unsigned char __RPC_FAR *)pbBuf,
  117.                                (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[30] );
  118.         
  119.         }
  120.     RpcFinally
  121.         {
  122.         NdrPointerFree( &_StubMsg,
  123.                         (unsigned char __RPC_FAR *)pbBuf,
  124.                         &__MIDL_TypeFormatString.Format[26] );
  125.         
  126.         }
  127.     RpcEndFinally
  128.     _pRpcMessage->BufferLength = 
  129.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  130.     
  131. }
  132.  
  133.  
  134. static const MIDL_STUB_DESC mdlrpc_StubDesc = 
  135.     {
  136.     (void __RPC_FAR *)& mdlrpc___RpcServerInterface,
  137.     MIDL_user_allocate,
  138.     MIDL_user_free,
  139.     0,
  140.     0,
  141.     0,
  142.     0,
  143.     0,
  144.     __MIDL_TypeFormatString.Format,
  145.     0, /* -error bounds_check flag */
  146.     0x10001, /* Ndr library version */
  147.     0,
  148.     0x303006e, /* MIDL Version 3.3.110 */
  149.     0,
  150.     0,
  151.     0,  /* Reserved1 */
  152.     0,  /* Reserved2 */
  153.     0,  /* Reserved3 */
  154.     0,  /* Reserved4 */
  155.     0   /* Reserved5 */
  156.     };
  157.  
  158. static RPC_DISPATCH_FUNCTION mdlrpc_table[] =
  159.     {
  160.     mdlrpc_MandelCalc,
  161.     0
  162.     };
  163. RPC_DISPATCH_TABLE mdlrpc_DispatchTable = 
  164.     {
  165.     1,
  166.     mdlrpc_table
  167.     };
  168.  
  169. #if !defined(__RPC_WIN32__)
  170. #error  Invalid build platform for this stub.
  171. #endif
  172.  
  173. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  174.     {
  175.         0,
  176.         {
  177.             
  178.             0x4d,        /* FC_IN_PARAM */
  179. #ifndef _ALPHA_
  180.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  181. #else
  182.             0x2,        /* Alpha Stack size = 2 */
  183. #endif
  184. /*  2 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  185. /*  4 */    
  186.             0x4d,        /* FC_IN_PARAM */
  187. #ifndef _ALPHA_
  188.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  189. #else
  190.             0x2,        /* Alpha Stack size = 2 */
  191. #endif
  192. /*  6 */    NdrFcShort( 0xc ),    /* Type Offset=12 */
  193. /*  8 */    0x4e,        /* FC_IN_PARAM_BASETYPE */
  194.             0xc,        /* FC_DOUBLE */
  195. /* 10 */    0x4e,        /* FC_IN_PARAM_BASETYPE */
  196.             0x8,        /* FC_LONG */
  197. /* 12 */    
  198.             0x51,        /* FC_OUT_PARAM */
  199. #ifndef _ALPHA_
  200.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  201. #else
  202.             0x2,        /* Alpha Stack size = 2 */
  203. #endif
  204. /* 14 */    NdrFcShort( 0x1a ),    /* Type Offset=26 */
  205. /* 16 */    0x5b,        /* FC_END */
  206.             0x5c,        /* FC_PAD */
  207.  
  208.             0x0
  209.         }
  210.     };
  211.  
  212. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  213.     {
  214.         0,
  215.         {
  216.             0x11, 0x0,    /* FC_RP */
  217. /*  2 */    NdrFcShort( 0x2 ),    /* Offset= 2 (4) */
  218. /*  4 */    
  219.             0x15,        /* FC_STRUCT */
  220.             0x7,        /* 7 */
  221. /*  6 */    NdrFcShort( 0x10 ),    /* 16 */
  222. /*  8 */    0xc,        /* FC_DOUBLE */
  223.             0xc,        /* FC_DOUBLE */
  224. /* 10 */    0x5c,        /* FC_PAD */
  225.             0x5b,        /* FC_END */
  226. /* 12 */    
  227.             0x11, 0x0,    /* FC_RP */
  228. /* 14 */    NdrFcShort( 0x2 ),    /* Offset= 2 (16) */
  229. /* 16 */    
  230.             0x15,        /* FC_STRUCT */
  231.             0x3,        /* 3 */
  232. /* 18 */    NdrFcShort( 0x10 ),    /* 16 */
  233. /* 20 */    0x8,        /* FC_LONG */
  234.             0x8,        /* FC_LONG */
  235. /* 22 */    0x8,        /* FC_LONG */
  236.             0x8,        /* FC_LONG */
  237. /* 24 */    0x5c,        /* FC_PAD */
  238.             0x5b,        /* FC_END */
  239. /* 26 */    
  240.             0x11, 0x4,    /* FC_RP [alloced_on_stack] */
  241. /* 28 */    NdrFcShort( 0x2 ),    /* Offset= 2 (30) */
  242. /* 30 */    
  243.             0x1d,        /* FC_SMFARRAY */
  244.             0x1,        /* 1 */
  245. /* 32 */    NdrFcShort( 0x960 ),    /* 2400 */
  246. /* 34 */    0x6,        /* FC_SHORT */
  247.             0x5b,        /* FC_END */
  248.  
  249.             0x0
  250.         }
  251.     };
  252.