diff --git a/patches/advapi-LsaLookupPrivilegeName/0001-advapi32-Fix-error-code-when-calling-LsaOpenPolicy-f.patch b/patches/advapi-LsaLookupPrivilegeName/0001-advapi32-Fix-error-code-when-calling-LsaOpenPolicy-f.patch index ae3d603a..f2b77566 100644 --- a/patches/advapi-LsaLookupPrivilegeName/0001-advapi32-Fix-error-code-when-calling-LsaOpenPolicy-f.patch +++ b/patches/advapi-LsaLookupPrivilegeName/0001-advapi32-Fix-error-code-when-calling-LsaOpenPolicy-f.patch @@ -1,4 +1,4 @@ -From ce0ab0ccd6e4953a9673d15e00cf602668469c2c Mon Sep 17 00:00:00 2001 +From 971cfbe9ab8a7cb62c5b3e62fe4fe0bfc4518889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Sun, 5 Mar 2017 23:04:36 +0100 Subject: advapi32: Fix error code when calling LsaOpenPolicy for non existing @@ -10,10 +10,10 @@ Subject: advapi32: Fix error code when calling LsaOpenPolicy for non existing 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c -index b8dedbd6d58..e5e3b1649c0 100644 +index bfd879bbc73..2e021a1ec2d 100644 --- a/dlls/advapi32/lsa.c +++ b/dlls/advapi32/lsa.c -@@ -692,7 +692,7 @@ NTSTATUS WINAPI LsaOpenPolicy( +@@ -659,7 +659,7 @@ NTSTATUS WINAPI LsaOpenPolicy( ObjectAttributes, DesiredAccess, PolicyHandle); ADVAPI_ForceLocalComputer(SystemName ? SystemName->Buffer : NULL, @@ -23,10 +23,10 @@ index b8dedbd6d58..e5e3b1649c0 100644 if(PolicyHandle) *PolicyHandle = (LSA_HANDLE)0xcafe; diff --git a/dlls/advapi32/tests/lsa.c b/dlls/advapi32/tests/lsa.c -index 4daf75f58d1..7ddda731be2 100644 +index 861fea0525e..bb291e65a71 100644 --- a/dlls/advapi32/tests/lsa.c +++ b/dlls/advapi32/tests/lsa.c -@@ -70,6 +70,8 @@ static BOOL init(void) +@@ -39,6 +39,8 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0); static void test_lsa(void) { @@ -35,7 +35,7 @@ index 4daf75f58d1..7ddda731be2 100644 NTSTATUS status; LSA_HANDLE handle; LSA_OBJECT_ATTRIBUTES object_attributes; -@@ -77,6 +79,14 @@ static void test_lsa(void) +@@ -46,6 +48,14 @@ static void test_lsa(void) ZeroMemory(&object_attributes, sizeof(object_attributes)); object_attributes.Length = sizeof(object_attributes); @@ -43,13 +43,13 @@ index 4daf75f58d1..7ddda731be2 100644 + machine.Length = sizeof(machineW) - 2; + machine.MaximumLength = sizeof(machineW); + -+ status = pLsaOpenPolicy( &machine, &object_attributes, POLICY_LOOKUP_NAMES, &handle); ++ status = LsaOpenPolicy( &machine, &object_attributes, POLICY_LOOKUP_NAMES, &handle); + ok(status == RPC_NT_SERVER_UNAVAILABLE, + "LsaOpenPolicy(POLICY_LOOKUP_NAMES) for invalid machine returned 0x%08x\n", status); + - status = pLsaOpenPolicy( NULL, &object_attributes, POLICY_ALL_ACCESS, &handle); + status = LsaOpenPolicy( NULL, &object_attributes, POLICY_ALL_ACCESS, &handle); ok(status == STATUS_SUCCESS || status == STATUS_ACCESS_DENIED, "LsaOpenPolicy(POLICY_ALL_ACCESS) returned 0x%08x\n", status); -- -2.11.0 +2.14.2 diff --git a/patches/advapi-LsaLookupPrivilegeName/0003-advapi32-Implement-LsaLookupPrivilegeName.patch b/patches/advapi-LsaLookupPrivilegeName/0003-advapi32-Implement-LsaLookupPrivilegeName.patch deleted file mode 100644 index 711e4f71..00000000 --- a/patches/advapi-LsaLookupPrivilegeName/0003-advapi32-Implement-LsaLookupPrivilegeName.patch +++ /dev/null @@ -1,141 +0,0 @@ -From ca415799729a5330fc9def2df8fb9c4ffef80448 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sun, 5 Mar 2017 23:50:06 +0100 -Subject: advapi32: Implement LsaLookupPrivilegeName. - ---- - dlls/advapi32/advapi32_misc.h | 2 ++ - dlls/advapi32/lsa.c | 30 ++++++++++++++++++++++++++++-- - dlls/advapi32/security.c | 27 ++++++++++++++++++--------- - include/ntsecapi.h | 1 + - 4 files changed, 49 insertions(+), 11 deletions(-) - -diff --git a/dlls/advapi32/advapi32_misc.h b/dlls/advapi32/advapi32_misc.h -index d116ecb836e..ecb07f635a6 100644 ---- a/dlls/advapi32/advapi32_misc.h -+++ b/dlls/advapi32/advapi32_misc.h -@@ -68,4 +68,6 @@ static inline WCHAR *strdupAW( const char *src ) - return dst; - } - -+const WCHAR * const WellKnownPrivNames[SE_MAX_WELL_KNOWN_PRIVILEGE + 1]; -+ - #endif /* __WINE_ADVAPI32MISC_H */ -diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c -index 61c91f497eb..e6f88d2fa73 100644 ---- a/dlls/advapi32/lsa.c -+++ b/dlls/advapi32/lsa.c -@@ -983,6 +983,32 @@ NTSTATUS WINAPI LsaLookupPrivilegeName( - LUID *luid, - UNICODE_STRING **name) - { -- FIXME("(%p,%p,%p) stub\n", handle, luid, name); -- return STATUS_NO_SUCH_PRIVILEGE; -+ UNICODE_STRING *priv_unicode; -+ size_t priv_size; -+ WCHAR *strW; -+ -+ TRACE("(%p, %p, %p)\n", handle, luid, name); -+ -+ if (!handle) -+ return STATUS_INVALID_HANDLE; -+ -+ if (!name) -+ return STATUS_INVALID_PARAMETER; -+ -+ if (luid->HighPart || -+ (luid->LowPart < SE_MIN_WELL_KNOWN_PRIVILEGE || -+ luid->LowPart > SE_MAX_WELL_KNOWN_PRIVILEGE || -+ !WellKnownPrivNames[luid->LowPart])) -+ return STATUS_NO_SUCH_PRIVILEGE; -+ -+ priv_size = (strlenW(WellKnownPrivNames[luid->LowPart]) + 1) * sizeof(WCHAR); -+ priv_unicode = heap_alloc(sizeof(*priv_unicode) + priv_size); -+ if (!priv_unicode) return STATUS_NO_MEMORY; -+ -+ strW = (WCHAR *)(priv_unicode + 1); -+ strcpyW(strW, WellKnownPrivNames[luid->LowPart]); -+ RtlInitUnicodeString(priv_unicode, strW); -+ -+ *name = priv_unicode; -+ return STATUS_SUCCESS; - } -diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c -index e36792cff4b..3bc8f48b19c 100644 ---- a/dlls/advapi32/security.c -+++ b/dlls/advapi32/security.c -@@ -1840,7 +1840,7 @@ static const WCHAR SE_IMPERSONATE_NAME_W[] = - static const WCHAR SE_CREATE_GLOBAL_NAME_W[] = - { 'S','e','C','r','e','a','t','e','G','l','o','b','a','l','P','r','i','v','i','l','e','g','e',0 }; - --static const WCHAR * const WellKnownPrivNames[SE_MAX_WELL_KNOWN_PRIVILEGE + 1] = -+const WCHAR * const WellKnownPrivNames[SE_MAX_WELL_KNOWN_PRIVILEGE + 1] = - { - NULL, - NULL, -@@ -2043,33 +2043,42 @@ BOOL WINAPI - LookupPrivilegeNameW( LPCWSTR lpSystemName, PLUID lpLuid, LPWSTR lpName, - LPDWORD cchName) - { -+ UNICODE_STRING system_name, *priv; -+ LSA_HANDLE lsa; -+ NTSTATUS status; - size_t privNameLen; - - TRACE("%s,%p,%p,%p\n",debugstr_w(lpSystemName), lpLuid, lpName, cchName); - -- if (!ADVAPI_IsLocalComputer(lpSystemName)) -+ RtlInitUnicodeString(&system_name, lpSystemName); -+ status = LsaOpenPolicy(&system_name, NULL, POLICY_LOOKUP_NAMES, &lsa); -+ if (status) - { -- SetLastError(RPC_S_SERVER_UNAVAILABLE); -+ SetLastError(LsaNtStatusToWinError(status)); - return FALSE; - } -- if (lpLuid->HighPart || (lpLuid->LowPart < SE_MIN_WELL_KNOWN_PRIVILEGE || -- lpLuid->LowPart > SE_MAX_WELL_KNOWN_PRIVILEGE)) -+ -+ status = LsaLookupPrivilegeName(&lsa, lpLuid, &priv); -+ LsaClose(lsa); -+ if (status) - { -- SetLastError(ERROR_NO_SUCH_PRIVILEGE); -+ SetLastError(LsaNtStatusToWinError(status)); - return FALSE; - } -- privNameLen = strlenW(WellKnownPrivNames[lpLuid->LowPart]); -- /* Windows crashes if cchName is NULL, so will I */ -+ -+ privNameLen = priv->Length / sizeof(WCHAR); - if (*cchName <= privNameLen) - { - *cchName = privNameLen + 1; -+ LsaFreeMemory(priv); - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return FALSE; - } - else - { -- strcpyW(lpName, WellKnownPrivNames[lpLuid->LowPart]); -+ strcpyW(lpName, priv->Buffer); - *cchName = privNameLen; -+ LsaFreeMemory(priv); - return TRUE; - } - } -diff --git a/include/ntsecapi.h b/include/ntsecapi.h -index 2bb3d312e43..0bf0eca43ed 100644 ---- a/include/ntsecapi.h -+++ b/include/ntsecapi.h -@@ -370,6 +370,7 @@ NTSTATUS WINAPI LsaLookupNames(LSA_HANDLE,ULONG,PLSA_UNICODE_STRING,PLSA_REFEREN - PLSA_TRANSLATED_SID*); - NTSTATUS WINAPI LsaLookupNames2(LSA_HANDLE,ULONG,ULONG,PLSA_UNICODE_STRING,PLSA_REFERENCED_DOMAIN_LIST*, - PLSA_TRANSLATED_SID2*); -+NTSTATUS WINAPI LsaLookupPrivilegeName(LSA_HANDLE,PLUID,PUNICODE_STRING*); - NTSTATUS WINAPI LsaLookupSids(LSA_HANDLE,ULONG,PSID *,PLSA_REFERENCED_DOMAIN_LIST *,PLSA_TRANSLATED_NAME *); - ULONG WINAPI LsaNtStatusToWinError(NTSTATUS); - NTSTATUS WINAPI LsaOpenPolicy(PLSA_UNICODE_STRING,PLSA_OBJECT_ATTRIBUTES,ACCESS_MASK,PLSA_HANDLE); --- -2.14.1 - diff --git a/patches/advapi-LsaLookupPrivilegeName/0004-advapi32-Add-stub-for-LsaLookupPrivilegeDisplayName.patch b/patches/advapi-LsaLookupPrivilegeName/0004-advapi32-Add-stub-for-LsaLookupPrivilegeDisplayName.patch deleted file mode 100644 index a72abc26..00000000 --- a/patches/advapi-LsaLookupPrivilegeName/0004-advapi32-Add-stub-for-LsaLookupPrivilegeDisplayName.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 63d642a1af3ccc579123cb8fd13959ab5e9136dd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Mon, 6 Mar 2017 00:01:53 +0100 -Subject: advapi32: Add stub for LsaLookupPrivilegeDisplayName. - ---- - dlls/advapi32/advapi32.spec | 2 +- - dlls/advapi32/lsa.c | 21 +++++++++++++++++++++ - 2 files changed, 22 insertions(+), 1 deletion(-) - -diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec -index 124f527282..0b03cec3f5 100644 ---- a/dlls/advapi32/advapi32.spec -+++ b/dlls/advapi32/advapi32.spec -@@ -468,7 +468,7 @@ - # @ stub LsaICLookupSidsWithCreds - @ stdcall LsaLookupNames(long long ptr ptr ptr) - @ stdcall LsaLookupNames2(ptr long long ptr ptr ptr) --@ stub LsaLookupPrivilegeDisplayName -+@ stdcall LsaLookupPrivilegeDisplayName(long ptr ptr ptr) - @ stdcall LsaLookupPrivilegeName(long ptr ptr) - # @ stub LsaLookupPrivilegeValue - @ stdcall LsaLookupSids(ptr long ptr ptr ptr) -diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c -index ceb3b05c05..c2e02fb462 100644 ---- a/dlls/advapi32/lsa.c -+++ b/dlls/advapi32/lsa.c -@@ -44,6 +44,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(advapi); - return FailureCode; \ - } - -+static LPCSTR debugstr_us( const UNICODE_STRING *us ) -+{ -+ if (!us) return "(null)"; -+ return debugstr_wn(us->Buffer, us->Length / sizeof(WCHAR)); -+} -+ - static void dumpLsaAttributes(const LSA_OBJECT_ATTRIBUTES *oa) - { - if (oa) -@@ -1011,3 +1017,18 @@ NTSTATUS WINAPI LsaLookupPrivilegeName( - *name = priv_unicode; - return STATUS_SUCCESS; - } -+ -+/****************************************************************************** -+ * LsaLookupPrivilegeDisplayName [ADVAPI32.@] -+ * -+ */ -+NTSTATUS WINAPI LsaLookupPrivilegeDisplayName( -+ LSA_HANDLE handle, -+ PLSA_UNICODE_STRING name, -+ PLSA_UNICODE_STRING *dispname, -+ SHORT *language) -+{ -+ FIXME("(%p, %s, %p, %p)\n", handle, debugstr_us(name), dispname, language); -+ -+ return STATUS_NO_SUCH_PRIVILEGE; -+} --- -2.11.0 - diff --git a/patches/advapi-LsaLookupPrivilegeName/definition b/patches/advapi-LsaLookupPrivilegeName/definition deleted file mode 100644 index 1099a8ff..00000000 --- a/patches/advapi-LsaLookupPrivilegeName/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [43316] Add LsaLookupPrivilege[Display]Name stubs diff --git a/patches/ntdll-Junction_Points/0001-ntdll-Add-support-for-junction-point-creation.patch b/patches/ntdll-Junction_Points/0001-ntdll-Add-support-for-junction-point-creation.patch index 8091200d..1ff20af3 100644 --- a/patches/ntdll-Junction_Points/0001-ntdll-Add-support-for-junction-point-creation.patch +++ b/patches/ntdll-Junction_Points/0001-ntdll-Add-support-for-junction-point-creation.patch @@ -1,4 +1,4 @@ -From 76d196e4f7e4b4a74dbd4777a29a39a3baf3762d Mon Sep 17 00:00:00 2001 +From 61bf2e5fc768bcdf7c28fa459c9e1f8a98912169 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Thu, 16 Jan 2014 20:56:49 -0700 Subject: ntdll: Add support for junction point creation. @@ -12,7 +12,7 @@ Subject: ntdll: Add support for junction point creation. create mode 100644 include/ntifs.h diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c -index 9ebcdd54bc3..0ebbd3a90ec 100644 +index 6a456efc46c..a058e9b362f 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -108,12 +108,14 @@ @@ -30,7 +30,7 @@ index 9ebcdd54bc3..0ebbd3a90ec 100644 #define SECSPERDAY 86400 #define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY) -@@ -1655,6 +1657,76 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event, +@@ -1653,6 +1655,76 @@ NTSTATUS WINAPI NtDeviceIoControlFile(HANDLE handle, HANDLE event, } @@ -107,7 +107,7 @@ index 9ebcdd54bc3..0ebbd3a90ec 100644 /************************************************************************** * NtFsControlFile [NTDLL.@] * ZwFsControlFile [NTDLL.@] -@@ -1807,11 +1879,30 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc +@@ -1742,11 +1814,30 @@ NTSTATUS WINAPI NtFsControlFile(HANDLE handle, HANDLE event, PIO_APC_ROUTINE apc } break; } @@ -139,7 +139,7 @@ index 9ebcdd54bc3..0ebbd3a90ec 100644 return server_ioctl_file( handle, event, apc, apc_context, io, code, in_buffer, in_size, out_buffer, out_size ); diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c -index f66ac1d74f0..86fd6d0bc65 100644 +index d1b8e5fee84..cfa60961d6d 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -37,6 +37,7 @@ @@ -150,7 +150,7 @@ index f66ac1d74f0..86fd6d0bc65 100644 #ifndef IO_COMPLETION_ALL_ACCESS #define IO_COMPLETION_ALL_ACCESS 0x001F0003 -@@ -4378,6 +4379,98 @@ static void test_query_ea(void) +@@ -4374,6 +4375,98 @@ static void test_query_ea(void) #undef EA_BUFFER_SIZE } @@ -249,24 +249,24 @@ index f66ac1d74f0..86fd6d0bc65 100644 START_TEST(file) { HMODULE hkernel32 = GetModuleHandleA("kernel32.dll"); -@@ -4444,4 +4537,5 @@ START_TEST(file) +@@ -4440,4 +4533,5 @@ START_TEST(file) test_ioctl(); test_flush_buffers_file(); test_query_ea(); + test_junction_points(); } diff --git a/include/Makefile.in b/include/Makefile.in -index 1dd6aafa324..31a6ac1d441 100644 +index cc42f66ebd4..255797759fb 100644 --- a/include/Makefile.in +++ b/include/Makefile.in -@@ -532,6 +532,7 @@ HEADER_SRCS = \ +@@ -550,6 +550,7 @@ HEADER_SRCS = \ ntddstor.h \ ntdef.h \ ntdsapi.h \ + ntifs.h \ + ntlsa.h \ ntquery.h \ ntsecapi.h \ - ntsecpkg.h \ diff --git a/include/ntifs.h b/include/ntifs.h new file mode 100644 index 00000000000..db07c28a5df @@ -326,5 +326,5 @@ index 00000000000..db07c28a5df + +#endif /* __WINE_NTIFS_H */ -- -2.13.1 +2.14.2 diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index a8c1491a..c581acdd 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -52,7 +52,7 @@ usage() # Get the upstream commit sha upstream_commit() { - echo "31ef99245ae8cd08b2bb611a2a8803c6206f4d54" + echo "2c51fc1bfc1d551aebb47616c19d3329c5e0f7f6" } # Show version information @@ -3076,23 +3076,15 @@ fi # Patchset advapi-LsaLookupPrivilegeName # | -# | This patchset fixes the following Wine bugs: -# | * [#43316] Add LsaLookupPrivilege[Display]Name stubs -# | # | Modified files: -# | * dlls/advapi32/advapi32.spec, dlls/advapi32/advapi32_misc.h, dlls/advapi32/lsa.c, dlls/advapi32/security.c, -# | dlls/advapi32/tests/lsa.c, include/ntsecapi.h +# | * dlls/advapi32/lsa.c, dlls/advapi32/tests/lsa.c # | if test "$enable_advapi_LsaLookupPrivilegeName" -eq 1; then patch_apply advapi-LsaLookupPrivilegeName/0001-advapi32-Fix-error-code-when-calling-LsaOpenPolicy-f.patch patch_apply advapi-LsaLookupPrivilegeName/0002-advapi32-Use-TRACE-for-LsaOpenPolicy-LsaClose.patch - patch_apply advapi-LsaLookupPrivilegeName/0003-advapi32-Implement-LsaLookupPrivilegeName.patch - patch_apply advapi-LsaLookupPrivilegeName/0004-advapi32-Add-stub-for-LsaLookupPrivilegeDisplayName.patch ( printf '%s\n' '+ { "Michael Müller", "advapi32: Fix error code when calling LsaOpenPolicy for non existing remote machine.", 1 },'; printf '%s\n' '+ { "Michael Müller", "advapi32: Use TRACE for LsaOpenPolicy/LsaClose.", 1 },'; - printf '%s\n' '+ { "Michael Müller", "advapi32: Implement LsaLookupPrivilegeName.", 1 },'; - printf '%s\n' '+ { "Michael Müller", "advapi32: Add stub for LsaLookupPrivilegeDisplayName.", 1 },'; ) >> "$patchlist" fi