--- mstools/samples/rpc/hello/helloc.c 2018/08/09 18:20:55 1.1.1.1 +++ mstools/samples/rpc/hello/helloc.c 2018/08/09 18:21:58 1.1.1.2 @@ -8,7 +8,7 @@ -p protocol_sequence -e endpoint -o options - -u uuid + -s string_displayed_on_server PURPOSE: Client side of RPC distributed application FUNCTIONS: main() - binds to server and calls remote procedure @@ -32,21 +32,21 @@ void Usage(char * pszProgramName) fprintf(stderr, " -n network_address\n"); fprintf(stderr, " -e endpoint\n"); fprintf(stderr, " -o options\n"); - fprintf(stderr, " -u uuid\n"); fprintf(stderr, " -s string\n"); exit(1); } -void main(int argc, char **argv) +void _CRTAPI1 main(int argc, char **argv) { RPC_STATUS status; // returned by RPC API function - unsigned char * pszUuid = "12345678-1234-1234-1234-123456789ABC"; + unsigned char * pszUuid = NULL; unsigned char * pszProtocolSequence = "ncacn_np"; unsigned char * pszNetworkAddress = NULL; unsigned char * pszEndpoint = "\\pipe\\hello"; unsigned char * pszOptions = NULL; unsigned char * pszStringBinding = NULL; unsigned char * pszString = "hello, world"; + unsigned long ulCode; int i; // allow the user to override settings with command line switches @@ -65,9 +65,6 @@ void main(int argc, char **argv) case 'o': pszOptions = argv[++i]; break; - case 'u': - pszUuid = argv[++i]; - break; case 's': pszString = argv[++i]; break; @@ -111,7 +108,8 @@ void main(int argc, char **argv) Shutdown(); // shut down the server side } RpcExcept(1) { - printf("Runtime library reported an exception\n"); + ulCode = RpcExceptionCode(); + printf("Runtime reported exception 0x%lx = %ld\n", ulCode, ulCode); } RpcEndExcept @@ -128,7 +126,6 @@ void main(int argc, char **argv) if (status) exit(2); - exit(0); }