- Code/Resource
- Windows Develop
- Linux-Unix program
- Internet-Socket-Network
- Web Server
- Browser Client
- Ftp Server
- Ftp Client
- Browser Plugins
- Proxy Server
- Email Server
- Email Client
- WEB Mail
- Firewall-Security
- Telnet Server
- Telnet Client
- ICQ-IM-Chat
- Search Engine
- Sniffer Package capture
- Remote Control
- xml-soap-webservice
- P2P
- WEB(ASP,PHP,...)
- TCP/IP Stack
- SNMP
- Grid Computing
- SilverLight
- DNS
- Cluster Service
- Network Security
- Communication-Mobile
- Game Program
- Editor
- Multimedia program
- Graph program
- Compiler program
- Compress-Decompress algrithms
- Crypt_Decrypt algrithms
- Mathimatics-Numerical algorithms
- MultiLanguage
- Disk/Storage
- Java Develop
- assembly language
- Applications
- Other systems
- Database system
- Embeded-SCM Develop
- FlashMX/Flex
- source in ebook
- Delphi VCL
- OS Develop
- MiddleWare
- MPI
- MacOS develop
- LabView
- ELanguage
- Software/Tools
- E-Books
- Artical/Document
DYNOUTS.C
Package: MSDN_VC98.zip [view]
Upload User: bangxh
Upload Date: 2007-01-31
Package Size: 42235k
Code Size: 2k
Category:
Windows Develop
Development Platform:
Visual C++
- /******************************************************************************
- * This is a part of the Microsoft Source Code Samples.
- * Copyright (C) 1995-1997 Microsoft Corporation.
- * All rights reserved.
- * This source code is only intended as a supplement to
- * Microsoft Development Tools and/or WinHelp documentation.
- * See these sources for detailed information regarding the
- * Microsoft samples programs.
- ******************************************************************************/
- //
- // Copyright 1996-1997 Microsoft Corporation. All Rights Reserved.
- //
- //
- // Sample code to show server-side
- // memory allocation for an [out] parameter
- //
- //
- #include <stdio.h>
- #include <assert.h>
- #include <malloc.h>
- #include "dynout.h"
- #ifdef NODEBUG
- #define CHECK_STATUS(x)
- #define TRACE(s)
- #else
- #define CHECK_STATUS(x) {if (x!=RPC_S_OK) { printf("RPC Err: %dnfile = %s, line=%d.",x,__FILE__,__LINE__); exit(x);}}
- #define TRACE(s) puts(s)
- #endif
- void main(int argc,char **argv)
- {
- RPC_STATUS rpcStatus;
- RPC_BINDING_VECTOR *vectBinding;
- unsigned char *szEntryName;
- TRACE("RpcServerRegisterIf");
- rpcStatus=RpcServerRegisterIf(MemStuff_v1_0_s_ifspec,0,0);
- CHECK_STATUS(rpcStatus);
- TRACE("RpcServerUseAllProtseqs");
- rpcStatus=RpcServerUseAllProtseqs(RPC_C_PROTSEQ_MAX_REQS_DEFAULT,NULL);
- CHECK_STATUS(rpcStatus);
- TRACE("RpcServerInqBindings");
- rpcStatus=RpcServerInqBindings(&vectBinding);
- CHECK_STATUS(rpcStatus);
- TRACE("RpcNsBindingExport");
- szEntryName="/.:/MyServer";
- rpcStatus=RpcNsBindingExport(RPC_C_NS_SYNTAX_DEFAULT,szEntryName,MemStuff_v1_0_s_ifspec,vectBinding,NULL);
- CHECK_STATUS(rpcStatus);
- TRACE("RpcEpRegister");
- rpcStatus=RpcEpRegister(MemStuff_v1_0_s_ifspec,
- vectBinding,
- NULL,NULL);
- CHECK_STATUS(rpcStatus);
- TRACE("RpcBindingVectorFree");
- rpcStatus=RpcBindingVectorFree(&vectBinding);
- CHECK_STATUS(rpcStatus);
- puts("nn");
- puts("(C) Microsoft New Zealand Limited. Written by Michael Howard, " __DATE__);
- puts("nListening....");
- rpcStatus=RpcServerListen(1,RPC_C_LISTEN_MAX_CALLS_DEFAULT,FALSE);
- CHECK_STATUS(rpcStatus);
- }
- void __RPC_FAR * __RPC_API midl_user_allocate(size_t len)
- {
- return malloc(len);
- }
- void __RPC_API midl_user_free(void __RPC_FAR * ptr)
- {
- free(ptr);
- }