mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Rebase against 4e2ad334b5881af7661be4d6df3c51aae92ca4a2
This commit is contained in:
parent
d4918b4305
commit
76ba9d2387
@ -82,7 +82,7 @@ index da35bdf85..2bb85d910 100644
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ obj = interlocked_xchg_ptr((void **)&esync_list[entry][idx], obj);
|
||||
+ obj = InterlockedExchangePointer((void **)&esync_list[entry][idx], obj);
|
||||
+ assert(!obj);
|
||||
+ return TRUE;
|
||||
+}
|
||||
|
@ -26,7 +26,7 @@ index bca95b9b2d9..f7a427425b7 100644
|
||||
+
|
||||
+ if (entry < ESYNC_LIST_ENTRIES && esync_list[entry])
|
||||
+ {
|
||||
+ if ((obj = interlocked_xchg_ptr( (void **)&esync_list[entry][idx], 0 )))
|
||||
+ if ((obj = InterlockedExchangePointer( (void **)&esync_list[entry][idx], 0 )))
|
||||
+ {
|
||||
+ close( obj->fd );
|
||||
+ RtlFreeHeap( GetProcessHeap(), 0, obj );
|
||||
|
@ -62,7 +62,7 @@ index 9da300853..25e049291 100644
|
||||
+
|
||||
+ if (count + current > semaphore->max)
|
||||
+ return STATUS_SEMAPHORE_LIMIT_EXCEEDED;
|
||||
+ } while (interlocked_cmpxchg( &semaphore->count, count + current, current ) != current);
|
||||
+ } while (InterlockedCompareExchange( &semaphore->count, count + current, current ) != current);
|
||||
+
|
||||
+ if (prev) *prev = current;
|
||||
+
|
||||
@ -83,7 +83,7 @@ index 9da300853..25e049291 100644
|
||||
+ * the fact that we were able to grab it at all means the count
|
||||
+ * is nonzero, and if someone else grabbed it then the count
|
||||
+ * must have been >= 2, etc. */
|
||||
+ interlocked_xchg_add( &semaphore->count, -1 );
|
||||
+ InterlockedDecrement( &semaphore->count );
|
||||
+ }
|
||||
return i;
|
||||
}
|
||||
@ -105,7 +105,7 @@ index 9da300853..25e049291 100644
|
||||
+ else if (objs[i]->type == ESYNC_SEMAPHORE)
|
||||
+ {
|
||||
+ struct semaphore *semaphore = (struct semaphore *)objs[i];
|
||||
+ interlocked_xchg_add( &semaphore->count, -1 );
|
||||
+ InterlockedDecrement( &semaphore->count );
|
||||
+ }
|
||||
}
|
||||
TRACE("Wait successful.\n");
|
||||
|
@ -100,7 +100,7 @@ index c1d8882d817..ea71c960007 100644
|
||||
+
|
||||
+ TRACE("Mapping page %d at %p.\n", entry, addr);
|
||||
+
|
||||
+ if (interlocked_cmpxchg_ptr( &shm_addrs[entry], addr, 0 ))
|
||||
+ if (InterlockedCompareExchangePointer( &shm_addrs[entry], addr, 0 ))
|
||||
+ munmap( addr, pagesize ); /* someone beat us to it */
|
||||
+ }
|
||||
+
|
||||
@ -654,7 +654,7 @@ index c1d8882d817..ea71c960007 100644
|
||||
{
|
||||
- struct semaphore *semaphore = (struct semaphore *)objs[i];
|
||||
+ struct semaphore *semaphore = objs[i]->shm;
|
||||
interlocked_xchg_add( &semaphore->count, -1 );
|
||||
InterlockedDecrement( &semaphore->count );
|
||||
}
|
||||
}
|
||||
diff --git a/dlls/ntdll/esync.h b/dlls/ntdll/esync.h
|
||||
|
@ -43,10 +43,10 @@ index 0a1999162..3d0c17fd1 100644
|
||||
}
|
||||
}
|
||||
|
||||
- obj = interlocked_xchg_ptr((void **)&esync_list[entry][idx], obj);
|
||||
- obj = InterlockedExchangePointer((void **)&esync_list[entry][idx], obj);
|
||||
- assert(!obj);
|
||||
- return TRUE;
|
||||
+ if (!interlocked_cmpxchg((int *)&esync_list[entry][idx].type, type, 0))
|
||||
+ if (!InterlockedCompareExchange((int *)&esync_list[entry][idx].type, type, 0))
|
||||
+ {
|
||||
+ esync_list[entry][idx].fd = fd;
|
||||
+ esync_list[entry][idx].shm = shm;
|
||||
@ -129,8 +129,8 @@ index 0a1999162..3d0c17fd1 100644
|
||||
|
||||
if (entry < ESYNC_LIST_ENTRIES && esync_list[entry])
|
||||
{
|
||||
- if ((obj = interlocked_xchg_ptr( (void **)&esync_list[entry][idx], 0 )))
|
||||
+ if (interlocked_xchg((int *)&esync_list[entry][idx].type, 0))
|
||||
- if ((obj = InterlockedExchangePointer( (void **)&esync_list[entry][idx], 0 )))
|
||||
+ if (InterlockedExchange((int *)&esync_list[entry][idx].type, 0))
|
||||
{
|
||||
- close( obj->fd );
|
||||
- RtlFreeHeap( GetProcessHeap(), 0, obj );
|
||||
|
@ -68,7 +68,7 @@ index 506d1c99d..4e5fcef8e 100644
|
||||
+ if ((size = read( obj->fd, &value, sizeof(value) )) == sizeof(value))
|
||||
+ {
|
||||
+ TRACE("Woken up by handle %p [%d].\n", handles[i], i);
|
||||
+ interlocked_xchg_add( &semaphore->count, -1 );
|
||||
+ InterlockedDecrement( &semaphore->count );
|
||||
+ return i;
|
||||
+ }
|
||||
+ }
|
||||
|
@ -155,12 +155,12 @@ index 4e5fcef8e..663b3658b 100644
|
||||
+ event = obj->shm;
|
||||
+
|
||||
+ /* Acquire the spinlock. */
|
||||
+ while (interlocked_cmpxchg( &event->locked, 1, 0 ))
|
||||
+ while (InterlockedCompareExchange( &event->locked, 1, 0 ))
|
||||
+ small_pause();
|
||||
|
||||
- if (prev)
|
||||
+ /* Only bother signaling the fd if we weren't already signaled. */
|
||||
+ if (!(current = interlocked_xchg( &event->signaled, 1 )))
|
||||
+ if (!(current = InterlockedExchange( &event->signaled, 1 )))
|
||||
{
|
||||
- FIXME("Can't write previous value.\n");
|
||||
- *prev = 1;
|
||||
@ -192,12 +192,12 @@ index 4e5fcef8e..663b3658b 100644
|
||||
+ event = obj->shm;
|
||||
+
|
||||
+ /* Acquire the spinlock. */
|
||||
+ while (interlocked_cmpxchg( &event->locked, 1, 0 ))
|
||||
+ while (InterlockedCompareExchange( &event->locked, 1, 0 ))
|
||||
+ small_pause();
|
||||
|
||||
- if (prev)
|
||||
+ /* Only bother signaling the fd if we weren't already signaled. */
|
||||
+ if ((current = interlocked_xchg( &event->signaled, 0 )))
|
||||
+ if ((current = InterlockedExchange( &event->signaled, 0 )))
|
||||
{
|
||||
- FIXME("Can't write previous value.\n");
|
||||
- *prev = 1;
|
||||
@ -233,7 +233,7 @@ index 4e5fcef8e..663b3658b 100644
|
||||
- *prev = 1;
|
||||
- }
|
||||
+ /* Acquire the spinlock. */
|
||||
+ while (interlocked_cmpxchg( &event->locked, 1, 0 ))
|
||||
+ while (InterlockedCompareExchange( &event->locked, 1, 0 ))
|
||||
+ small_pause();
|
||||
|
||||
/* This isn't really correct; an application could miss the write.
|
||||
@ -242,7 +242,7 @@ index 4e5fcef8e..663b3658b 100644
|
||||
return FILE_GetNtStatus();
|
||||
read( obj->fd, &value, sizeof(value) );
|
||||
|
||||
+ current = interlocked_xchg( &event->signaled, 0 );
|
||||
+ current = InterlockedExchange( &event->signaled, 0 );
|
||||
+ if (prev) *prev = current;
|
||||
+
|
||||
+ /* Release the spinlock. */
|
||||
@ -273,7 +273,7 @@ index 4e5fcef8e..663b3658b 100644
|
||||
+ * fact that we were able to grab it at all means the count is nonzero,
|
||||
+ * and if someone else grabbed it then the count must have been >= 2,
|
||||
+ * etc. */
|
||||
+ interlocked_xchg_add( &semaphore->count, -1 );
|
||||
+ InterlockedDecrement( &semaphore->count );
|
||||
+ }
|
||||
+ else if (obj->type == ESYNC_AUTO_EVENT)
|
||||
+ {
|
||||
@ -340,7 +340,7 @@ index 4e5fcef8e..663b3658b 100644
|
||||
- * the fact that we were able to grab it at all means the count
|
||||
- * is nonzero, and if someone else grabbed it then the count
|
||||
- * must have been >= 2, etc. */
|
||||
- interlocked_xchg_add( &semaphore->count, -1 );
|
||||
- InterlockedDecrement( &semaphore->count );
|
||||
- }
|
||||
+ update_grabbed_object( obj );
|
||||
return i;
|
||||
@ -360,7 +360,7 @@ index 4e5fcef8e..663b3658b 100644
|
||||
- else if (objs[i]->type == ESYNC_SEMAPHORE)
|
||||
- {
|
||||
- struct semaphore *semaphore = objs[i]->shm;
|
||||
- interlocked_xchg_add( &semaphore->count, -1 );
|
||||
- InterlockedDecrement( &semaphore->count );
|
||||
- }
|
||||
- }
|
||||
+ update_grabbed_object( objs[i] );
|
||||
|
@ -78,7 +78,7 @@ index 847f1e974..1fc9316b1 100644
|
||||
+ if (debug_level)
|
||||
+ fprintf( stderr, "esync: Mapping page %d at %p.\n", entry, addr );
|
||||
+
|
||||
+ if (interlocked_cmpxchg_ptr( &shm_addrs[entry], addr, 0 ))
|
||||
+ if (InterlockedCompareExchangePointer( &shm_addrs[entry], addr, 0 ))
|
||||
+ munmap( addr, pagesize ); /* someone beat us to it */
|
||||
+ }
|
||||
+
|
||||
@ -116,10 +116,10 @@ index 847f1e974..1fc9316b1 100644
|
||||
+ fprintf( stderr, "esync_set_event() fd=%d\n", esync->fd );
|
||||
+
|
||||
+ /* Acquire the spinlock. */
|
||||
+ while (interlocked_cmpxchg( &event->locked, 1, 0 ))
|
||||
+ while (InterlockedCompareExchange( &event->locked, 1, 0 ))
|
||||
+ small_pause();
|
||||
+
|
||||
+ if (!interlocked_xchg( &event->signaled, 1 ))
|
||||
+ if (!InterlockedExchange( &event->signaled, 1 ))
|
||||
+ {
|
||||
+ if (write( esync->fd, &value, sizeof(value) ) == -1)
|
||||
+ perror( "esync: write" );
|
||||
@ -143,11 +143,11 @@ index 847f1e974..1fc9316b1 100644
|
||||
+ fprintf( stderr, "esync_reset_event() fd=%d\n", esync->fd );
|
||||
+
|
||||
+ /* Acquire the spinlock. */
|
||||
+ while (interlocked_cmpxchg( &event->locked, 1, 0 ))
|
||||
+ while (InterlockedCompareExchange( &event->locked, 1, 0 ))
|
||||
+ small_pause();
|
||||
+
|
||||
+ /* Only bother signaling the fd if we weren't already signaled. */
|
||||
+ if (interlocked_xchg( &event->signaled, 0 ))
|
||||
+ if (InterlockedExchange( &event->signaled, 0 ))
|
||||
+ {
|
||||
+ /* we don't care about the return value */
|
||||
+ read( esync->fd, &value, sizeof(value) );
|
||||
|
@ -234,7 +234,7 @@ index f5556e91c..19e614a89 100644
|
||||
+ if (debug_level)
|
||||
+ fprintf( stderr, "esync: Mapping page %d at %p.\n", entry, addr );
|
||||
+
|
||||
+ if (interlocked_cmpxchg_ptr( &shm_addrs[entry], addr, 0 ))
|
||||
+ if (InterlockedCompareExchangePointer( &shm_addrs[entry], addr, 0 ))
|
||||
+ munmap( addr, pagesize ); /* someone beat us to it */
|
||||
+ }
|
||||
+
|
||||
@ -340,7 +340,7 @@ index f5556e91c..19e614a89 100644
|
||||
- if (debug_level)
|
||||
- fprintf( stderr, "esync: Mapping page %d at %p.\n", entry, addr );
|
||||
-
|
||||
- if (interlocked_cmpxchg_ptr( &shm_addrs[entry], addr, 0 ))
|
||||
- if (InterlockedCompareExchangePointer( &shm_addrs[entry], addr, 0 ))
|
||||
- munmap( addr, pagesize ); /* someone beat us to it */
|
||||
- }
|
||||
-
|
||||
|
@ -23,7 +23,7 @@ index 597cb8fa8..d9b5b1a70 100644
|
||||
+
|
||||
read( obj->fd, &value, sizeof(value) );
|
||||
|
||||
current = interlocked_xchg( &event->signaled, 0 );
|
||||
current = InterlockedExchange( &event->signaled, 0 );
|
||||
--
|
||||
2.20.1
|
||||
|
||||
|
@ -34,12 +34,12 @@ index 2f030c141..87f303403 100644
|
||||
event = obj->shm;
|
||||
|
||||
- /* Acquire the spinlock. */
|
||||
- while (interlocked_cmpxchg( &event->locked, 1, 0 ))
|
||||
- while (InterlockedCompareExchange( &event->locked, 1, 0 ))
|
||||
- small_pause();
|
||||
+ if (obj->type == ESYNC_MANUAL_EVENT)
|
||||
+ {
|
||||
+ /* Acquire the spinlock. */
|
||||
+ while (interlocked_cmpxchg( &event->locked, 1, 0 ))
|
||||
+ while (InterlockedCompareExchange( &event->locked, 1, 0 ))
|
||||
+ small_pause();
|
||||
+ }
|
||||
+
|
||||
@ -53,8 +53,8 @@ index 2f030c141..87f303403 100644
|
||||
+ * *must* signal the fd now, or any waiting threads will never wake up. */
|
||||
|
||||
/* Only bother signaling the fd if we weren't already signaled. */
|
||||
- if (!(current = interlocked_xchg( &event->signaled, 1 )))
|
||||
+ if (!(current = interlocked_xchg( &event->signaled, 1 )) || obj->type == ESYNC_AUTO_EVENT)
|
||||
- if (!(current = InterlockedExchange( &event->signaled, 1 )))
|
||||
+ if (!(current = InterlockedExchange( &event->signaled, 1 )) || obj->type == ESYNC_AUTO_EVENT)
|
||||
{
|
||||
if (write( obj->fd, &value, sizeof(value) ) == -1)
|
||||
- return FILE_GetNtStatus();
|
||||
@ -78,24 +78,24 @@ index 2f030c141..87f303403 100644
|
||||
event = obj->shm;
|
||||
|
||||
- /* Acquire the spinlock. */
|
||||
- while (interlocked_cmpxchg( &event->locked, 1, 0 ))
|
||||
- while (InterlockedCompareExchange( &event->locked, 1, 0 ))
|
||||
- small_pause();
|
||||
+ if (obj->type == ESYNC_MANUAL_EVENT)
|
||||
+ {
|
||||
+ /* Acquire the spinlock. */
|
||||
+ while (interlocked_cmpxchg( &event->locked, 1, 0 ))
|
||||
+ while (InterlockedCompareExchange( &event->locked, 1, 0 ))
|
||||
+ small_pause();
|
||||
+ }
|
||||
|
||||
- /* Only bother signaling the fd if we weren't already signaled. */
|
||||
- if ((current = interlocked_xchg( &event->signaled, 0 )))
|
||||
- if ((current = InterlockedExchange( &event->signaled, 0 )))
|
||||
+ /* For manual-reset events, as long as we're in a lock, we can take the
|
||||
+ * optimization of only calling read() if the event was already signaled.
|
||||
+ *
|
||||
+ * For auto-reset events, we have no guarantee that the previous "signaled"
|
||||
+ * state is actually correct. We need to leave both states unsignaled after
|
||||
+ * leaving this function, so we always have to read(). */
|
||||
+ if ((current = interlocked_xchg( &event->signaled, 0 )) || obj->type == ESYNC_AUTO_EVENT)
|
||||
+ if ((current = InterlockedExchange( &event->signaled, 0 )) || obj->type == ESYNC_AUTO_EVENT)
|
||||
{
|
||||
- /* we don't care about the return value */
|
||||
- read( obj->fd, &value, sizeof(value) );
|
||||
@ -146,16 +146,16 @@ index 4521993d4..84d0951cb 100644
|
||||
fprintf( stderr, "esync_set_event() fd=%d\n", esync->fd );
|
||||
|
||||
- /* Acquire the spinlock. */
|
||||
- while (interlocked_cmpxchg( &event->locked, 1, 0 ))
|
||||
- while (InterlockedCompareExchange( &event->locked, 1, 0 ))
|
||||
- small_pause();
|
||||
+ if (esync->type == ESYNC_MANUAL_EVENT)
|
||||
+ {
|
||||
+ /* Acquire the spinlock. */
|
||||
+ while (interlocked_cmpxchg( &event->locked, 1, 0 ))
|
||||
+ while (InterlockedCompareExchange( &event->locked, 1, 0 ))
|
||||
+ small_pause();
|
||||
+ }
|
||||
|
||||
if (!interlocked_xchg( &event->signaled, 1 ))
|
||||
if (!InterlockedExchange( &event->signaled, 1 ))
|
||||
{
|
||||
@@ -406,8 +409,11 @@ void esync_set_event( struct esync *esync )
|
||||
perror( "esync: write" );
|
||||
@ -176,17 +176,17 @@ index 4521993d4..84d0951cb 100644
|
||||
fprintf( stderr, "esync_reset_event() fd=%d\n", esync->fd );
|
||||
|
||||
- /* Acquire the spinlock. */
|
||||
- while (interlocked_cmpxchg( &event->locked, 1, 0 ))
|
||||
- while (InterlockedCompareExchange( &event->locked, 1, 0 ))
|
||||
- small_pause();
|
||||
+ if (esync->type == ESYNC_MANUAL_EVENT)
|
||||
+ {
|
||||
+ /* Acquire the spinlock. */
|
||||
+ while (interlocked_cmpxchg( &event->locked, 1, 0 ))
|
||||
+ while (InterlockedCompareExchange( &event->locked, 1, 0 ))
|
||||
+ small_pause();
|
||||
+ }
|
||||
|
||||
/* Only bother signaling the fd if we weren't already signaled. */
|
||||
if (interlocked_xchg( &event->signaled, 0 ))
|
||||
if (InterlockedExchange( &event->signaled, 0 ))
|
||||
@@ -432,8 +441,11 @@ void esync_reset_event( struct esync *esync )
|
||||
read( esync->fd, &value, sizeof(value) );
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 31994d20fb36774cb6cc0652bdd432e524ce4837 Mon Sep 17 00:00:00 2001
|
||||
From b03e8c0e0097e3dfd2c30f1f53f13abaa731b858 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Tue, 3 Mar 2015 03:39:12 +0100
|
||||
Subject: ntdll: Reuse old async fileio structures if possible.
|
||||
Subject: [PATCH] ntdll: Reuse old async fileio structures if possible.
|
||||
|
||||
This should speed up apps which heavily rely on async io stuff. Some
|
||||
tests (using the kernel and ntdll wine tests) show that it is very
|
||||
@ -11,10 +11,10 @@ often possible to reuse old fileio structures.
|
||||
1 file changed, 18 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 264ad65fe0..011e47a1ca 100644
|
||||
index 45660b47ec2e..083a413aac5f 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -352,6 +352,7 @@ struct async_fileio
|
||||
@@ -387,6 +387,7 @@ struct async_fileio
|
||||
{
|
||||
async_callback_t *callback; /* must be the first field */
|
||||
struct async_fileio *next;
|
||||
@ -22,12 +22,12 @@ index 264ad65fe0..011e47a1ca 100644
|
||||
HANDLE handle;
|
||||
};
|
||||
|
||||
@@ -396,18 +397,29 @@ static struct async_fileio *alloc_fileio( DWORD size, async_callback_t callback,
|
||||
@@ -430,18 +431,29 @@ static struct async_fileio *alloc_fileio( DWORD size, async_callback_t callback,
|
||||
{
|
||||
/* first free remaining previous fileinfos */
|
||||
|
||||
- struct async_fileio *io = interlocked_xchg_ptr( (void **)&fileio_freelist, NULL );
|
||||
+ struct async_fileio *old_io = interlocked_xchg_ptr( (void **)&fileio_freelist, NULL );
|
||||
- struct async_fileio *io = InterlockedExchangePointer( (void **)&fileio_freelist, NULL );
|
||||
+ struct async_fileio *old_io = InterlockedExchangePointer( (void **)&fileio_freelist, NULL );
|
||||
+ struct async_fileio *io = NULL;
|
||||
|
||||
- while (io)
|
||||
@ -59,5 +59,5 @@ index 264ad65fe0..011e47a1ca 100644
|
||||
}
|
||||
return io;
|
||||
--
|
||||
2.11.0
|
||||
2.26.2
|
||||
|
||||
|
@ -1,90 +0,0 @@
|
||||
From 334c3d93fc14f11be5b750c539f61a9ae88a943f Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 03:37:47 +0200
|
||||
Subject: [PATCH] include: Move interlocked_inc/dec to port.h.
|
||||
|
||||
---
|
||||
dlls/ntdll/critsection.c | 10 ----------
|
||||
dlls/ntdll/threadpool.c | 10 ----------
|
||||
include/wine/port.h | 14 +++++++++++++-
|
||||
3 files changed, 13 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/critsection.c b/dlls/ntdll/critsection.c
|
||||
index 1892d3abcb7..95acc321240 100644
|
||||
--- a/dlls/ntdll/critsection.c
|
||||
+++ b/dlls/ntdll/critsection.c
|
||||
@@ -40,16 +40,6 @@
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
|
||||
WINE_DECLARE_DEBUG_CHANNEL(relay);
|
||||
|
||||
-static inline LONG interlocked_inc( PLONG dest )
|
||||
-{
|
||||
- return interlocked_xchg_add( dest, 1 ) + 1;
|
||||
-}
|
||||
-
|
||||
-static inline LONG interlocked_dec( PLONG dest )
|
||||
-{
|
||||
- return interlocked_xchg_add( dest, -1 ) - 1;
|
||||
-}
|
||||
-
|
||||
static inline void small_pause(void)
|
||||
{
|
||||
#ifdef __i386__
|
||||
diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c
|
||||
index 215a5e9c53a..6ee739b9c02 100644
|
||||
--- a/dlls/ntdll/threadpool.c
|
||||
+++ b/dlls/ntdll/threadpool.c
|
||||
@@ -378,16 +378,6 @@ static void tp_object_prepare_shutdown( struct threadpool_object *object );
|
||||
static BOOL tp_object_release( struct threadpool_object *object );
|
||||
static struct threadpool *default_threadpool = NULL;
|
||||
|
||||
-static inline LONG interlocked_inc( PLONG dest )
|
||||
-{
|
||||
- return interlocked_xchg_add( dest, 1 ) + 1;
|
||||
-}
|
||||
-
|
||||
-static inline LONG interlocked_dec( PLONG dest )
|
||||
-{
|
||||
- return interlocked_xchg_add( dest, -1 ) - 1;
|
||||
-}
|
||||
-
|
||||
static BOOL array_reserve(void **elements, unsigned int *capacity, unsigned int count, unsigned int size)
|
||||
{
|
||||
unsigned int new_capacity, max_capacity;
|
||||
diff --git a/include/wine/port.h b/include/wine/port.h
|
||||
index 8514a4a43bf..60c95af6cb5 100644
|
||||
--- a/include/wine/port.h
|
||||
+++ b/include/wine/port.h
|
||||
@@ -479,6 +479,16 @@ static inline __int64 interlocked_cmpxchg64( __int64 *dest, __int64 xchg, __int6
|
||||
extern __int64 interlocked_cmpxchg64( __int64 *dest, __int64 xchg, __int64 compare );
|
||||
#endif
|
||||
|
||||
+static inline int interlocked_inc( int *dest )
|
||||
+{
|
||||
+ return interlocked_xchg_add( dest, 1 ) + 1;
|
||||
+}
|
||||
+
|
||||
+static inline int interlocked_dec( int *dest )
|
||||
+{
|
||||
+ return interlocked_xchg_add( dest, -1 ) - 1;
|
||||
+}
|
||||
+
|
||||
#else /* NO_LIBWINE_PORT */
|
||||
|
||||
#define __WINE_NOT_PORTABLE(func) func##_is_not_portable func##_is_not_portable
|
||||
@@ -489,9 +499,11 @@ extern __int64 interlocked_cmpxchg64( __int64 *dest, __int64 xchg, __int64 compa
|
||||
#define getopt_long_only __WINE_NOT_PORTABLE(getopt_long_only)
|
||||
#define interlocked_cmpxchg __WINE_NOT_PORTABLE(interlocked_cmpxchg)
|
||||
#define interlocked_cmpxchg_ptr __WINE_NOT_PORTABLE(interlocked_cmpxchg_ptr)
|
||||
+#define interlocked_dec __WINE_NOT_PORTABLE(interlocked_dec)
|
||||
+#define interlocked_inc __WINE_NOT_PORTABLE(interlocked_inc)
|
||||
#define interlocked_xchg __WINE_NOT_PORTABLE(interlocked_xchg)
|
||||
-#define interlocked_xchg_ptr __WINE_NOT_PORTABLE(interlocked_xchg_ptr)
|
||||
#define interlocked_xchg_add __WINE_NOT_PORTABLE(interlocked_xchg_add)
|
||||
+#define interlocked_xchg_ptr __WINE_NOT_PORTABLE(interlocked_xchg_ptr)
|
||||
#define lstat __WINE_NOT_PORTABLE(lstat)
|
||||
#define pread __WINE_NOT_PORTABLE(pread)
|
||||
#define pwrite __WINE_NOT_PORTABLE(pwrite)
|
||||
--
|
||||
2.26.0
|
||||
|
@ -29,7 +29,7 @@ index 84866721a07..303cad1764a 100644
|
||||
+/* inline version of RtlEnterCriticalSection */
|
||||
+static inline void enter_critical_section( RTL_CRITICAL_SECTION *crit )
|
||||
+{
|
||||
+ if (interlocked_inc( &crit->LockCount ))
|
||||
+ if (InterlockedIncrement( &crit->LockCount ))
|
||||
+ {
|
||||
+ if (crit->OwningThread == ULongToHandle(GetCurrentThreadId()))
|
||||
+ {
|
||||
@ -48,13 +48,13 @@ index 84866721a07..303cad1764a 100644
|
||||
+ WINE_DECLARE_DEBUG_CHANNEL(ntdll);
|
||||
+ if (--crit->RecursionCount)
|
||||
+ {
|
||||
+ if (crit->RecursionCount > 0) interlocked_dec( &crit->LockCount );
|
||||
+ if (crit->RecursionCount > 0) InterlockedDecrement( &crit->LockCount );
|
||||
+ else ERR_(ntdll)( "section %p is not acquired\n", crit );
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ crit->OwningThread = 0;
|
||||
+ if (interlocked_dec( &crit->LockCount ) >= 0)
|
||||
+ if (InterlockedDecrement( &crit->LockCount ) >= 0)
|
||||
+ RtlpUnWaitCriticalSection( crit );
|
||||
+ }
|
||||
+}
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 7fb74639d7598c653bbd70fef5c58c9a1c1541d3 Mon Sep 17 00:00:00 2001
|
||||
From 7dcc94642b6771f949fa2ff747a2f992e862157d Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 03:39:37 +0200
|
||||
Subject: [PATCH] ntdll: Use fast CS functions for threadpool locking.
|
||||
@ -8,7 +8,7 @@ Subject: [PATCH] ntdll: Use fast CS functions for threadpool locking.
|
||||
1 file changed, 48 insertions(+), 48 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c
|
||||
index 6ee739b9c02..94d6efced9e 100644
|
||||
index 451d441f5725..253a13002950 100644
|
||||
--- a/dlls/ntdll/threadpool.c
|
||||
+++ b/dlls/ntdll/threadpool.c
|
||||
@@ -1279,7 +1279,7 @@ static void CALLBACK timerqueue_thread_proc( void *param )
|
||||
@ -176,7 +176,7 @@ index 6ee739b9c02..94d6efced9e 100644
|
||||
|
||||
@@ -2125,10 +2125,10 @@ static void tp_object_initialize( struct threadpool_object *object, struct threa
|
||||
struct threadpool_group *group = object->group;
|
||||
interlocked_inc( &group->refcount );
|
||||
InterlockedIncrement( &group->refcount );
|
||||
|
||||
- RtlEnterCriticalSection( &group->cs );
|
||||
+ enter_critical_section( &group->cs );
|
||||
@ -413,5 +413,5 @@ index 6ee739b9c02..94d6efced9e 100644
|
||||
if (submit_wait)
|
||||
tp_object_submit( this, FALSE );
|
||||
--
|
||||
2.26.0
|
||||
2.26.2
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 5f8071c1a278c96b1fd0a83b4b9924ed69520e5e Mon Sep 17 00:00:00 2001
|
||||
From 74693bc85e3dbc1f757cfea348dc385b4badeb89 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Tue, 19 Aug 2014 22:10:49 -0600
|
||||
Subject: [PATCH] ntdll: Implement retrieving DOS attributes in
|
||||
@ -14,7 +14,7 @@ Subject: [PATCH] ntdll: Implement retrieving DOS attributes in
|
||||
create mode 100644 libs/port/xattr.c
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index af9175dfaad..4cbd823f5e0 100644
|
||||
index 180d958fc4ef..1e3d2e0d4ef0 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -89,6 +89,7 @@ AC_ARG_WITH(usb, AS_HELP_STRING([--without-usb],[do not use the libusb lib
|
||||
@ -25,7 +25,7 @@ index af9175dfaad..4cbd823f5e0 100644
|
||||
AC_ARG_WITH(xcomposite,AS_HELP_STRING([--without-xcomposite],[do not use the Xcomposite extension]),
|
||||
[if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_Xcomposite_h=no; fi])
|
||||
AC_ARG_WITH(xcursor, AS_HELP_STRING([--without-xcursor],[do not use the Xcursor extension]),
|
||||
@@ -699,6 +700,17 @@ AC_CHECK_HEADERS([libprocstat.h],,,
|
||||
@@ -709,6 +710,17 @@ AC_CHECK_HEADERS([libprocstat.h],,,
|
||||
#include <sys/socket.h>
|
||||
#endif])
|
||||
|
||||
@ -44,7 +44,7 @@ index af9175dfaad..4cbd823f5e0 100644
|
||||
|
||||
AC_SUBST(DLLFLAGS,"-D_REENTRANT")
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 583da3a236e..f8227f10163 100644
|
||||
index 9a9acfdb623b..5536e61db2e4 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -126,6 +126,22 @@ mode_t FILE_umask = 0;
|
||||
@ -71,7 +71,7 @@ index 583da3a236e..f8227f10163 100644
|
||||
static inline ULONG get_file_attributes( const struct stat *st )
|
||||
{
|
||||
diff --git a/include/wine/port.h b/include/wine/port.h
|
||||
index 5a805c11993..c0efa12fbde 100644
|
||||
index e8434c73cca2..f0507efcc7e7 100644
|
||||
--- a/include/wine/port.h
|
||||
+++ b/include/wine/port.h
|
||||
@@ -361,6 +361,14 @@ int usleep (unsigned int useconds);
|
||||
@ -86,14 +86,14 @@ index 5a805c11993..c0efa12fbde 100644
|
||||
+
|
||||
+extern int xattr_fget( int filedes, const char *name, void *value, size_t size );
|
||||
+
|
||||
/* Interlocked functions */
|
||||
#else /* NO_LIBWINE_PORT */
|
||||
|
||||
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
|
||||
#define __WINE_NOT_PORTABLE(func) func##_is_not_portable func##_is_not_portable
|
||||
diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in
|
||||
index 695938ae434..9796bc40537 100644
|
||||
index 1963afe24232..4b1ecab7516b 100644
|
||||
--- a/libs/port/Makefile.in
|
||||
+++ b/libs/port/Makefile.in
|
||||
@@ -23,4 +23,5 @@ C_SRCS = \
|
||||
@@ -22,4 +22,5 @@ C_SRCS = \
|
||||
strnlen.c \
|
||||
symlink.c \
|
||||
usleep.c \
|
||||
@ -102,7 +102,7 @@ index 695938ae434..9796bc40537 100644
|
||||
+ xattr.c
|
||||
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
|
||||
new file mode 100644
|
||||
index 00000000000..94b77132bbf
|
||||
index 000000000000..94b77132bbf2
|
||||
--- /dev/null
|
||||
+++ b/libs/port/xattr.c
|
||||
@@ -0,0 +1,39 @@
|
||||
@ -146,5 +146,5 @@ index 00000000000..94b77132bbf
|
||||
+#endif
|
||||
+}
|
||||
--
|
||||
2.25.1
|
||||
2.26.2
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 4f3272686f4ae084510f96baa5ad52bbf74d3d8d Mon Sep 17 00:00:00 2001
|
||||
From 34ed49d7dbff7c5f0da8553330c3378b574429fc Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 20 Aug 2014 16:04:34 -0600
|
||||
Subject: [PATCH] ntdll: Implement retrieving DOS attributes in
|
||||
@ -11,10 +11,10 @@ Subject: [PATCH] ntdll: Implement retrieving DOS attributes in
|
||||
3 files changed, 16 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 43a13cd8fdf..74b346b51e8 100644
|
||||
index 5536e61db2e4..2fd62ebfb802 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -183,7 +183,8 @@ int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULONG *attr
|
||||
@@ -182,7 +182,8 @@ int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULONG *attr
|
||||
int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
{
|
||||
char *parent_path;
|
||||
@ -24,7 +24,7 @@ index 43a13cd8fdf..74b346b51e8 100644
|
||||
|
||||
*attr = 0;
|
||||
ret = lstat( path, st );
|
||||
@@ -216,6 +217,9 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
@@ -215,6 +216,9 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
RtlFreeHeap( GetProcessHeap(), 0, parent_path );
|
||||
}
|
||||
*attr |= get_file_attributes( st );
|
||||
@ -35,19 +35,19 @@ index 43a13cd8fdf..74b346b51e8 100644
|
||||
}
|
||||
|
||||
diff --git a/include/wine/port.h b/include/wine/port.h
|
||||
index 8fec3a34591..570988a9422 100644
|
||||
index f0507efcc7e7..6e81cb71a76d 100644
|
||||
--- a/include/wine/port.h
|
||||
+++ b/include/wine/port.h
|
||||
@@ -363,6 +363,7 @@ extern int mkstemps(char *template, int suffix_len);
|
||||
@@ -368,6 +368,7 @@ extern int mkstemps(char *template, int suffix_len);
|
||||
#endif
|
||||
|
||||
extern int xattr_fget( int filedes, const char *name, void *value, size_t size );
|
||||
+extern int xattr_get( const char *path, const char *name, void *value, size_t size );
|
||||
|
||||
/* Interlocked functions */
|
||||
#else /* NO_LIBWINE_PORT */
|
||||
|
||||
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
|
||||
index 94b77132bbf..88e900dac6d 100644
|
||||
index 94b77132bbf2..88e900dac6d4 100644
|
||||
--- a/libs/port/xattr.c
|
||||
+++ b/libs/port/xattr.c
|
||||
@@ -37,3 +37,13 @@ int xattr_fget( int filedes, const char *name, void *value, size_t size )
|
||||
@ -65,5 +65,5 @@ index 94b77132bbf..88e900dac6d 100644
|
||||
+#endif
|
||||
+}
|
||||
--
|
||||
2.25.1
|
||||
2.26.2
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From b8d44b453c650178926c9d2a4eb44a3f05d34389 Mon Sep 17 00:00:00 2001
|
||||
From 1a04bc9a0ef3cf03b89d50becee9240f8a195873 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 20 Aug 2014 00:08:52 -0600
|
||||
Subject: [PATCH] ntdll: Implement storing DOS attributes in
|
||||
@ -12,10 +12,10 @@ Subject: [PATCH] ntdll: Implement storing DOS attributes in
|
||||
4 files changed, 60 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 71706c832..674e0abea 100644
|
||||
index 2fd62ebfb802..c077add9769e 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -169,6 +169,39 @@ int fd_get_file_info( int fd, struct stat *st, ULONG *attr )
|
||||
@@ -178,6 +178,39 @@ int fd_get_file_info( int fd, unsigned int options, struct stat *st, ULONG *attr
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ index 71706c832..674e0abea 100644
|
||||
/* get the stat info and file attributes for a file (by name) */
|
||||
int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
{
|
||||
@@ -3050,7 +3083,6 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
|
||||
@@ -3240,7 +3273,6 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
|
||||
case FileBasicInformation:
|
||||
if (len >= sizeof(FILE_BASIC_INFORMATION))
|
||||
{
|
||||
@ -63,7 +63,7 @@ index 71706c832..674e0abea 100644
|
||||
const FILE_BASIC_INFORMATION *info = ptr;
|
||||
LARGE_INTEGER mtime, atime;
|
||||
|
||||
@@ -3064,25 +3096,7 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
|
||||
@@ -3254,25 +3286,7 @@ NTSTATUS WINAPI NtSetInformationFile(HANDLE handle, PIO_STATUS_BLOCK io,
|
||||
io->u.Status = set_file_times( fd, &mtime, &atime );
|
||||
|
||||
if (io->u.Status == STATUS_SUCCESS && info->FileAttributes)
|
||||
@ -91,10 +91,10 @@ index 71706c832..674e0abea 100644
|
||||
if (needs_close) close( fd );
|
||||
}
|
||||
diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c
|
||||
index cfc48c4ab..e59cdba5e 100644
|
||||
index 0b05c39685cd..b49a9a4dbbda 100644
|
||||
--- a/dlls/ntdll/tests/file.c
|
||||
+++ b/dlls/ntdll/tests/file.c
|
||||
@@ -1364,7 +1364,7 @@ static void test_file_basic_information(void)
|
||||
@@ -1365,7 +1365,7 @@ static void test_file_basic_information(void)
|
||||
memset(&fbi, 0, sizeof(fbi));
|
||||
res = pNtQueryInformationFile(h, &io, &fbi, sizeof fbi, FileBasicInformation);
|
||||
ok ( res == STATUS_SUCCESS, "can't get attributes\n");
|
||||
@ -103,7 +103,7 @@ index cfc48c4ab..e59cdba5e 100644
|
||||
|
||||
/* Then HIDDEN */
|
||||
memset(&fbi, 0, sizeof(fbi));
|
||||
@@ -1377,7 +1377,7 @@ static void test_file_basic_information(void)
|
||||
@@ -1378,7 +1378,7 @@ static void test_file_basic_information(void)
|
||||
memset(&fbi, 0, sizeof(fbi));
|
||||
res = pNtQueryInformationFile(h, &io, &fbi, sizeof fbi, FileBasicInformation);
|
||||
ok ( res == STATUS_SUCCESS, "can't get attributes\n");
|
||||
@ -112,7 +112,7 @@ index cfc48c4ab..e59cdba5e 100644
|
||||
|
||||
/* Check NORMAL last of all (to make sure we can clear attributes) */
|
||||
memset(&fbi, 0, sizeof(fbi));
|
||||
@@ -1434,7 +1434,7 @@ static void test_file_all_information(void)
|
||||
@@ -1435,7 +1435,7 @@ static void test_file_all_information(void)
|
||||
memset(&fai_buf.fai, 0, sizeof(fai_buf.fai));
|
||||
res = pNtQueryInformationFile(h, &io, &fai_buf.fai, sizeof fai_buf, FileAllInformation);
|
||||
ok ( res == STATUS_SUCCESS, "can't get attributes, res %x\n", res);
|
||||
@ -121,7 +121,7 @@ index cfc48c4ab..e59cdba5e 100644
|
||||
|
||||
/* Then HIDDEN */
|
||||
memset(&fai_buf.fai.BasicInformation, 0, sizeof(fai_buf.fai.BasicInformation));
|
||||
@@ -1447,7 +1447,7 @@ static void test_file_all_information(void)
|
||||
@@ -1448,7 +1448,7 @@ static void test_file_all_information(void)
|
||||
memset(&fai_buf.fai, 0, sizeof(fai_buf.fai));
|
||||
res = pNtQueryInformationFile(h, &io, &fai_buf.fai, sizeof fai_buf, FileAllInformation);
|
||||
ok ( res == STATUS_SUCCESS, "can't get attributes\n");
|
||||
@ -131,10 +131,10 @@ index cfc48c4ab..e59cdba5e 100644
|
||||
/* Check NORMAL last of all (to make sure we can clear attributes) */
|
||||
memset(&fai_buf.fai.BasicInformation, 0, sizeof(fai_buf.fai.BasicInformation));
|
||||
diff --git a/include/wine/port.h b/include/wine/port.h
|
||||
index d4fc47080..44375d94e 100644
|
||||
index 6e81cb71a76d..f90396727d6d 100644
|
||||
--- a/include/wine/port.h
|
||||
+++ b/include/wine/port.h
|
||||
@@ -351,6 +351,8 @@ extern int mkstemps(char *template, int suffix_len);
|
||||
@@ -368,6 +368,8 @@ extern int mkstemps(char *template, int suffix_len);
|
||||
#endif
|
||||
|
||||
extern int xattr_fget( int filedes, const char *name, void *value, size_t size );
|
||||
@ -142,9 +142,9 @@ index d4fc47080..44375d94e 100644
|
||||
+extern int xattr_fset( int filedes, const char *name, void *value, size_t size );
|
||||
extern int xattr_get( const char *path, const char *name, void *value, size_t size );
|
||||
|
||||
/* Interlocked functions */
|
||||
#else /* NO_LIBWINE_PORT */
|
||||
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
|
||||
index 88e900dac..6918c9956 100644
|
||||
index 88e900dac6d4..6918c9956cc6 100644
|
||||
--- a/libs/port/xattr.c
|
||||
+++ b/libs/port/xattr.c
|
||||
@@ -38,6 +38,26 @@ int xattr_fget( int filedes, const char *name, void *value, size_t size )
|
||||
@ -175,5 +175,5 @@ index 88e900dac..6918c9956 100644
|
||||
{
|
||||
#if defined(HAVE_ATTR_XATTR_H)
|
||||
--
|
||||
2.22.0
|
||||
2.26.2
|
||||
|
||||
|
@ -1,20 +1,20 @@
|
||||
From e8aeb367e785ab32686c94c11b18ddcee9911206 Mon Sep 17 00:00:00 2001
|
||||
From 8fde8af21e169d9a48bab50bac4d6e24238141b6 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Wed, 20 Aug 2014 15:28:00 -0600
|
||||
Subject: [PATCH] ntdll: Implement storing DOS attributes in NtCreateFile.
|
||||
|
||||
---
|
||||
dlls/ntdll/file.c | 76 ++++++++++++++++++++++++++++----------------
|
||||
dlls/ntdll/tests/directory.c | 24 +++++++-------
|
||||
include/wine/port.h | 2 ++
|
||||
libs/port/xattr.c | 20 ++++++++++++
|
||||
dlls/ntdll/file.c | 76 +++++++++++++++++++++++-------------
|
||||
dlls/ntdll/tests/directory.c | 24 ++++++------
|
||||
include/wine/port.h | 2 +
|
||||
libs/port/xattr.c | 20 ++++++++++
|
||||
4 files changed, 82 insertions(+), 40 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c
|
||||
index 38c555e..3a96d3b 100644
|
||||
index c077add9769e..a596afed72e7 100644
|
||||
--- a/dlls/ntdll/file.c
|
||||
+++ b/dlls/ntdll/file.c
|
||||
@@ -224,6 +224,21 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
@@ -255,6 +255,21 @@ int get_file_info( const char *path, struct stat *st, ULONG *attr )
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ index 38c555e..3a96d3b 100644
|
||||
/**************************************************************************
|
||||
* FILE_CreateFile (internal)
|
||||
* Open a file.
|
||||
@@ -235,6 +250,10 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
@@ -266,6 +281,10 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
ULONG attributes, ULONG sharing, ULONG disposition,
|
||||
ULONG options, PVOID ea_buffer, ULONG ea_length )
|
||||
{
|
||||
@ -47,7 +47,7 @@ index 38c555e..3a96d3b 100644
|
||||
ANSI_STRING unix_name;
|
||||
BOOL created = FALSE;
|
||||
|
||||
@@ -278,37 +297,34 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
@@ -309,37 +328,34 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
io->u.Status = STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ index 38c555e..3a96d3b 100644
|
||||
|
||||
if (io->u.Status == STATUS_SUCCESS)
|
||||
{
|
||||
@@ -330,6 +346,11 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
@@ -361,6 +377,11 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
io->Information = FILE_OVERWRITTEN;
|
||||
break;
|
||||
}
|
||||
@ -121,7 +121,7 @@ index 38c555e..3a96d3b 100644
|
||||
}
|
||||
else if (io->u.Status == STATUS_TOO_MANY_OPENED_FILES)
|
||||
{
|
||||
@@ -337,6 +358,7 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
@@ -368,6 +389,7 @@ static NTSTATUS FILE_CreateFile( PHANDLE handle, ACCESS_MASK access, POBJECT_ATT
|
||||
if (!once++) ERR_(winediag)( "Too many open files, ulimit -n probably needs to be increased\n" );
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ index 38c555e..3a96d3b 100644
|
||||
}
|
||||
|
||||
diff --git a/dlls/ntdll/tests/directory.c b/dlls/ntdll/tests/directory.c
|
||||
index 2c6170b..0eed603 100644
|
||||
index 4618f4eaff2b..44933c2153df 100644
|
||||
--- a/dlls/ntdll/tests/directory.c
|
||||
+++ b/dlls/ntdll/tests/directory.c
|
||||
@@ -55,7 +55,6 @@ static NTSTATUS (WINAPI *pRtlWow64EnableFsRedirectionEx)( ULONG disable, ULONG *
|
||||
@ -179,20 +179,20 @@ index 2c6170b..0eed603 100644
|
||||
}
|
||||
testfiles[i].nfound++;
|
||||
diff --git a/include/wine/port.h b/include/wine/port.h
|
||||
index e30a744..741cf27 100644
|
||||
index f90396727d6d..7d2c73887073 100644
|
||||
--- a/include/wine/port.h
|
||||
+++ b/include/wine/port.h
|
||||
@@ -401,6 +401,8 @@ extern int xattr_fget( int filedes, const char *name, void *value, size_t size )
|
||||
@@ -371,6 +371,8 @@ extern int xattr_fget( int filedes, const char *name, void *value, size_t size )
|
||||
extern int xattr_fremove( int filedes, const char *name );
|
||||
extern int xattr_fset( int filedes, const char *name, void *value, size_t size );
|
||||
extern int xattr_get( const char *path, const char *name, void *value, size_t size );
|
||||
+extern int xattr_remove( const char *path, const char *name );
|
||||
+extern int xattr_set( const char *path, const char *name, void *value, size_t size );
|
||||
|
||||
/* Interlocked functions */
|
||||
#else /* NO_LIBWINE_PORT */
|
||||
|
||||
diff --git a/libs/port/xattr.c b/libs/port/xattr.c
|
||||
index 6918c99..683e7a6 100644
|
||||
index 6918c9956cc6..683e7a615e2b 100644
|
||||
--- a/libs/port/xattr.c
|
||||
+++ b/libs/port/xattr.c
|
||||
@@ -67,3 +67,23 @@ int xattr_get( const char *path, const char *name, void *value, size_t size )
|
||||
@ -220,5 +220,5 @@ index 6918c99..683e7a6 100644
|
||||
+#endif
|
||||
+}
|
||||
--
|
||||
1.9.1
|
||||
2.26.2
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 55a04c83c276864d4f442c3e9c33b36b4e9bdfb6 Mon Sep 17 00:00:00 2001
|
||||
From 6c463b0bd58fb0830271582e5dd916f936084daf Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 30 May 2015 02:23:15 +0200
|
||||
Subject: [PATCH] ntdll: Add support for hiding wine version information from
|
||||
@ -10,10 +10,10 @@ Subject: [PATCH] ntdll: Add support for hiding wine version information from
|
||||
2 files changed, 104 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index 6ba7b15c09e..b90e1516614 100644
|
||||
index 926098ebf50a..4cf7fed9e1b2 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -70,6 +70,7 @@ const WCHAR system_dir[] = {'C',':','\\','w','i','n','d','o','w','s','\\',
|
||||
@@ -78,6 +78,7 @@ const WCHAR system_dir[] = {'C',':','\\','w','i','n','d','o','w','s','\\',
|
||||
const WCHAR syswow64_dir[] = {'C',':','\\','w','i','n','d','o','w','s','\\',
|
||||
's','y','s','w','o','w','6','4','\\',0};
|
||||
|
||||
@ -21,7 +21,7 @@ index 6ba7b15c09e..b90e1516614 100644
|
||||
/* system search path */
|
||||
static const WCHAR system_path[] =
|
||||
{'C',':','\\','w','i','n','d','o','w','s','\\','s','y','s','t','e','m','3','2',';',
|
||||
@@ -78,6 +79,9 @@ static const WCHAR system_path[] =
|
||||
@@ -86,6 +87,9 @@ static const WCHAR system_path[] =
|
||||
|
||||
static const WCHAR dotW[] = {'.',0};
|
||||
|
||||
@ -31,7 +31,7 @@ index 6ba7b15c09e..b90e1516614 100644
|
||||
static BOOL imports_fixup_done = FALSE; /* set once the imports have been fixed up, before attaching them */
|
||||
static BOOL process_detaching = FALSE; /* set on process detach to avoid deadlocks with thread detach */
|
||||
static int free_lib_count; /* recursion depth of LdrUnloadDll calls */
|
||||
@@ -94,6 +98,8 @@ struct dll_dir_entry
|
||||
@@ -102,6 +106,8 @@ struct dll_dir_entry
|
||||
|
||||
static struct list dll_dir_list = LIST_INIT( dll_dir_list ); /* extra dirs from LdrAddDllDirectory */
|
||||
|
||||
@ -40,7 +40,7 @@ index 6ba7b15c09e..b90e1516614 100644
|
||||
struct ldr_notification
|
||||
{
|
||||
struct list entry;
|
||||
@@ -1710,6 +1716,96 @@ NTSTATUS WINAPI LdrUnlockLoaderLock( ULONG flags, ULONG_PTR magic )
|
||||
@@ -1872,6 +1878,96 @@ NTSTATUS WINAPI LdrUnlockLoaderLock( ULONG flags, ULONG_PTR magic )
|
||||
}
|
||||
|
||||
|
||||
@ -137,7 +137,7 @@ index 6ba7b15c09e..b90e1516614 100644
|
||||
/******************************************************************
|
||||
* LdrGetProcedureAddress (NTDLL.@)
|
||||
*/
|
||||
@@ -1730,7 +1826,7 @@ NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE module, const ANSI_STRING *name,
|
||||
@@ -1892,7 +1988,7 @@ NTSTATUS WINAPI LdrGetProcedureAddress(HMODULE module, const ANSI_STRING *name,
|
||||
LPCWSTR load_path = NtCurrentTeb()->Peb->ProcessParameters->DllPath.Buffer;
|
||||
void *proc = name ? find_named_export( module, exports, exp_size, name->Buffer, -1, load_path )
|
||||
: find_ordinal_export( module, exports, exp_size, ord - exports->Base, load_path );
|
||||
@ -146,7 +146,7 @@ index 6ba7b15c09e..b90e1516614 100644
|
||||
{
|
||||
*address = proc;
|
||||
ret = STATUS_SUCCESS;
|
||||
@@ -4349,6 +4445,8 @@ void __wine_process_init(void)
|
||||
@@ -4739,6 +4835,8 @@ void __wine_process_init(void)
|
||||
NtTerminateProcess( GetCurrentProcess(), status );
|
||||
}
|
||||
|
||||
@ -156,12 +156,12 @@ index 6ba7b15c09e..b90e1516614 100644
|
||||
|
||||
/* elevate process if necessary */
|
||||
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
|
||||
index 84500602bb8..e8559c040a3 100644
|
||||
index 7d631cb33ddb..8256ec710a00 100644
|
||||
--- a/dlls/ntdll/ntdll_misc.h
|
||||
+++ b/dlls/ntdll/ntdll_misc.h
|
||||
@@ -274,6 +274,11 @@ extern SYSTEM_CPU_INFORMATION cpu_info DECLSPEC_HIDDEN;
|
||||
NTSTATUS WINAPI RtlHashUnicodeString(PCUNICODE_STRING,BOOLEAN,ULONG,ULONG*);
|
||||
void WINAPI LdrInitializeThunk(CONTEXT*,void**,ULONG_PTR,ULONG_PTR);
|
||||
@@ -347,6 +347,11 @@ void WINAPI LdrInitializeThunk(CONTEXT*,void**,ULONG_PTR,ULONG_PTR);
|
||||
#define InterlockedCompareExchange64(dest,xchg,cmp) RtlInterlockedCompareExchange64(dest,xchg,cmp)
|
||||
#endif
|
||||
|
||||
+/* version */
|
||||
+extern const char * CDECL NTDLL_wine_get_version(void);
|
||||
@ -172,5 +172,5 @@ index 84500602bb8..e8559c040a3 100644
|
||||
extern BOOL read_process_time(int unix_pid, int unix_tid, unsigned long clk_tck,
|
||||
LARGE_INTEGER *kernel, LARGE_INTEGER *user) DECLSPEC_HIDDEN;
|
||||
--
|
||||
2.17.1
|
||||
2.26.2
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user