home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / WIN_NT / PSXRPC.ZIP / README.TXT < prev    next >
Encoding:
Text File  |  1992-11-20  |  5.2 KB  |  106 lines

  1.  
  2. Included in this directory is a set of programs that allow a Windows NT
  3. POSIX process to be able to make RPC requests to a WIN32 server. This is to
  4. allow access to system facilities such as command execution that is not
  5. available in the native Windows NT POSIX environment.
  6.  
  7. These programs can be used to run the compiler from a make or shell program,
  8. start and wait for WIN16, DOS, WIN32 or OS/2 applications, or provide an
  9. interface to the WINSOCK API in order to send remote communications requests
  10. to an X-server. These functions could be used as a transport to allow the
  11. X Windows Client libraries to be supported under the POSIX subsystem. The
  12. X-server could be on a remote UNIX workstation over WINSOCK, or could be a
  13. local WIN32 X-server implementation.
  14.  
  15. Users are encouraged to extend the functions and feed back client and server
  16. libraries that expose WIN32 API's to POSIX client applications. I do
  17. recommend implementing RPC's that mimic existing UNIX functionality that is
  18. missing from the POSIX subsystem, as opposed to just 'exposing' native WIN32
  19. services to POSIX applications. This will be in keeping with Windows NT
  20. guidelines in not mixing the API's of different programming environments.
  21.  
  22. An example of this approach would be to implement the X-libraries and have
  23. the RPC's send X-wire protocol requests to an X-server running on WIN32. This
  24. is much more preferable than exposing WIN32 GDI routines to the POSIX subsystem
  25. through RPC's. This will allow a program that conforms to the UNIX API
  26. environment to talk to its graphics display in its native manner, and not
  27. be developed into a 'mutant' that is half UNIX, half WIN32. I have attempted
  28. to demonstrate this by emulating the functionality of the UNIX 'system()'
  29. function, as opposed to exposing WIN32 'CreateProcess()', as an RPC. The
  30. WIN32 server implements this using CreateProcess(), but this should be
  31. as transparent as possible to the UNIX program.
  32.  
  33. Compiling and using the programs:
  34.  
  35.   In order to compile the programs, you must install the Micrsoft Windows NT
  36. SDK from October 1992. You have to setup the POSIX environment as documented
  37. in the release notes. Once that has been done, doit.bat will run nmake on
  38. all of the supplied makefiles for each program. A list of each program and
  39. what it does follows:
  40.  
  41. win32srv.c:    Main WIN32 server program. It automaticly starts the
  42.         psxagent program.
  43.  
  44. psxagent.c:    POSIX 'agent' program that passes RPC requests received from
  45.         POSIX named pipes to the WIN32 server.
  46.  
  47. rpcclt.c:    Library of functions that is linked with POSIX client programs
  48.         to request RPC services of the WIN32 server. It knows how
  49.         to establish a connection with the psxagent process.
  50.  
  51. psxclt.c:    Example POSIX client that does a NULL RPC and runs a command
  52.         line.
  53.  
  54. rpctime.c:    Example POSIX client that measures RPC performance.
  55.  
  56.  
  57. In order to have the WIN32 server and the POSIX client output to the same
  58. console window, start the win32srv program with "start /b win32srv". This
  59. will return the prompt to you with the win32srv and psxagent programs running
  60. in the background. POSIX client applications may now be run from the command
  61. line and execute DOS, WIN16, WIN32 or OS/2, (or even POSIX) applications
  62. through the RPC facility. Output from these subprograms will go to the current
  63. console. If you do not use the /b parameter to start, console output from
  64. applications started by the WIN32 server will go to a new window separate
  65. from the POSIX client. You can also just run win32srv without start, but
  66. will have to switch to a new window in order to run POSIX client applications.
  67.  
  68.  
  69. Concerns:
  70.  
  71. One area of concern is performance. I get 104 round trip NULL RPC's
  72. per second on my 33MHz 80386. This is approx. 10 ms per RPC round trip.
  73. For remote command execution, or even X-Lib requests, this is not too bad.
  74. But for other more timing sensitive system services, this might be to slow.
  75.  
  76. A last area of concern is that only WIN32 calls that return results to the
  77. program, or perform some visible action such as launching a command line
  78. can be run. Any WIN32 calls that effect the calling process such as
  79. FileMapping() would only effect the WIN32 servers address space, and not
  80. the POSIX programs.
  81.  
  82. Possible Improvements:
  83.  
  84.  Once possible improvment is to implement the run time transport library
  85. for MS (DCE) RPC so that a more standard client-server application may be
  86. developed. I have not had the time to tackle this right now, and this could
  87. also be limited by not having select() or poll() available to the POSIX
  88. agent process who must pass the data between the POSIX client and WIN32
  89. server. Unless this program knows the amount of data in a given request, it
  90. could block waiting to send more data while ignoring the reply. This could
  91. possibly be handled by having the POSIX agent use fork() to have a read-side
  92. and a write-side process.
  93.  
  94.  A final improvment would be to support multiple named pipes so that more
  95. than one POSIX client may make requests at any given time.
  96.  
  97.  
  98. Please send comments to:
  99.  
  100.             John Richardson
  101.             CompuServe 70541,672
  102.             Internet jr@sni-usa.com
  103.  
  104. Also keep me abreast of any UNIX functions others have written for the
  105. Windows NT POSIX subsystem.
  106.