ReactOS  0.4.14-dev-342-gdc047f9
nbcmdqueue.h
Go to the documentation of this file.
1 /* Copyright (c) 2003 Juan Lang
2  *
3  * This library is free software; you can redistribute it and/or
4  * modify it under the terms of the GNU Lesser General Public
5  * License as published by the Free Software Foundation; either
6  * version 2.1 of the License, or (at your option) any later version.
7  *
8  * This library is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  * Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with this library; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16  */
17 #ifndef __NBCMDQUEUE_H__
18 #define __NBCMDQUEUE_H__
19 
20 /* This file defines a queue of pending NetBIOS commands. The queue operations
21  * are thread safe, with the exception of NBCmdQueueDestroy: ensure no other
22  * threads are manipulating the queue when calling NBCmdQueueDestroy.
23  */
24 
25 struct NBCmdQueue;
26 
27 /* Allocates a new command queue from heap. */
29 
30 /* Adds ncb to queue. Assumes queue is not NULL, and ncb is not already in the
31  * queue. If ncb is already in the queue, returns NRC_TOOMANY.
32  */
34 
35 /* Cancels the given ncb. Blocks until the command completes. Implicitly
36  * removes ncb from the queue. Assumes queue and ncb are not NULL, and that
37  * ncb has been added to queue previously.
38  * Returns NRC_CMDCAN on a successful cancellation, NRC_CMDOCCR if the command
39  * completed before it could be cancelled, and various other return values for
40  * different failures.
41  */
43 
44 /* Sets the return code of the given ncb, and implicitly removes the command
45  * from the queue. Assumes queue and ncb are not NULL, and that ncb has been
46  * added to queue previously.
47  * Returns NRC_GOODRET on success.
48  */
50 
51 /* Cancels all pending commands in the queue (useful for a RESET or a shutdown).
52  * Returns when all commands have been completed.
53  */
55 
56 /* Frees all memory associated with the queue. Blocks until all commands
57  * pending in the queue have been completed.
58  */
60 
61 #endif /* __NBCMDQUEUE_H__ */
Definition: nb30.h:148
Definition: _queue.h:59
UCHAR NBCmdQueueCancelAll(struct NBCmdQueue *queue) DECLSPEC_HIDDEN
Definition: nbcmdqueue.c:167
UCHAR NBCmdQueueCancel(struct NBCmdQueue *queue, PNCB ncb) DECLSPEC_HIDDEN
Definition: nbcmdqueue.c:106
UCHAR NBCmdQueueComplete(struct NBCmdQueue *queue, PNCB ncb, UCHAR retcode) DECLSPEC_HIDDEN
Definition: nbcmdqueue.c:138
struct NBCmdQueue * NBCmdQueueCreate(HANDLE heap) DECLSPEC_HIDDEN
Definition: nbcmdqueue.c:53
HANDLE heap
Definition: nbcmdqueue.c:24
unsigned char UCHAR
Definition: xmlstorage.h:181
#define DECLSPEC_HIDDEN
Definition: precomp.h:8
void NBCmdQueueDestroy(struct NBCmdQueue *queue) DECLSPEC_HIDDEN
Definition: nbcmdqueue.c:189
UCHAR NBCmdQueueAdd(struct NBCmdQueue *queue, PNCB ncb) DECLSPEC_HIDDEN
Definition: nbcmdqueue.c:70