[Technical Tips - table of contents] How to Share an Event between Kernel Mode and User Mode A kernel mode driver and an application can easily share an event for synchronization using the named event feature of the Win32 API. Here’s how: 1. The driver creates a named event. Using Vireo Driver::Works, it’s as simple as declaring an instance of KEvent, and providing the event name and type: KEvent TheEvent(KUstring(L"\\BaseNamedObjects\\SynchEvent"), SynchronizationEvent); Notice that the event is in object directory \BaseNamedObjects. This enables application code to locate the event. 2. Initially, the event is in the signaled state, so we clear it. TheEvent.Clear(); 3. The application opens the event, using the known name: HANDLE hEvent = OpenEvent(SYNCHRONIZE, FALSE, "SynchEvent"); 4. The application can wait on the event, pending notification by the driver: WaitForSingleObject(hEvent, INFINITE); 5. When the driver wants to signal the application, it sets the event: TheEvent.Set(); This causes the application to return from WaitForSingleObject. [Image] Vireo Home Page -- Prices and Ordering Driver::Works -- VtoolsD -- Driver::Agent Vireo Software, Inc. -- Suite 135 -- 30 Monument Square -- Concord, MA 01742 (978) 369-3380 -- Fax (978) 318-6946 -- Info@vireo.com Copyright © 1996-1997 Vireo Software, Inc.