ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

nbcmdqueue.h
Go to the documentation of this file.
00001 /* Copyright (c) 2003 Juan Lang
00002  *
00003  * This library is free software; you can redistribute it and/or
00004  * modify it under the terms of the GNU Lesser General Public
00005  * License as published by the Free Software Foundation; either
00006  * version 2.1 of the License, or (at your option) any later version.
00007  *
00008  * This library is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011  * Lesser General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU Lesser General Public
00014  * License along with this library; if not, write to the Free Software
00015  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00016  */
00017 #ifndef __NBCMDQUEUE_H__
00018 #define __NBCMDQUEUE_H__
00019 
00020 #include <stdarg.h>
00021 #include "windef.h"
00022 #include "winbase.h"
00023 #include "nb30.h"
00024 
00025 /* This file defines a queue of pending NetBIOS commands.  The queue operations
00026  * are thread safe, with the exception of NBCmdQueueDestroy:  ensure no other
00027  * threads are manipulating the queue when calling NBCmdQueueDestroy.
00028  */
00029 
00030 struct NBCmdQueue;
00031 
00032 /* Allocates a new command queue from heap. */
00033 struct NBCmdQueue *NBCmdQueueCreate(HANDLE heap);
00034 
00035 /* Adds ncb to queue.  Assumes queue is not NULL, and ncb is not already in the
00036  * queue.  If ncb is already in the queue, returns NRC_TOOMANY.
00037  */
00038 UCHAR NBCmdQueueAdd(struct NBCmdQueue *queue, PNCB ncb);
00039 
00040 /* Cancels the given ncb.  Blocks until the command completes.  Implicitly
00041  * removes ncb from the queue.  Assumes queue and ncb are not NULL, and that
00042  * ncb has been added to queue previously.
00043  * Returns NRC_CMDCAN on a successful cancellation, NRC_CMDOCCR if the command
00044  * completed before it could be cancelled, and various other return values for
00045  * different failures.
00046  */
00047 UCHAR NBCmdQueueCancel(struct NBCmdQueue *queue, PNCB ncb);
00048 
00049 /* Sets the return code of the given ncb, and implicitly removes the command
00050  * from the queue.  Assumes queue and ncb are not NULL, and that ncb has been
00051  * added to queue previously.
00052  * Returns NRC_GOODRET on success.
00053  */
00054 UCHAR NBCmdQueueComplete(struct NBCmdQueue *queue, PNCB ncb, UCHAR retcode);
00055 
00056 /* Cancels all pending commands in the queue (useful for a RESET or a shutdown).
00057  * Returns when all commands have been completed.
00058  */
00059 UCHAR NBCmdQueueCancelAll(struct NBCmdQueue *queue);
00060 
00061 /* Frees all memory associated with the queue.  Blocks until all commands
00062  * pending in the queue have been completed.
00063  */
00064 void NBCmdQueueDestroy(struct NBCmdQueue *queue);
00065 
00066 #endif /* __NBCMDQUEUE_H__ */

Generated on Sun May 27 2012 04:25:27 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.