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