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 / strout / strout_s.c < prev    next >
C/C++ Source or Header  |  1998-03-30  |  7KB  |  273 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:09:11 1998
  6.  */
  7. /* Compiler settings for strout.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 "strout.h"
  15.  
  16. #define TYPE_FORMAT_STRING_SIZE   43                                
  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: strout_sample, ver. 1.0,
  35.    GUID={0xcab31280,0xb996,0x11cf,{0x95,0x48,0x00,0xaa,0x00,0x37,0x4e,0x69}} */
  36.  
  37.  
  38. extern RPC_DISPATCH_TABLE strout_sample_v1_0_DispatchTable;
  39.  
  40. static const RPC_SERVER_INTERFACE strout_sample___RpcServerInterface =
  41.     {
  42.     sizeof(RPC_SERVER_INTERFACE),
  43.     {{0xcab31280,0xb996,0x11cf,{0x95,0x48,0x00,0xaa,0x00,0x37,0x4e,0x69}},{1,0}},
  44.     {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},
  45.     &strout_sample_v1_0_DispatchTable,
  46.     0,
  47.     0,
  48.     0,
  49.     0,
  50.     0
  51.     };
  52. RPC_IF_HANDLE strout_sample_v1_0_s_ifspec = (RPC_IF_HANDLE)& strout_sample___RpcServerInterface;
  53.  
  54. extern const MIDL_STUB_DESC strout_sample_StubDesc;
  55.  
  56. void __RPC_STUB
  57. strout_sample_GetRemoteEnv(
  58.     PRPC_MESSAGE _pRpcMessage )
  59. {
  60.     str __RPC_FAR *__RPC_FAR *EnvBlock;
  61.     unsigned long __RPC_FAR *Lines;
  62.     str __RPC_FAR *_M1;
  63.     MIDL_STUB_MESSAGE _StubMsg;
  64.     RPC_STATUS _Status;
  65.     
  66.     ((void)(_Status));
  67.     NdrServerInitializeNew(
  68.                           _pRpcMessage,
  69.                           &_StubMsg,
  70.                           &strout_sample_StubDesc);
  71.     
  72.     ( unsigned long __RPC_FAR * )Lines = 0;
  73.     ( str __RPC_FAR *__RPC_FAR * )EnvBlock = 0;
  74.     RpcTryFinally
  75.         {
  76.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  77.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  78.         
  79.         Lines = ( unsigned long __RPC_FAR * )_StubMsg.Buffer;
  80.         _StubMsg.Buffer += sizeof( unsigned long  );
  81.         
  82.         EnvBlock = &_M1;
  83.         _M1 = 0;
  84.         
  85.         GetRemoteEnv(Lines,EnvBlock);
  86.         
  87.         _StubMsg.BufferLength = 4U + 8U;
  88.         _StubMsg.MaxCount = Lines ? *Lines : 0;
  89.         
  90.         NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  91.                               (unsigned char __RPC_FAR *)EnvBlock,
  92.                               (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[4] );
  93.         
  94.         _pRpcMessage->BufferLength = _StubMsg.BufferLength;
  95.         
  96.         _Status = I_RpcGetBuffer( _pRpcMessage ); 
  97.         if ( _Status )
  98.             RpcRaiseException( _Status );
  99.         
  100.         _StubMsg.Buffer = (unsigned char __RPC_FAR *) _pRpcMessage->Buffer;
  101.         
  102.         *(( unsigned long __RPC_FAR * )_StubMsg.Buffer)++ = *Lines;
  103.         
  104.         _StubMsg.MaxCount = Lines ? *Lines : 0;
  105.         
  106.         NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  107.                             (unsigned char __RPC_FAR *)EnvBlock,
  108.                             (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[4] );
  109.         
  110.         }
  111.     RpcFinally
  112.         {
  113.         _StubMsg.MaxCount = Lines ? *Lines : 0;
  114.         
  115.         NdrPointerFree( &_StubMsg,
  116.                         (unsigned char __RPC_FAR *)EnvBlock,
  117.                         &__MIDL_TypeFormatString.Format[4] );
  118.         
  119.         }
  120.     RpcEndFinally
  121.     _pRpcMessage->BufferLength = 
  122.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  123.     
  124. }
  125.  
  126. void __RPC_STUB
  127. strout_sample_ShutDown(
  128.     PRPC_MESSAGE _pRpcMessage )
  129. {
  130.     MIDL_STUB_MESSAGE _StubMsg;
  131.     RPC_STATUS _Status;
  132.     
  133.     ((void)(_Status));
  134.     NdrServerInitializeNew(
  135.                           _pRpcMessage,
  136.                           &_StubMsg,
  137.                           &strout_sample_StubDesc);
  138.     
  139.     RpcTryFinally
  140.         {
  141.         
  142.         ShutDown();
  143.         
  144.         }
  145.     RpcFinally
  146.         {
  147.         }
  148.     RpcEndFinally
  149.     _pRpcMessage->BufferLength = 
  150.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  151.     
  152. }
  153.  
  154.  
  155. static const MIDL_STUB_DESC strout_sample_StubDesc = 
  156.     {
  157.     (void __RPC_FAR *)& strout_sample___RpcServerInterface,
  158.     MIDL_user_allocate,
  159.     MIDL_user_free,
  160.     0,
  161.     0,
  162.     0,
  163.     0,
  164.     0,
  165.     __MIDL_TypeFormatString.Format,
  166.     0, /* -error bounds_check flag */
  167.     0x10001, /* Ndr library version */
  168.     0,
  169.     0x303006e, /* MIDL Version 3.3.110 */
  170.     0,
  171.     0,
  172.     0,  /* Reserved1 */
  173.     0,  /* Reserved2 */
  174.     0,  /* Reserved3 */
  175.     0,  /* Reserved4 */
  176.     0   /* Reserved5 */
  177.     };
  178.  
  179. static RPC_DISPATCH_FUNCTION strout_sample_table[] =
  180.     {
  181.     strout_sample_GetRemoteEnv,
  182.     strout_sample_ShutDown,
  183.     0
  184.     };
  185. RPC_DISPATCH_TABLE strout_sample_v1_0_DispatchTable = 
  186.     {
  187.     2,
  188.     strout_sample_table
  189.     };
  190.  
  191. #if !defined(__RPC_WIN32__)
  192. #error  Invalid build platform for this stub.
  193. #endif
  194.  
  195. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  196.     {
  197.         0,
  198.         {
  199.             
  200.             0x50,        /* FC_IN_OUT_PARAM */
  201. #ifndef _ALPHA_
  202.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  203. #else
  204.             0x2,        /* Alpha Stack size = 2 */
  205. #endif
  206. /*  2 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  207. /*  4 */    
  208.             0x51,        /* FC_OUT_PARAM */
  209. #ifndef _ALPHA_
  210.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  211. #else
  212.             0x2,        /* Alpha Stack size = 2 */
  213. #endif
  214. /*  6 */    NdrFcShort( 0x4 ),    /* Type Offset=4 */
  215. /*  8 */    0x5b,        /* FC_END */
  216.             0x5c,        /* FC_PAD */
  217. /* 10 */    0x5b,        /* FC_END */
  218.             0x5c,        /* FC_PAD */
  219.  
  220.             0x0
  221.         }
  222.     };
  223.  
  224. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  225.     {
  226.         0,
  227.         {
  228.             0x11, 0x8,    /* FC_RP [simple_pointer] */
  229. /*  2 */    0x8,        /* FC_LONG */
  230.             0x5c,        /* FC_PAD */
  231. /*  4 */    
  232.             0x11, 0x14,    /* FC_RP [alloced_on_stack] */
  233. /*  6 */    NdrFcShort( 0x2 ),    /* Offset= 2 (8) */
  234. /*  8 */    
  235.             0x12, 0x0,    /* FC_UP */
  236. /* 10 */    NdrFcShort( 0x2 ),    /* Offset= 2 (12) */
  237. /* 12 */    
  238.             0x1b,        /* FC_CARRAY */
  239.             0x3,        /* 3 */
  240. /* 14 */    NdrFcShort( 0x4 ),    /* 4 */
  241. /* 16 */    0x29,        /* 41 */
  242.             0x54,        /* FC_DEREFERENCE */
  243. #ifndef _ALPHA_
  244. /* 18 */    NdrFcShort( 0x0 ),    /* x86, MIPS, PPC Stack size/offset = 0 */
  245. #else
  246.             NdrFcShort( 0x0 ),    /* Alpha Stack size/offset = 0 */
  247. #endif
  248. /* 20 */    
  249.             0x4b,        /* FC_PP */
  250.             0x5c,        /* FC_PAD */
  251. /* 22 */    
  252.             0x48,        /* FC_VARIABLE_REPEAT */
  253.             0x49,        /* FC_FIXED_OFFSET */
  254. /* 24 */    NdrFcShort( 0x4 ),    /* 4 */
  255. /* 26 */    NdrFcShort( 0x0 ),    /* 0 */
  256. /* 28 */    NdrFcShort( 0x1 ),    /* 1 */
  257. /* 30 */    NdrFcShort( 0x0 ),    /* 0 */
  258. /* 32 */    NdrFcShort( 0x0 ),    /* 0 */
  259. /* 34 */    0x12, 0x8,    /* FC_UP [simple_pointer] */
  260. /* 36 */    
  261.             0x22,        /* FC_C_CSTRING */
  262.             0x5c,        /* FC_PAD */
  263. /* 38 */    
  264.             0x5b,        /* FC_END */
  265.  
  266.             0x8,        /* FC_LONG */
  267. /* 40 */    0x5c,        /* FC_PAD */
  268.             0x5b,        /* FC_END */
  269.  
  270.             0x0
  271.         }
  272.     };
  273.