2 * Copyright (c) 2009 Intel Corp., Inc. All rights reserved.
\r
4 * This software is available to you under the OpenIB.org BSD license
\r
7 * Redistribution and use in source and binary forms, with or
\r
8 * without modification, are permitted provided that the following
\r
9 * conditions are met:
\r
11 * - Redistributions of source code must retain the above
\r
12 * copyright notice, this list of conditions and the following
\r
15 * - Redistributions in binary form must reproduce the above
\r
16 * copyright notice, this list of conditions and the following
\r
17 * disclaimer in the documentation and/or other materials
\r
18 * provided with the distribution.
\r
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
21 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
22 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AWV
\r
23 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
24 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
25 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
26 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
32 #ifndef COMP_CHANNEL_H
\r
33 #define COMP_CHANNEL_H
\r
35 #include <windows.h>
\r
42 typedef struct _COMP_ENTRY
\r
44 struct _COMP_ENTRY *Next;
\r
45 DLIST_ENTRY MgrEntry;
\r
47 struct _COMP_CHANNEL *Channel;
\r
52 typedef struct _COMP_CHANNEL
\r
54 struct _COMP_MANAGER *Manager;
\r
56 COMP_ENTRY **TailPtr;
\r
59 CRITICAL_SECTION Lock;
\r
64 typedef struct _COMP_MANAGER
\r
67 DLIST_ENTRY DoneList;
\r
73 CRITICAL_SECTION Lock;
\r
77 DWORD CompManagerOpen(COMP_MANAGER *pMgr);
\r
78 void CompManagerClose(COMP_MANAGER *pMgr);
\r
79 DWORD CompManagerMonitor(COMP_MANAGER *pMgr, HANDLE hFile, ULONG_PTR Key);
\r
80 DWORD CompManagerPoll(COMP_MANAGER *pMgr, DWORD Milliseconds,
\r
81 COMP_CHANNEL **ppChannel);
\r
82 void CompManagerCancel(COMP_MANAGER *pMgr);
\r
84 DWORD CompChannelInit(COMP_MANAGER *pMgr, COMP_CHANNEL *pChannel,
\r
85 DWORD Milliseconds);
\r
86 void CompChannelCleanup(COMP_CHANNEL *pChannel);
\r
87 DWORD CompChannelPoll(COMP_CHANNEL *pChannel, COMP_ENTRY **ppEntry);
\r
88 void CompChannelCancel(COMP_CHANNEL *pChannel);
\r
90 void CompEntryInit(COMP_CHANNEL *pChannel, COMP_ENTRY *pEntry);
\r
91 DWORD CompEntryPost(COMP_ENTRY *pEntry);
\r
92 void CompEntryCancel(COMP_ENTRY *pEntry);
\r
98 #endif /* COMP_CHANNEL_H */
\r