Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
November 2021
- 83 participants
- 2620 messages
[PATCH v5 1/3] uiautomationcore: Implement UiaGetReservedNotSupportedValue.
by Connor McAdams
Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com>
---
dlls/uiautomationcore/Makefile.in | 1 +
dlls/uiautomationcore/uia_main.c | 131 +++++++++++++++++++++++++++++-
2 files changed, 130 insertions(+), 2 deletions(-)
diff --git a/dlls/uiautomationcore/Makefile.in b/dlls/uiautomationcore/Makefile.in
index 71ea7b99c94..5a72ea144c4 100644
--- a/dlls/uiautomationcore/Makefile.in
+++ b/dlls/uiautomationcore/Makefile.in
@@ -1,5 +1,6 @@
MODULE = uiautomationcore.dll
IMPORTLIB = uiautomationcore
+IMPORTS = uuid ole32
EXTRADLLFLAGS = -Wb,--prefer-native
diff --git a/dlls/uiautomationcore/uia_main.c b/dlls/uiautomationcore/uia_main.c
index 2dada95af80..77cacb7c4a4 100644
--- a/dlls/uiautomationcore/uia_main.c
+++ b/dlls/uiautomationcore/uia_main.c
@@ -16,12 +16,134 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#define COBJMACROS
+
#include "uiautomation.h"
#include "wine/debug.h"
+#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(uiautomation);
+struct uia_object_wrapper
+{
+ IUnknown IUnknown_iface;
+ LONG refcount;
+
+ IUnknown *marshaler;
+ IUnknown *marshal_object;
+};
+
+static struct uia_object_wrapper *impl_uia_object_wrapper_from_IUnknown(IUnknown *iface)
+{
+ return CONTAINING_RECORD(iface, struct uia_object_wrapper, IUnknown_iface);
+}
+
+static HRESULT WINAPI uia_object_wrapper_QueryInterface(IUnknown *iface,
+ REFIID riid, void **ppv)
+{
+ struct uia_object_wrapper *wrapper = impl_uia_object_wrapper_from_IUnknown(iface);
+ return IUnknown_QueryInterface(wrapper->marshal_object, riid, ppv);
+}
+
+static ULONG WINAPI uia_object_wrapper_AddRef(IUnknown *iface)
+{
+ struct uia_object_wrapper *wrapper = impl_uia_object_wrapper_from_IUnknown(iface);
+ ULONG refcount = InterlockedIncrement(&wrapper->refcount);
+
+ TRACE("%p, refcount %d\n", iface, refcount);
+
+ return refcount;
+}
+
+static ULONG WINAPI uia_object_wrapper_Release(IUnknown *iface)
+{
+ struct uia_object_wrapper *wrapper = impl_uia_object_wrapper_from_IUnknown(iface);
+ ULONG refcount = InterlockedDecrement(&wrapper->refcount);
+
+ TRACE("%p, refcount %d\n", iface, refcount);
+ if (!refcount)
+ {
+ IUnknown_Release(wrapper->marshaler);
+ heap_free(wrapper);
+ }
+
+ return refcount;
+}
+
+static const IUnknownVtbl uia_object_wrapper_vtbl = {
+ uia_object_wrapper_QueryInterface,
+ uia_object_wrapper_AddRef,
+ uia_object_wrapper_Release,
+};
+
+/*
+ * When passing the ReservedNotSupportedValue/ReservedMixedAttributeValue
+ * interface pointers across apartments within the same process, create a free
+ * threaded marshaler so that the pointer value is preserved.
+ */
+static HRESULT create_uia_object_wrapper(IUnknown *reserved, void **ppv)
+{
+ struct uia_object_wrapper *wrapper;
+ HRESULT hr;
+
+ TRACE("%p, %p\n", reserved, ppv);
+
+ wrapper = heap_alloc(sizeof(*wrapper));
+ if (!wrapper)
+ return E_OUTOFMEMORY;
+
+ wrapper->IUnknown_iface.lpVtbl = &uia_object_wrapper_vtbl;
+ wrapper->marshal_object = reserved;
+ wrapper->refcount = 1;
+
+ if (FAILED(hr = CoCreateFreeThreadedMarshaler(&wrapper->IUnknown_iface, &wrapper->marshaler)))
+ {
+ heap_free(wrapper);
+ return hr;
+ }
+
+ hr = IUnknown_QueryInterface(wrapper->marshaler, &IID_IMarshal, ppv);
+ IUnknown_Release(&wrapper->IUnknown_iface);
+
+ return hr;
+}
+
+/*
+ * UiaReservedNotSupportedValue object.
+ */
+static HRESULT WINAPI uia_reserved_obj_QueryInterface(IUnknown *iface,
+ REFIID riid, void **ppv)
+{
+ *ppv = NULL;
+ if (IsEqualIID(riid, &IID_IUnknown))
+ *ppv = iface;
+ else if (IsEqualIID(riid, &IID_IMarshal))
+ return create_uia_object_wrapper(iface, ppv);
+ else
+ return E_NOINTERFACE;
+
+ return S_OK;
+}
+
+static ULONG WINAPI uia_reserved_obj_AddRef(IUnknown *iface)
+{
+ return 1;
+}
+
+static ULONG WINAPI uia_reserved_obj_Release(IUnknown *iface)
+{
+ return 1;
+}
+
+static const IUnknownVtbl uia_reserved_obj_vtbl = {
+ uia_reserved_obj_QueryInterface,
+ uia_reserved_obj_AddRef,
+ uia_reserved_obj_Release,
+};
+
+static IUnknown uia_reserved_ns_iface = {&uia_reserved_obj_vtbl};
+
/***********************************************************************
* UiaClientsAreListening (uiautomationcore.@)
*/
@@ -46,8 +168,13 @@ HRESULT WINAPI UiaGetReservedMixedAttributeValue(IUnknown **value)
*/
HRESULT WINAPI UiaGetReservedNotSupportedValue(IUnknown **value)
{
- FIXME("(%p) stub!\n", value);
- *value = NULL;
+ TRACE("(%p)\n", value);
+
+ if (!value)
+ return E_INVALIDARG;
+
+ *value = &uia_reserved_ns_iface;
+
return S_OK;
}
--
2.25.1
Nov. 4, 2021
Re: [PATCH] kerberos: Fix expiry time conversion.
by Alexandre Julliard
Dmitry Timoshkov <dmitry(a)baikal.ru> writes:
> Alexandre Julliard <julliard(a)winehq.org> wrote:
>
>> Dmitry Timoshkov <dmitry(a)baikal.ru> writes:
>>
>> > @@ -477,6 +477,7 @@ static void expirytime_gss_to_sspi( OM_uint32 expirytime, TimeStamp *timestamp )
>> >
>> > NtQuerySystemTime( &time );
>> > RtlSystemTimeToLocalTime( &time, &time );
>> > + time.QuadPart += expirytime;
>>
>> Isn't expirytime supposed to be in seconds?
>
> Good catch, thanks, that's correct, however that's how it was in old code where
> I copied it from. Would you mind adding a multiplier before committing? Or should
> I resend the patch?
I'm reworking that code anyway, so I'll fix it.
--
Alexandre Julliard
julliard(a)winehq.org
Nov. 4, 2021
Re: [PATCH] kerberos: Fix expiry time conversion.
by Dmitry Timoshkov
Alexandre Julliard <julliard(a)winehq.org> wrote:
> Dmitry Timoshkov <dmitry(a)baikal.ru> writes:
>
> > @@ -477,6 +477,7 @@ static void expirytime_gss_to_sspi( OM_uint32 expirytime, TimeStamp *timestamp )
> >
> > NtQuerySystemTime( &time );
> > RtlSystemTimeToLocalTime( &time, &time );
> > + time.QuadPart += expirytime;
>
> Isn't expirytime supposed to be in seconds?
Good catch, thanks, that's correct, however that's how it was in old code where
I copied it from. Would you mind adding a multiplier before committing? Or should
I resend the patch?
--
Dmitry.
Nov. 4, 2021
[PATCH v3 2/2] ntdll: Prevent loading Wine system dependencies in place of identically named application DLLs.
by Zebediah Figura
That is, load Wine system dependencies only when they are imported from Wine
builtins or other system dependencies, and do not match a Wine system dependency
by its base name when looking for already-loaded modules.
The reasoning is that it is possible for an application to ship, and expect to
use, a newer version of a MinGW-compiled library, or one with custom patches, or
possibly an unrelated library with the same name. We don't want to offer Wine's
system dependencies in place of the application's, or vice versa.
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
dlls/ntdll/loader.c | 45 ++++++++++++++++++++++++++-------------------
include/winternl.h | 1 +
2 files changed, 27 insertions(+), 19 deletions(-)
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index a9578ae86bf..85dc0820976 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -186,7 +186,7 @@ static WINE_MODREF *last_failed_modref;
static LDR_DDAG_NODE *node_ntdll, *node_kernel32;
static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WCHAR *default_ext,
- DWORD flags, WINE_MODREF** pwm );
+ DWORD flags, WINE_MODREF **pwm, BOOL system );
static NTSTATUS process_attach( LDR_DDAG_NODE *node, LPVOID lpReserved );
static FARPROC find_ordinal_export( HMODULE module, const IMAGE_EXPORT_DIRECTORY *exports,
DWORD exp_size, DWORD ordinal, LPCWSTR load_path );
@@ -505,21 +505,23 @@ static WINE_MODREF *get_modref( HMODULE hmod )
* Find a module from its base name.
* The loader_section must be locked while calling this function
*/
-static WINE_MODREF *find_basename_module( LPCWSTR name )
+static WINE_MODREF *find_basename_module( const WCHAR *name, BOOL system )
{
PLIST_ENTRY mark, entry;
UNICODE_STRING name_str;
RtlInitUnicodeString( &name_str, name );
- if (cached_modref && RtlEqualUnicodeString( &name_str, &cached_modref->ldr.BaseDllName, TRUE ))
+ if (cached_modref && RtlEqualUnicodeString( &name_str, &cached_modref->ldr.BaseDllName, TRUE )
+ && system == !!(cached_modref->ldr.Flags & LDR_WINE_SYSTEM))
return cached_modref;
mark = &NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList;
for (entry = mark->Flink; entry != mark; entry = entry->Flink)
{
LDR_DATA_TABLE_ENTRY *mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InLoadOrderLinks);
- if (RtlEqualUnicodeString( &name_str, &mod->BaseDllName, TRUE ))
+ if (RtlEqualUnicodeString( &name_str, &mod->BaseDllName, TRUE )
+ && system == !!(mod->Flags & LDR_WINE_SYSTEM))
{
cached_modref = CONTAINING_RECORD(mod, WINE_MODREF, ldr);
return cached_modref;
@@ -714,6 +716,7 @@ static NTSTATUS walk_node_dependencies( LDR_DDAG_NODE *node, void *context,
*/
static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWSTR load_path )
{
+ BOOL system = !!(get_modref( module )->ldr.Flags & (LDR_WINE_SYSTEM | LDR_WINE_INTERNAL));
const IMAGE_EXPORT_DIRECTORY *exports;
DWORD exp_size;
WINE_MODREF *wm;
@@ -733,10 +736,10 @@ static FARPROC find_forwarded_export( HMODULE module, const char *forward, LPCWS
if (!wcschr( mod_name, '.' ))
memcpy( mod_name + (end - forward), L".dll", sizeof(L".dll") );
- if (!(wm = find_basename_module( mod_name )))
+ if (!(wm = find_basename_module( mod_name, system )))
{
TRACE( "delay loading %s for '%s'\n", debugstr_w(mod_name), forward );
- if (load_dll( load_path, mod_name, L".dll", 0, &wm ) == STATUS_SUCCESS &&
+ if (load_dll( load_path, mod_name, L".dll", 0, &wm, system ) == STATUS_SUCCESS &&
!(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS))
{
if (!imports_fixup_done && current_modref)
@@ -903,6 +906,7 @@ void * WINAPI RtlFindExportedRoutineByName( HMODULE module, const char *name )
*/
static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LPCWSTR load_path, WINE_MODREF **pwm )
{
+ BOOL system = !!(current_modref->ldr.Flags & (LDR_WINE_SYSTEM | LDR_WINE_INTERNAL));
NTSTATUS status;
WINE_MODREF *wmImp;
HMODULE imp_mod;
@@ -936,7 +940,7 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP
{
ascii_to_unicode( buffer, name, len );
buffer[len] = 0;
- status = load_dll( load_path, buffer, L".dll", 0, &wmImp );
+ status = load_dll( load_path, buffer, L".dll", 0, &wmImp, system );
}
else /* need to allocate a larger buffer */
{
@@ -944,7 +948,7 @@ static BOOL import_dll( HMODULE module, const IMAGE_IMPORT_DESCRIPTOR *descr, LP
if (!ptr) return FALSE;
ascii_to_unicode( ptr, name, len );
ptr[len] = 0;
- status = load_dll( load_path, ptr, L".dll", 0, &wmImp );
+ status = load_dll( load_path, ptr, L".dll", 0, &wmImp, system );
RtlFreeHeap( GetProcessHeap(), 0, ptr );
}
@@ -1216,7 +1220,7 @@ static NTSTATUS fixup_imports_ilonly( WINE_MODREF *wm, LPCWSTR load_path, void *
prev = current_modref;
current_modref = wm;
assert( !wm->ldr.DdagNode->Dependencies.Tail );
- if (!(status = load_dll( load_path, L"mscoree.dll", NULL, 0, &imp ))
+ if (!(status = load_dll( load_path, L"mscoree.dll", NULL, 0, &imp, FALSE ))
&& !add_module_dependency_after( wm->ldr.DdagNode, imp->ldr.DdagNode, NULL ))
status = STATUS_NO_MEMORY;
current_modref = prev;
@@ -2902,7 +2906,7 @@ done:
*/
static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, const WCHAR *default_ext,
UNICODE_STRING *nt_name, WINE_MODREF **pwm, HANDLE *mapping,
- SECTION_IMAGE_INFORMATION *image_info, struct file_id *id )
+ SECTION_IMAGE_INFORMATION *image_info, struct file_id *id, BOOL system )
{
WCHAR *ext, *dllname;
NTSTATUS status;
@@ -2943,7 +2947,7 @@ static NTSTATUS find_dll_file( const WCHAR *load_path, const WCHAR *libname, con
else
{
if (status != STATUS_SXS_KEY_NOT_FOUND) goto done;
- if ((*pwm = find_basename_module( libname )) != NULL)
+ if ((*pwm = find_basename_module( libname, system )) != NULL)
{
status = STATUS_SUCCESS;
goto done;
@@ -2976,7 +2980,7 @@ done:
* The loader_section must be locked while calling this function.
*/
static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WCHAR *default_ext,
- DWORD flags, WINE_MODREF** pwm )
+ DWORD flags, WINE_MODREF **pwm, BOOL system )
{
UNICODE_STRING nt_name;
struct file_id id;
@@ -2987,10 +2991,10 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
TRACE( "looking for %s in %s\n", debugstr_w(libname), debugstr_w(load_path) );
- if (system_dll_path.Buffer)
- nts = find_dll_file( system_dll_path.Buffer, libname, default_ext, &nt_name, pwm, &mapping, &image_info, &id );
+ if (system && system_dll_path.Buffer)
+ nts = find_dll_file( system_dll_path.Buffer, libname, default_ext, &nt_name, pwm, &mapping, &image_info, &id, TRUE );
if (nts)
- nts = find_dll_file( load_path, libname, default_ext, &nt_name, pwm, &mapping, &image_info, &id );
+ nts = find_dll_file( load_path, libname, default_ext, &nt_name, pwm, &mapping, &image_info, &id, FALSE );
if (*pwm) /* found already loaded module */
{
@@ -3027,6 +3031,9 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
break;
}
+ if (system)
+ (*pwm)->ldr.Flags |= LDR_WINE_SYSTEM;
+
if (NtCurrentTeb64())
NtCurrentTeb64()->Tib.ArbitraryUserPointer = prev;
else
@@ -3084,7 +3091,7 @@ NTSTATUS WINAPI DECLSPEC_HOTPATCH LdrLoadDll(LPCWSTR path_name, DWORD flags,
RtlEnterCriticalSection( &loader_section );
- nts = load_dll( path_name, libname->Buffer, L".dll", flags, &wm );
+ nts = load_dll( path_name, libname->Buffer, L".dll", flags, &wm, FALSE );
if (nts == STATUS_SUCCESS && !(wm->ldr.Flags & LDR_DONT_RESOLVE_REFS))
{
@@ -3159,7 +3166,7 @@ NTSTATUS WINAPI LdrGetDllHandleEx( ULONG flags, LPCWSTR load_path, ULONG *dll_ch
RtlEnterCriticalSection( &loader_section );
- status = find_dll_file( load_path, name->Buffer, L".dll", &nt_name, &wm, &mapping, &image_info, &id );
+ status = find_dll_file( load_path, name->Buffer, L".dll", &nt_name, &wm, &mapping, &image_info, &id, FALSE );
if (wm) *base = wm->ldr.DllBase;
else
@@ -3860,7 +3867,7 @@ static void init_wow64( CONTEXT *context )
NTSTATUS status;
static const WCHAR wow64_path[] = L"C:\\windows\\system32\\wow64.dll";
- if ((status = load_dll( NULL, wow64_path, NULL, 0, &wm )))
+ if ((status = load_dll( NULL, wow64_path, NULL, 0, &wm, FALSE )))
{
ERR( "could not load %s, status %x\n", debugstr_w(wow64_path), status );
NtTerminateProcess( GetCurrentProcess(), status );
@@ -4010,7 +4017,7 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
if (NtCurrentTeb()->WowTebOffset) init_wow64( context );
- if ((status = load_dll( NULL, L"kernel32.dll", NULL, 0, &kernel32 )) != STATUS_SUCCESS)
+ if ((status = load_dll( NULL, L"kernel32.dll", NULL, 0, &kernel32, FALSE )) != STATUS_SUCCESS)
{
MESSAGE( "wine: could not load kernel32.dll, status %x\n", status );
NtTerminateProcess( GetCurrentProcess(), status );
diff --git a/include/winternl.h b/include/winternl.h
index eea97f1238b..3a1d46cd05e 100644
--- a/include/winternl.h
+++ b/include/winternl.h
@@ -3393,6 +3393,7 @@ typedef void (CALLBACK *PLDR_DLL_NOTIFICATION_FUNCTION)(ULONG, LDR_DLL_NOTIFICAT
#define LDR_COR_ILONLY 0x01000000
/* these ones is Wine specific */
+#define LDR_WINE_SYSTEM 0x20000000
#define LDR_DONT_RESOLVE_REFS 0x40000000
#define LDR_WINE_INTERNAL 0x80000000
--
2.33.0
Nov. 4, 2021
[PATCH v3 1/2] ntdll: Allow loading system DLLs from a path specified at configure time.
by Zebediah Figura
Many distributions provide MinGW-compiled system DLLs which are currently
bundled with Wine. Unfortunately, while MinGW pkg-config can be used to detect
the linking path, there is no standardized runtime path, and many distributions
in fact use different paths.
Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com>
---
v3: Use AC_ARG_WITH instead of AC_ARG_VAR, and pass the path via the top-level
makefile rather than config.h.
Makefile.in | 1 +
configure.ac | 3 +++
dlls/ntdll/Makefile.in | 1 +
dlls/ntdll/loader.c | 10 ++++++++--
dlls/ntdll/unix/env.c | 1 +
dlls/ntdll/unix/loader.c | 3 +++
dlls/ntdll/unix/unix_private.h | 1 +
7 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 42f161e3af9..c4b0fbda616 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -32,6 +32,7 @@ nlsdir = ${datadir}/wine/nls
dlldir = ${libdir}/wine
srcdir = @srcdir@
host_cpu = @host_cpu@
+system_dlldir = @system_dlldir@
SHELL = /bin/sh
CC = @CC@
CXX = @CXX@
diff --git a/configure.ac b/configure.ac
index 57383fb2e31..77765db0490 100644
--- a/configure.ac
+++ b/configure.ac
@@ -103,6 +103,7 @@ AC_ARG_WITH(xshm, AS_HELP_STRING([--without-xshm],[do not use XShm (shared
AC_ARG_WITH(xxf86vm, AS_HELP_STRING([--without-xxf86vm],[do not use XFree video mode extension]),
[if test "x$withval" = "xno"; then ac_cv_header_X11_extensions_xf86vmode_h=no; ac_cv_header_X11_extensions_xf86vmproto_h=no; fi])
+AC_ARG_WITH(system-dlldir, AS_HELP_STRING([--with-system-dlldir=DIR],[load external PE dependencies from directory DIR]))
AC_ARG_WITH(wine-tools,AS_HELP_STRING([--with-wine-tools=DIR],[use Wine tools from directory DIR]))
AC_ARG_WITH(wine64, AS_HELP_STRING([--with-wine64=DIR],[use the 64-bit Wine in DIR for a Wow64 build]))
@@ -256,6 +257,8 @@ then
TARGETFLAGS="-b $host_alias $TARGETFLAGS"
fi
+AC_SUBST(system_dlldir,"$with_system_dlldir")
+
dnl Check for flex
AC_CHECK_PROGS(FLEX,flex,none)
if test "$FLEX" = "none"
diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in
index fa2ac1623ea..5b15ab5108f 100644
--- a/dlls/ntdll/Makefile.in
+++ b/dlls/ntdll/Makefile.in
@@ -73,5 +73,6 @@ EXTRA_OBJS = unix/version.o
unix_loader_EXTRADEFS = \
-DBINDIR=\"${bindir}\" \
+ -DSYSTEMDLLDIR=\"${system_dlldir}\" \
-DDLL_TO_BINDIR=\"`${MAKEDEP} -R ${dlldir} ${bindir}`\" \
-DBIN_TO_DATADIR=\"`${MAKEDEP} -R ${bindir} ${datadir}/wine`\"
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 255d5afef79..a9578ae86bf 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -95,6 +95,7 @@ static int free_lib_count; /* recursion depth of LdrUnloadDll calls */
static ULONG path_safe_mode; /* path mode set by RtlSetSearchPathMode */
static ULONG dll_safe_mode = 1; /* dll search mode */
static UNICODE_STRING dll_directory; /* extra path for LdrSetDllDirectory */
+static UNICODE_STRING system_dll_path; /* path to search for system dependency dlls */
static DWORD default_search_flags; /* default flags set by LdrSetDefaultDllDirectories */
static WCHAR *default_load_path; /* default dll search path */
@@ -2981,12 +2982,15 @@ static NTSTATUS load_dll( const WCHAR *load_path, const WCHAR *libname, const WC
struct file_id id;
HANDLE mapping = 0;
SECTION_IMAGE_INFORMATION image_info;
- NTSTATUS nts;
+ NTSTATUS nts = STATUS_DLL_NOT_FOUND;
ULONG64 prev;
TRACE( "looking for %s in %s\n", debugstr_w(libname), debugstr_w(load_path) );
- nts = find_dll_file( load_path, libname, default_ext, &nt_name, pwm, &mapping, &image_info, &id );
+ if (system_dll_path.Buffer)
+ nts = find_dll_file( system_dll_path.Buffer, libname, default_ext, &nt_name, pwm, &mapping, &image_info, &id );
+ if (nts)
+ nts = find_dll_file( load_path, libname, default_ext, &nt_name, pwm, &mapping, &image_info, &id );
if (*pwm) /* found already loaded module */
{
@@ -3997,6 +4001,8 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unknown2, ULONG_PTR
load_global_options();
version_init();
+ get_env_var( L"WINESYSTEMDLLDIR", 0, &system_dll_path );
+
wm = build_main_module();
wm->ldr.LoadCount = -1;
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c
index 43a34bf831b..1647603efa5 100644
--- a/dlls/ntdll/unix/env.c
+++ b/dlls/ntdll/unix/env.c
@@ -1296,6 +1296,7 @@ static void add_dynamic_environment( WCHAR **env, SIZE_T *pos, SIZE_T *size )
add_path_var( env, pos, size, "WINEHOMEDIR", home_dir );
add_path_var( env, pos, size, "WINEBUILDDIR", build_dir );
add_path_var( env, pos, size, "WINECONFIGDIR", config_dir );
+ add_path_var( env, pos, size, "WINESYSTEMDLLDIR", system_dll_path );
for (i = 0; dll_paths[i]; i++)
{
sprintf( str, "WINEDLLDIR%u", i );
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index 0ca4b1ea6dd..9fdcc236fb1 100644
--- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -388,6 +388,7 @@ const char *data_dir = NULL;
const char *build_dir = NULL;
const char *config_dir = NULL;
const char **dll_paths = NULL;
+const char *system_dll_path = NULL;
const char *user_name = NULL;
SECTION_IMAGE_INFORMATION main_image_info = { NULL };
static HMODULE ntdll_module;
@@ -619,6 +620,8 @@ static void init_paths( char *argv[] )
data_dir = build_path( bin_dir, BIN_TO_DATADIR );
}
+ if (strlen(SYSTEMDLLDIR)) system_dll_path = SYSTEMDLLDIR;
+
set_dll_path();
set_home_dir();
set_config_dir();
diff --git a/dlls/ntdll/unix/unix_private.h b/dlls/ntdll/unix/unix_private.h
index 792cb33710d..01c7cc1c103 100644
--- a/dlls/ntdll/unix/unix_private.h
+++ b/dlls/ntdll/unix/unix_private.h
@@ -125,6 +125,7 @@ extern const char *build_dir DECLSPEC_HIDDEN;
extern const char *config_dir DECLSPEC_HIDDEN;
extern const char *user_name DECLSPEC_HIDDEN;
extern const char **dll_paths DECLSPEC_HIDDEN;
+extern const char *system_dll_path DECLSPEC_HIDDEN;
extern PEB *peb DECLSPEC_HIDDEN;
extern USHORT *uctable DECLSPEC_HIDDEN;
extern USHORT *lctable DECLSPEC_HIDDEN;
--
2.33.0
Nov. 4, 2021
Re: [PATCH 8/8] wined3d: Try to allocate new Vulkan BOs from the client thread for DISCARD maps.
by Matteo Bruni
On Thu, Nov 4, 2021 at 5:49 PM Henri Verbeet <hverbeet(a)gmail.com> wrote:
>
> On Thu, 4 Nov 2021 at 17:31, Zebediah Figura <zfigura(a)codeweavers.com> wrote:
> > On 11/4/21 11:19 AM, Matteo Bruni wrote:
> > > That was more or less the idea, although the whole mechanism was a bit
> > > different (and with GL posing more constraints). Specifically, we
> > > can't / don't want to make GL calls from non-CS threads, but at the
> > > same time we want to be able to create new BOs for DISCARD maps
> > > (either because we use a separate BO for each wined3d buffer DISCARD
> > > map or because we're suballocating and there is no free space but we
> > > want to trigger the allocation of a new BO to suballocate from -
> > > basically the same as the non-slab case of
> > > wined3d_context_vk_create_bo()).
> > > So yeah, I don't think you have to care about that case here in the VK
> > > callback and it's probably nicer to do what Henri suggested i.e. go
> > > explicitly through the CS for a "slow" alloc, since that way the
> > > fallback is in generic code.
> > >
> > > Assuming I understood the whole thing correctly, I'm not up to speed
> > > with this as much as I'd like...
> > >
> >
> > For Vulkan I think it doesn't matter, since we can just map from the
> > client thread. For GL we have to to map from the CS thread, but if we
> > just map the old resource via wined3d_resource_map(), we'll use
> > &wined3d_buffer_gl.bo instead of allocating new memory, which means that
> > the client will continue to have no accessible memory to return for a
> > discard map. Repeat ad infinitum.
> >
> > Allocating sysmem would help, but my understanding is that expanding the
> > available GPU memory pool would be better.
> >
> Yeah. My idea for that, although I never worked it out all the way,
> would be to keep a mapped bo for uploads on the application side of
> the CS. Then if that runs low, we'd send a request through the CS to
> allocate more, but without waiting for that to complete. Ideally that
> request would then have completed before the original upload space
> actually runs out. If we did run out though, we'd use a CPU allocation
> to avoid stalling those requests. I.e., the basic premise being that
> we'd like to avoid stalling even for those requests.
Yeah, that sounds great in principle.
Nov. 4, 2021
Re: [PATCH 8/8] wined3d: Try to allocate new Vulkan BOs from the client thread for DISCARD maps.
by Matteo Bruni
On Thu, Nov 4, 2021 at 5:31 PM Zebediah Figura <zfigura(a)codeweavers.com> wrote:
>
> On 11/4/21 11:19 AM, Matteo Bruni wrote:
> > On Thu, Nov 4, 2021 at 4:45 PM Zebediah Figura <zfigura(a)codeweavers.com> wrote:
> >>
> >> On 11/4/21 8:17 AM, Henri Verbeet wrote:
> >>> On Wed, 3 Nov 2021 at 21:47, Zebediah Figura <zfigura(a)codeweavers.com> wrote:
> >>>> On 11/3/21 12:11 PM, Henri Verbeet wrote:
> >>>>> On Wed, 3 Nov 2021 at 00:37, Zebediah Figura <zfigura(a)codeweavers.com> wrote:
> >>>>>> +static bool adapter_vk_alloc_bo(struct wined3d_device *device, struct wined3d_resource *resource,
> >>>>>> + unsigned int sub_resource_idx, struct wined3d_bo_address *addr)
> >>>>>> +{
> >>>>>> + wined3d_not_from_cs(device->cs);
> >>>>>> +
> >>>>>> + if (resource->type == WINED3D_RTYPE_BUFFER)
> >>>>>> + {
> >>>>>> + struct wined3d_buffer_vk *buffer_vk = wined3d_buffer_vk(buffer_from_resource(resource));
> >>>>>> + struct wined3d_client_bo_vk *client_bo;
> >>>>>> +
> >>>>>> + if (!(client_bo = heap_alloc(sizeof(*client_bo))))
> >>>>>> + return false;
> >>>>>> +
> >>>>>> + if (!wined3d_buffer_vk_create_buffer_object(buffer_vk, NULL, &client_bo->bo))
> >>>>>> + {
> >>>>>> + heap_free(client_bo);
> >>>>>> + return false;
> >>>>>> + }
> >>>>>> +
> >>>>>> + if (!client_bo->bo.b.map_ptr)
> >>>>>> + {
> >>>>>> + struct wined3d_client_bo_vk_map_ctx ctx = {.device = device, .client_bo = client_bo};
> >>>>>> +
> >>>>>> + WARN_(d3d_perf)("BO %p (chunk %p, slab %p) is not persistently mapped.\n", &client_bo->bo,
> >>>>>> + client_bo->bo.memory ? client_bo->bo.memory->chunk : NULL, client_bo->bo.slab);
> >>>>>> +
> >>>>>> + wined3d_cs_map_object(device->cs, wined3d_client_bo_vk_map_cs, &ctx);
> >>>>>> + wined3d_cs_finish(device->cs, WINED3D_CS_QUEUE_MAP);
> >>>>>> + }
> >>>>> wined3d_cs_map_object() almost sounds like it would emit a
> >>>>> WINED3D_CS_OP_MAP, somewhat like wined3d_device_context_map() back
> >>>>> when that was still called wined3d_cs_map()...
> >>>>
> >>>> Indeed, except that WINED3D_CS_OP_MAP takes the resource. I don't think
> >>>> we want to change that, either, although we could create a new CS op
> >>>> instead of using WINED3D_CS_OP_CALLBACK.
> >>>>
> >>> Yeah, I'm not suggesting we change WINED3D_CS_OP_MAP. It's somewhat
> >>> moot for the Vulkan backend now, but I would argue that if we would
> >>> have to go through the CS to map the bo anyway, we might as well
> >>> either give up and just map the resource through the CS, or allocate
> >>> the staging memory on the CPU.
> >>
> >> I think the motivation for not just doing that was to make sure that we
> >> actually did allocate new memory, instead of repeatedly going through
> >> the slow path to use the same mapped memory. I don't remember if this
> >> happened in practice, but there's a comment to similar effect on one of
> >> Matteo's patches...
> >
> > That was more or less the idea, although the whole mechanism was a bit
> > different (and with GL posing more constraints). Specifically, we
> > can't / don't want to make GL calls from non-CS threads, but at the
> > same time we want to be able to create new BOs for DISCARD maps
> > (either because we use a separate BO for each wined3d buffer DISCARD
> > map or because we're suballocating and there is no free space but we
> > want to trigger the allocation of a new BO to suballocate from -
> > basically the same as the non-slab case of
> > wined3d_context_vk_create_bo()).
> > So yeah, I don't think you have to care about that case here in the VK
> > callback and it's probably nicer to do what Henri suggested i.e. go
> > explicitly through the CS for a "slow" alloc, since that way the
> > fallback is in generic code.
> >
> > Assuming I understood the whole thing correctly, I'm not up to speed
> > with this as much as I'd like...
> >
>
> For Vulkan I think it doesn't matter, since we can just map from the
> client thread. For GL we have to to map from the CS thread, but if we
> just map the old resource via wined3d_resource_map(), we'll use
> &wined3d_buffer_gl.bo instead of allocating new memory, which means that
> the client will continue to have no accessible memory to return for a
> discard map. Repeat ad infinitum.
Right, I guess the problem is that our "CS api", so to speak, works
with wined3d buffers, which match d3d resources. That's really not
what we would want in an ideal world.
Nov. 4, 2021
Re: [PATCH v2 1/3] include: Rename LDR_WINE_INTERNAL to LDR_WINE_BUILTIN.
by Zebediah Figura
On 11/4/21 4:31 AM, Alexandre Julliard wrote:
> Zebediah Figura <zfigura(a)codeweavers.com> writes:
>
>> @@ -3394,7 +3394,7 @@ typedef void (CALLBACK *PLDR_DLL_NOTIFICATION_FUNCTION)(ULONG, LDR_DLL_NOTIFICAT
>>
>> /* these ones is Wine specific */
>> #define LDR_DONT_RESOLVE_REFS 0x40000000
>> -#define LDR_WINE_INTERNAL 0x80000000
>> +#define LDR_WINE_BUILTIN 0x80000000
>
> That doesn't seem necessary.
>
No, it's not necessary. The idea is that LDR_WINE_INTERNAL is somewhat
ambiguous, especially if we're introducing a second sense in which a
module can be internally marked, and I wanted to clarify it.
I suppose that it's less ambiguous to one who is familiar with the
loader code, though. I'll resend the series without this patch.
Nov. 4, 2021
Re: [PATCH] kerberos: Fix expiry time conversion.
by Alexandre Julliard
Dmitry Timoshkov <dmitry(a)baikal.ru> writes:
> @@ -477,6 +477,7 @@ static void expirytime_gss_to_sspi( OM_uint32 expirytime, TimeStamp *timestamp )
>
> NtQuerySystemTime( &time );
> RtlSystemTimeToLocalTime( &time, &time );
> + time.QuadPart += expirytime;
Isn't expirytime supposed to be in seconds?
--
Alexandre Julliard
julliard(a)winehq.org
Nov. 4, 2021
Re: [PATCH 8/8] wined3d: Try to allocate new Vulkan BOs from the client thread for DISCARD maps.
by Henri Verbeet
On Thu, 4 Nov 2021 at 17:31, Zebediah Figura <zfigura(a)codeweavers.com> wrote:
> On 11/4/21 11:19 AM, Matteo Bruni wrote:
> > That was more or less the idea, although the whole mechanism was a bit
> > different (and with GL posing more constraints). Specifically, we
> > can't / don't want to make GL calls from non-CS threads, but at the
> > same time we want to be able to create new BOs for DISCARD maps
> > (either because we use a separate BO for each wined3d buffer DISCARD
> > map or because we're suballocating and there is no free space but we
> > want to trigger the allocation of a new BO to suballocate from -
> > basically the same as the non-slab case of
> > wined3d_context_vk_create_bo()).
> > So yeah, I don't think you have to care about that case here in the VK
> > callback and it's probably nicer to do what Henri suggested i.e. go
> > explicitly through the CS for a "slow" alloc, since that way the
> > fallback is in generic code.
> >
> > Assuming I understood the whole thing correctly, I'm not up to speed
> > with this as much as I'd like...
> >
>
> For Vulkan I think it doesn't matter, since we can just map from the
> client thread. For GL we have to to map from the CS thread, but if we
> just map the old resource via wined3d_resource_map(), we'll use
> &wined3d_buffer_gl.bo instead of allocating new memory, which means that
> the client will continue to have no accessible memory to return for a
> discard map. Repeat ad infinitum.
>
> Allocating sysmem would help, but my understanding is that expanding the
> available GPU memory pool would be better.
>
Yeah. My idea for that, although I never worked it out all the way,
would be to keep a mapped bo for uploads on the application side of
the CS. Then if that runs low, we'd send a request through the CS to
allocate more, but without waiting for that to complete. Ideally that
request would then have completed before the original upload space
actually runs out. If we did run out though, we'd use a CPU allocation
to avoid stalling those requests. I.e., the basic premise being that
we'd like to avoid stalling even for those requests.
Nov. 4, 2021