ReactOS 0.4.15-dev-7924-g5949c20
rxact.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/rtl/rxact.c
5 * PURPOSE: Registry Transaction API
6 * PROGRAMMERS: Timo Kreuzer (timo.kreuzer@reactos.org)
7 */
8
9/* INCLUDES *****************************************************************/
10
11#include <rtl.h>
12#include <ndk/cmfuncs.h>
13
14#define NDEBUG
15#include <debug.h>
16
17#define RXACT_DEFAULT_BUFFER_SIZE (4 * PAGE_SIZE)
18
19typedef struct _RXACT_INFO
20{
25
26typedef struct _RXACT_DATA
27{
32
33typedef struct _RXACT_CONTEXT
34{
40
41typedef struct _RXACT_ACTION
42{
52
53enum
54{
57};
58
59/* FUNCTIONS *****************************************************************/
60
61static
62VOID
68{
69 Context->Data = NULL;
70 Context->RootDirectory = RootDirectory;
71 Context->CanUseHandles = TRUE;
72 Context->KeyHandle = KeyHandle;
73}
74
75static
80 ULONG ActionType,
83{
87
88 /* Check what kind of action this is */
89 if (ActionType == RXactDeleteKey)
90 {
91 /* This is a delete, so open the key for delete */
93 KeyName,
96 NULL);
98 }
99 else if (ActionType == RXactSetValueKey)
100 {
101 /* This is a create, so open or create with write access */
103 KeyName,
106 NULL);
107 Status = ZwCreateKey(KeyHandle,
108 KEY_WRITE,
110 0,
111 NULL,
112 0,
113 &Disposition);
114 }
115 else
116 {
118 }
119
120 return Status;
121}
122
123static
125NTAPI
128{
131 NTSTATUS Status, TmpStatus;
133 ULONG i;
134
135 Data = Context->Data;
136
137 /* The first action record starts after the data header */
138 Action = (PRXACT_ACTION)(Data + 1);
139
140 /* Loop all recorded actions */
141 for (i = 0; i < Data->ActionCount; i++)
142 {
143 /* Translate relative offsets to actual pointers */
144 Action->KeyName.Buffer = (PWSTR)((PUCHAR)Data + (ULONG_PTR)Action->KeyName.Buffer);
145 Action->ValueName.Buffer = (PWSTR)((PUCHAR)Data + (ULONG_PTR)Action->ValueName.Buffer);
146 Action->ValueData = (PUCHAR)Data + (ULONG_PTR)Action->ValueData;
147
148 /* Check what kind of action this is */
149 if (Action->Type == RXactDeleteKey)
150 {
151 /* This is a delete action. Check if we can use a handle */
152 if ((Action->KeyHandle != INVALID_HANDLE_VALUE) && Context->CanUseHandles)
153 {
154 /* Delete the key by the given handle */
155 Status = ZwDeleteKey(Action->KeyHandle);
156 if (!NT_SUCCESS(Status))
157 {
158 return Status;
159 }
160 }
161 else
162 {
163 /* We cannot use a handle, open the key first by it's name */
164 Status = RXactpOpenTargetKey(Context->RootDirectory,
166 &Action->KeyName,
167 &KeyHandle);
168 if (NT_SUCCESS(Status))
169 {
170 Status = ZwDeleteKey(KeyHandle);
171 TmpStatus = NtClose(KeyHandle);
172 ASSERT(NT_SUCCESS(TmpStatus));
173 if (!NT_SUCCESS(Status))
174 {
175 return Status;
176 }
177 }
178 else
179 {
180 /* Failed to open the key, it's ok, if it was not found */
182 return Status;
183 }
184 }
185 }
186 else if (Action->Type == RXactSetValueKey)
187 {
188 /* This is a set action. Check if we can use a handle */
189 if ((Action->KeyHandle != INVALID_HANDLE_VALUE) && Context->CanUseHandles)
190 {
191 /* Set the key value using the given key handle */
192 Status = ZwSetValueKey(Action->KeyHandle,
193 &Action->ValueName,
194 0,
195 Action->ValueType,
196 Action->ValueData,
197 Action->ValueDataSize);
198 if (!NT_SUCCESS(Status))
199 {
200 return Status;
201 }
202 }
203 else
204 {
205 /* We cannot use a handle, open the key first by it's name */
206 Status = RXactpOpenTargetKey(Context->RootDirectory,
208 &Action->KeyName,
209 &KeyHandle);
210 if (!NT_SUCCESS(Status))
211 {
212 return Status;
213 }
214
215 /* Set the key value */
216 Status = ZwSetValueKey(KeyHandle,
217 &Action->ValueName,
218 0,
219 Action->ValueType,
220 Action->ValueData,
221 Action->ValueDataSize);
222
223 TmpStatus = NtClose(KeyHandle);
224 ASSERT(NT_SUCCESS(TmpStatus));
225
226 if (!NT_SUCCESS(Status))
227 {
228 return Status;
229 }
230 }
231 }
232 else
233 {
234 ASSERT(FALSE);
236 }
237
238 /* Go to the next action record */
240 }
241
242 return STATUS_SUCCESS;
243}
244
246NTAPI
249{
251
252 /* We must not have a buffer yet */
253 if (Context->Data != NULL)
254 {
256 }
257
258 /* Allocate a buffer */
259 Buffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, RXACT_DEFAULT_BUFFER_SIZE);
260 if (Buffer == NULL)
261 {
262 return STATUS_NO_MEMORY;
263 }
264
265 /* Initialize the buffer */
266 Buffer->ActionCount = 0;
267 Buffer->BufferSize = RXACT_DEFAULT_BUFFER_SIZE;
268 Buffer->CurrentSize = sizeof(RXACT_DATA);
269 Context->Data = Buffer;
270
271 return STATUS_SUCCESS;
272}
273
275NTAPI
278{
279 /* We must have a data buffer */
280 if (Context->Data == NULL)
281 {
283 }
284
285 /* Free the buffer */
286 RtlFreeHeap(RtlGetProcessHeap(), 0, Context->Data);
287
288 /* Reinitialize the context */
289 RXactInitializeContext(Context, Context->RootDirectory, Context->KeyHandle);
290
291 return STATUS_SUCCESS;
292}
293
295NTAPI
298 BOOLEAN Commit,
299 PRXACT_CONTEXT *OutContext)
300{
301 NTSTATUS Status, TmpStatus;
303 PKEY_VALUE_FULL_INFORMATION KeyValueInformation;
304 KEY_VALUE_BASIC_INFORMATION KeyValueBasicInfo;
308 RXACT_INFO TransactionInfo;
311 ULONG ValueDataLength;
314
315 /* Open or create the 'RXACT' key in the root directory */
318 &KeyName,
321 NULL);
322 Status = ZwCreateKey(&KeyHandle,
325 0,
326 NULL,
327 0,
328 &Disposition);
329 if (!NT_SUCCESS(Status))
330 {
331 return Status;
332 }
333
334 /* Allocate a new context */
335 Context = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(*Context));
336 *OutContext = Context;
337 if (Context == NULL)
338 {
339 TmpStatus = ZwDeleteKey(KeyHandle);
340 ASSERT(NT_SUCCESS(TmpStatus));
341
342 TmpStatus = NtClose(KeyHandle);
343 ASSERT(NT_SUCCESS(TmpStatus));
344
345 return STATUS_NO_MEMORY;
346 }
347
348 /* Initialize the context */
350
351 /* Check if we created a new key */
353 {
354 /* The key is new, set the default value */
355 TransactionInfo.Revision = 1;
357 Status = ZwSetValueKey(KeyHandle,
358 &ValueName,
359 0,
360 REG_NONE,
361 &TransactionInfo,
362 sizeof(TransactionInfo));
363 if (!NT_SUCCESS(Status))
364 {
365 TmpStatus = ZwDeleteKey(KeyHandle);
366 ASSERT(NT_SUCCESS(TmpStatus));
367
368 TmpStatus = NtClose(KeyHandle);
369 ASSERT(NT_SUCCESS(TmpStatus));
370
371 RtlFreeHeap(RtlGetProcessHeap(), 0, *OutContext);
372 return Status;
373 }
374
376 }
377 else
378 {
379 /* The key exited, get the default key value */
380 ValueDataLength = sizeof(TransactionInfo);
382 &ValueType,
383 &TransactionInfo,
384 &ValueDataLength,
385 0);
386 if (!NT_SUCCESS(Status))
387 {
388 TmpStatus = NtClose(KeyHandle);
389 ASSERT(NT_SUCCESS(TmpStatus));
390 RtlFreeHeap(RtlGetProcessHeap(), 0, Context);
391 return Status;
392 }
393
394 /* Check if the value date is valid */
395 if ((ValueDataLength != sizeof(TransactionInfo)) ||
396 (TransactionInfo.Revision != 1))
397 {
398 TmpStatus = NtClose(KeyHandle);
399 ASSERT(NT_SUCCESS(TmpStatus));
400 RtlFreeHeap(RtlGetProcessHeap(), 0, Context);
402 }
403
404 /* Query the 'Log' key value */
406 Status = ZwQueryValueKey(KeyHandle,
407 &ValueName,
409 &KeyValueBasicInfo,
410 sizeof(KeyValueBasicInfo),
411 &Length);
412 if (!NT_SUCCESS(Status))
413 {
414 /* There is no 'Log', so we are done */
415 return STATUS_SUCCESS;
416 }
417
418 /* Check if the caller asked to commit the current state */
419 if (!Commit)
420 {
421 /* We have a log, that must be committed first! */
423 }
424
425 /* Query the size of the 'Log' key value */
426 Status = ZwQueryValueKey(KeyHandle,
427 &ValueName,
429 NULL,
430 0,
431 &Length);
433 {
434 return Status;
435 }
436
437 /* Allocate a buffer for the key value information */
438 KeyValueInformation = RtlAllocateHeap(RtlGetProcessHeap(), 0, Length);
439 if (KeyValueInformation == NULL)
440 {
441 return STATUS_NO_MEMORY;
442 }
443
444 /* Query the 'Log' key value */
445 Status = ZwQueryValueKey(KeyHandle,
446 &ValueName,
448 KeyValueInformation,
449 Length,
450 &Length);
451 if (!NT_SUCCESS(Status))
452 {
453 RtlFreeHeap(RtlGetProcessHeap(), 0, KeyValueInformation);
454 RtlFreeHeap(RtlGetProcessHeap(), 0, Context);
455 return Status;
456 }
457
458 /* Set the Data pointer to the key value data */
459 Context->Data = (PRXACT_DATA)((PUCHAR)KeyValueInformation +
460 KeyValueInformation->DataOffset);
461
462 /* This is an old log, don't use handles when committing! */
463 Context->CanUseHandles = FALSE;
464
465 /* Commit the data */
467 if (!NT_SUCCESS(Status))
468 {
469 RtlFreeHeap(RtlGetProcessHeap(), 0, KeyValueInformation);
470 RtlFreeHeap(RtlGetProcessHeap(), 0, Context);
471 return Status;
472 }
473
474 /* Delete the old key */
477
478 /* Set the data member to the allocated buffer, so it will get freed */
479 Context->Data = (PRXACT_DATA)KeyValueInformation;
480
481 /* Abort the old transaction */
484
485 return Status;
486 }
487}
488
490NTAPI
493 ULONG ActionType,
499 ULONG ValueDataSize)
500{
501 ULONG ActionSize;
504 ULONG CurrentOffset;
505 PRXACT_DATA NewData;
507
508 /* Validate ActionType parameter */
509 if ((ActionType != RXactDeleteKey) && (ActionType != RXactSetValueKey))
510 {
512 }
513
514 /* Calculate the size of the new action record */
515 ActionSize = ALIGN_UP_BY(ValueName->Length, sizeof(ULONG)) +
516 ALIGN_UP_BY(ValueDataSize, sizeof(ULONG)) +
517 ALIGN_UP_BY(KeyName->Length, sizeof(ULONG)) +
518 ALIGN_UP_BY(sizeof(RXACT_ACTION), sizeof(ULONG));
519
520 /* Calculate the new buffer size we need */
521 RequiredSize = ActionSize + Context->Data->CurrentSize;
522
523 /* Check for integer overflow */
524 if (RequiredSize < ActionSize)
525 {
526 return STATUS_NO_MEMORY;
527 }
528
529 /* Check if the buffer is large enough */
530 BufferSize = Context->Data->BufferSize;
532 {
533 /* Increase by a factor of 2, until it is large enough */
534 while (BufferSize < RequiredSize)
535 {
536 BufferSize *= 2;
537 }
538
539 /* Allocate a new buffer from the heap */
540 NewData = RtlAllocateHeap(RtlGetProcessHeap(), 0, BufferSize);
541 if (NewData == NULL)
542 {
543 return STATUS_NO_MEMORY;
544 }
545
546 /* Copy the old buffer to the new one */
547 RtlCopyMemory(NewData, Context->Data, Context->Data->CurrentSize);
548
549 /* Free the old buffer and use the new one */
550 RtlFreeHeap(RtlGetProcessHeap(), 0, Context->Data);
551 Context->Data = NewData;
552 NewData->BufferSize = BufferSize;
553 }
554
555 /* Get the next action record */
556 Action = (RXACT_ACTION *)((PUCHAR)Context->Data + Context->Data->CurrentSize);
557
558 /* Fill in the fields */
559 Action->Size = ActionSize;
560 Action->Type = ActionType;
561 Action->KeyName = *KeyName;
562 Action->ValueName = *ValueName;
563 Action->ValueType = ValueType;
564 Action->ValueDataSize = ValueDataSize;
565 Action->KeyHandle = KeyHandle;
566
567 /* Copy the key name (and convert the pointer to a buffer offset) */
568 CurrentOffset = Context->Data->CurrentSize + sizeof(RXACT_ACTION);
569 Action->KeyName.Buffer = UlongToPtr(CurrentOffset);
570 RtlCopyMemory((PUCHAR)Context->Data + CurrentOffset,
571 KeyName->Buffer,
572 KeyName->Length);
573
574 /* Copy the value name (and convert the pointer to a buffer offset) */
575 CurrentOffset += ALIGN_UP_BY(KeyName->Length, sizeof(ULONG));
576 Action->ValueName.Buffer = UlongToPtr(CurrentOffset);
577 RtlCopyMemory((PUCHAR)Context->Data + CurrentOffset,
578 ValueName->Buffer,
579 ValueName->Length);
580
581 /* Update the offset */
582 CurrentOffset += ALIGN_UP_BY(ValueName->Length, sizeof(ULONG));
583
584 /* Is this a set action? */
585 if (ActionType == RXactSetValueKey)
586 {
587 /* Copy the key value data as well */
588 Action->ValueData = UlongToPtr(CurrentOffset);
589 RtlCopyMemory((PUCHAR)Context->Data + CurrentOffset,
590 ValueData,
591 ValueDataSize);
592 CurrentOffset += ALIGN_UP_BY(ValueDataSize, sizeof(ULONG));
593 }
594
595 /* Update data site and action count */
596 Context->Data->CurrentSize = CurrentOffset;
597 Context->Data->ActionCount++;
598
599 return STATUS_SUCCESS;
600}
601
603NTAPI
606 ULONG ActionType,
610 ULONG ValueDataSize)
611{
613
614 /* Create a key and set the default key value or delete a key. */
617 ActionType,
618 KeyName,
620 &ValueName,
621 ValueType,
622 ValueData,
623 ValueDataSize);
624}
625
627NTAPI
630{
632
633 /* Commit the transaction */
635 if (!NT_SUCCESS(Status))
636 {
637 return Status;
638 }
639
640 /* Reset the transaction */
643
644 return Status;
645}
646
648NTAPI
651{
654
655 /* Temporarily safe the current transaction in the 'Log' key value */
657 Status = ZwSetValueKey(Context->KeyHandle,
658 &ValueName,
659 0,
661 Context->Data,
662 Context->Data->CurrentSize);
663 if (!NT_SUCCESS(Status))
664 {
665 return Status;
666 }
667
668 /* Flush the key */
669 Status = NtFlushKey(Context->KeyHandle);
670 if (!NT_SUCCESS(Status))
671 {
672 NtDeleteValueKey(Context->KeyHandle, &ValueName);
673 return Status;
674 }
675
676 /* Now commit the transaction */
678 if (!NT_SUCCESS(Status))
679 {
680 NtDeleteValueKey(Context->KeyHandle, &ValueName);
681 return Status;
682 }
683
684 /* Delete the 'Log' key value */
687
688 /* Reset the transaction */
691
692 return STATUS_SUCCESS;
693}
694
#define ALIGN_UP_BY(size, align)
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
WCHAR RootDirectory[MAX_PATH]
Definition: format.c:74
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
Definition: bufpool.h:45
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define BufferSize
Definition: mmc.h:75
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define UlongToPtr(u)
Definition: config.h:106
#define ULONG_PTR
Definition: config.h:101
Status
Definition: gdiplustypes.h:25
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
Definition: glfuncs.h:248
_In_ GUID _In_ PVOID ValueData
Definition: hubbusif.h:312
#define OBJ_OPENIF
Definition: winternl.h:229
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define ASSERT(a)
Definition: mode.c:44
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4715
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
Definition: cmfuncs.h:56
#define REG_BINARY
Definition: nt_native.h:1496
@ KeyValueBasicInformation
Definition: nt_native.h:1180
@ KeyValueFullInformation
Definition: nt_native.h:1181
#define KEY_READ
Definition: nt_native.h:1023
NTSYSAPI NTSTATUS NTAPI NtDeleteValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName)
Definition: ntapi.c:1014
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define REG_CREATED_NEW_KEY
Definition: nt_native.h:1084
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
#define DELETE
Definition: nt_native.h:57
#define KEY_WRITE
Definition: nt_native.h:1031
#define REG_NONE
Definition: nt_native.h:1492
NTSTATUS NTAPI NtFlushKey(IN HANDLE KeyHandle)
Definition: ntapi.c:1085
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
#define STATUS_UNKNOWN_REVISION
Definition: ntstatus.h:324
#define STATUS_RXACT_INVALID_STATE
Definition: ntstatus.h:520
#define STATUS_RXACT_STATE_CREATED
Definition: ntstatus.h:118
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define STATUS_RXACT_COMMIT_NECESSARY
Definition: ntstatus.h:204
#define L(x)
Definition: ntvdm.h:50
NTSTATUS NTAPI RtlInitializeRXact(HANDLE RootDirectory, BOOLEAN Commit, PRXACT_CONTEXT *OutContext)
Definition: rxact.c:296
NTSTATUS NTAPI RtlAddActionToRXact(PRXACT_CONTEXT Context, ULONG ActionType, PUNICODE_STRING KeyName, ULONG ValueType, PVOID ValueData, ULONG ValueDataSize)
Definition: rxact.c:604
struct _RXACT_INFO * PRXACT_INFO
static VOID NTAPI RXactInitializeContext(PRXACT_CONTEXT Context, HANDLE RootDirectory, HANDLE KeyHandle)
Definition: rxact.c:64
NTSTATUS NTAPI RtlAddAttributeActionToRXact(PRXACT_CONTEXT Context, ULONG ActionType, PUNICODE_STRING KeyName, HANDLE KeyHandle, PUNICODE_STRING ValueName, ULONG ValueType, PVOID ValueData, ULONG ValueDataSize)
Definition: rxact.c:491
struct _RXACT_CONTEXT * PRXACT_CONTEXT
NTSTATUS NTAPI RtlStartRXact(PRXACT_CONTEXT Context)
Definition: rxact.c:247
struct _RXACT_DATA RXACT_DATA
static NTSTATUS NTAPI RXactpCommit(PRXACT_CONTEXT Context)
Definition: rxact.c:126
NTSTATUS NTAPI RtlApplyRXactNoFlush(PRXACT_CONTEXT Context)
Definition: rxact.c:628
#define RXACT_DEFAULT_BUFFER_SIZE
Definition: rxact.c:17
struct _RXACT_DATA * PRXACT_DATA
struct _RXACT_ACTION * PRXACT_ACTION
static NTSTATUS NTAPI RXactpOpenTargetKey(HANDLE RootDirectory, ULONG ActionType, PUNICODE_STRING KeyName, PHANDLE KeyHandle)
Definition: rxact.c:78
@ RXactSetValueKey
Definition: rxact.c:56
@ RXactDeleteKey
Definition: rxact.c:55
struct _RXACT_INFO RXACT_INFO
struct _RXACT_CONTEXT RXACT_CONTEXT
NTSTATUS NTAPI RtlApplyRXact(PRXACT_CONTEXT Context)
Definition: rxact.c:649
struct _RXACT_ACTION RXACT_ACTION
NTSTATUS NTAPI RtlAbortRXact(PRXACT_CONTEXT Context)
Definition: rxact.c:276
NTSTATUS NTAPI RtlpNtQueryValueKey(IN HANDLE KeyHandle, OUT PULONG Type OPTIONAL, OUT PVOID Data OPTIONAL, IN OUT PULONG DataLength OPTIONAL, IN ULONG Unused)
Definition: registry.c:933
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
HANDLE KeyHandle
Definition: rxact.c:47
UNICODE_STRING ValueName
Definition: rxact.c:46
ULONG Size
Definition: rxact.c:43
ULONG ValueDataSize
Definition: rxact.c:49
PVOID ValueData
Definition: rxact.c:50
ULONG Type
Definition: rxact.c:44
UNICODE_STRING KeyName
Definition: rxact.c:45
ULONG ValueType
Definition: rxact.c:48
HANDLE KeyHandle
Definition: rxact.c:36
BOOLEAN CanUseHandles
Definition: rxact.c:37
PRXACT_DATA Data
Definition: rxact.c:38
HANDLE RootDirectory
Definition: rxact.c:35
ULONG BufferSize
Definition: rxact.c:29
ULONG ActionCount
Definition: rxact.c:28
ULONG CurrentSize
Definition: rxact.c:30
ULONG Revision
Definition: rxact.c:21
ULONG Unknown1
Definition: rxact.c:22
ULONG Unknown2
Definition: rxact.c:23
uint16_t * PWSTR
Definition: typedefs.h:56
#define NTAPI
Definition: typedefs.h:36
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
Definition: wdfdevice.h:4439
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:510
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG _Out_opt_ PULONG _Out_opt_ PULONG ValueType
Definition: wdfregistry.h:282
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243