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 / repas / repas_s.c < prev    next >
C/C++ Source or Header  |  1998-03-30  |  10KB  |  334 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:58 1998
  6.  */
  7. /* Compiler settings for repas.idl, repass.acf:
  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 "repass.h"
  15.  
  16. #define TYPE_FORMAT_STRING_SIZE   31                                
  17. #define PROC_FORMAT_STRING_SIZE   15                                
  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: repas, ver. 1.0,
  35.    GUID={0x56BF67C0,0x6503,0x1068,{0xBF,0x67,0x00,0xDD,0x01,0x0F,0xBF,0x25}} */
  36.  
  37.  
  38. extern RPC_DISPATCH_TABLE repas_DispatchTable;
  39.  
  40. static const RPC_SERVER_INTERFACE repas___RpcServerInterface =
  41.     {
  42.     sizeof(RPC_SERVER_INTERFACE),
  43.     {{0x56BF67C0,0x6503,0x1068,{0xBF,0x67,0x00,0xDD,0x01,0x0F,0xBF,0x25}},{1,0}},
  44.     {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},
  45.     &repas_DispatchTable,
  46.     0,
  47.     0,
  48.     0,
  49.     0,
  50.     0
  51.     };
  52. RPC_IF_HANDLE repas_ServerIfHandle = (RPC_IF_HANDLE)& repas___RpcServerInterface;
  53.  
  54. extern const MIDL_STUB_DESC repas_StubDesc;
  55.  
  56. void __RPC_STUB
  57. repas_ModifyMyWString(
  58.     PRPC_MESSAGE _pRpcMessage )
  59. {
  60.     MIDL_STUB_MESSAGE _StubMsg;
  61.     WCHAR_STRING __RPC_FAR *pStr;
  62.     RPC_STATUS _Status;
  63.     
  64.     ((void)(_Status));
  65.     NdrServerInitializeNew(
  66.                           _pRpcMessage,
  67.                           &_StubMsg,
  68.                           &repas_StubDesc);
  69.     
  70.     ( WCHAR_STRING __RPC_FAR * )pStr = 0;
  71.     RpcTryFinally
  72.         {
  73.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  74.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  75.         
  76.         NdrFixedArrayUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  77.                                  (unsigned char __RPC_FAR * __RPC_FAR *)&pStr,
  78.                                  (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[4],
  79.                                  (unsigned char)0 );
  80.         
  81.         
  82.         ModifyMyWString(pStr);
  83.         
  84.         _StubMsg.BufferLength = 200U;
  85.         _pRpcMessage->BufferLength = _StubMsg.BufferLength;
  86.         
  87.         _Status = I_RpcGetBuffer( _pRpcMessage ); 
  88.         if ( _Status )
  89.             RpcRaiseException( _Status );
  90.         
  91.         _StubMsg.Buffer = (unsigned char __RPC_FAR *) _pRpcMessage->Buffer;
  92.         
  93.         NdrFixedArrayMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  94.                                (unsigned char __RPC_FAR *)pStr,
  95.                                (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[4] );
  96.         
  97.         }
  98.     RpcFinally
  99.         {
  100.         NdrPointerFree( &_StubMsg,
  101.                         (unsigned char __RPC_FAR *)pStr,
  102.                         &__MIDL_TypeFormatString.Format[0] );
  103.         
  104.         }
  105.     RpcEndFinally
  106.     _pRpcMessage->BufferLength = 
  107.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  108.     
  109. }
  110.  
  111. void __RPC_STUB
  112. repas_ModifyMyString(
  113.     PRPC_MESSAGE _pRpcMessage )
  114. {
  115.     MIDL_STUB_MESSAGE _StubMsg;
  116.     WCHAR_STRING __RPC_FAR *pStr;
  117.     RPC_STATUS _Status;
  118.     
  119.     ((void)(_Status));
  120.     NdrServerInitializeNew(
  121.                           _pRpcMessage,
  122.                           &_StubMsg,
  123.                           &repas_StubDesc);
  124.     
  125.     ( WCHAR_STRING __RPC_FAR * )pStr = 0;
  126.     RpcTryFinally
  127.         {
  128.         if ( (_pRpcMessage->DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  129.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[6] );
  130.         
  131.         NdrXmitOrRepAsUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  132.                                   (unsigned char __RPC_FAR * __RPC_FAR *)&pStr,
  133.                                   (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[20],
  134.                                   (unsigned char)0 );
  135.         
  136.         
  137.         ModifyMyString(pStr);
  138.         
  139.         _StubMsg.BufferLength = 100U;
  140.         _pRpcMessage->BufferLength = _StubMsg.BufferLength;
  141.         
  142.         _Status = I_RpcGetBuffer( _pRpcMessage ); 
  143.         if ( _Status )
  144.             RpcRaiseException( _Status );
  145.         
  146.         _StubMsg.Buffer = (unsigned char __RPC_FAR *) _pRpcMessage->Buffer;
  147.         
  148.         NdrXmitOrRepAsMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  149.                                 (unsigned char __RPC_FAR *)pStr,
  150.                                 (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[20] );
  151.         
  152.         }
  153.     RpcFinally
  154.         {
  155.         NdrPointerFree( &_StubMsg,
  156.                         (unsigned char __RPC_FAR *)pStr,
  157.                         &__MIDL_TypeFormatString.Format[10] );
  158.         
  159.         }
  160.     RpcEndFinally
  161.     _pRpcMessage->BufferLength = 
  162.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  163.     
  164. }
  165.  
  166. void __RPC_STUB
  167. repas_Shutdown(
  168.     PRPC_MESSAGE _pRpcMessage )
  169. {
  170.     MIDL_STUB_MESSAGE _StubMsg;
  171.     RPC_STATUS _Status;
  172.     
  173.     ((void)(_Status));
  174.     NdrServerInitializeNew(
  175.                           _pRpcMessage,
  176.                           &_StubMsg,
  177.                           &repas_StubDesc);
  178.     
  179.     RpcTryFinally
  180.         {
  181.         
  182.         Shutdown();
  183.         
  184.         }
  185.     RpcFinally
  186.         {
  187.         }
  188.     RpcEndFinally
  189.     _pRpcMessage->BufferLength = 
  190.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  191.     
  192. }
  193.  
  194. extern const XMIT_ROUTINE_QUINTUPLE TransmitAsRoutines[1];
  195.  
  196. static const MIDL_STUB_DESC repas_StubDesc = 
  197.     {
  198.     (void __RPC_FAR *)& repas___RpcServerInterface,
  199.     MIDL_user_allocate,
  200.     MIDL_user_free,
  201.     0,
  202.     0,
  203.     0,
  204.     0,
  205.     TransmitAsRoutines,
  206.     __MIDL_TypeFormatString.Format,
  207.     0, /* -error bounds_check flag */
  208.     0x10001, /* Ndr library version */
  209.     0,
  210.     0x303006e, /* MIDL Version 3.3.110 */
  211.     0,
  212.     0,
  213.     0,  /* Reserved1 */
  214.     0,  /* Reserved2 */
  215.     0,  /* Reserved3 */
  216.     0,  /* Reserved4 */
  217.     0   /* Reserved5 */
  218.     };
  219.  
  220. static RPC_DISPATCH_FUNCTION repas_table[] =
  221.     {
  222.     repas_ModifyMyWString,
  223.     repas_ModifyMyString,
  224.     repas_Shutdown,
  225.     0
  226.     };
  227. RPC_DISPATCH_TABLE repas_DispatchTable = 
  228.     {
  229.     3,
  230.     repas_table
  231.     };
  232. NDR_SHAREABLE void __RPC_USER
  233. CHAR_STRING_RepAsTranslateToLocal( PMIDL_STUB_MESSAGE pStubMsg )
  234. {
  235.     CHAR_STRING_to_local( (CHAR_STRING __RPC_FAR *) pStubMsg->pTransmitType, 
  236.         (WCHAR_STRING __RPC_FAR *) pStubMsg->pPresentedType ); 
  237. }
  238. NDR_SHAREABLE void __RPC_USER
  239. CHAR_STRING_RepAsTranslateFromLocal( PMIDL_STUB_MESSAGE pStubMsg )
  240. {
  241.     CHAR_STRING_from_local( (WCHAR_STRING __RPC_FAR *) pStubMsg->pPresentedType, 
  242.         (CHAR_STRING __RPC_FAR * __RPC_FAR *) &pStubMsg->pTransmitType );
  243. }
  244. NDR_SHAREABLE void __RPC_USER
  245. CHAR_STRING_RepAsFreeInst( PMIDL_STUB_MESSAGE pStubMsg )
  246. {
  247.     CHAR_STRING_free_inst( (CHAR_STRING __RPC_FAR *) pStubMsg->pTransmitType );
  248. }
  249. NDR_SHAREABLE void __RPC_USER
  250. CHAR_STRING_RepAsFreeLocal( PMIDL_STUB_MESSAGE pStubMsg )
  251. {
  252.     CHAR_STRING_free_local( (WCHAR_STRING __RPC_FAR *) pStubMsg->pPresentedType ); 
  253. }
  254.  
  255. static const XMIT_ROUTINE_QUINTUPLE TransmitAsRoutines[1] = 
  256.         {
  257.             
  258.             {
  259.             CHAR_STRING_RepAsTranslateFromLocal
  260.             ,CHAR_STRING_RepAsTranslateToLocal
  261.             ,CHAR_STRING_RepAsFreeInst
  262.             ,CHAR_STRING_RepAsFreeLocal
  263.             }
  264.  
  265.         };
  266.  
  267.  
  268. #if !defined(__RPC_WIN32__)
  269. #error  Invalid build platform for this stub.
  270. #endif
  271.  
  272. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  273.     {
  274.         0,
  275.         {
  276.             
  277.             0x50,        /* FC_IN_OUT_PARAM */
  278. #ifndef _ALPHA_
  279.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  280. #else
  281.             0x2,        /* Alpha Stack size = 2 */
  282. #endif
  283. /*  2 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  284. /*  4 */    0x5b,        /* FC_END */
  285.             0x5c,        /* FC_PAD */
  286. /*  6 */    
  287.             0x50,        /* FC_IN_OUT_PARAM */
  288. #ifndef _ALPHA_
  289.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  290. #else
  291.             0x2,        /* Alpha Stack size = 2 */
  292. #endif
  293. /*  8 */    NdrFcShort( 0xa ),    /* Type Offset=10 */
  294. /* 10 */    0x5b,        /* FC_END */
  295.             0x5c,        /* FC_PAD */
  296. /* 12 */    0x5b,        /* FC_END */
  297.             0x5c,        /* FC_PAD */
  298.  
  299.             0x0
  300.         }
  301.     };
  302.  
  303. static const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString =
  304.     {
  305.         0,
  306.         {
  307.             0x11, 0x0,    /* FC_RP */
  308. /*  2 */    NdrFcShort( 0x2 ),    /* Offset= 2 (4) */
  309. /*  4 */    
  310.             0x1d,        /* FC_SMFARRAY */
  311.             0x1,        /* 1 */
  312. /*  6 */    NdrFcShort( 0xc8 ),    /* 200 */
  313. /*  8 */    0x5,        /* FC_WCHAR */
  314.             0x5b,        /* FC_END */
  315. /* 10 */    
  316.             0x11, 0x0,    /* FC_RP */
  317. /* 12 */    NdrFcShort( 0x8 ),    /* Offset= 8 (20) */
  318. /* 14 */    
  319.             0x1d,        /* FC_SMFARRAY */
  320.             0x0,        /* 0 */
  321. /* 16 */    NdrFcShort( 0x64 ),    /* 100 */
  322. /* 18 */    0x2,        /* FC_CHAR */
  323.             0x5b,        /* FC_END */
  324. /* 20 */    0x2e,        /* FC_REPRESENT_AS */
  325.             0x10,        /* 16 */
  326. /* 22 */    NdrFcShort( 0x0 ),    /* 0 */
  327. /* 24 */    NdrFcShort( 0xc8 ),    /* 200 */
  328. /* 26 */    NdrFcShort( 0x64 ),    /* 100 */
  329. /* 28 */    NdrFcShort( 0xfffffff2 ),    /* Offset= -14 (14) */
  330.  
  331.             0x0
  332.         }
  333.     };
  334.