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_c.c < prev    next >
C/C++ Source or Header  |  1998-03-30  |  7KB  |  257 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: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. #if defined( _ALPHA_ )
  15. #include <stdarg.h>
  16. #endif
  17.  
  18. #include <malloc.h>
  19. #include "rpcssm.h"
  20.  
  21. #define TYPE_FORMAT_STRING_SIZE   29                                
  22. #define PROC_FORMAT_STRING_SIZE   9                                 
  23.  
  24. typedef struct _MIDL_TYPE_FORMAT_STRING
  25.     {
  26.     short          Pad;
  27.     unsigned char  Format[ TYPE_FORMAT_STRING_SIZE ];
  28.     } MIDL_TYPE_FORMAT_STRING;
  29.  
  30. typedef struct _MIDL_PROC_FORMAT_STRING
  31.     {
  32.     short          Pad;
  33.     unsigned char  Format[ PROC_FORMAT_STRING_SIZE ];
  34.     } MIDL_PROC_FORMAT_STRING;
  35.  
  36.  
  37. extern const MIDL_TYPE_FORMAT_STRING __MIDL_TypeFormatString;
  38. extern const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString;
  39.  
  40. /* Standard interface: rpcssm, ver. 1.0,
  41.    GUID={0xA4F1DB00,0xCA47,0x1067,{0xB3,0x1F,0x00,0xDD,0x01,0x06,0x62,0xDA}} */
  42.  
  43. handle_t hStarter;
  44.  
  45.  
  46. static const RPC_CLIENT_INTERFACE rpcssm___RpcClientInterface =
  47.     {
  48.     sizeof(RPC_CLIENT_INTERFACE),
  49.     {{0xA4F1DB00,0xCA47,0x1067,{0xB3,0x1F,0x00,0xDD,0x01,0x06,0x62,0xDA}},{1,0}},
  50.     {{0x8A885D04,0x1CEB,0x11C9,{0x9F,0xE8,0x08,0x00,0x2B,0x10,0x48,0x60}},{2,0}},
  51.     0,
  52.     0,
  53.     0,
  54.     0,
  55.     0,
  56.     0
  57.     };
  58. RPC_IF_HANDLE rpcssm_ClientIfHandle = (RPC_IF_HANDLE)& rpcssm___RpcClientInterface;
  59.  
  60. extern const MIDL_STUB_DESC rpcssm_StubDesc;
  61.  
  62. static RPC_BINDING_HANDLE rpcssm__MIDL_AutoBindHandle;
  63.  
  64.  
  65. void InOutList( 
  66.     /* [out][in] */ PBOX __RPC_FAR *ppBox)
  67. {
  68.  
  69.     RPC_BINDING_HANDLE _Handle    =    0;
  70.     
  71.     RPC_MESSAGE _RpcMessage;
  72.     
  73.     MIDL_STUB_MESSAGE _StubMsg;
  74.     
  75.     RpcTryFinally
  76.         {
  77.         NdrClientInitializeNew(
  78.                           ( PRPC_MESSAGE  )&_RpcMessage,
  79.                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  80.                           ( PMIDL_STUB_DESC  )&rpcssm_StubDesc,
  81.                           0);
  82.         
  83.         
  84.         _Handle = hStarter;
  85.         
  86.         
  87.         _StubMsg.BufferLength = 4U;
  88.         NdrPointerBufferSize( (PMIDL_STUB_MESSAGE) &_StubMsg,
  89.                               (unsigned char __RPC_FAR *)ppBox,
  90.                               (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[0] );
  91.         
  92.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  93.         
  94.         NdrPointerMarshall( (PMIDL_STUB_MESSAGE)& _StubMsg,
  95.                             (unsigned char __RPC_FAR *)ppBox,
  96.                             (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[0] );
  97.         
  98.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  99.         
  100.         if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
  101.             NdrConvert( (PMIDL_STUB_MESSAGE) &_StubMsg, (PFORMAT_STRING) &__MIDL_ProcFormatString.Format[0] );
  102.         
  103.         NdrPointerUnmarshall( (PMIDL_STUB_MESSAGE) &_StubMsg,
  104.                               (unsigned char __RPC_FAR * __RPC_FAR *)&ppBox,
  105.                               (PFORMAT_STRING) &__MIDL_TypeFormatString.Format[0],
  106.                               (unsigned char)0 );
  107.         
  108.         }
  109.     RpcFinally
  110.         {
  111.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  112.         
  113.         }
  114.     RpcEndFinally
  115.     
  116. }
  117.  
  118.  
  119. void Shutdown( void)
  120. {
  121.  
  122.     RPC_BINDING_HANDLE _Handle    =    0;
  123.     
  124.     RPC_MESSAGE _RpcMessage;
  125.     
  126.     MIDL_STUB_MESSAGE _StubMsg;
  127.     
  128.     RpcTryFinally
  129.         {
  130.         NdrClientInitializeNew(
  131.                           ( PRPC_MESSAGE  )&_RpcMessage,
  132.                           ( PMIDL_STUB_MESSAGE  )&_StubMsg,
  133.                           ( PMIDL_STUB_DESC  )&rpcssm_StubDesc,
  134.                           1);
  135.         
  136.         
  137.         _Handle = hStarter;
  138.         
  139.         
  140.         _StubMsg.BufferLength = 0U;
  141.         NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
  142.         
  143.         NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
  144.         
  145.         }
  146.     RpcFinally
  147.         {
  148.         NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
  149.         
  150.         }
  151.     RpcEndFinally
  152.     
  153. }
  154.  
  155. extern MALLOC_FREE_STRUCT _MallocFreeStruct;
  156.  
  157. static const MIDL_STUB_DESC rpcssm_StubDesc = 
  158.     {
  159.     (void __RPC_FAR *)& rpcssm___RpcClientInterface,
  160.     NdrRpcSmClientAllocate,
  161.     NdrRpcSmClientFree,
  162.     &hStarter,
  163.     0,
  164.     0,
  165.     0,
  166.     0,
  167.     __MIDL_TypeFormatString.Format,
  168.     0, /* -error bounds_check flag */
  169.     0x10001, /* Ndr library version */
  170.     &_MallocFreeStruct,
  171.     0x303006e, /* MIDL Version 3.3.110 */
  172.     0,
  173.     0,
  174.     0,  /* Reserved1 */
  175.     0,  /* Reserved2 */
  176.     0,  /* Reserved3 */
  177.     0,  /* Reserved4 */
  178.     0   /* Reserved5 */
  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.