mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Rebase against c5023aea7e97213159b754a168b7abddc89664bb
This commit is contained in:
parent
3e2b8a53bb
commit
5b388bb912
@ -1,268 +0,0 @@
|
||||
From 95fd708dbdd9f8d61fdd8f1571c44e98c54b8988 Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Wesie <awesie@gmail.com>
|
||||
Date: Tue, 2 May 2017 00:59:49 -0500
|
||||
Subject: [PATCH] advapi32: Implement BuildSecurityDescriptorW.
|
||||
|
||||
---
|
||||
dlls/advapi32/security.c | 218 +++++++++++++++++++++++++++++++++++------------
|
||||
1 file changed, 164 insertions(+), 54 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
|
||||
index 6f4fb44..3737827 100644
|
||||
--- a/dlls/advapi32/security.c
|
||||
+++ b/dlls/advapi32/security.c
|
||||
@@ -48,6 +48,7 @@
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(advapi);
|
||||
|
||||
static BOOL ParseStringSidToSid(LPCWSTR StringSid, PSID pSid, LPDWORD cBytes);
|
||||
+static DWORD trustee_to_sid(DWORD nDestinationSidLength, PSID pDestinationSid, PTRUSTEEW pTrustee);
|
||||
|
||||
typedef struct _ACEFLAG
|
||||
{
|
||||
@@ -1255,16 +1256,122 @@ DWORD WINAPI BuildSecurityDescriptorW(
|
||||
IN ULONG cCountOfAccessEntries,
|
||||
IN PEXPLICIT_ACCESSW pListOfAccessEntries,
|
||||
IN ULONG cCountOfAuditEntries,
|
||||
- IN PEXPLICIT_ACCESSW pListofAuditEntries,
|
||||
+ IN PEXPLICIT_ACCESSW pListOfAuditEntries,
|
||||
IN PSECURITY_DESCRIPTOR pOldSD,
|
||||
IN OUT PULONG lpdwBufferLength,
|
||||
OUT PSECURITY_DESCRIPTOR* pNewSD)
|
||||
{
|
||||
- FIXME("(%p,%p,%d,%p,%d,%p,%p,%p,%p) stub!\n",pOwner,pGroup,
|
||||
- cCountOfAccessEntries,pListOfAccessEntries,cCountOfAuditEntries,
|
||||
- pListofAuditEntries,pOldSD,lpdwBufferLength,pNewSD);
|
||||
+ SECURITY_DESCRIPTOR desc;
|
||||
+ NTSTATUS status;
|
||||
+ DWORD ret = ERROR_SUCCESS;
|
||||
+
|
||||
+ TRACE("(%p,%p,%d,%p,%d,%p,%p,%p,%p)\n", pOwner, pGroup,
|
||||
+ cCountOfAccessEntries, pListOfAccessEntries, cCountOfAuditEntries,
|
||||
+ pListOfAuditEntries, pOldSD, lpdwBufferLength, pNewSD);
|
||||
|
||||
- return ERROR_CALL_NOT_IMPLEMENTED;
|
||||
+ if (pOldSD)
|
||||
+ {
|
||||
+ SECURITY_DESCRIPTOR_CONTROL control;
|
||||
+ DWORD desc_size, dacl_size = 0, sacl_size = 0, owner_size = 0, group_size = 0;
|
||||
+ PACL dacl = NULL, sacl = NULL;
|
||||
+ PSID owner = NULL, group = NULL;
|
||||
+ DWORD revision;
|
||||
+
|
||||
+ if ((status = RtlGetControlSecurityDescriptor( pOldSD, &control, &revision )) != STATUS_SUCCESS)
|
||||
+ return RtlNtStatusToDosError( status );
|
||||
+ if (!(control & SE_SELF_RELATIVE))
|
||||
+ return ERROR_INVALID_SECURITY_DESCR;
|
||||
+
|
||||
+ desc_size = sizeof(desc);
|
||||
+ status = RtlSelfRelativeToAbsoluteSD( pOldSD, &desc, &desc_size, dacl, &dacl_size, sacl, &sacl_size,
|
||||
+ owner, &owner_size, group, &group_size );
|
||||
+ if (status == STATUS_BUFFER_TOO_SMALL)
|
||||
+ {
|
||||
+ if (dacl_size)
|
||||
+ dacl = LocalAlloc( LMEM_FIXED, dacl_size );
|
||||
+ if (sacl_size)
|
||||
+ sacl = LocalAlloc( LMEM_FIXED, sacl_size );
|
||||
+ if (owner_size)
|
||||
+ owner = LocalAlloc( LMEM_FIXED, owner_size );
|
||||
+ if (group_size)
|
||||
+ group = LocalAlloc( LMEM_FIXED, group_size );
|
||||
+
|
||||
+ desc_size = sizeof(desc);
|
||||
+ status = RtlSelfRelativeToAbsoluteSD( pOldSD, &desc, &desc_size, dacl, &dacl_size, sacl, &sacl_size,
|
||||
+ owner, &owner_size, group, &group_size );
|
||||
+ }
|
||||
+ if (status != STATUS_SUCCESS)
|
||||
+ {
|
||||
+ LocalFree( dacl );
|
||||
+ LocalFree( sacl );
|
||||
+ LocalFree( owner );
|
||||
+ LocalFree( group );
|
||||
+ return RtlNtStatusToDosError( status );
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if ((status = RtlCreateSecurityDescriptor( &desc, SECURITY_DESCRIPTOR_REVISION )) != STATUS_SUCCESS)
|
||||
+ return RtlNtStatusToDosError( status );
|
||||
+ }
|
||||
+
|
||||
+ if (pOwner)
|
||||
+ {
|
||||
+ LocalFree( desc.Owner );
|
||||
+ desc.Owner = LocalAlloc( LMEM_FIXED, sizeof(MAX_SID) );
|
||||
+ if ((ret = trustee_to_sid( sizeof(MAX_SID), desc.Owner, pOwner )))
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ if (pGroup)
|
||||
+ {
|
||||
+ LocalFree( desc.Group );
|
||||
+ desc.Group = LocalAlloc( LMEM_FIXED, sizeof(MAX_SID) );
|
||||
+ if ((ret = trustee_to_sid( sizeof(MAX_SID), desc.Group, pGroup )))
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ if (pListOfAccessEntries)
|
||||
+ {
|
||||
+ PACL new_dacl;
|
||||
+
|
||||
+ if ((ret = SetEntriesInAclW( cCountOfAccessEntries, pListOfAccessEntries, desc.Dacl, &new_dacl )))
|
||||
+ goto done;
|
||||
+
|
||||
+ LocalFree( desc.Dacl );
|
||||
+ desc.Dacl = new_dacl;
|
||||
+ desc.Control |= SE_DACL_PRESENT;
|
||||
+ }
|
||||
+
|
||||
+ if (pListOfAuditEntries)
|
||||
+ {
|
||||
+ PACL new_sacl;
|
||||
+
|
||||
+ if ((ret = SetEntriesInAclW( cCountOfAuditEntries, pListOfAuditEntries, desc.Sacl, &new_sacl )))
|
||||
+ goto done;
|
||||
+
|
||||
+ LocalFree( desc.Sacl );
|
||||
+ desc.Sacl = new_sacl;
|
||||
+ desc.Control |= SE_SACL_PRESENT;
|
||||
+ }
|
||||
+
|
||||
+ *lpdwBufferLength = RtlLengthSecurityDescriptor( &desc );
|
||||
+ *pNewSD = LocalAlloc( LMEM_FIXED, *lpdwBufferLength );
|
||||
+
|
||||
+ if ((status = RtlMakeSelfRelativeSD( &desc, *pNewSD, lpdwBufferLength )) != STATUS_SUCCESS)
|
||||
+ {
|
||||
+ ret = RtlNtStatusToDosError( status );
|
||||
+ LocalFree( *pNewSD );
|
||||
+ *pNewSD = NULL;
|
||||
+ }
|
||||
+
|
||||
+done:
|
||||
+ /* free absolute descriptor */
|
||||
+ LocalFree( desc.Owner );
|
||||
+ LocalFree( desc.Group );
|
||||
+ LocalFree( desc.Sacl );
|
||||
+ LocalFree( desc.Dacl );
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
@@ -3754,6 +3861,56 @@ static void free_trustee_name(TRUSTEE_FORM form, WCHAR *trustee_nameW)
|
||||
}
|
||||
}
|
||||
|
||||
+static DWORD trustee_to_sid( DWORD nDestinationSidLength, PSID pDestinationSid, PTRUSTEEW pTrustee )
|
||||
+{
|
||||
+ if (pTrustee->MultipleTrusteeOperation == TRUSTEE_IS_IMPERSONATE)
|
||||
+ {
|
||||
+ WARN("bad multiple trustee operation %d\n", pTrustee->MultipleTrusteeOperation);
|
||||
+ return ERROR_INVALID_PARAMETER;
|
||||
+ }
|
||||
+
|
||||
+ switch (pTrustee->TrusteeForm)
|
||||
+ {
|
||||
+ case TRUSTEE_IS_SID:
|
||||
+ if (!CopySid(nDestinationSidLength, pDestinationSid, pTrustee->ptstrName))
|
||||
+ {
|
||||
+ WARN("bad sid %p\n", pTrustee->ptstrName);
|
||||
+ return ERROR_INVALID_PARAMETER;
|
||||
+ }
|
||||
+ break;
|
||||
+ case TRUSTEE_IS_NAME:
|
||||
+ {
|
||||
+ DWORD sid_size = nDestinationSidLength;
|
||||
+ DWORD domain_size = MAX_COMPUTERNAME_LENGTH + 1;
|
||||
+ SID_NAME_USE use;
|
||||
+ if (!strcmpW( pTrustee->ptstrName, CURRENT_USER ))
|
||||
+ {
|
||||
+ if (!lookup_user_account_name( pDestinationSid, &sid_size, NULL, &domain_size, &use ))
|
||||
+ {
|
||||
+ return GetLastError();
|
||||
+ }
|
||||
+ }
|
||||
+ else if (!LookupAccountNameW(NULL, pTrustee->ptstrName, pDestinationSid, &sid_size, NULL, &domain_size, &use))
|
||||
+ {
|
||||
+ WARN("bad user name %s\n", debugstr_w(pTrustee->ptstrName));
|
||||
+ return ERROR_INVALID_PARAMETER;
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ case TRUSTEE_IS_OBJECTS_AND_SID:
|
||||
+ FIXME("TRUSTEE_IS_OBJECTS_AND_SID unimplemented\n");
|
||||
+ break;
|
||||
+ case TRUSTEE_IS_OBJECTS_AND_NAME:
|
||||
+ FIXME("TRUSTEE_IS_OBJECTS_AND_NAME unimplemented\n");
|
||||
+ break;
|
||||
+ default:
|
||||
+ WARN("bad trustee form %d\n", pTrustee->TrusteeForm);
|
||||
+ return ERROR_INVALID_PARAMETER;
|
||||
+ }
|
||||
+
|
||||
+ return ERROR_SUCCESS;
|
||||
+}
|
||||
+
|
||||
/******************************************************************************
|
||||
* SetEntriesInAclA [ADVAPI32.@]
|
||||
*/
|
||||
@@ -3849,56 +4006,9 @@ DWORD WINAPI SetEntriesInAclW( ULONG count, PEXPLICIT_ACCESSW pEntries,
|
||||
pEntries[i].Trustee.TrusteeForm, pEntries[i].Trustee.TrusteeType,
|
||||
pEntries[i].Trustee.ptstrName);
|
||||
|
||||
- if (pEntries[i].Trustee.MultipleTrusteeOperation == TRUSTEE_IS_IMPERSONATE)
|
||||
- {
|
||||
- WARN("bad multiple trustee operation %d for trustee %d\n", pEntries[i].Trustee.MultipleTrusteeOperation, i);
|
||||
- ret = ERROR_INVALID_PARAMETER;
|
||||
- goto exit;
|
||||
- }
|
||||
-
|
||||
- switch (pEntries[i].Trustee.TrusteeForm)
|
||||
- {
|
||||
- case TRUSTEE_IS_SID:
|
||||
- if (!CopySid(FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]),
|
||||
- ppsid[i], pEntries[i].Trustee.ptstrName))
|
||||
- {
|
||||
- WARN("bad sid %p for trustee %d\n", pEntries[i].Trustee.ptstrName, i);
|
||||
- ret = ERROR_INVALID_PARAMETER;
|
||||
- goto exit;
|
||||
- }
|
||||
- break;
|
||||
- case TRUSTEE_IS_NAME:
|
||||
- {
|
||||
- DWORD sid_size = FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]);
|
||||
- DWORD domain_size = MAX_COMPUTERNAME_LENGTH + 1;
|
||||
- SID_NAME_USE use;
|
||||
- if (!strcmpW( pEntries[i].Trustee.ptstrName, CURRENT_USER ))
|
||||
- {
|
||||
- if (!lookup_user_account_name( ppsid[i], &sid_size, NULL, &domain_size, &use ))
|
||||
- {
|
||||
- ret = GetLastError();
|
||||
- goto exit;
|
||||
- }
|
||||
- }
|
||||
- else if (!LookupAccountNameW(NULL, pEntries[i].Trustee.ptstrName, ppsid[i], &sid_size, NULL, &domain_size, &use))
|
||||
- {
|
||||
- WARN("bad user name %s for trustee %d\n", debugstr_w(pEntries[i].Trustee.ptstrName), i);
|
||||
- ret = ERROR_INVALID_PARAMETER;
|
||||
- goto exit;
|
||||
- }
|
||||
- break;
|
||||
- }
|
||||
- case TRUSTEE_IS_OBJECTS_AND_SID:
|
||||
- FIXME("TRUSTEE_IS_OBJECTS_AND_SID unimplemented\n");
|
||||
- break;
|
||||
- case TRUSTEE_IS_OBJECTS_AND_NAME:
|
||||
- FIXME("TRUSTEE_IS_OBJECTS_AND_NAME unimplemented\n");
|
||||
- break;
|
||||
- default:
|
||||
- WARN("bad trustee form %d for trustee %d\n", pEntries[i].Trustee.TrusteeForm, i);
|
||||
- ret = ERROR_INVALID_PARAMETER;
|
||||
+ ret = trustee_to_sid( FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]), ppsid[i], &pEntries[i].Trustee);
|
||||
+ if (ret)
|
||||
goto exit;
|
||||
- }
|
||||
|
||||
/* Note: we overestimate the ACL size here as a tradeoff between
|
||||
* instructions (simplicity) and memory */
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,69 +0,0 @@
|
||||
From 09d62cfc4fa999eacc89af2ad414810e22c910a9 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Fri, 5 May 2017 00:18:50 +0200
|
||||
Subject: advapi32/tests: Add basic tests for BuildSecurityDescriptor.
|
||||
|
||||
---
|
||||
dlls/advapi32/tests/security.c | 39 +++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 39 insertions(+)
|
||||
|
||||
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
|
||||
index ca5edffae5..db5a0f934c 100644
|
||||
--- a/dlls/advapi32/tests/security.c
|
||||
+++ b/dlls/advapi32/tests/security.c
|
||||
@@ -7217,6 +7217,44 @@ static void test_GetExplicitEntriesFromAclW(void)
|
||||
HeapFree(GetProcessHeap(), 0, old_acl);
|
||||
}
|
||||
|
||||
+static void test_BuildSecurityDescriptorW(void)
|
||||
+{
|
||||
+ SECURITY_DESCRIPTOR old_sd, *new_sd, *rel_sd;
|
||||
+ ULONG new_sd_size;
|
||||
+ DWORD buf_size;
|
||||
+ char buf[1024];
|
||||
+ BOOL success;
|
||||
+ DWORD ret;
|
||||
+
|
||||
+ InitializeSecurityDescriptor(&old_sd, SECURITY_DESCRIPTOR_REVISION);
|
||||
+
|
||||
+ buf_size = sizeof(buf);
|
||||
+ rel_sd = (SECURITY_DESCRIPTOR *)buf;
|
||||
+ success = MakeSelfRelativeSD(&old_sd, rel_sd, &buf_size);
|
||||
+ ok(success, "MakeSelfRelativeSD failed with %u\n", GetLastError());
|
||||
+
|
||||
+ new_sd = NULL;
|
||||
+ new_sd_size = 0;
|
||||
+ ret = BuildSecurityDescriptorW(NULL, NULL, 0, NULL, 0, NULL, NULL, &new_sd_size, (void **)&new_sd);
|
||||
+ ok(ret == ERROR_SUCCESS, "BuildSecurityDescriptor failed with %u\n", ret);
|
||||
+ ok(new_sd != NULL, "expected new_sd != NULL\n");
|
||||
+ ok(new_sd_size == sizeof(old_sd), "expected new_sd_size == sizeof(old_sd), got %u\n", new_sd_size);
|
||||
+ LocalFree(new_sd);
|
||||
+
|
||||
+ new_sd = (void *)0xdeadbeef;
|
||||
+ ret = BuildSecurityDescriptorW(NULL, NULL, 0, NULL, 0, NULL, &old_sd, &new_sd_size, (void **)&new_sd);
|
||||
+ ok(ret == ERROR_INVALID_SECURITY_DESCR, "expected ERROR_INVALID_SECURITY_DESCR, got %u\n", ret);
|
||||
+ ok(new_sd == (void *)0xdeadbeef, "expected new_sd == 0xdeadbeef, got %p\n", new_sd);
|
||||
+
|
||||
+ new_sd = NULL;
|
||||
+ new_sd_size = 0;
|
||||
+ ret = BuildSecurityDescriptorW(NULL, NULL, 0, NULL, 0, NULL, rel_sd, &new_sd_size, (void **)&new_sd);
|
||||
+ ok(ret == ERROR_SUCCESS, "BuildSecurityDescriptor failed with %u\n", ret);
|
||||
+ ok(new_sd != NULL, "expected new_sd != NULL\n");
|
||||
+ ok(new_sd_size == sizeof(old_sd), "expected new_sd_size == sizeof(old_sd), got %u\n", new_sd_size);
|
||||
+ LocalFree(new_sd);
|
||||
+}
|
||||
+
|
||||
START_TEST(security)
|
||||
{
|
||||
init();
|
||||
@@ -7271,6 +7309,7 @@ START_TEST(security)
|
||||
test_maximum_allowed();
|
||||
test_token_label();
|
||||
test_GetExplicitEntriesFromAclW();
|
||||
+ test_BuildSecurityDescriptorW();
|
||||
|
||||
/* Must be the last test, modifies process token */
|
||||
test_token_security_descriptor();
|
||||
--
|
||||
2.13.1
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [37594] Initial implementation of advapi32.BuildSecurityDescriptorW
|
@ -1,4 +1,4 @@
|
||||
From 89e0f1fded64240d2f59fd800232e9e9f8dd90d2 Mon Sep 17 00:00:00 2001
|
||||
From d510ead4493b1b0de9f1e53fa66bdb842f823929 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 4 Mar 2016 22:22:42 +0100
|
||||
Subject: [PATCH] ddraw: Set ddsOldCaps correctly in ddraw7_GetCaps.
|
||||
@ -25,10 +25,10 @@ index 33e18b8..2628b76 100644
|
||||
|
||||
if(DriverCaps)
|
||||
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
|
||||
index c63ddee..b9eec25 100644
|
||||
index 4c2e703..61af5a2 100644
|
||||
--- a/dlls/ddraw/tests/ddraw1.c
|
||||
+++ b/dlls/ddraw/tests/ddraw1.c
|
||||
@@ -11373,6 +11373,31 @@ static void test_execute_data(void)
|
||||
@@ -11371,6 +11371,31 @@ static void test_execute_data(void)
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
@ -60,17 +60,17 @@ index c63ddee..b9eec25 100644
|
||||
START_TEST(ddraw1)
|
||||
{
|
||||
DDDEVICEIDENTIFIER identifier;
|
||||
@@ -11475,4 +11500,5 @@ START_TEST(ddraw1)
|
||||
@@ -11473,4 +11498,5 @@ START_TEST(ddraw1)
|
||||
test_clear();
|
||||
test_enum_surfaces();
|
||||
test_execute_data();
|
||||
+ test_caps();
|
||||
}
|
||||
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
|
||||
index 1ab1f9c..272f364 100644
|
||||
index 3bfb1b5..8db6c45 100644
|
||||
--- a/dlls/ddraw/tests/ddraw2.c
|
||||
+++ b/dlls/ddraw/tests/ddraw2.c
|
||||
@@ -12646,6 +12646,31 @@ static void test_enum_surfaces(void)
|
||||
@@ -12633,6 +12633,31 @@ static void test_enum_surfaces(void)
|
||||
IDirectDraw2_Release(ddraw);
|
||||
}
|
||||
|
||||
@ -102,18 +102,18 @@ index 1ab1f9c..272f364 100644
|
||||
START_TEST(ddraw2)
|
||||
{
|
||||
DDDEVICEIDENTIFIER identifier;
|
||||
@@ -12756,4 +12781,5 @@ START_TEST(ddraw2)
|
||||
@@ -12743,4 +12768,5 @@ START_TEST(ddraw2)
|
||||
test_depth_readback();
|
||||
test_clear();
|
||||
test_enum_surfaces();
|
||||
+ test_caps();
|
||||
}
|
||||
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
|
||||
index 550d73a..f3c020c 100644
|
||||
index 9c4c5a3..6eebcb3 100644
|
||||
--- a/dlls/ddraw/tests/ddraw4.c
|
||||
+++ b/dlls/ddraw/tests/ddraw4.c
|
||||
@@ -14751,6 +14751,31 @@ static void test_enum_surfaces(void)
|
||||
IDirectDraw4_Release(ddraw);
|
||||
@@ -14957,6 +14957,31 @@ static void test_viewport(void)
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
+static void test_caps(void)
|
||||
@ -144,10 +144,10 @@ index 550d73a..f3c020c 100644
|
||||
START_TEST(ddraw4)
|
||||
{
|
||||
DDDEVICEIDENTIFIER identifier;
|
||||
@@ -14875,4 +14900,5 @@ START_TEST(ddraw4)
|
||||
test_depth_readback();
|
||||
@@ -15082,4 +15107,5 @@ START_TEST(ddraw4)
|
||||
test_clear();
|
||||
test_enum_surfaces();
|
||||
test_viewport();
|
||||
+ test_caps();
|
||||
}
|
||||
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
|
||||
|
@ -1,101 +0,0 @@
|
||||
From accdfe8f540d28911a56df946bee00d589778b2a Mon Sep 17 00:00:00 2001
|
||||
From: Qian Hong <qhong@codeweavers.com>
|
||||
Date: Sat, 6 Jun 2015 09:24:00 +0800
|
||||
Subject: kernel32: Init TimezoneInformation registry.
|
||||
|
||||
---
|
||||
dlls/kernel32/kernel_main.c | 3 +++
|
||||
dlls/kernel32/kernel_private.h | 3 +++
|
||||
dlls/kernel32/time.c | 48 ++++++++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 54 insertions(+)
|
||||
|
||||
diff --git a/dlls/kernel32/kernel_main.c b/dlls/kernel32/kernel_main.c
|
||||
index e24100b..d3420ec 100644
|
||||
--- a/dlls/kernel32/kernel_main.c
|
||||
+++ b/dlls/kernel32/kernel_main.c
|
||||
@@ -88,6 +88,9 @@ static BOOL process_attach( HMODULE module )
|
||||
/* Setup registry locale information */
|
||||
LOCALE_InitRegistry();
|
||||
|
||||
+ /* Setup registry timezone information */
|
||||
+ TIMEZONE_InitRegistry();
|
||||
+
|
||||
/* Setup computer name */
|
||||
COMPUTERNAME_Init();
|
||||
|
||||
diff --git a/dlls/kernel32/kernel_private.h b/dlls/kernel32/kernel_private.h
|
||||
index 76611d7..2d4ba02 100644
|
||||
--- a/dlls/kernel32/kernel_private.h
|
||||
+++ b/dlls/kernel32/kernel_private.h
|
||||
@@ -104,6 +104,9 @@ extern void COMPUTERNAME_Init(void) DECLSPEC_HIDDEN;
|
||||
extern void LOCALE_Init(void) DECLSPEC_HIDDEN;
|
||||
extern void LOCALE_InitRegistry(void) DECLSPEC_HIDDEN;
|
||||
|
||||
+/* time.c */
|
||||
+extern void TIMEZONE_InitRegistry(void) DECLSPEC_HIDDEN;
|
||||
+
|
||||
/* oldconfig.c */
|
||||
extern void convert_old_config(void) DECLSPEC_HIDDEN;
|
||||
|
||||
diff --git a/dlls/kernel32/time.c b/dlls/kernel32/time.c
|
||||
index daafc7f..43c2f80 100644
|
||||
--- a/dlls/kernel32/time.c
|
||||
+++ b/dlls/kernel32/time.c
|
||||
@@ -581,6 +581,54 @@ static void TIME_ClockTimeToFileTime(clock_t unix_time, LPFILETIME filetime)
|
||||
filetime->dwHighDateTime = (DWORD)(secs >> 32);
|
||||
}
|
||||
|
||||
+/***********************************************************************
|
||||
+ * TIMEZONE_InitRegistry
|
||||
+ *
|
||||
+ * Update registry contents on startup if the user timezone has changed.
|
||||
+ * This simulates the action of the Windows control panel.
|
||||
+ */
|
||||
+void TIMEZONE_InitRegistry(void)
|
||||
+{
|
||||
+ static const WCHAR szTimezoneInformation[] = {
|
||||
+ 'M','a','c','h','i','n','e','\\','S','y','s','t','e','m','\\',
|
||||
+ 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
|
||||
+ 'C','o','n','t','r','o','l','\\',
|
||||
+ 'T','i','m','e','Z','o','n','e','I','n','f','o','r','m','a','t','i','o','n','\0'
|
||||
+ };
|
||||
+ WCHAR standardnameW[] = {'S','t','a','n','d','a','r','d','N','a','m','e','\0'};
|
||||
+ WCHAR timezonekeynameW[] = {'T','i','m','e','Z','o','n','e','K','e','y','N','a','m','e','\0'};
|
||||
+ DYNAMIC_TIME_ZONE_INFORMATION tzinfo;
|
||||
+ UNICODE_STRING keyName;
|
||||
+ OBJECT_ATTRIBUTES attr;
|
||||
+ HANDLE hkey;
|
||||
+ DWORD tzid;
|
||||
+
|
||||
+ tzid = GetDynamicTimeZoneInformation(&tzinfo);
|
||||
+ if (tzid == TIME_ZONE_ID_INVALID)
|
||||
+ {
|
||||
+ ERR("fail to get timezone information.\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ RtlInitUnicodeString(&keyName, szTimezoneInformation);
|
||||
+ InitializeObjectAttributes(&attr, &keyName, 0, 0, NULL);
|
||||
+ if (NtCreateKey(&hkey, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL) != STATUS_SUCCESS)
|
||||
+ {
|
||||
+ ERR("fail to create timezone information key.\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ RtlInitUnicodeString(&keyName, standardnameW);
|
||||
+ NtSetValueKey(hkey, &keyName, 0, REG_SZ, tzinfo.StandardName,
|
||||
+ (strlenW(tzinfo.StandardName) + 1) * sizeof(WCHAR));
|
||||
+
|
||||
+ RtlInitUnicodeString(&keyName, timezonekeynameW);
|
||||
+ NtSetValueKey(hkey, &keyName, 0, REG_SZ, tzinfo.TimeZoneKeyName,
|
||||
+ (strlenW(tzinfo.TimeZoneKeyName) + 1) * sizeof(WCHAR));
|
||||
+
|
||||
+ NtClose( hkey );
|
||||
+}
|
||||
+
|
||||
/*********************************************************************
|
||||
* GetProcessTimes (KERNEL32.@)
|
||||
*
|
||||
--
|
||||
2.4.2
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: Initialize System\CurrentControlSet\Control\TimeZoneInformation registry keys
|
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "70c5dc64fc02408c6f7233c996e0ffdc5dc4a5a0"
|
||||
echo "c5023aea7e97213159b754a168b7abddc89664bb"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
@ -88,7 +88,6 @@ patch_enable_all ()
|
||||
enable_Pipelight="$1"
|
||||
enable_Staging="$1"
|
||||
enable_advapi_LsaLookupPrivilegeName="$1"
|
||||
enable_advapi32_BuildSecurityDescriptor="$1"
|
||||
enable_advapi32_CreateRestrictedToken="$1"
|
||||
enable_advapi32_LsaLookupSids="$1"
|
||||
enable_advapi32_Performance_Counters="$1"
|
||||
@ -185,7 +184,6 @@ patch_enable_all ()
|
||||
enable_kernel32_SCSI_Sysfs="$1"
|
||||
enable_kernel32_SetFileCompletionNotificationModes="$1"
|
||||
enable_kernel32_SetProcessAffinityUpdateMode="$1"
|
||||
enable_kernel32_TimezoneInformation_Registry="$1"
|
||||
enable_kernelbase_PathCchCombineEx="$1"
|
||||
enable_krnl386_exe16_GDT_LDT_Emulation="$1"
|
||||
enable_krnl386_exe16_Invalid_Console_Handles="$1"
|
||||
@ -457,9 +455,6 @@ patch_enable ()
|
||||
advapi-LsaLookupPrivilegeName)
|
||||
enable_advapi_LsaLookupPrivilegeName="$2"
|
||||
;;
|
||||
advapi32-BuildSecurityDescriptor)
|
||||
enable_advapi32_BuildSecurityDescriptor="$2"
|
||||
;;
|
||||
advapi32-CreateRestrictedToken)
|
||||
enable_advapi32_CreateRestrictedToken="$2"
|
||||
;;
|
||||
@ -748,9 +743,6 @@ patch_enable ()
|
||||
kernel32-SetProcessAffinityUpdateMode)
|
||||
enable_kernel32_SetProcessAffinityUpdateMode="$2"
|
||||
;;
|
||||
kernel32-TimezoneInformation_Registry)
|
||||
enable_kernel32_TimezoneInformation_Registry="$2"
|
||||
;;
|
||||
kernelbase-PathCchCombineEx)
|
||||
enable_kernelbase_PathCchCombineEx="$2"
|
||||
;;
|
||||
@ -2535,23 +2527,6 @@ if test "$enable_advapi_LsaLookupPrivilegeName" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset advapi32-BuildSecurityDescriptor
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#37594] Initial implementation of advapi32.BuildSecurityDescriptorW
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/advapi32/security.c, dlls/advapi32/tests/security.c
|
||||
# |
|
||||
if test "$enable_advapi32_BuildSecurityDescriptor" -eq 1; then
|
||||
patch_apply advapi32-BuildSecurityDescriptor/0001-advapi32-Implement-BuildSecurityDescriptorW.patch
|
||||
patch_apply advapi32-BuildSecurityDescriptor/0002-advapi32-tests-Add-basic-tests-for-BuildSecurityDesc.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Andrew Wesie", "advapi32: Implement BuildSecurityDescriptorW.", 1 },';
|
||||
printf '%s\n' '+ { "Sebastian Lackner", "advapi32/tests: Add basic tests for BuildSecurityDescriptor.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset advapi32-CreateRestrictedToken
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
@ -4442,18 +4417,6 @@ if test "$enable_kernel32_SetProcessAffinityUpdateMode" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset kernel32-TimezoneInformation_Registry
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/kernel32/kernel_main.c, dlls/kernel32/kernel_private.h, dlls/kernel32/time.c
|
||||
# |
|
||||
if test "$enable_kernel32_TimezoneInformation_Registry" -eq 1; then
|
||||
patch_apply kernel32-TimezoneInformation_Registry/0001-kernel32-Init-TimezoneInformation-registry.patch
|
||||
(
|
||||
printf '%s\n' '+ { "Qian Hong", "kernel32: Init TimezoneInformation registry.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset kernelbase-PathCchCombineEx
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
Loading…
x
Reference in New Issue
Block a user