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 / data / dunion / dunion_s.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-30  |  8.4 KB  |  300 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:05:33 1998
  6.  */
  7. /* Compiler settings for dunion.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 "dunion.h"
  15.  
  16. #define TYPE_FORMAT_STRING_SIZE   63                                
  17. #define PROC_FORMAT_STRING_SIZE   17                                
  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: dunion, ver. 1.0,
  35.    GUID={0x87E5BFA0,0xCA46,0x1067,{0xB3,0x1B,0x00,0xDD,0x01,0x06,0x62,0xDA}} */
  36.  
  37.  
  38. extern RPC_DISPATCH_TABLE dunion_DispatchTable;
  39.  
  40. static const RPC_SERVER_INTERFACE dunion___RpcServerInterface =
  41.     {
  42.     sizeof(RPC_SERVER_INTERFACE),
  43.     {{0x87E5BFA0,0xCA46,0x1067,{0xB3,0x1B,0x00,0xDD,0x01,0x06,0x62,0xDA}},{1,0}},
  44.     {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},
  45.     &dunion_DispatchTable,
  46.     0,
  47.     0,
  48.     0,
  49.     0,
  50.     0
  51.     };
  52. RPC_IF_HANDLE dunion_ServerIfHandle = (RPC_IF_HANDLE)& dunion___RpcServerInterface;
  53.  
  54. extern const MIDL_STUB_DESC dunion_StubDesc;
  55.  
  56. void __RPC_STUB
  57. dunion_UnionParamProc(
  58.     PRPC_MESSAGE _pRpcMessage )
  59. {
  60.     DISCRIM_UNION_PARAM_TYPE __RPC_FAR *UnionParam;
  61.     MIDL_STUB_MESSAGE _StubMsg;
  62.     short sDiscrim;
  63.     RPC_STATUS _Status;
  64.     
  65.     ((void)(_Status));
  66.     NdrServerInitializeNew(
  67.                           _pRpcMessage,
  68.                           &_StubMsg,
  69.                           &dunion_StubDesc);
  70.     
  71.     ( DISCRIM_UNION_PARAM_TYPE __RPC_FAR * )UnionParam = 0;
  72.     RpcTryFinally
  73.         {
  74.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  75.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  76.         
  77.         NdrNonEncapsulatedUnionUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  78.                                            (unsigned char __RPC_FAR * __RPC_FAR *)&UnionParam,
  79.                                            (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[4],
  80.                                            (unsigned char)0 );
  81.         
  82.         _StubMsg.Buffer = (unsigned char __RPC_FAR *)(((long)_StubMsg.Buffer + 1) & ~ 0x1);
  83.         sDiscrim = *(( short __RPC_FAR * )_StubMsg.Buffer)++;
  84.         
  85.         
  86.         UnionParamProc(UnionParam,sDiscrim);
  87.         
  88.         }
  89.     RpcFinally
  90.         {
  91.         _StubMsg.MaxCount = sDiscrim;
  92.         
  93.         NdrPointerFree( &_StubMsg,
  94.                         (unsigned char __RPC_FAR *)UnionParam,
  95.                         &__MIDL_TypeFormatString.Format[0] );
  96.         
  97.         }
  98.     RpcEndFinally
  99.     _pRpcMessage->BufferLength = 
  100.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  101.     
  102. }
  103.  
  104. void __RPC_STUB
  105. dunion_UnionStructProc(
  106.     PRPC_MESSAGE _pRpcMessage )
  107. {
  108.     DISCRIM_UNION_STRUCT_TYPE __RPC_FAR *UnionStruct;
  109.     MIDL_STUB_MESSAGE _StubMsg;
  110.     RPC_STATUS _Status;
  111.     
  112.     ((void)(_Status));
  113.     NdrServerInitializeNew(
  114.                           _pRpcMessage,
  115.                           &_StubMsg,
  116.                           &dunion_StubDesc);
  117.     
  118.     ( DISCRIM_UNION_STRUCT_TYPE __RPC_FAR * )UnionStruct = 0;
  119.     RpcTryFinally
  120.         {
  121.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  122.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[8] );
  123.         
  124.         NdrComplexStructUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  125.                                     (unsigned char __RPC_FAR * __RPC_FAR *)&UnionStruct,
  126.                                     (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[48],
  127.                                     (unsigned char)0 );
  128.         
  129.         
  130.         UnionStructProc(UnionStruct);
  131.         
  132.         }
  133.     RpcFinally
  134.         {
  135.         NdrPointerFree( &_StubMsg,
  136.                         (unsigned char __RPC_FAR *)UnionStruct,
  137.                         &__MIDL_TypeFormatString.Format[36] );
  138.         
  139.         }
  140.     RpcEndFinally
  141.     _pRpcMessage->BufferLength = 
  142.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  143.     
  144. }
  145.  
  146. void __RPC_STUB
  147. dunion_Shutdown(
  148.     PRPC_MESSAGE _pRpcMessage )
  149. {
  150.     MIDL_STUB_MESSAGE _StubMsg;
  151.     RPC_STATUS _Status;
  152.     
  153.     ((void)(_Status));
  154.     NdrServerInitializeNew(
  155.                           _pRpcMessage,
  156.                           &_StubMsg,
  157.                           &dunion_StubDesc);
  158.     
  159.     RpcTryFinally
  160.         {
  161.         
  162.         Shutdown();
  163.         
  164.         }
  165.     RpcFinally
  166.         {
  167.         }
  168.     RpcEndFinally
  169.     _pRpcMessage->BufferLength = 
  170.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  171.     
  172. }
  173.  
  174.  
  175. static const MIDL_STUB_DESC dunion_StubDesc = 
  176.     {
  177.     (void __RPC_FAR *)& dunion___RpcServerInterface,
  178.     MIDL_user_allocate,
  179.     MIDL_user_free,
  180.     0,
  181.     0,
  182.     0,
  183.     0,
  184.     0,
  185.     __MIDL_TypeFormatString.Format,
  186.     0, /* -error bounds_check flag */
  187.     0x10001, /* Ndr library version */
  188.     0,
  189.     0x303006e, /* MIDL Version 3.3.110 */
  190.     0,
  191.     0,
  192.     0,  /* Reserved1 */
  193.     0,  /* Reserved2 */
  194.     0,  /* Reserved3 */
  195.     0,  /* Reserved4 */
  196.     0   /* Reserved5 */
  197.     };
  198.  
  199. static RPC_DISPATCH_FUNCTION dunion_table[] =
  200.     {
  201.     dunion_UnionParamProc,
  202.     dunion_UnionStructProc,
  203.     dunion_Shutdown,
  204.     0
  205.     };
  206. RPC_DISPATCH_TABLE dunion_DispatchTable = 
  207.     {
  208.     3,
  209.     dunion_table
  210.     };
  211.  
  212. #if !defined(__RPC_WIN32__)
  213. #error  Invalid build platform for this stub.
  214. #endif
  215.  
  216. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  217.     {
  218.         0,
  219.         {
  220.             
  221.             0x4d,        /* FC_IN_PARAM */
  222. #ifndef _ALPHA_
  223.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  224. #else
  225.             0x2,        /* Alpha Stack size = 2 */
  226. #endif
  227. /*  2 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  228. /*  4 */    0x4e,        /* FC_IN_PARAM_BASETYPE */
  229.             0x6,        /* FC_SHORT */
  230. /*  6 */    0x5b,        /* FC_END */
  231.             0x5c,        /* FC_PAD */
  232. /*  8 */    
  233.             0x4d,        /* FC_IN_PARAM */
  234. #ifndef _ALPHA_
  235.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  236. #else
  237.             0x2,        /* Alpha Stack size = 2 */
  238. #endif
  239. /* 10 */    NdrFcShort( 0x24 ),    /* Type Offset=36 */
  240. /* 12 */    0x5b,        /* FC_END */
  241.             0x5c,        /* FC_PAD */
  242. /* 14 */    0x5b,        /* FC_END */
  243.             0x5c,        /* FC_PAD */
  244.  
  245.             0x0
  246.         }
  247.     };
  248.  
  249. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  250.     {
  251.         0,
  252.         {
  253.             0x11, 0x0,    /* FC_RP */
  254. /*  2 */    NdrFcShort( 0x2 ),    /* Offset= 2 (4) */
  255. /*  4 */    
  256.             0x2b,        /* FC_NON_ENCAPSULATED_UNION */
  257.             0x6,        /* FC_SHORT */
  258. /*  6 */    0x26,        /* 38 */
  259.             0x0,        /*  */
  260. #ifndef _ALPHA_
  261. /*  8 */    NdrFcShort( 0x4 ),    /* x86, MIPS, PPC Stack size/offset = 4 */
  262. #else
  263.             NdrFcShort( 0x8 ),    /* Alpha Stack size/offset = 8 */
  264. #endif
  265. /* 10 */    NdrFcShort( 0x2 ),    /* Offset= 2 (12) */
  266. /* 12 */    NdrFcShort( 0x4 ),    /* 4 */
  267. /* 14 */    NdrFcShort( 0x3 ),    /* 3 */
  268. /* 16 */    NdrFcLong( 0x0 ),    /* 0 */
  269. /* 20 */    NdrFcShort( 0xffff8006 ),    /* Offset= -32762 (-32742) */
  270. /* 22 */    NdrFcLong( 0x1 ),    /* 1 */
  271. /* 26 */    NdrFcShort( 0xffff800a ),    /* Offset= -32758 (-32732) */
  272. /* 28 */    NdrFcLong( 0x2 ),    /* 2 */
  273. /* 32 */    NdrFcShort( 0xffff8002 ),    /* Offset= -32766 (-32734) */
  274. /* 34 */    NdrFcShort( 0x0 ),    /* Offset= 0 (34) */
  275. /* 36 */    
  276.             0x11, 0x0,    /* FC_RP */
  277. /* 38 */    NdrFcShort( 0xa ),    /* Offset= 10 (48) */
  278. /* 40 */    
  279.             0x2b,        /* FC_NON_ENCAPSULATED_UNION */
  280.             0x6,        /* FC_SHORT */
  281. /* 42 */    0x6,        /* 6 */
  282.             0x0,        /*  */
  283. /* 44 */    NdrFcShort( 0xfffffffc ),    /* -4 */
  284. /* 46 */    NdrFcShort( 0xffffffde ),    /* Offset= -34 (12) */
  285. /* 48 */    
  286.             0x1a,        /* FC_BOGUS_STRUCT */
  287.             0x3,        /* 3 */
  288. /* 50 */    NdrFcShort( 0x8 ),    /* 8 */
  289. /* 52 */    NdrFcShort( 0x0 ),    /* 0 */
  290. /* 54 */    NdrFcShort( 0x0 ),    /* Offset= 0 (54) */
  291. /* 56 */    0x6,        /* FC_SHORT */
  292.             0x4c,        /* FC_EMBEDDED_COMPLEX */
  293. /* 58 */    0x2,        /* 2 */
  294.             NdrFcShort( 0xffffffed ),    /* Offset= -19 (40) */
  295.             0x5b,        /* FC_END */
  296.  
  297.             0x0
  298.         }
  299.     };
  300.