SlideShare a Scribd company logo
2
Most read
8
Most read
17
Most read
IPC mechanisms in Windows 
A brief description of different IPC 
mechanisms in Windows OS 
Compiled By: 
B. Vinoth Raj 
Senior Software Engineer 
Mindfire Solutions
IPC mechanisms in Windows 
 Clipboard 
 Data Copy 
 Dynamic Data Exchange (DDE) 
 Component Object Model (COM) 
 File Mapping 
 Mailslots 
 Pipes 
 Remote Procedure Call (RPC) 
 Sockets
IPC using Clipboard 
 Loosely coupled exchange medium 
 Applications agree on data format 
 Following Windows API functions used 
OpenClipboard() 
EmptyClipboard() 
SetClipboardData() 
CloseClipboard() 
GetClipboardData() 
 Applications can reside on the same computer or on 
different computers on a network
IPC using Data Copy 
 Use WM_COPYDATA windows message to share data 
 SendMessage() API function used to send data 
 COPYDATASTRUCT structure used to send data 
SendMessage(hwnd, // Handle to destination window 
WM_COPYDATA, // Message to send to destination window 
(WPARAM)wparam, // Handle to window passing the data 
(LPARAM)lparam); // Data (pointer to COPYDATASTRUCT) 
 The data sent is read-only for the receiving application 
 Works only for processes running on same computer
IPC using DDE 
 DDE is a message-based protocol 
 Uses shared memory to exchange data 
 Share data between applications running on the same 
computer or on different computers on a network 
 Nine DDE message are defined. All DDE transactions are 
conducted by passing these messages b/w client and 
server 
 An application calls SendMessage to issue the 
WM_DDE_INITIATE message or a WM_DDE_ACK 
message sent in response to WM_DDE_INITIATE
IPC using DDE (cont.) 
 All other messages are sent by PostMessage 
LRESULT WINAPI SendMessage( _In_ HWND hWnd, 
_In_ UINT Msg, 
_In_ WPARAM wParam, 
_In_ LPARAM lParam); 
 First parameter of these calls is a handle to the receiving 
window 
 Second parameter contains the message to be sent 
 Third parameter identifies the sending window 
 Fourth parameter contains the message-specific 
arguments
IPC using File Mapping 
 Allows one-way and bi-directional communication between 
applications 
 Windows API functions used: CreateFileMapping(), 
MapViewOfFile(), UnMapViewOfFile(), CloseHandle() 
 A synchronization object (e.g., semaphore) is required to 
prevent data corruption in multi-tasking environment 
 Uses shared memory for data sharing
IPC using File Mapping (cont.) 
 Server process does the following: 
– Create file mapping by invoking CreateFileMapping function 
– Map the view of the file mapping into the address space of the current process 
(MapViewOfFile) 
– Use CopyMemory function to write message to the file view 
– Unmap the file view and close the file mapping objects (UnmapViewOfFile, 
CloseHandle)
IPC using File Mapping (cont.) 
 Client process does the following: 
– Open a named file mapping using OpenFileMapping 
– Map the view of the file mapping into the address space of the current process 
using MapViewOfFile 
– Read message from the view of the shared memory 
– Unmap the file view and close the file mapping objects (UnmapViewOfFile, 
CloseHandle)
IPC using Mailslots 
 Provides one-way communication 
 Process that creates mailslot is a mailslot server 
 Mailslot clients send data to mailslot server 
 Mailslot IPC mechanism is a Windows only feature 
 A process can be both mailslot server and mailslot client so 
two-way communication is possible using multiple 
mailslots 
 Mailslot messages can be broadcasted
IPC using Mailslots (cont.) 
 A mailslot server does the following: 
- Create a mailslot using CreateMailslot() function 
- Check messages in the mailslotusing ReadMailslot() function 
- Check for the number of messages in the mailslotusing GetMailslotInfo() function 
- Retrieve the messages one by one from the mailslot. While reading, update the number of 
messages that are left in the mailslot. (ReadFile, GetMailslotInfo) 
- Close the handle of the mailslot instance using CloseHandle() function
IPC using Mailslots (cont.) 
 A mailslot client does the following: 
- Open the mailslot using CreateFile() function 
- Write messages to the mailslot. (WriteMailslot, WriteFile) 
- Close the slotusing CloseHandle() function
IPC using Pipes 
 Allows two-way communication 
 Two types of pipes available: named and anonymous 
 Named pipes are used to transfer data between unrelated 
processes 
 Anonymous pipe works between processes on same 
computer 
 To have two-way communication, two anonymous pipes 
can be used
IPC using Pipes (cont.) 
 Windows API functions used are: 
CreateNamedPipe() 
ConnectNamedPipe() 
WaitNamedPipe() 
DisconnectNamedPipe() 
ReadFile() 
WriteFile() 
CloseHandle() 
 A Named Pipe name needs to be in the following format: 
For named pipe server – .pipePipeName 
For named pipe client – ComputerNamepipePipeName
IPC using Windows sockets 
 Socket is a communication endpoint 
 Applications can send or receive packets of data across a 
network 
 Two types of sockets available 
Stream Sockets – stream of bytes. No record boundaries 
Datagram Sockets - record-oriented data flow that is not guaranteed to be delivered 
Packets may not be sequenced and duplication can occur
IPC using Sockets (cont.) 
 Sockets are highly useful in at least three communications 
contexts: 
– Client/Server models 
– Peer-to-peer scenarios, such as chat applications 
– Making remote procedure calls (RPC) by having the 
receiving application interpret a message as a function call
Thanks!

More Related Content

PPT
Angular Seminar-js
PDF
NodeJS for Beginner
PPTX
ReactJS presentation.pptx
PDF
Race conditions
PPTX
Php.ppt
PDF
Infrastructure Deployment with Docker & Ansible
PPTX
Vim Editor And Basic Scripting (Ch-7)
PDF
Introduction to Network Function Virtualization (NFV)
Angular Seminar-js
NodeJS for Beginner
ReactJS presentation.pptx
Race conditions
Php.ppt
Infrastructure Deployment with Docker & Ansible
Vim Editor And Basic Scripting (Ch-7)
Introduction to Network Function Virtualization (NFV)

What's hot (20)

PPTX
Access control list acl - permissions in linux
PPTX
PDF
Modern Kernel Pool Exploitation: Attacks and Techniques
PPSX
Php and MySQL
PPT
Ipc in linux
PPTX
Looping statement in vb.net
PPTX
[Final] ReactJS presentation
PPTX
Introduction to Node.js
ODP
Datatype in JavaScript
PDF
Php tutorial(w3schools)
PDF
The linux networking architecture
PDF
An Introduction of Node Package Manager (NPM)
PDF
codeBeamer Medical ALM at AgileMed
PPTX
eBPF Basics
PPTX
Client side scripting using Javascript
PDF
Intel dpdk Tutorial
PDF
Lab1-DB-Cassandra
PPTX
DHTML - Events & Buttons
PDF
React JS and Redux
PDF
Unix system programming
Access control list acl - permissions in linux
Modern Kernel Pool Exploitation: Attacks and Techniques
Php and MySQL
Ipc in linux
Looping statement in vb.net
[Final] ReactJS presentation
Introduction to Node.js
Datatype in JavaScript
Php tutorial(w3schools)
The linux networking architecture
An Introduction of Node Package Manager (NPM)
codeBeamer Medical ALM at AgileMed
eBPF Basics
Client side scripting using Javascript
Intel dpdk Tutorial
Lab1-DB-Cassandra
DHTML - Events & Buttons
React JS and Redux
Unix system programming
Ad

Viewers also liked (20)

PPT
Inter-Process Communication (IPC) techniques on Mac OS X
PDF
Inter Process Communication
PPS
Linux Ubuntu
PPT
Peterson Critical Section Problem Solution
PDF
Implementation of Pipe in Linux
PPT
Research on Audio and Video Streaming
PPTX
Pipes in Windows and Linux.
PPTX
Ffmpeg for android
PDF
Tdevelopers forum web_rtc 기술 및 api 활용
PDF
WebRTC 품질 측정 기초
PDF
WebRTC in 2014
PPTX
FFmpeg presentation
PDF
[Hello world 오픈세미나]실시간웹을위한comet과socket.io
PPTX
Program Threats
PDF
[Hello world 오픈 세미나]ffmpeg android
PDF
Inter process communication using Linux System Calls
PDF
WebRTC 현재와 미래 최진호 2016
PPT
Interprocess Communication
PPT
Inter process communication
Inter-Process Communication (IPC) techniques on Mac OS X
Inter Process Communication
Linux Ubuntu
Peterson Critical Section Problem Solution
Implementation of Pipe in Linux
Research on Audio and Video Streaming
Pipes in Windows and Linux.
Ffmpeg for android
Tdevelopers forum web_rtc 기술 및 api 활용
WebRTC 품질 측정 기초
WebRTC in 2014
FFmpeg presentation
[Hello world 오픈세미나]실시간웹을위한comet과socket.io
Program Threats
[Hello world 오픈 세미나]ffmpeg android
Inter process communication using Linux System Calls
WebRTC 현재와 미래 최진호 2016
Interprocess Communication
Inter process communication
Ad

