Move include/async.h to include/wine/async.h
Robert Shearman
rob at codeweavers.com
Thu Aug 19 21:13:39 CDT 2004
Changelog:
Move include/async.h to include/wine/async.h
-------------- next part --------------
Index: wine/dlls/kernel/comm.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/comm.c,v
retrieving revision 1.81
diff -u -p -r1.81 comm.c
--- wine/dlls/kernel/comm.c 18 Aug 2004 00:04:58 -0000 1.81
+++ wine/dlls/kernel/comm.c 20 Aug 2004 02:08:31 -0000
@@ -93,7 +93,7 @@
#include "winerror.h"
#include "wine/server.h"
-#include "async.h"
+#include "wine/async.h"
#include "heap.h"
#include "wine/unicode.h"
Index: wine/dlls/kernel/file.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/file.c,v
retrieving revision 1.26
diff -u -p -r1.26 file.c
--- wine/dlls/kernel/file.c 18 Aug 2004 00:04:58 -0000 1.26
+++ wine/dlls/kernel/file.c 20 Aug 2004 02:08:32 -0000
@@ -42,7 +42,7 @@
#include "excpt.h"
#include "wine/unicode.h"
#include "wine/debug.h"
-#include "async.h"
+#include "wine/async.h"
WINE_DEFAULT_DEBUG_CHANNEL(file);
Index: wine/dlls/ntdll/file.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/file.c,v
retrieving revision 1.66
diff -u -p -r1.66 file.c
--- wine/dlls/ntdll/file.c 19 Aug 2004 02:41:55 -0000 1.66
+++ wine/dlls/ntdll/file.c 20 Aug 2004 02:08:32 -0000
@@ -62,7 +62,7 @@
#include "wine/unicode.h"
#include "wine/debug.h"
#include "wine/server.h"
-#include "async.h"
+#include "wine/async.h"
#include "ntdll_misc.h"
#include "winternl.h"
Index: wine/dlls/ntdll/sync.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/sync.c,v
retrieving revision 1.35
diff -u -p -r1.35 sync.c
--- wine/dlls/ntdll/sync.c 1 Apr 2004 21:01:53 -0000 1.35
+++ wine/dlls/ntdll/sync.c 20 Aug 2004 02:08:32 -0000
@@ -48,7 +48,7 @@
#include "winbase.h"
#include "winreg.h"
#include "winternl.h"
-#include "async.h"
+#include "wine/async.h"
#include "thread.h"
#include "wine/server.h"
#include "wine/unicode.h"
Index: wine/dlls/winsock/socket.c
===================================================================
RCS file: /home/wine/wine/dlls/winsock/socket.c,v
retrieving revision 1.153
diff -u -p -r1.153 socket.c
--- wine/dlls/winsock/socket.c 18 Aug 2004 00:04:58 -0000 1.153
+++ wine/dlls/winsock/socket.c 20 Aug 2004 02:08:33 -0000
@@ -154,7 +154,7 @@ inline static const char *debugstr_socka
/****************************************************************
* Async IO declarations
****************************************************************/
-#include "async.h"
+#include "wine/async.h"
static DWORD ws2_async_get_count (const struct async_private *ovp);
static void CALLBACK ws2_async_call_completion (ULONG_PTR data);
--- wine/include/async.h 2004-08-20 03:10:04.005320928 +0100
+++ /dev/null 2003-09-15 14:40:47.000000000 +0100
@@ -1,140 +0,0 @@
-/*
- * Structures and static functions for handling asynchronous I/O.
- *
- * Copyright (C) 2002 Mike McCormack, Martin Wilck
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/*
- * This file declares static functions.
- * It should only be included by those source files that implement async I/O requests.
- */
-
-#ifndef __WINE_ASYNC_H
-#define __WINE_ASYNC_H
-
-#include <thread.h>
-#include <ntstatus.h>
-#include <wine/server.h>
-#include <winternl.h>
-
-struct async_private;
-
-typedef void (*async_handler)(struct async_private *ovp);
-typedef void (CALLBACK *async_call_completion_func)(ULONG_PTR data);
-typedef DWORD (*async_get_count)(const struct async_private *ovp);
-typedef void (*async_cleanup)(struct async_private *ovp);
-
-typedef struct async_ops
-{
- async_get_count get_count;
- async_call_completion_func call_completion;
- async_cleanup cleanup;
-} async_ops;
-
-typedef struct async_private
-{
- struct async_ops* ops;
- HANDLE handle;
- HANDLE event;
- int fd;
- async_handler func;
- int type;
- IO_STATUS_BLOCK* iosb;
- struct async_private* next;
- struct async_private* prev;
-} async_private;
-
-/* All functions declared static for Dll separation purposes */
-static void CALLBACK call_user_apc( ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3 )
-{
- PAPCFUNC func = (PAPCFUNC)arg1;
- func( arg2 );
-}
-
-inline static void finish_async( async_private *ovp )
-{
- if (ovp->prev)
- ovp->prev->next = ovp->next;
- else
- NtCurrentTeb()->pending_list = ovp->next;
-
- if (ovp->next)
- ovp->next->prev = ovp->prev;
-
- ovp->next = ovp->prev = NULL;
-
- wine_server_release_fd( ovp->handle, ovp->fd );
- if ( ovp->event != INVALID_HANDLE_VALUE )
- NtSetEvent( ovp->event, NULL );
-
- if ( ovp->ops->call_completion )
- NtQueueApcThread( GetCurrentThread(), call_user_apc,
- (ULONG_PTR)ovp->ops->call_completion, (ULONG_PTR)ovp, 0 );
- else
- ovp->ops->cleanup( ovp );
-}
-
-inline static NTSTATUS __register_async( async_private *ovp, const DWORD status )
-{
- NTSTATUS ret;
-
- SERVER_START_REQ( register_async )
- {
- req->handle = ovp->handle;
- req->overlapped = ovp;
- req->type = ovp->type;
- req->count = ovp->ops->get_count( ovp );
- req->status = status;
- ret = wine_server_call( req );
- }
- SERVER_END_REQ;
-
- if (ret) ovp->iosb->u.Status = ret;
-
- if ( ovp->iosb->u.Status != STATUS_PENDING )
- finish_async(ovp);
-
- return ret;
-}
-
-inline static NTSTATUS register_old_async( async_private *ovp )
-{
- return __register_async(ovp, ovp->iosb->u.Status);
-}
-
-inline static NTSTATUS register_new_async( async_private *ovp )
-{
- ovp->iosb->u.Status = STATUS_PENDING;
-
- ovp->next = NtCurrentTeb()->pending_list;
- ovp->prev = NULL;
- if ( ovp->next ) ovp->next->prev = ovp;
- NtCurrentTeb()->pending_list = ovp;
-
- return __register_async( ovp, STATUS_PENDING );
-}
-
-inline static NTSTATUS cancel_async( async_private *ovp )
-{
- /* avoid multiple cancellations */
- if ( ovp->iosb->u.Status != STATUS_PENDING )
- return STATUS_SUCCESS;
- ovp->iosb->u.Status = STATUS_CANCELLED;
- return __register_async( ovp, STATUS_CANCELLED );
-}
-
-#endif /* __WINE_ASYNC_H */
--- /dev/null 2003-09-15 14:40:47.000000000 +0100
+++ wine/include/wine/async.h 2004-08-18 23:35:31.000000000 +0100
@@ -0,0 +1,140 @@
+/*
+ * Structures and static functions for handling asynchronous I/O.
+ *
+ * Copyright (C) 2002 Mike McCormack, Martin Wilck
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * This file declares static functions.
+ * It should only be included by those source files that implement async I/O requests.
+ */
+
+#ifndef __WINE_ASYNC_H
+#define __WINE_ASYNC_H
+
+#include <thread.h>
+#include <ntstatus.h>
+#include <wine/server.h>
+#include <winternl.h>
+
+struct async_private;
+
+typedef void (*async_handler)(struct async_private *ovp);
+typedef void (CALLBACK *async_call_completion_func)(ULONG_PTR data);
+typedef DWORD (*async_get_count)(const struct async_private *ovp);
+typedef void (*async_cleanup)(struct async_private *ovp);
+
+typedef struct async_ops
+{
+ async_get_count get_count;
+ async_call_completion_func call_completion;
+ async_cleanup cleanup;
+} async_ops;
+
+typedef struct async_private
+{
+ struct async_ops* ops;
+ HANDLE handle;
+ HANDLE event;
+ int fd;
+ async_handler func;
+ int type;
+ IO_STATUS_BLOCK* iosb;
+ struct async_private* next;
+ struct async_private* prev;
+} async_private;
+
+/* All functions declared static for Dll separation purposes */
+static void CALLBACK call_user_apc( ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3 )
+{
+ PAPCFUNC func = (PAPCFUNC)arg1;
+ func( arg2 );
+}
+
+inline static void finish_async( async_private *ovp )
+{
+ if (ovp->prev)
+ ovp->prev->next = ovp->next;
+ else
+ NtCurrentTeb()->pending_list = ovp->next;
+
+ if (ovp->next)
+ ovp->next->prev = ovp->prev;
+
+ ovp->next = ovp->prev = NULL;
+
+ wine_server_release_fd( ovp->handle, ovp->fd );
+ if ( ovp->event != INVALID_HANDLE_VALUE )
+ NtSetEvent( ovp->event, NULL );
+
+ if ( ovp->ops->call_completion )
+ NtQueueApcThread( GetCurrentThread(), call_user_apc,
+ (ULONG_PTR)ovp->ops->call_completion, (ULONG_PTR)ovp, 0 );
+ else
+ ovp->ops->cleanup( ovp );
+}
+
+inline static NTSTATUS __register_async( async_private *ovp, const DWORD status )
+{
+ NTSTATUS ret;
+
+ SERVER_START_REQ( register_async )
+ {
+ req->handle = ovp->handle;
+ req->overlapped = ovp;
+ req->type = ovp->type;
+ req->count = ovp->ops->get_count( ovp );
+ req->status = status;
+ ret = wine_server_call( req );
+ }
+ SERVER_END_REQ;
+
+ if (ret) ovp->iosb->u.Status = ret;
+
+ if ( ovp->iosb->u.Status != STATUS_PENDING )
+ finish_async(ovp);
+
+ return ret;
+}
+
+inline static NTSTATUS register_old_async( async_private *ovp )
+{
+ return __register_async(ovp, ovp->iosb->u.Status);
+}
+
+inline static NTSTATUS register_new_async( async_private *ovp )
+{
+ ovp->iosb->u.Status = STATUS_PENDING;
+
+ ovp->next = NtCurrentTeb()->pending_list;
+ ovp->prev = NULL;
+ if ( ovp->next ) ovp->next->prev = ovp;
+ NtCurrentTeb()->pending_list = ovp;
+
+ return __register_async( ovp, STATUS_PENDING );
+}
+
+inline static NTSTATUS cancel_async( async_private *ovp )
+{
+ /* avoid multiple cancellations */
+ if ( ovp->iosb->u.Status != STATUS_PENDING )
+ return STATUS_SUCCESS;
+ ovp->iosb->u.Status = STATUS_CANCELLED;
+ return __register_async( ovp, STATUS_CANCELLED );
+}
+
+#endif /* __WINE_ASYNC_H */
More information about the wine-patches
mailing list