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 / rpcssm / rpcssm_s.c < prev    next >
C/C++ Source or Header  |  1998-03-30  |  7KB  |  257 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:49 1998
  6.  */
  7. /* Compiler settings for rpcssm.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 "rpcssm.h"
  15.  
  16. #define TYPE_FORMAT_STRING_SIZE   29                                
  17. #define PROC_FORMAT_STRING_SIZE   9                                 
  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: rpcssm, ver. 1.0,
  35.    GUID={0xA4F1DB00,0xCA47,0x1067,{0xB3,0x1F,0x00,0xDD,0x01,0x06,0x62,0xDA}} */
  36.  
  37.  
  38. extern RPC_DISPATCH_TABLE rpcssm_DispatchTable;
  39.  
  40. static const RPC_SERVER_INTERFACE rpcssm___RpcServerInterface =
  41.     {
  42.     sizeof(RPC_SERVER_INTERFACE),
  43.     {{0xA4F1DB00,0xCA47,0x1067,{0xB3,0x1F,0x00,0xDD,0x01,0x06,0x62,0xDA}},{1,0}},
  44.     {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},
  45.     &rpcssm_DispatchTable,
  46.     0,
  47.     0,
  48.     0,
  49.     0,
  50.     0
  51.     };
  52. RPC_IF_HANDLE rpcssm_ServerIfHandle = (RPC_IF_HANDLE)& rpcssm___RpcServerInterface;
  53.  
  54. extern const MIDL_STUB_DESC rpcssm_StubDesc;
  55.  
  56. void __RPC_STUB
  57. rpcssm_InOutList(
  58.     PRPC_MESSAGE _pRpcMessage )
  59. {
  60.     MIDL_STUB_MESSAGE _StubMsg;
  61.     PBOX __RPC_FAR *ppBox;
  62.     RPC_STATUS _Status;
  63.     
  64.     ((void)(_Status));
  65.     NdrServerInitializeNew(
  66.                           _pRpcMessage,
  67.                           &_StubMsg,
  68.                           &rpcssm_StubDesc);
  69.     
  70.     NdrRpcSsEnableAllocate(&_StubMsg);
  71.     ( PBOX __RPC_FAR * )ppBox = 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.         NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  78.                               (unsigned char __RPC_FAR * __RPC_FAR *)&ppBox,
  79.                               (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[0],
  80.                               (unsigned char)0 );
  81.         
  82.         
  83.         InOutList(ppBox);
  84.         
  85.         _StubMsg.BufferLength = 4U;
  86.         NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  87.                               (unsigned char __RPC_FAR *)ppBox,
  88.                               (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[0] );
  89.         
  90.         _pRpcMessage->BufferLength = _StubMsg.BufferLength;
  91.         
  92.         _Status = I_RpcGetBuffer( _pRpcMessage ); 
  93.         if ( _Status )
  94.             RpcRaiseException( _Status );
  95.         
  96.         _StubMsg.Buffer = (unsigned char __RPC_FAR *) _pRpcMessage->Buffer;
  97.         
  98.         NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  99.                             (unsigned char __RPC_FAR *)ppBox,
  100.                             (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[0] );
  101.         
  102.         }
  103.     RpcFinally
  104.         {
  105.         NdrRpcSsDisableAllocate(&_StubMsg);
  106.         }
  107.     RpcEndFinally
  108.     _pRpcMessage->BufferLength = 
  109.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  110.     
  111. }
  112.  
  113. void __RPC_STUB
  114. rpcssm_Shutdown(
  115.     PRPC_MESSAGE _pRpcMessage )
  116. {
  117.     MIDL_STUB_MESSAGE _StubMsg;
  118.     RPC_STATUS _Status;
  119.     
  120.     ((void)(_Status));
  121.     NdrServerInitializeNew(
  122.                           _pRpcMessage,
  123.                           &_StubMsg,
  124.                           &rpcssm_StubDesc);
  125.     
  126.     NdrRpcSsEnableAllocate(&_StubMsg);
  127.     RpcTryFinally
  128.         {
  129.         
  130.         Shutdown();
  131.         
  132.         }
  133.     RpcFinally
  134.         {
  135.         NdrRpcSsDisableAllocate(&_StubMsg);
  136.         }
  137.     RpcEndFinally
  138.     _pRpcMessage->BufferLength = 
  139.         (unsigned int)((long)_StubMsg.Buffer - (long)_pRpcMessage->Buffer);
  140.     
  141. }
  142.  
  143. extern MALLOC_FREE_STRUCT _MallocFreeStruct;
  144.  
  145. static const MIDL_STUB_DESC rpcssm_StubDesc = 
  146.     {
  147.     (void __RPC_FAR *)& rpcssm___RpcServerInterface,
  148.     NdrRpcSsDefaultAllocate,
  149.     NdrRpcSsDefaultFree,
  150.     0,
  151.     0,
  152.     0,
  153.     0,
  154.     0,
  155.     __MIDL_TypeFormatString.Format,
  156.     0, /* -error bounds_check flag */
  157.     0x10001, /* Ndr library version */
  158.     &_MallocFreeStruct,
  159.     0x303006e, /* MIDL Version 3.3.110 */
  160.     0,
  161.     0,
  162.     0,  /* Reserved1 */
  163.     0,  /* Reserved2 */
  164.     0,  /* Reserved3 */
  165.     0,  /* Reserved4 */
  166.     0   /* Reserved5 */
  167.     };
  168.  
  169. static RPC_DISPATCH_FUNCTION rpcssm_table[] =
  170.     {
  171.     rpcssm_InOutList,
  172.     rpcssm_Shutdown,
  173.     0
  174.     };
  175. RPC_DISPATCH_TABLE rpcssm_DispatchTable = 
  176.     {
  177.     2,
  178.     rpcssm_table
  179.     };
  180.  
  181. static void __RPC_FAR * __RPC_USER
  182. rpcssm_malloc_wrapper( size_t _Size )
  183. {
  184.     return( malloc( _Size ) );
  185. }
  186.  
  187. static void  __RPC_USER
  188. rpcssm_free_wrapper( void __RPC_FAR * _p )
  189. {
  190.     free( _p );
  191. }
  192.  
  193. static MALLOC_FREE_STRUCT _MallocFreeStruct = 
  194. {
  195.     rpcssm_malloc_wrapper,
  196.     rpcssm_free_wrapper
  197. };
  198.  
  199. #if !defined(__RPC_WIN32__)
  200. #error  Invalid build platform for this stub.
  201. #endif
  202.  
  203. static const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString =
  204.     {
  205.         0,
  206.         {
  207.             
  208.             0x50,        /* FC_IN_OUT_PARAM */
  209. #ifndef _ALPHA_
  210.             0x1,        /* x86, MIPS & PPC Stack size = 1 */
  211. #else
  212.             0x2,        /* Alpha Stack size = 2 */
  213. #endif
  214. /*  2 */    NdrFcShort( 0x0 ),    /* Type Offset=0 */
  215. /*  4 */    0x5b,        /* FC_END */
  216.             0x5c,        /* FC_PAD */
  217. /*  6 */    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, 0x10,    /* FC_RP */
  229. /*  2 */    NdrFcShort( 0x2 ),    /* Offset= 2 (4) */
  230. /*  4 */    
  231.             0x12, 0x0,    /* FC_UP */
  232. /*  6 */    NdrFcShort( 0x2 ),    /* Offset= 2 (8) */
  233. /*  8 */    
  234.             0x16,        /* FC_PSTRUCT */
  235.             0x3,        /* 3 */
  236. /* 10 */    NdrFcShort( 0x8 ),    /* 8 */
  237. /* 12 */    
  238.             0x4b,        /* FC_PP */
  239.             0x5c,        /* FC_PAD */
  240. /* 14 */    
  241.             0x46,        /* FC_NO_REPEAT */
  242.             0x5c,        /* FC_PAD */
  243. /* 16 */    NdrFcShort( 0x4 ),    /* 4 */
  244. /* 18 */    NdrFcShort( 0x4 ),    /* 4 */
  245. /* 20 */    0x12, 0x0,    /* FC_UP */
  246. /* 22 */    NdrFcShort( 0xfffffff2 ),    /* Offset= -14 (8) */
  247. /* 24 */    
  248.             0x5b,        /* FC_END */
  249.  
  250.             0x8,        /* FC_LONG */
  251. /* 26 */    0x8,        /* FC_LONG */
  252.             0x5b,        /* FC_END */
  253.  
  254.             0x0
  255.         }
  256.     };
  257.