Similar to IPC mechanisms in windows (20)

PPT
Ipc clipboard and data copy
PPTX
Chuong5_Networking_updated.Networking_updatedpptx
PPT
Lecture 2 -_understanding_networks_with_presenter_notes
PDF
Computer Networks Notes Complete Syllabus
DOCX
Networking Fundamentals
ZIP
OneTeam Media Server
PPTX
Chimera Tool Crack 41.56.2046 Download 2025
PDF
iTop VPN Latest Version 2025 Crack Free Download
PPTX
VSO ConvertXto HD Free CRACKS Download .
PDF
Wondershare Filmora Crack Free Download
PDF
Minitool Partition Wizard Crack Free Download
PPTX
Nickelodeon All Star Brawl 2 v1.13 Free Download
PDF
LDPlayer 9.1.20 Latest Crack Free Download
PPTX
Mini Airways v0.11.3 TENOKE Free Download
PPTX
Replay Media Catcher Free CRACK Download
PDF
Tenorshare 4uKey Crack Fre e Download
PPTX
The Daum PotPlayer Free CRACK Download.
PPTX
CarX Street Deluxe edition v1.4.0 Free Download
PPTX
Horizon Zero Dawn Remastered Free Download For PC
PDF
Enscape Latest 2025 Crack Free Download
Ipc clipboard and data copy
Chuong5_Networking_updated.Networking_updatedpptx
Lecture 2 -_understanding_networks_with_presenter_notes
Computer Networks Notes Complete Syllabus
Networking Fundamentals
OneTeam Media Server
Chimera Tool Crack 41.56.2046 Download 2025
iTop VPN Latest Version 2025 Crack Free Download
VSO ConvertXto HD Free CRACKS Download .
Wondershare Filmora Crack Free Download
Minitool Partition Wizard Crack Free Download
Nickelodeon All Star Brawl 2 v1.13 Free Download
LDPlayer 9.1.20 Latest Crack Free Download
Mini Airways v0.11.3 TENOKE Free Download
Replay Media Catcher Free CRACK Download
Tenorshare 4uKey Crack Fre e Download
The Daum PotPlayer Free CRACK Download.
CarX Street Deluxe edition v1.4.0 Free Download
Horizon Zero Dawn Remastered Free Download For PC
Enscape Latest 2025 Crack Free Download

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Machine Learning_overview_presentation.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Electronic commerce courselecture one. Pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Machine Learning_overview_presentation.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Review of recent advances in non-invasive hemoglobin estimation
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Network Security Unit 5.pdf for BCA BBA.
NewMind AI Weekly Chronicles - August'25-Week II
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Programs and apps: productivity, graphics, security and other tools
Assigned Numbers - 2025 - Bluetooth® Document
Building Integrated photovoltaic BIPV_UPV.pdf
Spectroscopy.pptx food analysis technology
Electronic commerce courselecture one. Pdf
20250228 LYD VKU AI Blended-Learning.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

