24{
26 DWORD dwRes, dwDisposition;
38
39
41 {
46 {
47 skip(
"'HKCU\\mykey' cannot be deleted. Terminating test\n");
49 }
50 }
51
53 {
58 {
59 skip(
"'HKCU\\mykey1' cannot be deleted. Terminating test\n");
61 }
62 }
63
65 {
70 {
71 skip(
"'HKCU\\mykey2' cannot be deleted. Terminating test\n");
73 }
74 }
75
76
78
79
82 0, 0, 0, 0, 0, 0, 0,
83 &pEveryoneSID);
85 if (!bRes)
86 {
87 skip(
"EveryoneSID not initialized. Terminating test\n");
89 }
90
91
92
100
101
105 0, 0, 0, 0, 0, 0,
106 &pAdminSID);
108 if (!bRes)
109 {
110 skip(
"AdminSID not initialized. Terminating test\n");
112 }
113
114
115
122
123
128
129
134
136 ok(bRes,
"InitializeSecurityDescriptor Error %ld\n",
GetLastError());
137 if (!bRes)
139
140
143 pACL,
145 ok(bRes,
"SetSecurityDescriptorDacl Error %ld\n",
GetLastError());
146 if (!bRes)
148
149
150 sa.lpSecurityDescriptor = pSD;
152
153
154
158 ok(lRes ==
ERROR_SUCCESS,
"RegCreateKeyExW returned '%ld', expected 0", lRes);
162
163
166 ok(lRes ==
ERROR_SUCCESS,
"RegCreateKeyExA returned '%ld', expected 0", lRes);
170
171
172
176 ok(lRes ==
ERROR_SUCCESS,
"RegCreateKeyExW returned '%ld', expected 0", lRes);
180
181
184 ok(lRes ==
ERROR_SUCCESS,
"RegCreateKeyExA returned '%ld', expected 0", lRes);
188
189
190
194 ok(lRes ==
ERROR_SUCCESS,
"RegCreateKeyExW returned '%ld', expected 0", lRes);
198
199
202 ok(lRes ==
ERROR_SUCCESS,
"RegCreateKeyExA returned '%ld', expected 0", lRes);
206
208
209 if (pEveryoneSID)
211 if (pAdminSID)
213 if (pACL)
215 if (pSD)
217 if (hkSub)
219
220
223
226
229}
DWORD WINAPI SetEntriesInAclW(ULONG cCountOfExplicitEntries, PEXPLICIT_ACCESS_W pListOfExplicitEntries, PACL OldAcl, PACL *NewAcl)
@ TRUSTEE_IS_WELL_KNOWN_GROUP
static struct sockaddr_in sa
#define ok_dec(expression, result)
#define RegCloseKey(hKey)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
LONG WINAPI RegCreateKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD Reserved, _In_ LPSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_ LPDWORD lpdwDisposition)
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
BOOL WINAPI InitializeSecurityDescriptor(PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision)
PVOID WINAPI FreeSid(PSID pSid)
struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES
static const WCHAR Cleanup[]
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
_In_ NDIS_ERROR_CODE ErrorCode
#define REG_CREATED_NEW_KEY
#define REG_OPENED_EXISTING_KEY
BOOL WINAPI SetSecurityDescriptorDacl(PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, BOOL bDaclDefaulted)
DWORD grfAccessPermissions
ACCESS_MODE grfAccessMode
DWORD WINAPI GetLastError(void)
#define HKEY_CURRENT_USER
#define SECURITY_BUILTIN_DOMAIN_RID
#define SECURITY_WORLD_SID_AUTHORITY
#define SECURITY_WORLD_RID
#define SECURITY_NT_AUTHORITY
#define SECURITY_DESCRIPTOR_REVISION
#define SECURITY_DESCRIPTOR_MIN_LENGTH
#define DOMAIN_ALIAS_RID_ADMINS