How to Use RPC Under Win32s (127903)



The information in this article applies to:

  • Microsoft Win32s 1.2
  • Microsoft Win32s 1.25a

This article was previously published under Q127903

SUMMARY

Win32s does not thunk Remote Procedure Call (RPC) calls. Therefore, if you have a Win32-based application that uses RPC and you want it to run on Win32s, you will need to write a thunking layer for your application to thunk the 32-bit calls to the 16-bit RPC implementation.

One issue to keep in mind when writing the thunking layer is how to handle stub code. It is convenient to direct the MIDL compiler to produce 16-bit stub code for the application. The stub code can be built as a 16-bit DLL, which can be called from the Win32-based application via the Universal Thunk. This eliminates the need to write a thunking layer for the RPC run-time functions that appear in 32-bit client stub code.

One limitation is that RPC servers are not supported with the 16-bit RPC, only clients. Microsoft's 32-bit RPC implements servers by spawning threads for each call, and threads are not supported under Win32s. There may be other vendors who supply a 16-bit RPC that supports servers.

Modification Type:MajorLast Reviewed:10/30/2003
Keywords:KB127903