IPC mechanisms in windows

  • 1. IPC mechanisms in Windows A brief description of different IPC mechanisms in Windows OS Compiled By: B. Vinoth Raj Senior Software Engineer Mindfire Solutions
  • 2. IPC mechanisms in Windows  Clipboard  Data Copy  Dynamic Data Exchange (DDE)  Component Object Model (COM)  File Mapping  Mailslots  Pipes  Remote Procedure Call (RPC)  Sockets
  • 3. IPC using Clipboard  Loosely coupled exchange medium  Applications agree on data format  Following Windows API functions used OpenClipboard() EmptyClipboard() SetClipboardData() CloseClipboard() GetClipboardData()  Applications can reside on the same computer or on different computers on a network
  • 4. IPC using Data Copy  Use WM_COPYDATA windows message to share data  SendMessage() API function used to send data  COPYDATASTRUCT structure used to send data SendMessage(hwnd, // Handle to destination window WM_COPYDATA, // Message to send to destination window (WPARAM)wparam, // Handle to window passing the data (LPARAM)lparam); // Data (pointer to COPYDATASTRUCT)  The data sent is read-only for the receiving application  Works only for processes running on same computer
  • 5. IPC using DDE  DDE is a message-based protocol  Uses shared memory to exchange data  Share data between applications running on the same computer or on different computers on a network  Nine DDE message are defined. All DDE transactions are conducted by passing these messages b/w client and server  An application calls SendMessage to issue the WM_DDE_INITIATE message or a WM_DDE_ACK message sent in response to WM_DDE_INITIATE
  • 6. IPC using DDE (cont.)  All other messages are sent by PostMessage LRESULT WINAPI SendMessage( _In_ HWND hWnd, _In_ UINT Msg, _In_ WPARAM wParam, _In_ LPARAM lParam);  First parameter of these calls is a handle to the receiving window  Second parameter contains the message to be sent  Third parameter identifies the sending window  Fourth parameter contains the message-specific arguments
  • 7. IPC using File Mapping  Allows one-way and bi-directional communication between applications  Windows API functions used: CreateFileMapping(), MapViewOfFile(), UnMapViewOfFile(), CloseHandle()  A synchronization object (e.g., semaphore) is required to prevent data corruption in multi-tasking environment  Uses shared memory for data sharing
  • 8. IPC using File Mapping (cont.)  Server process does the following: – Create file mapping by invoking CreateFileMapping function – Map the view of the file mapping into the address space of the current process (MapViewOfFile) – Use CopyMemory function to write message to the file view – Unmap the file view and close the file mapping objects (UnmapViewOfFile, CloseHandle)
  • 9. IPC using File Mapping (cont.)  Client process does the following: – Open a named file mapping using OpenFileMapping – Map the view of the file mapping into the address space of the current process using MapViewOfFile – Read message from the view of the shared memory – Unmap the file view and close the file mapping objects (UnmapViewOfFile, CloseHandle)
  • 10. IPC using Mailslots  Provides one-way communication  Process that creates mailslot is a mailslot server  Mailslot clients send data to mailslot server  Mailslot IPC mechanism is a Windows only feature  A process can be both mailslot server and mailslot client so two-way communication is possible using multiple mailslots  Mailslot messages can be broadcasted
  • 11. IPC using Mailslots (cont.)  A mailslot server does the following: - Create a mailslot using CreateMailslot() function - Check messages in the mailslotusing ReadMailslot() function - Check for the number of messages in the mailslotusing GetMailslotInfo() function - Retrieve the messages one by one from the mailslot. While reading, update the number of messages that are left in the mailslot. (ReadFile, GetMailslotInfo) - Close the handle of the mailslot instance using CloseHandle() function
  • 12. IPC using Mailslots (cont.)  A mailslot client does the following: - Open the mailslot using CreateFile() function - Write messages to the mailslot. (WriteMailslot, WriteFile) - Close the slotusing CloseHandle() function
  • 13. IPC using Pipes  Allows two-way communication  Two types of pipes available: named and anonymous  Named pipes are used to transfer data between unrelated processes  Anonymous pipe works between processes on same computer  To have two-way communication, two anonymous pipes can be used
  • 14. IPC using Pipes (cont.)  Windows API functions used are: CreateNamedPipe() ConnectNamedPipe() WaitNamedPipe() DisconnectNamedPipe() ReadFile() WriteFile() CloseHandle()  A Named Pipe name needs to be in the following format: For named pipe server – .pipePipeName For named pipe client – ComputerNamepipePipeName
  • 15. IPC using Windows sockets  Socket is a communication endpoint  Applications can send or receive packets of data across a network  Two types of sockets available Stream Sockets – stream of bytes. No record boundaries Datagram Sockets - record-oriented data flow that is not guaranteed to be delivered Packets may not be sequenced and duplication can occur
  • 16. IPC using Sockets (cont.)  Sockets are highly useful in at least three communications contexts: – Client/Server models – Peer-to-peer scenarios, such as chat applications – Making remote procedure calls (RPC) by having the receiving application interpret a message as a function call