The '''local procedure call''' ('''LPC''') facility is a service provided by the [[Microsoft]] [[Windows NT]] [[Kernel (computer science)|kernel]] for light weight [[message queue]] between processes[[process (computing)|process]]es on the same computer. The LPC interface is part of Windows NT's undocumented Native [[Applicationapplication programming interface|API]], although it can be used indirectly in applications via the documented [[Remoteremote procedure call|RPC]] system using the NCALRPC transport (which is implemented by LPC).
== Implementation ==
LPC is implemented using [[Kernel (computer science)|kernel]] "port" objects. A server process first creates a port object with a well known name, and waits for clients to connect. A client process then connects by opening that port and sending a connect message. If the server accepts the connection, a new unnamed port object is created for the connection. Port objects are secuable kernel objects that allow a process to identify the process on the other side of the connection.
For short messages (less than 304 bytes) the kernel copies the message buffers between processes. Longer messages require the creation of a shared memory section to transfer data, which the LPC service maps between the processes instead.
There is aA related method of [[Interinter-process communication|IPC]] is known as "Quick LPC", in which communication uses shared memory for data transfer and special event pair objects for synchronization. Event pairs allow the called thread to continue the current quantum, reducing scheduling overhead and latency. A standard port object (or some other IPC mechanism) is needed for initial communication.
== Known Usage ==
LPC is used heavily in communication between internal subsystems in [[Windows NT]]. The Win32 subsystem used LPC heavily for communication between client and the subsystem server (CSRSS). Quick LPC was introduced in version 3.51 of [[Windows NT]] to make these calls faster. This method was largely abandoned in version 4.0 in favor of moving the performance critical server portions into kernel mode (win32k.sys).
The [[Local Security Authority Subsystem Service]] (LSASS), Session Manager (SMSS), and Service Control Manager all use LPC ports directly to communicate with client processes.
[[Microsoft]] RPC can use LPC as a transport when the client and server are both on the same machine. Many services that are designed to communicate only on the local computer use LPC as the only transport through RPC. The implemntationimplementation of remote [[Objectobject linking and embedding|OLE]] and [[DCOM]] in many cases uses LPC for local communication as well.
== References ==
* Prasad Dabak, Milind Borate, Sandeep Phadke. ''Undocumented Windows NT.'' [[Hungry Minds]], 1999. ISBN 0764545698
* David A. Solomon, Mark E. Russinovich. ''Inside Windows 2000.'' Microsoft Press. ISBN 0735610215
[[Category:Microsoft Windows]]
|