Local Inter-Process Communication: Difference between revisions

Content deleted Content added
Clarify what "by calling Windows APIs" refers to (some APIs are implemented "under the hood" by sending messages, using LPC, to system processes).
m formatting fix
 
(16 intermediate revisions by 12 users not shown)
Line 1:
The '''Local ProcedureInter-Process CallCommunication'''<ref name="ntdebugging">{{cite web|url=https://docs.microsoft.com/en-us/archive/blogs/ntdebugging/lpc-local-procedure-calls-part-1-architecture|title=LPC (Local procedure calls) Part 1 architecture|website=[[Microsoft Docs]]}}</ref> ('''LPC''', often also referred to as '''LightweightLocal Procedure Call''' or '''LocalLightweight Inter-ProcessProcedure CommunicationCall''') is an internal, undocumented [[inter-process communication]] facility provided by the [[Microsoft]] [[Windows NT]] [[Kernel (computeroperating sciencesystem)|kernel]] for lightweight [[inter-process communication|IPC]] between [[process (computing)|process]]es on the same computer. As of [[Windows Vista]], LPC has been rewritten as '''AdvancedAsynchronous Local ProcedureInter-Process CallCommunication'''<ref name="ntdebugging"/> ('''ALPC''', often also '''Advanced Local Procedure Call''') in order to provide a high-speed scalable communication mechanism required to efficiently implement [[User-Mode Driver Framework]] (UMDF), whose user-mode parts require an efficient communication channel with UMDF's components in the [[Architecture_of_Windows_NT#Executive|executive]].<ref>{{Harvcoltxt|Russinovich|Solomon|Ionescu|2009|p=201}}</ref>
 
The (A)LPC interface is part of Windows NT's undocumented [[Windows Native API|Native API]], and as such is not available to applications for direct use. However, it can be used indirectly in the following instances:
* when using the [[Microsoft RPC]] API to communicate locally, i.e. between the processes on the same machine
* by calling Windows APIs that are implemented with (A)LPC (see below)
 
==Implementation==
(A)LPC is implemented using kernel "port" objects, which are securable (with [[Access -control list|ACL]]s, allowing e.g. only specific [[Security Identifier|SID]]s to use them) and allow identification of the process on the other side of the connection. Individual messages are also securable: applications can set per-message SIDs, and also test for changes of the security context in the token associated with the (A)LPC message.
 
The typical communication scenario between the server and the client is as follows:
Line 28:
The [[Local Security Authority Subsystem Service]] (LSASS), [[Session Manager]] (SMSS), and [[Service Control Manager]] all use (A)LPC ports directly to communicate with client processes. [[Winlogon]] and the [[Reference monitor|Security Reference Monitor]] use it to communicate with the LSASS process.
 
As mentioned, Microsoft RPC can use (A)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 (A)LPC as the only transport through RPC. The implementation of remote [[objectObject linkingLinking and embeddingEmbedding|OLE]] and [[Distributed Component Object Model|DCOM]] in many cases uses (A)LPC for local communication as well.
 
==See also==
Line 39:
==References==
* {{citation |first1=Prasad |last1=Dabak |first2=Milind |last2=Borate |first3=Sandeep |last3=Phadke |title=Undocumented Windows NT |publisher=[[Hungry Minds]] |year=1999 |isbn=0-7645-4569-8}}
* {{citation |title=Windows® Internals| edition=5th |first1=Mark |last1=Russinovich |author1-link=Mark Russinovich |first2=David |last2=Solomon |first3=Alex |last3=Ionescu |year=2009 |publisher=[[Microsoft Press]] |isbn=978-0-7356-2530-13}}
 
==External links==
* [{{webarchive |url=https://web.archive.org/web/20080612141354/http://www.windowsitlibrary.com/Content/356/08/toc.html |date=June 12, 2008 |title=Local Procedure Call] -}} — Includes explanation of undocumented functions (broken link, redirect to a webshop)
* [http://www.zezula.net/en/prog/lpc.html LPC Communication]