13{
25 ULONG PartialInfoLength;
29 ULONG LargeBufferLength;
30 const struct
31 {
40 {
64 };
66
67#if defined(_M_AMD64)
69 {
70 skip(
"ROSTESTS-365: Skipping ntdll_apitest:NtSetValueKey because it hangs on Windows Server 2003 x64-Testbot. Set winetest_interactive to run it anyway.\n");
71 return;
72 }
73#endif
74
78 {
79 skip(
"No user key handle\n");
80 return;
81 }
82
86 ParentKeyHandle,
91 0,
97 {
99 skip(
"No key handle\n");
100 return;
101 }
102
103 LargeBufferLength = 0x20000;
104 LargeBuffer =
RtlAllocateHeap(RtlGetProcessHeap(), 0, LargeBufferLength);
105
107 PartialInfo =
RtlAllocateHeap(RtlGetProcessHeap(), 0, PartialInfoLength);
108
109 if (LargeBuffer ==
NULL || PartialInfo ==
NULL)
110 {
116 skip(
"Could not allocate buffers\n");
117 return;
118 }
119
121 {
122
123
124
125
129
130
133 ok(
Status ==
Tests[
i].StatusExisting ||
Status ==
Tests[
i].StatusExisting2,
"[%lu, %p, %lu] NtSetValueKey returned %lx, expected %lx or %lx\n",
135 else
136 ok(
Status ==
Tests[
i].StatusExisting,
"[%lu, %p, %lu] NtSetValueKey returned %lx, expected %lx\n",
138
139
142 ok(QueryStatus ==
STATUS_SUCCESS,
"[%lu, %p, %lu] NtQueryValueKey failed with %lx\n",
145 {
147 {
148 ok(PartialInfo->
TitleIndex == 0,
"[%lu, %p, %lu] TitleIndex = %lu\n",
150 ok(PartialInfo->
Type ==
Tests[
i].Type,
"[%lu, %p, %lu] Type = %lu\n",
156 }
157 else
158 {
159 ok(PartialInfo->
TitleIndex == 0,
"[%lu, %p, %lu] TitleIndex = %lu\n",
161 ok(PartialInfo->
Type ==
REG_SZ,
"[%lu, %p, %lu] Type = %lu\n",
163 ok(PartialInfo->
DataLength ==
sizeof(Default),
"[%lu, %p, %lu] DataLength = %lu\n",
165 ok(!
memcmp(PartialInfo->
Data, Default,
sizeof(Default)),
"[%lu, %p, %lu] Data does not match default\n",
167 }
168 }
169
170
171
172
173
177 "[%lu] NtDeleteValueKey failed with %lx",
i,
Status);
178
179
182 ok(
Status ==
Tests[
i].StatusNew ||
Status ==
Tests[
i].StatusNew2,
"[%lu, %p, %lu] NtSetValueKey returned %lx, expected %lx or %lx\n",
184 else
185 ok(
Status ==
Tests[
i].StatusNew,
"[%lu, %p, %lu] NtSetValueKey returned %lx, expected %lx\n",
187
188
192 {
193 ok(QueryStatus ==
STATUS_SUCCESS,
"[%lu, %p, %lu] NtQueryValueKey failed with %lx\n",
196 {
197 ok(PartialInfo->
TitleIndex == 0,
"[%lu, %p, %lu] TitleIndex = %lu\n",
199 ok(PartialInfo->
Type ==
Tests[
i].Type,
"[%lu, %p, %lu] Type = %lu\n",
205 }
206 }
207 else
208 {
211 }
212 }
213
214
215 {
216 const ULONG DataLengths[] = { 0x10000, 0x10002, 0x20000 };
217
220 {
227
235 }
236 }
237
246}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
_In_ ULONG _In_opt_ WDFREQUEST _In_opt_ PVOID _In_ size_t _In_ PVOID _In_ size_t _Out_ size_t * DataLength
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define OBJ_CASE_INSENSITIVE
#define RtlFillMemoryUlong(dst, len, val)
#define InitializeObjectAttributes(p, n, a, r, s)
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
NTSYSAPI NTSTATUS NTAPI RtlOpenCurrentUser(_In_ ACCESS_MASK DesiredAccess, _Out_ PHANDLE KeyHandle)
NTSYSAPI NTSTATUS NTAPI NtSetValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN ULONG TitleIndex OPTIONAL, IN ULONG Type, IN PVOID Data, IN ULONG DataSize)
@ KeyValuePartialInformation
NTSYSAPI NTSTATUS NTAPI NtDeleteValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI NTSTATUS NTAPI NtQueryValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, IN PVOID KeyValueInformation, IN ULONG Length, IN PULONG ResultLength)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
#define REG_OPTION_VOLATILE
NTSTATUS NTAPI NtDeleteKey(IN HANDLE KeyHandle)
NTSTATUS NTAPI NtCreateKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN ULONG TitleIndex, IN PUNICODE_STRING Class OPTIONAL, IN ULONG CreateOptions, OUT PULONG Disposition OPTIONAL)
#define STATUS_ACCESS_VIOLATION
#define RTL_CONSTANT_STRING(s)
#define FIELD_OFFSET(t, f)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
#define STATUS_OBJECT_NAME_NOT_FOUND
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName