//*************************************************************** // From the book "Win32 System Services: The Heart of Windows 98 // and Windows 2000" // by Marshall Brain // Published by Prentice Hall // // Copyright 1995, by Prentice Hall. // // This code implements the RPC server body. //*************************************************************** // conserv2.cpp #include #include #include #include "sum.h" #include "memstub" INT main(VOID) { // use the specified protocol and // get endpoint from IDL file if (RpcServerUseProtseqIf( (UCHAR *) "ncacn_ip_tcp", 1, sumup_v1_0_s_ifspec, NULL)) { cerr << "ERROR: Could not specify protocol" << endl; return(1); } // register the interface if (RpcServerRegisterIf(sumup_v1_0_s_ifspec, NULL, NULL)) { cerr << "ERROR: Could not register interface" << endl; return(1); } // listen for and service RPC requests if (RpcServerListen(1, 5, FALSE)) { cerr << "ERROR: Unable to listen for requests" << endl; return(1); } return(0); }