|
|
1.1 ! root 1: /**************************************************************************** ! 2: Microsoft RPC Version 1.0 Alpha ! 3: October 1991 ! 4: Hello3 Example ! 5: ! 6: FILE: hello3\procs.c ! 7: PURPOSE: Remote procedures; linked with server side of RPC ! 8: distributed application hello3 ! 9: FUNCTIONS: HelloProc3 - displays string parameter ! 10: MIDL_user_allocate - allocates memory ! 11: MIDL_user_free - frees memory ! 12: COMMENTS: ! 13: The functions MIDL_user_allocate and MIDL_user_free are ! 14: called by the stubs whenever they need to allocate or free ! 15: memory. Functions with these names must be provided by ! 16: the programmer; this allows the programmer to determine ! 17: the memory management scheme to be used with RPC. ! 18: ! 19: The hello3 program does not need to manage memory, so these ! 20: required functions simply call malloc() and free(). ! 21: ! 22: ****************************************************************************/ ! 23: #include <malloc.h> // malloc, free ! 24: #include <stdio.h> // printf ! 25: ! 26: void HelloProc3(char *pszString) ! 27: { ! 28: printf("%s\n", pszString); ! 29: } ! 30: ! 31: // ==================================================================== ! 32: // MIDL allocate and free ! 33: // ==================================================================== ! 34: ! 35: void * MIDL_user_allocate(unsigned long len) ! 36: { ! 37: return malloc((short) len); ! 38: } ! 39: ! 40: void MIDL_user_free(void * ptr) ! 41: { ! 42: free(ptr); ! 43: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.