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_c.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-30  |  6.8 KB  |  241 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: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. #if defined( _ALPHA_ )
  15. #include <stdarg.h>
  16. #endif
  17.  
  18. #include "mdlrpc.h"
  19.  
  20. #define TYPE_FORMAT_STRING_SIZE   37                                
  21. #define PROC_FORMAT_STRING_SIZE   19                                
  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: mdlrpc, ver. 1.0,
  40.    GUID={0x5630EAA0,0xCA48,0x1067,{0xB3,0x20,0x00,0xDD,0x01,0x06,0x62,0xDA}} */
  41.  
  42. handle_t hMandel;
  43.  
  44.  
  45. static const RPC_CLIENT_INTERFACE mdlrpc___RpcClientInterface =
  46.     {
  47.     sizeof(RPC_CLIENT_INTERFACE),
  48.     {{0x5630EAA0,0xCA48,0x1067,{0xB3,0x20,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 mdlrpc_ClientIfHandle = (RPC_IF_HANDLE)& mdlrpc___RpcClientInterface;
  58.  
  59. extern const MIDL_STUB_DESC mdlrpc_StubDesc;
  60.  
  61. static RPC_BINDING_HANDLE mdlrpc__MIDL_AutoBindHandle;
  62.  
  63.  
  64. void MandelCalc( 
  65.     /* [in] */ PCPOINT pcptLL,
  66.     /* [in] */ PLONGRECT prcDraw,
  67.     /* [in] */ double precision,
  68.     /* [in] */ unsigned long ulThreshold,
  69.     /* [ref][out] */ LINEBUF __RPC_FAR *pbBuf)
  70. {
  71.  
  72.     RPC_BINDING_HANDLE _Handle    =    0;
  73.     
  74.     RPC_MESSAGE _RpcMessage;
  75.     
  76.     MIDL_STUB_MESSAGE _StubMsg;
  77.     
  78.     RpcTryFinally
  79.         {
  80.         NdrClientInitializeNew(
  81.                           ( PRPC_MESSAGE  )&_RpcMessage,
  82.                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  83.                           ( PMIDL_STUB_DESC  )&mdlrpc_StubDesc,
  84.                           0);
  85.         
  86.         
  87.         _Handle = hMandel;
  88.         
  89.         
  90.         _StubMsg.BufferLength = 0U + 0U + 23U + 8U;
  91.         NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  92.                                    (unsigned char __RPC_FAR *)pcptLL,
  93.                                    (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[4] );
  94.         
  95.         NdrSimpleStructBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  96.                                    (unsigned char __RPC_FAR *)prcDraw,
  97.                                    (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[16] );
  98.         
  99.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  100.         
  101.         NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  102.                                  (unsigned char __RPC_FAR *)pcptLL,
  103.                                  (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[4] );
  104.         
  105.         NdrSimpleStructMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  106.                                  (unsigned char __RPC_FAR *)prcDraw,
  107.                                  (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[16] );
  108.         
  109.         *(( double __RPC_FAR * )_StubMsg.Buffer)++ = precision;
  110.         
  111.         *(( unsigned long __RPC_FAR * )_StubMsg.Buffer)++ = ulThreshold;
  112.         
  113.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  114.         
  115.         if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  116.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  117.         
  118.         NdrFixedArrayUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  119.                                  (unsigned char __RPC_FAR * __RPC_FAR *)&pbBuf,
  120.                                  (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[30],
  121.                                  (unsigned char)0 );
  122.         
  123.         }
  124.     RpcFinally
  125.         {
  126.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  127.         
  128.         }
  129.     RpcEndFinally
  130.     
  131. }
  132.  
  133.  
  134. static const MIDL_STUB_DESC mdlrpc_StubDesc = 
  135.     {
  136.     (void __RPC_FAR *)& mdlrpc___RpcClientInterface,
  137.     MIDL_user_allocate,
  138.     MIDL_user_free,
  139.     &hMandel,
  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. #if !defined(__RPC_WIN32__)
  159. #error  Invalid build platform for this stub.
  160. #endif
  161.  
  162. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  163.     {
  164.         0,
  165.         {
  166.             
  167.             0x4d,        /* FC_IN_PARAM */
  168. #ifndef _ALPHA_
  169.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  170. #else
  171.             0x2,        /* Alpha Stack size = 2 */
  172. #endif
  173. /*  2 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  174. /*  4 */    
  175.             0x4d,        /* FC_IN_PARAM */
  176. #ifndef _ALPHA_
  177.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  178. #else
  179.             0x2,        /* Alpha Stack size = 2 */
  180. #endif
  181. /*  6 */    NdrFcShort( 0xc ),    /* Type Offset=12 */
  182. /*  8 */    0x4e,        /* FC_IN_PARAM_BASETYPE */
  183.             0xc,        /* FC_DOUBLE */
  184. /* 10 */    0x4e,        /* FC_IN_PARAM_BASETYPE */
  185.             0x8,        /* FC_LONG */
  186. /* 12 */    
  187.             0x51,        /* FC_OUT_PARAM */
  188. #ifndef _ALPHA_
  189.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  190. #else
  191.             0x2,        /* Alpha Stack size = 2 */
  192. #endif
  193. /* 14 */    NdrFcShort( 0x1a ),    /* Type Offset=26 */
  194. /* 16 */    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, 0x0,    /* FC_RP */
  206. /*  2 */    NdrFcShort( 0x2 ),    /* Offset= 2 (4) */
  207. /*  4 */    
  208.             0x15,        /* FC_STRUCT */
  209.             0x7,        /* 7 */
  210. /*  6 */    NdrFcShort( 0x10 ),    /* 16 */
  211. /*  8 */    0xc,        /* FC_DOUBLE */
  212.             0xc,        /* FC_DOUBLE */
  213. /* 10 */    0x5c,        /* FC_PAD */
  214.             0x5b,        /* FC_END */
  215. /* 12 */    
  216.             0x11, 0x0,    /* FC_RP */
  217. /* 14 */    NdrFcShort( 0x2 ),    /* Offset= 2 (16) */
  218. /* 16 */    
  219.             0x15,        /* FC_STRUCT */
  220.             0x3,        /* 3 */
  221. /* 18 */    NdrFcShort( 0x10 ),    /* 16 */
  222. /* 20 */    0x8,        /* FC_LONG */
  223.             0x8,        /* FC_LONG */
  224. /* 22 */    0x8,        /* FC_LONG */
  225.             0x8,        /* FC_LONG */
  226. /* 24 */    0x5c,        /* FC_PAD */
  227.             0x5b,        /* FC_END */
  228. /* 26 */    
  229.             0x11, 0x4,    /* FC_RP [alloced_on_stack] */
  230. /* 28 */    NdrFcShort( 0x2 ),    /* Offset= 2 (30) */
  231. /* 30 */    
  232.             0x1d,        /* FC_SMFARRAY */
  233.             0x1,        /* 1 */
  234. /* 32 */    NdrFcShort( 0x960 ),    /* 2400 */
  235. /* 34 */    0x6,        /* FC_SHORT */
  236.             0x5b,        /* FC_END */
  237.  
  238.             0x0
  239.         }
  240.     };
  241.