winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
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
List overview
wine-commits
February 2021
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
915 discussions
Start a n
N
ew thread
Alexandre Julliard : ntdll: Initialize the ShowDotFiles option on the Unix side.
by Alexandre Julliard
25 Feb '21
25 Feb '21
Module: wine Branch: master Commit: 305cb8af27da11e71950005796ec74d319c7d12f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=305cb8af27da11e719500057…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Feb 25 15:14:41 2021 +0100 ntdll: Initialize the ShowDotFiles option on the Unix side. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/directory.c | 39 ------------------------------ dlls/ntdll/loader.c | 1 - dlls/ntdll/ntdll_misc.h | 2 -- dlls/ntdll/unix/file.c | 62 +++++++++++++++++++++++++++++++++++++++++------- dlls/ntdll/unix/loader.c | 1 - dlls/ntdll/unixlib.h | 5 +--- 6 files changed, 54 insertions(+), 56 deletions(-) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index fb2f25d35bc..4125170b509 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -40,45 +40,6 @@ #include "wine/debug.h" #include "wine/exception.h" -#define IS_OPTION_TRUE(ch) ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1') - -static BOOL show_dot_files; - -/*********************************************************************** - * init_directories - */ -void init_directories(void) -{ - char tmp[80]; - HANDLE root, hkey; - DWORD dummy; - OBJECT_ATTRIBUTES attr; - UNICODE_STRING nameW; - - RtlOpenCurrentUser( KEY_ALL_ACCESS, &root ); - attr.Length = sizeof(attr); - attr.RootDirectory = root; - attr.ObjectName = &nameW; - attr.Attributes = 0; - attr.SecurityDescriptor = NULL; - attr.SecurityQualityOfService = NULL; - RtlInitUnicodeString( &nameW, L"Software\\Wine" ); - - /* @@ Wine registry key: HKCU\Software\Wine */ - if (!NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr )) - { - RtlInitUnicodeString( &nameW, L"ShowDotFiles" ); - if (!NtQueryValueKey( hkey, &nameW, KeyValuePartialInformation, tmp, sizeof(tmp), &dummy )) - { - WCHAR *str = (WCHAR *)((KEY_VALUE_PARTIAL_INFORMATION *)tmp)->Data; - show_dot_files = IS_OPTION_TRUE( str[0] ); - } - NtClose( hkey ); - } - NtClose( root ); - unix_funcs->set_show_dot_files( show_dot_files ); -} - /****************************************************************** * RtlWow64EnableFsRedirection (NTDLL.@) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index e609a0f77d4..8dbbb14f05d 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -3999,7 +3999,6 @@ static NTSTATUS process_init(void) #endif init_unix_codepage(); - init_directories(); init_user_process_params(); params = peb->ProcessParameters; diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index 67696f80db3..aebea12e6ba 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -84,8 +84,6 @@ extern const WCHAR syswow64_dir[] DECLSPEC_HIDDEN; extern void (FASTCALL *pBaseThreadInitThunk)(DWORD,LPTHREAD_START_ROUTINE,void *) DECLSPEC_HIDDEN; extern const struct unix_funcs *unix_funcs DECLSPEC_HIDDEN; -extern void init_directories(void) DECLSPEC_HIDDEN; - extern struct _KUSER_SHARED_DATA *user_shared_data DECLSPEC_HIDDEN; /* locale */ diff --git a/dlls/ntdll/unix/file.c b/dlls/ntdll/unix/file.c index 00ca2005f92..381805c0f04 100644 --- a/dlls/ntdll/unix/file.c +++ b/dlls/ntdll/unix/file.c @@ -2726,11 +2726,46 @@ static int get_redirect_path( char *unix_name, int pos, const WCHAR *name, int l #endif +#define IS_OPTION_TRUE(ch) ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1') + +static NTSTATUS open_hkcu_key( const char *path, HANDLE *key ) +{ + NTSTATUS status; + char buffer[256]; + WCHAR bufferW[256]; + DWORD_PTR sid_data[(sizeof(TOKEN_USER) + SECURITY_MAX_SID_SIZE) / sizeof(DWORD_PTR)]; + DWORD i, len = sizeof(sid_data); + SID *sid; + UNICODE_STRING name; + OBJECT_ATTRIBUTES attr; + + status = NtQueryInformationToken( GetCurrentThreadEffectiveToken(), TokenUser, sid_data, len, &len ); + if (status) return status; + + sid = ((TOKEN_USER *)sid_data)->User.Sid; + len = sprintf( buffer, "\\Registry\\User\\S-%u-%u", sid->Revision, + MAKELONG( MAKEWORD( sid->IdentifierAuthority.Value[5], sid->IdentifierAuthority.Value[4] ), + MAKEWORD( sid->IdentifierAuthority.Value[3], sid->IdentifierAuthority.Value[2] ))); + for (i = 0; i < sid->SubAuthorityCount; i++) + len += sprintf( buffer + len, "-%u", sid->SubAuthority[i] ); + len += sprintf( buffer + len, "\\%s", path ); + + name.Buffer = bufferW; + name.Length = len * sizeof(WCHAR); + name.MaximumLength = name.Length + sizeof(WCHAR); + ascii_to_unicode( bufferW, buffer, len + 1 ); + InitializeObjectAttributes( &attr, &name, OBJ_CASE_INSENSITIVE, 0, NULL ); + return NtCreateKey( key, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL ); +} + + /*********************************************************************** * init_files */ void init_files(void) { + HANDLE key; + #ifndef _WIN64 if (is_wow64) init_redirects(); #endif @@ -2744,6 +2779,24 @@ void init_files(void) /* retrieve initial umask */ start_umask = umask( 0777 ); umask( start_umask ); + + if (!open_hkcu_key( "Software\\Wine", &key )) + { + static WCHAR showdotfilesW[] = {'S','h','o','w','D','o','t','F','i','l','e','s',0}; + char tmp[80]; + DWORD dummy; + UNICODE_STRING nameW; + + nameW.MaximumLength = sizeof(showdotfilesW); + nameW.Length = nameW.MaximumLength - sizeof(WCHAR); + nameW.Buffer = showdotfilesW; + if (!NtQueryValueKey( key, &nameW, KeyValuePartialInformation, tmp, sizeof(tmp), &dummy )) + { + WCHAR *str = (WCHAR *)((KEY_VALUE_PARTIAL_INFORMATION *)tmp)->Data; + show_dot_files = IS_OPTION_TRUE( str[0] ); + } + NtClose( key ); + } } @@ -3522,15 +3575,6 @@ static NTSTATUS unmount_device( HANDLE handle ) } -/*********************************************************************** - * set_show_dot_files - */ -void CDECL set_show_dot_files( BOOL enable ) -{ - show_dot_files = enable; -} - - /****************************************************************************** * open_unix_file * diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index d03034f35fc..df8d99ce489 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -1718,7 +1718,6 @@ static struct unix_funcs unix_funcs = get_unix_codepage_data, get_locales, virtual_release_address_space, - set_show_dot_files, load_so_dll, load_builtin_dll, unload_builtin_dll, diff --git a/dlls/ntdll/unixlib.h b/dlls/ntdll/unixlib.h index c317784a3ea..bd2512030c2 100644 --- a/dlls/ntdll/unixlib.h +++ b/dlls/ntdll/unixlib.h @@ -26,7 +26,7 @@ struct _DISPATCHER_CONTEXT; /* increment this when you change the function table */ -#define NTDLL_UNIXLIB_VERSION 112 +#define NTDLL_UNIXLIB_VERSION 113 struct unix_funcs { @@ -76,9 +76,6 @@ struct unix_funcs /* virtual memory functions */ void (CDECL *virtual_release_address_space)(void); - /* file functions */ - void (CDECL *set_show_dot_files)( BOOL enable ); - /* loader functions */ NTSTATUS (CDECL *load_so_dll)( UNICODE_STRING *nt_name, void **module ); NTSTATUS (CDECL *load_builtin_dll)( UNICODE_STRING *name, void **module, void **unix_entry,
1
0
0
0
Alexandre Julliard : ntdll: Relocate the PE ntdll if necessary.
by Alexandre Julliard
25 Feb '21
25 Feb '21
Module: wine Branch: master Commit: 06b729f7773243a76fb2df3c1bfe53b39819da5f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=06b729f7773243a76fb2df3c…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Feb 25 12:37:37 2021 +0100 ntdll: Relocate the PE ntdll if necessary. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/unix/loader.c | 99 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index c4f897f3d0d..d03034f35fc 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -891,6 +891,98 @@ static void load_ntdll_functions( HMODULE module ) #undef SET_PTR } +/* reimplementation of LdrProcessRelocationBlock */ +static IMAGE_BASE_RELOCATION *process_relocation_block( void *module, IMAGE_BASE_RELOCATION *rel, + INT_PTR delta ) +{ + char *page = get_rva( module, rel->VirtualAddress ); + UINT count = (rel->SizeOfBlock - sizeof(*rel)) / sizeof(USHORT); + USHORT *relocs = (USHORT *)(rel + 1); + + while (count--) + { + USHORT offset = *relocs & 0xfff; + switch (*relocs >> 12) + { + case IMAGE_REL_BASED_ABSOLUTE: + break; + case IMAGE_REL_BASED_HIGH: + *(short *)(page + offset) += HIWORD(delta); + break; + case IMAGE_REL_BASED_LOW: + *(short *)(page + offset) += LOWORD(delta); + break; + case IMAGE_REL_BASED_HIGHLOW: + *(int *)(page + offset) += delta; + break; +#ifdef _WIN64 + case IMAGE_REL_BASED_DIR64: + *(INT_PTR *)(page + offset) += delta; + break; +#elif defined(__arm__) + case IMAGE_REL_BASED_THUMB_MOV32: + { + DWORD *inst = (DWORD *)(page + offset); + WORD lo = ((inst[0] << 1) & 0x0800) + ((inst[0] << 12) & 0xf000) + + ((inst[0] >> 20) & 0x0700) + ((inst[0] >> 16) & 0x00ff); + WORD hi = ((inst[1] << 1) & 0x0800) + ((inst[1] << 12) & 0xf000) + + ((inst[1] >> 20) & 0x0700) + ((inst[1] >> 16) & 0x00ff); + DWORD imm = MAKELONG( lo, hi ) + delta; + + lo = LOWORD( imm ); + hi = HIWORD( imm ); + inst[0] = (inst[0] & 0x8f00fbf0) + ((lo >> 1) & 0x0400) + ((lo >> 12) & 0x000f) + + ((lo << 20) & 0x70000000) + ((lo << 16) & 0xff0000); + inst[1] = (inst[1] & 0x8f00fbf0) + ((hi >> 1) & 0x0400) + ((hi >> 12) & 0x000f) + + ((hi << 20) & 0x70000000) + ((hi << 16) & 0xff0000); + break; + } +#endif + default: + FIXME("Unknown/unsupported relocation %x\n", *relocs); + return NULL; + } + relocs++; + } + return (IMAGE_BASE_RELOCATION *)relocs; /* return address of next block */ +} + +static void relocate_ntdll( void *module ) +{ + IMAGE_DOS_HEADER *dos = module; + IMAGE_NT_HEADERS *nt = (IMAGE_NT_HEADERS *)((char *)dos + dos->e_lfanew); + IMAGE_DATA_DIRECTORY *relocs = &nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC]; + IMAGE_BASE_RELOCATION *rel, *end; + IMAGE_SECTION_HEADER *sec; + ULONG protect_old[96], i; + INT_PTR delta; + + ERR( "ntdll could not be mapped at preferred address (%p/%p), expect trouble\n", + module, (void *)nt->OptionalHeader.ImageBase ); + + if (!relocs->Size || !relocs->VirtualAddress) return; + + sec = (IMAGE_SECTION_HEADER *)((char *)&nt->OptionalHeader + nt->FileHeader.SizeOfOptionalHeader); + for (i = 0; i < nt->FileHeader.NumberOfSections; i++) + { + void *addr = get_rva( module, sec[i].VirtualAddress ); + SIZE_T size = sec[i].SizeOfRawData; + NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size, PAGE_READWRITE, &protect_old[i] ); + } + + rel = get_rva( module, relocs->VirtualAddress ); + end = get_rva( module, relocs->VirtualAddress + relocs->Size ); + delta = (char *)module - (char *)nt->OptionalHeader.ImageBase; + while (rel && rel < end - 1 && rel->SizeOfBlock) rel = process_relocation_block( module, rel, delta ); + + for (i = 0; i < nt->FileHeader.NumberOfSections; i++) + { + void *addr = get_rva( module, sec[i].VirtualAddress ); + SIZE_T size = sec[i].SizeOfRawData; + NtProtectVirtualMemory( NtCurrentProcess(), &addr, &size, protect_old[i], &protect_old[i] ); + } +} + static void *callback_module; @@ -1534,8 +1626,11 @@ static void load_ntdll(void) status = open_builtin_file( name, &attr, &mapping, &module, &info, &st, FALSE ); if (!status && !module) { - status = map_builtin_module( mapping, &module, &st ); - NtClose( mapping ); + SIZE_T len = 0; + status = NtMapViewOfSection( mapping, NtCurrentProcess(), &module, 0, 0, NULL, &len, + ViewShare, 0, PAGE_EXECUTE_READ ); + if (status == STATUS_IMAGE_NOT_AT_BASE) relocate_ntdll( module ); + status = add_builtin_module( module, NULL, &st ); } if (status) fatal_error( "failed to load %s error %x\n", name, status ); free( name );
1
0
0
0
Alexandre Julliard : ntdll: Add a separate helper for creating the initial ntdll module.
by Alexandre Julliard
25 Feb '21
25 Feb '21
Module: wine Branch: master Commit: 93eb4dbde875497c9c38a79d01f6c045f92560f0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=93eb4dbde875497c9c38a79d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Feb 25 12:30:18 2021 +0100 ntdll: Add a separate helper for creating the initial ntdll module. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ntdll/loader.c | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index a166a6cc071..e609a0f77d4 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1937,20 +1937,23 @@ static NTSTATUS build_module( LPCWSTR load_path, const UNICODE_STRING *nt_name, /************************************************************************* - * build_builtin_module + * build_ntdll_module * - * Build the module for a builtin library. + * Build the module data for the initially-loaded ntdll. */ -static NTSTATUS build_builtin_module( const WCHAR *load_path, const UNICODE_STRING *nt_name, - void *module, DWORD flags, WINE_MODREF **pwm ) +static void build_ntdll_module(void) { - NTSTATUS status; - SECTION_IMAGE_INFORMATION image_info = { 0 }; + MEMORY_BASIC_INFORMATION meminfo; + UNICODE_STRING nt_name; + WINE_MODREF *wm; - image_info.u.s.WineBuiltin = 1; - status = build_module( load_path, nt_name, &module, &image_info, NULL, flags, pwm ); - if (status && module) unix_funcs->unload_builtin_dll( module ); - return status; + RtlInitUnicodeString( &nt_name, L"\\??\\C:\\windows\\system32\\ntdll.dll" ); + NtQueryVirtualMemory( GetCurrentProcess(), build_ntdll_module, MemoryBasicInformation, + &meminfo, sizeof(meminfo), NULL ); + wm = alloc_module( meminfo.AllocationBase, &nt_name, TRUE ); + assert( wm ); + wm->ldr.Flags &= ~LDR_DONT_RESOLVE_REFS; + if (TRACE_ON(relay)) RELAY_SetupDLL( meminfo.AllocationBase ); } @@ -2348,7 +2351,14 @@ static NTSTATUS load_so_dll( LPCWSTR load_path, const UNICODE_STRING *nt_name, } else { - if ((status = build_builtin_module( load_path, &win_name, module, flags, &wm ))) return status; + SECTION_IMAGE_INFORMATION image_info = { 0 }; + + image_info.u.s.WineBuiltin = 1; + if ((status = build_module( load_path, &win_name, &module, &image_info, NULL, flags, pwm ))) + { + if (module) unix_funcs->unload_builtin_dll( module ); + return status; + } TRACE_(loaddll)( "Loaded %s at %p: builtin\n", debugstr_us(nt_name), module ); } *pwm = wm; @@ -3958,8 +3968,6 @@ static NTSTATUS process_init(void) WINE_MODREF *wm; NTSTATUS status; ANSI_STRING func_name; - UNICODE_STRING nt_name; - MEMORY_BASIC_INFORMATION meminfo; INITIAL_TEB stack; TEB *teb = NtCurrentTeb(); PEB *peb = teb->Peb; @@ -4059,11 +4067,7 @@ static NTSTATUS process_init(void) } #endif - RtlInitUnicodeString( &nt_name, L"\\??\\C:\\windows\\system32\\ntdll.dll" ); - NtQueryVirtualMemory( GetCurrentProcess(), process_init, MemoryBasicInformation, - &meminfo, sizeof(meminfo), NULL ); - status = build_builtin_module( params->DllPath.Buffer, &nt_name, meminfo.AllocationBase, 0, &wm ); - assert( !status ); + build_ntdll_module(); if ((status = load_dll( params->DllPath.Buffer, L"C:\\windows\\system32\\kernel32.dll", NULL, 0, &wm )) != STATUS_SUCCESS)
1
0
0
0
Nikolay Sivov : wbemdisp: Use context object internally for named value set.
by Alexandre Julliard
25 Feb '21
25 Feb '21
Module: wine Branch: master Commit: 7709d9b87063015b6295a6b5bcdcfc52576e4f49 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7709d9b87063015b6295a6b5…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Feb 25 10:04:31 2021 +0300 wbemdisp: Use context object internally for named value set. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemdisp/locator.c | 241 +++++++++++++++++++++++++++++++++++++++-- dlls/wbemdisp/tests/wbemdisp.c | 76 +++++++++++++ 2 files changed, 308 insertions(+), 9 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=7709d9b87063015b6295…
1
0
0
0
Nikolay Sivov : wbemprox: Implement GetValue()/SetValue() for context object.
by Alexandre Julliard
25 Feb '21
25 Feb '21
Module: wine Branch: master Commit: 377853dc512a48971f5e3fc6a18e7f43c0c7af04 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=377853dc512a48971f5e3fc6…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Feb 25 10:04:30 2021 +0300 wbemprox: Implement GetValue()/SetValue() for context object. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wbemprox/services.c | 87 +++++++++++++++++++++++++++++++++++++++--- dlls/wbemprox/tests/services.c | 63 ++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+), 6 deletions(-) diff --git a/dlls/wbemprox/services.c b/dlls/wbemprox/services.c index 965f1b168f1..eff5148ef29 100644 --- a/dlls/wbemprox/services.c +++ b/dlls/wbemprox/services.c @@ -955,12 +955,33 @@ HRESULT WbemServices_create( const WCHAR *namespace, LPVOID *ppObj ) return S_OK; } +struct wbem_context_value +{ + struct list entry; + WCHAR *name; + VARIANT value; +}; + struct wbem_context { IWbemContext IWbemContext_iface; LONG refs; + struct list values; }; +static void wbem_context_delete_values(struct wbem_context *context) +{ + struct wbem_context_value *value, *next; + + LIST_FOR_EACH_ENTRY_SAFE(value, next, &context->values, struct wbem_context_value, entry) + { + list_remove( &value->entry ); + VariantClear( &value->value ); + heap_free( value->name ); + heap_free( value ); + } +} + static struct wbem_context *impl_from_IWbemContext( IWbemContext *iface ) { return CONTAINING_RECORD( iface, struct wbem_context, IWbemContext_iface ); @@ -1004,6 +1025,7 @@ static ULONG WINAPI wbem_context_Release( if (!refs) { TRACE("destroying %p\n", context); + wbem_context_delete_values( context ); heap_free( context ); } return refs; @@ -1056,26 +1078,78 @@ static HRESULT WINAPI wbem_context_EndEnumeration( return E_NOTIMPL; } +static struct wbem_context_value *wbem_context_get_value( struct wbem_context *context, const WCHAR *name ) +{ + struct wbem_context_value *value; + + LIST_FOR_EACH_ENTRY( value, &context->values, struct wbem_context_value, entry ) + { + if (!lstrcmpiW( value->name, name )) return value; + } + + return NULL; +} + static HRESULT WINAPI wbem_context_SetValue( IWbemContext *iface, LPCWSTR name, LONG flags, - VARIANT *value ) + VARIANT *var ) { - FIXME("%p, %s, %#x, %p\n", iface, debugstr_w(name), flags, value); + struct wbem_context *context = impl_from_IWbemContext( iface ); + struct wbem_context_value *value; + HRESULT hr; - return E_NOTIMPL; + TRACE("%p, %s, %#x, %s\n", iface, debugstr_w(name), flags, debugstr_variant(var)); + + if (!name || !var) + return WBEM_E_INVALID_PARAMETER; + + if ((value = wbem_context_get_value( context, name ))) + { + VariantClear( &value->value ); + hr = VariantCopy( &value->value, var ); + } + else + { + if (!(value = heap_alloc_zero( sizeof(*value) ))) return E_OUTOFMEMORY; + if (!(value->name = heap_strdupW( name ))) + { + heap_free( value ); + return E_OUTOFMEMORY; + } + if (FAILED(hr = VariantCopy( &value->value, var ))) + { + heap_free( value->name ); + heap_free( value ); + return hr; + } + + list_add_tail( &context->values, &value->entry ); + } + + return hr; } static HRESULT WINAPI wbem_context_GetValue( IWbemContext *iface, LPCWSTR name, LONG flags, - VARIANT *value ) + VARIANT *var ) { - FIXME("%p, %s, %#x, %p\n", iface, debugstr_w(name), flags, value); + struct wbem_context *context = impl_from_IWbemContext( iface ); + struct wbem_context_value *value; - return E_NOTIMPL; + TRACE("%p, %s, %#x, %p\n", iface, debugstr_w(name), flags, var); + + if (!name || !var) + return WBEM_E_INVALID_PARAMETER; + + if (!(value = wbem_context_get_value( context, name ))) + return WBEM_E_NOT_FOUND; + + V_VT(var) = VT_EMPTY; + return VariantCopy( var, &value->value ); } static HRESULT WINAPI wbem_context_DeleteValue( @@ -1123,6 +1197,7 @@ HRESULT WbemContext_create( void **obj ) context->IWbemContext_iface.lpVtbl = &wbem_context_vtbl; context->refs = 1; + list_init(&context->values); *obj = &context->IWbemContext_iface; diff --git a/dlls/wbemprox/tests/services.c b/dlls/wbemprox/tests/services.c index a60d39f1ef2..ebbc766d6c5 100644 --- a/dlls/wbemprox/tests/services.c +++ b/dlls/wbemprox/tests/services.c @@ -152,11 +152,74 @@ static void test_IWbemLocator(void) static void test_IWbemContext(void) { IWbemContext *context; + VARIANT var; HRESULT hr; + BSTR str; hr = CoCreateInstance( &CLSID_WbemContext, NULL, CLSCTX_INPROC_SERVER, &IID_IWbemContext, (void **)&context ); ok(hr == S_OK, "Failed to create context object, hr %#x.\n", hr); + hr = IWbemContext_SetValue(context, L"name", 0, NULL); + ok(hr == WBEM_E_INVALID_PARAMETER, "Unexpected hr %#x.\n", hr); + + V_VT(&var) = VT_I4; + V_I4(&var) = 12; + hr = IWbemContext_SetValue(context, NULL, 0, &var); + ok(hr == WBEM_E_INVALID_PARAMETER, "Unexpected hr %#x.\n", hr); + + hr = IWbemContext_SetValue(context, L"name", 0, &var); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + hr = IWbemContext_GetValue(context, NULL, 0, &var); + ok(hr == WBEM_E_INVALID_PARAMETER, "Unexpected hr %#x.\n", hr); + + hr = IWbemContext_GetValue(context, L"name", 0, NULL); + ok(hr == WBEM_E_INVALID_PARAMETER, "Unexpected hr %#x.\n", hr); + + hr = IWbemContext_GetValue(context, L"noname", 0, &var); + ok(hr == WBEM_E_NOT_FOUND, "Unexpected hr %#x.\n", hr); + + V_VT(&var) = VT_EMPTY; + hr = IWbemContext_GetValue(context, L"NAME", 0, &var); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(V_VT(&var) == VT_I4, "Unexpected value type.\n"); + + V_VT(&var) = VT_I4; + V_I4(&var) = 13; + hr = IWbemContext_SetValue(context, L"name2", 0, &var); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + hr = IWbemContext_Next(context, 0, &str, &var); +todo_wine + ok(hr == WBEM_E_UNEXPECTED, "Unexpected hr %#x.\n", hr); + + hr = IWbemContext_BeginEnumeration(context, 0); +todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + str = NULL; + hr = IWbemContext_Next(context, 0, &str, &var); +todo_wine { + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(!lstrcmpW(str, L"name"), "Unexpected name %s.\n", wine_dbgstr_w(str)); + SysFreeString(str); +} + hr = IWbemContext_EndEnumeration(context); +todo_wine + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + /* Overwrite */ + V_VT(&var) = VT_I4; + V_I4(&var) = 14; + hr = IWbemContext_SetValue(context, L"name", 0, &var); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + + V_VT(&var) = VT_EMPTY; + hr = IWbemContext_GetValue(context, L"name", 0, &var); + ok(hr == S_OK, "Unexpected hr %#x.\n", hr); + ok(V_VT(&var) == VT_I4, "Unexpected value type.\n"); + ok(V_I4(&var) == 14, "Unexpected value.\n"); + IWbemContext_Release( context ); }
1
0
0
0
Alistair Leslie-Hughes : msado15: Semi-stub _Recordset Open.
by Alexandre Julliard
25 Feb '21
25 Feb '21
Module: wine Branch: master Commit: 83cd24bb41c971d0ae0f99ddae95cd5535973e83 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=83cd24bb41c971d0ae0f99dd…
Author: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Date: Thu Feb 25 06:52:52 2021 +1100 msado15: Semi-stub _Recordset Open. Signed-off-by: Alistair Leslie-Hughes <leslie_alistair(a)hotmail.com> Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/msado15/recordset.c | 54 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/dlls/msado15/recordset.c b/dlls/msado15/recordset.c index 12bb9680258..71df553ebb6 100644 --- a/dlls/msado15/recordset.c +++ b/dlls/msado15/recordset.c @@ -1182,15 +1182,63 @@ static HRESULT WINAPI recordset_Open( _Recordset *iface, VARIANT source, VARIANT CursorTypeEnum cursor_type, LockTypeEnum lock_type, LONG options ) { struct recordset *recordset = impl_from_Recordset( iface ); + ADOConnectionConstruction15 *construct; + IUnknown *session; + ICommandText *command_text; + DBROWCOUNT affected; + IUnknown *rowset; + HRESULT hr; - FIXME( "%p, %s, %s, %d, %d, %d\n", recordset, debugstr_variant(&source), debugstr_variant(&active_connection), + FIXME( "%p, %s, %s, %d, %d, %d Semi-stub\n", recordset, debugstr_variant(&source), debugstr_variant(&active_connection), cursor_type, lock_type, options ); - if (!recordset->fields) return MAKE_ADO_HRESULT( adErrInvalidConnection ); if (recordset->state == adStateOpen) return MAKE_ADO_HRESULT( adErrObjectOpen ); + if (recordset->fields) + { + recordset->state = adStateOpen; + return S_OK; + } + + if (V_VT(&active_connection) != VT_DISPATCH) + { + FIXME("Unsupported Active connection type %d\n", V_VT(&active_connection)); + return MAKE_ADO_HRESULT( adErrInvalidConnection ); + } + + hr = IDispatch_QueryInterface(V_DISPATCH(&active_connection), &IID_ADOConnectionConstruction15, (void**)&construct); + if (FAILED(hr)) + return E_FAIL; + + hr = ADOConnectionConstruction15_get_Session(construct, &session); + ADOConnectionConstruction15_Release(construct); + if (FAILED(hr)) + return E_FAIL; + + if (V_VT(&source) != VT_BSTR) + { + FIXME("Unsupported source type!\n"); + IUnknown_Release(session); + return E_FAIL; + } + + hr = create_command_text(session, V_BSTR(&source), &command_text); + IUnknown_Release(session); + if (FAILED(hr)) + return hr; + + hr = ICommandText_Execute(command_text, NULL, &IID_IUnknown, NULL, &affected, &rowset); + ICommandText_Release(command_text); + if (FAILED(hr)) + return hr; + + ADORecordsetConstruction_put_Rowset(&recordset->ADORecordsetConstruction_iface, rowset); + recordset->cursor_type = cursor_type; recordset->state = adStateOpen; - return S_OK; + + IUnknown_Release(rowset); + + return hr; } static HRESULT WINAPI recordset_Requery( _Recordset *iface, LONG options )
1
0
0
0
Alexandre Julliard : xolehlp: Use --prefer-native instead of DLL_WINE_PREATTACH.
by Alexandre Julliard
25 Feb '21
25 Feb '21
Module: wine Branch: master Commit: 1b826d9f563e235ea366e4599535f9844adab295 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1b826d9f563e235ea366e459…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Feb 25 08:59:52 2021 +0100 xolehlp: Use --prefer-native instead of DLL_WINE_PREATTACH. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/xolehlp/Makefile.in | 2 +- dlls/xolehlp/xolehlp.c | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/dlls/xolehlp/Makefile.in b/dlls/xolehlp/Makefile.in index 37b1d0169fe..629db5e01be 100644 --- a/dlls/xolehlp/Makefile.in +++ b/dlls/xolehlp/Makefile.in @@ -1,6 +1,6 @@ MODULE = xolehlp.dll IMPORTS = adsiid uuid -EXTRADLLFLAGS = -mno-cygwin +EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native C_SRCS = xolehlp.c diff --git a/dlls/xolehlp/xolehlp.c b/dlls/xolehlp/xolehlp.c index 29b30244451..d3355c1c34e 100644 --- a/dlls/xolehlp/xolehlp.c +++ b/dlls/xolehlp/xolehlp.c @@ -630,21 +630,6 @@ static HRESULT TransactionManager_Create(REFIID riid, void **ppv) } /* DTC Proxy Core Object end */ -BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) -{ - TRACE("%p, %u, %p\n", hinst, reason, reserved); - - switch (reason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( hinst ); - break; - } - return TRUE; -} - static BOOL is_local_machineA( const CHAR *server ) { static const CHAR dot[] = ".";
1
0
0
0
Alexandre Julliard : wsnmp32: Use --prefer-native instead of DLL_WINE_PREATTACH.
by Alexandre Julliard
25 Feb '21
25 Feb '21
Module: wine Branch: master Commit: 96d1c58e7087dada6d5d9d45aff0dc07063b0625 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=96d1c58e7087dada6d5d9d45…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Feb 25 08:59:48 2021 +0100 wsnmp32: Use --prefer-native instead of DLL_WINE_PREATTACH. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wsnmp32/Makefile.in | 2 +- dlls/wsnmp32/wsnmp32.c | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/dlls/wsnmp32/Makefile.in b/dlls/wsnmp32/Makefile.in index db01f47b298..c7b263bd964 100644 --- a/dlls/wsnmp32/Makefile.in +++ b/dlls/wsnmp32/Makefile.in @@ -1,6 +1,6 @@ MODULE = wsnmp32.dll IMPORTLIB = wsnmp32 -EXTRADLLFLAGS = -mno-cygwin +EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native C_SRCS = wsnmp32.c diff --git a/dlls/wsnmp32/wsnmp32.c b/dlls/wsnmp32/wsnmp32.c index 3dc54cb5fac..f0df30b3b4c 100644 --- a/dlls/wsnmp32/wsnmp32.c +++ b/dlls/wsnmp32/wsnmp32.c @@ -24,21 +24,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wsnmp32); -BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) -{ - TRACE("%p, %u, %p\n", hinst, reason, reserved); - - switch (reason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( hinst ); - break; - } - return TRUE; -} - SNMPAPI_STATUS WINAPI SnmpCleanup( void ) { FIXME( "\n" );
1
0
0
0
Alexandre Julliard : wmvcore: Use --prefer-native instead of DLL_WINE_PREATTACH.
by Alexandre Julliard
25 Feb '21
25 Feb '21
Module: wine Branch: master Commit: 1243c4e2c8e61ceb0fda179d3e6deffd8e043764 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1243c4e2c8e61ceb0fda179d…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Feb 25 08:59:44 2021 +0100 wmvcore: Use --prefer-native instead of DLL_WINE_PREATTACH. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wmvcore/Makefile.in | 2 +- dlls/wmvcore/wmvcore_main.c | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/dlls/wmvcore/Makefile.in b/dlls/wmvcore/Makefile.in index c0b582775eb..e4efe0d3873 100644 --- a/dlls/wmvcore/Makefile.in +++ b/dlls/wmvcore/Makefile.in @@ -2,7 +2,7 @@ MODULE = wmvcore.dll IMPORTLIB = wmvcore IMPORTS = kernel32 -EXTRADLLFLAGS = -mno-cygwin +EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native C_SRCS = \ reader.c \ diff --git a/dlls/wmvcore/wmvcore_main.c b/dlls/wmvcore/wmvcore_main.c index 4dafcf8055a..7d030a0e93a 100644 --- a/dlls/wmvcore/wmvcore_main.c +++ b/dlls/wmvcore/wmvcore_main.c @@ -25,22 +25,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wmvcore); -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) -{ - TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); - - switch (fdwReason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hinstDLL); - break; - } - - return TRUE; -} - HRESULT WINAPI DllRegisterServer(void) { FIXME("(): stub\n");
1
0
0
0
Alexandre Julliard : wlanapi: Use --prefer-native instead of DLL_WINE_PREATTACH.
by Alexandre Julliard
25 Feb '21
25 Feb '21
Module: wine Branch: master Commit: 8457f1376efafad33966f3cc609f2e9b3704857a URL:
https://source.winehq.org/git/wine.git/?a=commit;h=8457f1376efafad33966f3cc…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Thu Feb 25 08:59:40 2021 +0100 wlanapi: Use --prefer-native instead of DLL_WINE_PREATTACH. Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wlanapi/Makefile.in | 2 +- dlls/wlanapi/main.c | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/dlls/wlanapi/Makefile.in b/dlls/wlanapi/Makefile.in index 5cc2287c2d9..ab1a04ac241 100644 --- a/dlls/wlanapi/Makefile.in +++ b/dlls/wlanapi/Makefile.in @@ -1,7 +1,7 @@ MODULE = wlanapi.dll IMPORTLIB = wlanapi -EXTRADLLFLAGS = -mno-cygwin +EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native C_SRCS = \ main.c diff --git a/dlls/wlanapi/main.c b/dlls/wlanapi/main.c index cfffeedb110..d54cc1463ba 100644 --- a/dlls/wlanapi/main.c +++ b/dlls/wlanapi/main.c @@ -197,19 +197,3 @@ void *WINAPI WlanAllocateMemory(DWORD size) return ret; } - -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, void *reserved) -{ - TRACE("(0x%p, %u, %p)\n", hinstDLL, reason, reserved); - - switch (reason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hinstDLL); - break; - } - - return TRUE; -}
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
92
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Results per page:
10
25
50
100
200