You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Implement RegSetKeySecurity on top of NtSetSecurityObject.
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
From f578524f71033b89cbb1fda1d3ac676f2d330ea6 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Tue, 1 Jul 2014 19:23:30 -0600
|
||||
Subject: advapi: Implement RegSetKeySecurity on top of NtSetSecurityObject.
|
||||
|
||||
---
|
||||
dlls/advapi32/registry.c | 4 ++--
|
||||
dlls/advapi32/tests/registry.c | 30 +++++++++++++++---------------
|
||||
2 files changed, 17 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
|
||||
index c7ba3ef..253e708 100644
|
||||
--- a/dlls/advapi32/registry.c
|
||||
+++ b/dlls/advapi32/registry.c
|
||||
@@ -2469,9 +2469,9 @@ LSTATUS WINAPI RegSetKeySecurity( HKEY hkey, SECURITY_INFORMATION SecurityInfo,
|
||||
if (!pSecurityDesc)
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
- FIXME(":(%p,%d,%p): stub\n",hkey,SecurityInfo,pSecurityDesc);
|
||||
+ TRACE("(%p,%d,%p)\n",hkey,SecurityInfo,pSecurityDesc);
|
||||
|
||||
- return ERROR_SUCCESS;
|
||||
+ return RtlNtStatusToDosError( NtSetSecurityObject( hkey, SecurityInfo, pSecurityDesc ) );
|
||||
}
|
||||
|
||||
|
||||
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
|
||||
index 7c4db40..5069600 100644
|
||||
--- a/dlls/advapi32/tests/registry.c
|
||||
+++ b/dlls/advapi32/tests/registry.c
|
||||
@@ -1070,14 +1070,15 @@ static void test_reg_open_key(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
- /* The "sanctioned" methods of setting a registry ACL aren't implemented in Wine. */
|
||||
- bRet = SetKernelObjectSecurity(hkRoot64, DACL_SECURITY_INFORMATION, sd);
|
||||
- ok(bRet == TRUE,
|
||||
- "Expected SetKernelObjectSecurity to return TRUE, got %d, last error %u\n", bRet, GetLastError());
|
||||
+ LONG error;
|
||||
|
||||
- bRet = SetKernelObjectSecurity(hkRoot32, DACL_SECURITY_INFORMATION, sd);
|
||||
- ok(bRet == TRUE,
|
||||
- "Expected SetKernelObjectSecurity to return TRUE, got %d, last error %u\n", bRet, GetLastError());
|
||||
+ error = RegSetKeySecurity(hkRoot64, DACL_SECURITY_INFORMATION, sd);
|
||||
+ ok(error == ERROR_SUCCESS,
|
||||
+ "Expected RegSetKeySecurity to return success, got error %u\n", error);
|
||||
+
|
||||
+ bRet = RegSetKeySecurity(hkRoot32, DACL_SECURITY_INFORMATION, sd);
|
||||
+ ok(error == ERROR_SUCCESS,
|
||||
+ "Expected RegSetKeySecurity to return success, got error %u\n", error);
|
||||
|
||||
hkResult = NULL;
|
||||
ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine", 0, KEY_WOW64_64KEY | KEY_READ, &hkResult);
|
||||
@@ -1231,14 +1232,13 @@ static void test_reg_create_key(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
- /* The "sanctioned" methods of setting a registry ACL aren't implemented in Wine. */
|
||||
- bRet = SetKernelObjectSecurity(hkRoot64, DACL_SECURITY_INFORMATION, sd);
|
||||
- ok(bRet == TRUE,
|
||||
- "Expected SetKernelObjectSecurity to return TRUE, got %d, last error %u\n", bRet, GetLastError());
|
||||
-
|
||||
- bRet = SetKernelObjectSecurity(hkRoot32, DACL_SECURITY_INFORMATION, sd);
|
||||
- ok(bRet == TRUE,
|
||||
- "Expected SetKernelObjectSecurity to return TRUE, got %d, last error %u\n", bRet, GetLastError());
|
||||
+ ret = RegSetKeySecurity(hkRoot64, DACL_SECURITY_INFORMATION, sd);
|
||||
+ ok(ret == ERROR_SUCCESS,
|
||||
+ "Expected RegSetKeySecurity to return success, got error %u\n", ret);
|
||||
+
|
||||
+ ret = RegSetKeySecurity(hkRoot32, DACL_SECURITY_INFORMATION, sd);
|
||||
+ ok(ret == ERROR_SUCCESS,
|
||||
+ "Expected RegSetKeySecurity to return success, got error %u\n", ret);
|
||||
|
||||
hkey1 = NULL;
|
||||
ret = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine", 0, NULL, 0,
|
||||
--
|
||||
1.7.9.5
|
||||
|
@@ -0,0 +1,3 @@
|
||||
Revision: 1
|
||||
Author: Erich E. Hoover
|
||||
Title: Implement RegSetKeySecurity on top of NtSetSecurityObject.
|
Reference in New Issue
Block a user