ReactOS 0.4.17-dev-966-gf06eace
cminit.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/config/cminit.c
5 * PURPOSE: Configuration Manager - Hive Initialization
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8
9/* INCLUDES ******************************************************************/
10
11#include "ntoskrnl.h"
12#define NDEBUG
13#include "debug.h"
14
15/* FUNCTIONS *****************************************************************/
16
20 _Out_ PCMHIVE *CmHive,
21 _In_ ULONG OperationType,
22 _In_ ULONG HiveFlags,
24 _In_opt_ PVOID HiveData,
25 _In_ HANDLE Primary,
26 _In_ HANDLE Log,
28 _In_ HANDLE Alternate,
30 _In_ ULONG CheckFlags)
31{
32 PCMHIVE Hive;
34 FILE_FS_SIZE_INFORMATION FileSizeInformation;
36 ULONG Cluster;
37
38 /* Assume failure */
39 *CmHive = NULL;
40
41 /*
42 * The following are invalid:
43 * - An external hive that is also internal.
44 * - A log hive that is not a primary hive too.
45 * - A volatile hive that is linked to permanent storage,
46 * unless this hive is a shared system hive.
47 * - An in-memory initialization without hive data.
48 * - A log hive that is not linked to a correct file type.
49 * - An alternate hive that is not linked to a correct file type.
50 * - A lonely alternate hive not backed up with its corresponding primary hive.
51 */
52 if ((External && (Primary || Log)) ||
53 (Log && !Primary) ||
54 (!CmpShareSystemHives && (HiveFlags & HIVE_VOLATILE) &&
55 (Primary || External || Log)) ||
56 ((OperationType == HINIT_MEMORY) && !HiveData) ||
57 (Log && (FileType != HFILE_TYPE_LOG)) ||
58 (Alternate && (FileType != HFILE_TYPE_ALTERNATE)) ||
59 (Alternate && !Primary))
60 {
61 /* Fail the request */
63 }
64
65 /* Check if this is a primary hive */
66 if (Primary)
67 {
68 /* Get the cluster size */
71 &FileSizeInformation,
74 if (!NT_SUCCESS(Status)) return Status;
75
76 /* Make sure it's not larger then the block size */
77 if (FileSizeInformation.BytesPerSector > HBLOCK_SIZE)
78 {
79 /* Fail */
81 }
82
83 /* Otherwise, calculate the cluster */
84 Cluster = FileSizeInformation.BytesPerSector / HSECTOR_SIZE;
85 Cluster = max(1, Cluster);
86 }
87 else
88 {
89 /* Otherwise use cluster 1 */
90 Cluster = 1;
91 }
92
93 /* Allocate the hive */
95 if (!Hive) return STATUS_INSUFFICIENT_RESOURCES;
96
97 /* Setup null fields */
98 Hive->UnloadEvent = NULL;
99 Hive->RootKcb = NULL;
100 Hive->Frozen = FALSE;
101 Hive->UnloadWorkItem = NULL;
102 Hive->GrowOnlyMode = FALSE;
103 Hive->GrowOffset = 0;
104 Hive->CellRemapArray = NULL;
105 Hive->UseCountLog.Next = 0;
106 Hive->LockHiveLog.Next = 0;
107 Hive->FileObject = NULL;
108 Hive->NotifyList.Flink = NULL;
109 Hive->NotifyList.Blink = NULL;
110
111 /* Set the loading flag */
112 Hive->HiveIsLoading = TRUE;
113
114 /* Set the current thread as creator */
116
117 /* Initialize lists */
121
122 /* Allocate the view log */
124 sizeof(KGUARDED_MUTEX),
125 TAG_CMHIVE);
126 if (!Hive->ViewLock)
127 {
128 /* Cleanup allocation and fail */
131 }
132
133 /* Allocate the flush lock */
135 sizeof(ERESOURCE),
136 TAG_CMHIVE);
137 if (!Hive->FlusherLock)
138 {
139 /* Cleanup allocations and fail */
143 }
144
145 /* Setup the handles */
146 Hive->FileHandles[HFILE_TYPE_PRIMARY] = Primary;
147 Hive->FileHandles[HFILE_TYPE_LOG] = Log;
149 Hive->FileHandles[HFILE_TYPE_ALTERNATE] = Alternate;
150
151 /* Initialize the guarded mutex */
153 Hive->ViewLockOwner = NULL;
154
155 /* Initialize the flush lock */
157
158 /* Setup hive locks */
160 Hive->HiveLockOwner = NULL;
162 Hive->WriterLockOwner = NULL;
165
166 /* Clear file names */
167 RtlInitEmptyUnicodeString(&Hive->FileUserName, NULL, 0);
168 RtlInitEmptyUnicodeString(&Hive->FileFullPath, NULL, 0);
169 RtlInitEmptyUnicodeString(&Hive->HiveRootPath, NULL, 0);
170
171 /* Initialize the view list */
173
174 /* Initialize the security cache */
176
177 /* Setup flags */
178 Hive->Flags = 0;
179 Hive->FlushCount = 0;
180
181 /* Initialize it */
182 Status = HvInitialize(&Hive->Hive,
183 OperationType,
184 HiveFlags,
185 FileType,
186 HiveData,
188 CmpFree,
193 Cluster,
194 FileName);
195 if (!NT_SUCCESS(Status))
196 {
197 /* Cleanup allocations and fail */
202 return Status;
203 }
204
205 /* Check if we should verify the registry */
206 if ((OperationType == HINIT_FILE) ||
207 (OperationType == HINIT_MEMORY) ||
208 (OperationType == HINIT_MEMORY_INPLACE) ||
209 (OperationType == HINIT_MAPFILE))
210 {
211 /* Verify integrity */
212 CM_CHECK_REGISTRY_STATUS CheckStatus = CmCheckRegistry(Hive, CheckFlags);
213 if (!CM_CHECK_REGISTRY_SUCCESS(CheckStatus))
214 {
215 /* Cleanup allocations and fail */
221 }
222 }
223
224 /* Reset the loading flag */
225 Hive->HiveIsLoading = FALSE;
226
227 /* Lock the hive list */
229
230 /* Insert this hive */
232
233 /* Release the lock */
235
236 /* Return the hive and success */
237 *CmHive = Hive;
238 return STATUS_SUCCESS;
239}
240
242NTAPI
244{
245 /* Remove the hive from the list */
247 RemoveEntryList(&CmHive->HiveList);
249
250 /* Destroy the security descriptor cache */
252
253 /* Destroy the view list */
255
256 /* Delete the flusher lock */
257 ExDeleteResourceLite(CmHive->FlusherLock);
258 ExFreePoolWithTag(CmHive->FlusherLock, TAG_CMHIVE);
259
260 /* Delete the view lock */
261 ExFreePoolWithTag(CmHive->ViewLock, TAG_CMHIVE);
262
263 /* Free the hive storage */
264 HvFree(&CmHive->Hive);
265
266 /* Free the hive */
267 CmpFree(CmHive, TAG_CM);
268
269 return STATUS_SUCCESS;
270}
271
273NTAPI
276 OUT PHANDLE Primary,
277 OUT PHANDLE Log,
278 OUT PULONG PrimaryDisposition,
279 OUT PULONG LogDisposition,
280 IN BOOLEAN CreateAllowed,
281 IN BOOLEAN MarkAsSystemHive,
282 IN BOOLEAN NoBuffering,
284{
288 UNICODE_STRING FullName, ExtensionName;
289 PWCHAR NameBuffer;
293 ULONG AttributeFlags, ShareMode, DesiredAccess, CreateDisposition, IoFlags;
294 USHORT CompressionState;
296 FILE_FS_SIZE_INFORMATION FsSizeInformation;
297
298 /* Create event */
300 if (!NT_SUCCESS(Status)) return Status;
301
302 /* Initialize the full name */
303 RtlInitEmptyUnicodeString(&FullName, NULL, 0);
304 Length = BaseName->Length;
305
306 /* Check if we have an extension */
307 if (Extension)
308 {
309 /* Update the name length */
310 Length += (USHORT)wcslen(Extension) * sizeof(WCHAR) + sizeof(UNICODE_NULL);
311
312 /* Allocate the buffer for the full name */
314 if (!NameBuffer)
315 {
316 /* Fail */
319 return STATUS_NO_MEMORY;
320 }
321
322 /* Build the full name */
323 FullName.Buffer = NameBuffer;
325 RtlCopyUnicodeString(&FullName, BaseName);
326 }
327 else
328 {
329 /* The base name is the full name */
330 FullName = *BaseName;
331 NameBuffer = NULL;
332 }
333
334 /* Initialize the attributes */
336 &FullName,
338 NULL,
339 NULL);
340
341 /* Check if we can create the hive */
342 if (CreateAllowed && !CmpShareSystemHives)
343 {
344 /* Open only or create */
346 }
347 else
348 {
349 /* Open only */
351 }
352
353 /* Setup the flags */
354 // FIXME : FILE_OPEN_FOR_BACKUP_INTENT is unimplemented and breaks 3rd stage boot
355 IoFlags = //FILE_OPEN_FOR_BACKUP_INTENT |
358 (NoBuffering ? FILE_NO_INTERMEDIATE_BUFFERING : 0);
359
360 /* Set share and access modes */
362 {
363 /* We're on Live CD or otherwise sharing */
365 ShareMode = FILE_SHARE_READ;
366 }
367 else
368 {
369 /* We want to write exclusively */
370 ShareMode = 0;
372 }
373
374 /* Default attributes */
375 AttributeFlags = FILE_ATTRIBUTE_NORMAL;
376
377 /* Now create the file.
378 * Note: We use FILE_SYNCHRONOUS_IO_NONALERT here to simplify CmpFileRead/CmpFileWrite.
379 * Windows does async I/O and therefore does not use this flag (or SYNCHRONIZE).
380 */
381 Status = ZwCreateFile(Primary,
385 NULL,
386 AttributeFlags,
387 ShareMode,
390 NULL,
391 0);
392 /* Check if anything failed until now */
393 if (!NT_SUCCESS(Status))
394 {
395 DPRINT1("ZwCreateFile(%wZ) failed, Status 0x%08lx.\n", ObjectAttributes.ObjectName, Status);
396
397 /* Close handles and free buffers */
398 if (NameBuffer) ExFreePoolWithTag(NameBuffer, TAG_CM);
401 *Primary = NULL;
402 return Status;
403 }
404
405 if (MarkAsSystemHive)
406 {
407 /* We opened it, mark it as a system hive */
408 Status = ZwFsControlFile(*Primary,
410 NULL,
411 NULL,
414 NULL,
415 0,
416 NULL,
417 0);
418 if (Status == STATUS_PENDING)
419 {
420 /* Wait for completion */
422 Executive,
424 FALSE,
425 NULL);
426 Status = IoStatusBlock.Status;
427 }
428
429 /* If we don't support it, ignore the failure */
431
432 if (!NT_SUCCESS(Status))
433 {
434 /* Close handles and free buffers */
435 if (NameBuffer) ExFreePoolWithTag(NameBuffer, TAG_CM);
438 ZwClose(*Primary);
439 *Primary = NULL;
440 return Status;
441 }
442 }
443
444 /* Disable compression */
445 CompressionState = 0;
446 Status = ZwFsControlFile(*Primary,
448 NULL,
449 NULL,
452 &CompressionState,
453 sizeof(CompressionState),
454 NULL,
455 0);
456 if (Status == STATUS_PENDING)
457 {
458 /* Wait for completion */
460 Executive,
462 FALSE,
463 NULL);
464 }
465
466 /* Get the disposition */
467 *PrimaryDisposition = (ULONG)IoStatusBlock.Information;
468 if (IoStatusBlock.Information != FILE_CREATED)
469 {
470 /* Check how large the file is */
471 Status = ZwQueryInformationFile(*Primary,
474 sizeof(FileInformation),
476 if (NT_SUCCESS(Status))
477 {
478 /* Check if it's 0 bytes */
479 if (!FileInformation.EndOfFile.QuadPart)
480 {
481 /* Assume it's a new file */
482 *PrimaryDisposition = FILE_CREATED;
483 }
484 }
485 }
486
487 /* Check if the caller wants cluster size returned */
488 if (ClusterSize)
489 {
490 /* Query it */
493 &FsSizeInformation,
494 sizeof(FsSizeInformation),
496 if (!NT_SUCCESS(Status))
497 {
498 /* Close handles and free buffers */
499 if (NameBuffer) ExFreePoolWithTag(NameBuffer, TAG_CM);
502 return Status;
503 }
504
505 /* Check if the sector size is invalid */
506 if (FsSizeInformation.BytesPerSector > HBLOCK_SIZE)
507 {
508 /* Close handles and free buffers */
509 if (NameBuffer) ExFreePoolWithTag(NameBuffer, TAG_CM);
513 }
514
515 /* Return cluster size */
516 *ClusterSize = max(1, FsSizeInformation.BytesPerSector / HSECTOR_SIZE);
517 }
518
519 /* Check if we don't need to create a log file */
520 if (!Extension)
521 {
522 /* We're done, close handles */
525 return STATUS_SUCCESS;
526 }
527
528 /* Check if we can create the hive */
530 if (*PrimaryDisposition == FILE_CREATED)
531 {
532 /* Over-write the existing log file, since this is a new hive */
534 }
535
536 /* Setup the name */
537 RtlInitUnicodeString(&ExtensionName, Extension);
539
540 /* Initialize the attributes */
542 &FullName,
544 NULL,
545 NULL);
546
547 /* Setup the flags */
549
550 /* Check if this is a log file */
551 if (!_wcsnicmp(Extension, L".log", 4))
552 {
553 /* Hide log files */
554 AttributeFlags |= FILE_ATTRIBUTE_HIDDEN;
555 }
556
557 /* Now create the file.
558 * Note: We use FILE_SYNCHRONOUS_IO_NONALERT here to simplify CmpFileRead/CmpFileWrite.
559 * Windows does async I/O and therefore does not use this flag (or SYNCHRONIZE).
560 */
561 Status = ZwCreateFile(Log,
565 NULL,
566 AttributeFlags,
567 ShareMode,
570 NULL,
571 0);
572 if (NT_SUCCESS(Status) && MarkAsSystemHive)
573 {
574 /* We opened it, mark it as a system hive */
575 Status = ZwFsControlFile(*Log,
577 NULL,
578 NULL,
581 NULL,
582 0,
583 NULL,
584 0);
585 if (Status == STATUS_PENDING)
586 {
587 /* Wait for completion */
589 Executive,
591 FALSE,
592 NULL);
593 Status = IoStatusBlock.Status;
594 }
595
596 /* If we don't support it, ignore the failure */
598
599 /* If we failed, close the handle */
600 if (!NT_SUCCESS(Status)) ZwClose(*Log);
601 }
602
603 /* Check if anything failed until now */
604 if (!NT_SUCCESS(Status))
605 {
606 /* Clear the handle */
607 *Log = NULL;
608 }
609 else
610 {
611 /* Disable compression */
612 Status = ZwFsControlFile(*Log,
614 NULL,
615 NULL,
618 &CompressionState,
619 sizeof(CompressionState),
620 NULL,
621 0);
622 if (Status == STATUS_PENDING)
623 {
624 /* Wait for completion */
626 Executive,
628 FALSE,
629 NULL);
630 }
631
632 /* Return the disposition */
633 *LogDisposition = (ULONG)IoStatusBlock.Information;
634 }
635
636 /* We're done, close handles and free buffers */
637 if (NameBuffer) ExFreePoolWithTag(NameBuffer, TAG_CM);
640 return STATUS_SUCCESS;
641}
642
643VOID
644NTAPI
646{
647 ULONG i;
648
649 for (i = 0; i < HFILE_TYPE_MAX; i++)
650 {
651 if (Hive->FileHandles[i] != NULL)
652 {
653 ZwClose(Hive->FileHandles[i]);
654 Hive->FileHandles[i] = NULL;
655 }
656 }
657}
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
DWORD ClusterSize
Definition: format.c:66
VOID NTAPI CmpFree(IN PVOID Ptr, IN ULONG Quota)
Definition: registry.c:60
PVOID NTAPI CmpAllocate(IN SIZE_T Size, IN BOOLEAN Paged, IN ULONG Tag)
Definition: registry.c:49
CM_CHECK_REGISTRY_STATUS NTAPI CmCheckRegistry(_In_ PCMHIVE RegistryHive, _In_ ULONG Flags)
Checks the registry that is consistent and its contents valid and not corrupted. More specifically th...
Definition: cmcheck.c:1635
EX_PUSH_LOCK CmpHiveListHeadLock
Definition: cmdata.c:39
BOOLEAN CmpMiniNTBoot
Definition: cmdata.c:62
BOOLEAN CmpShareSystemHives
Definition: cmdata.c:60
#define TAG_CMHIVE
Definition: cmlib.h:221
NTSTATUS CMAPI HvInitialize(PHHIVE RegistryHive, ULONG OperationType, ULONG HiveFlags, ULONG FileType, PVOID HiveData OPTIONAL, PALLOCATE_ROUTINE Allocate, PFREE_ROUTINE Free, PFILE_SET_SIZE_ROUTINE FileSetSize, PFILE_WRITE_ROUTINE FileWrite, PFILE_READ_ROUTINE FileRead, PFILE_FLUSH_ROUTINE FileFlush, ULONG Cluster OPTIONAL, PCUNICODE_STRING FileName OPTIONAL)
#define CM_CHECK_REGISTRY_SUCCESS(StatusCode)
Definition: cmlib.h:288
ULONG CM_CHECK_REGISTRY_STATUS
Definition: cmlib.h:230
#define TAG_CM
Definition: cmlib.h:219
VOID CMAPI HvFree(PHHIVE RegistryHive)
VOID NTAPI CmpDestroyHiveViewList(IN PCMHIVE Hive)
Definition: cmmapvw.c:35
VOID NTAPI CmpInitHiveViewList(IN PCMHIVE Hive)
Definition: cmmapvw.c:21
VOID NTAPI CmpDestroySecurityCache(IN PCMHIVE Hive)
Definition: cmsecach.c:41
VOID NTAPI CmpInitSecurityCache(IN PCMHIVE Hive)
Definition: cmsecach.c:21
LIST_ENTRY CmpHiveListHead
Definition: cmsysini.c:17
BOOLEAN NTAPI CmpFileWrite(IN PHHIVE RegistryHive, IN ULONG FileType, IN PULONG FileOffset, IN PVOID Buffer, IN SIZE_T BufferLength)
Definition: cmwraprs.c:99
BOOLEAN NTAPI CmpFileSetSize(_In_ PHHIVE RegistryHive, _In_ ULONG FileType, _In_ ULONG FileSize, _In_ ULONG OldFileSize)
Definition: cmwraprs.c:132
BOOLEAN NTAPI CmpFileFlush(IN PHHIVE RegistryHive, IN ULONG FileType, IN OUT PLARGE_INTEGER FileOffset, IN ULONG Length)
Definition: cmwraprs.c:192
NTSTATUS NTAPI CmpCreateEvent(IN EVENT_TYPE EventType, OUT PHANDLE EventHandle, OUT PKEVENT *Event)
Definition: cmwraprs.c:19
BOOLEAN NTAPI CmpFileRead(IN PHHIVE RegistryHive, IN ULONG FileType, IN PULONG FileOffset, OUT PVOID Buffer, IN SIZE_T BufferLength)
Definition: cmwraprs.c:73
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
_In_ PIO_STATUS_BLOCK IoStatusBlock
Definition: dispmprt.h:608
_Check_return_ _In_ DXGK_EVENT_TYPE _In_ ULONG Event
Definition: dispmprt.h:1287
#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:33
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
Definition: wcs.c:2988
_ACRTIMP int __cdecl _wcsnicmp(const wchar_t *, const wchar_t *, size_t)
Definition: wcs.c:200
#define L(x)
Definition: resources.c:13
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define InsertHeadList(ListHead, Entry)
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
NTSTATUS ExInitializeResourceLite(PULONG res)
Definition: env_spec_w32.h:641
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
#define ExDeleteResourceLite(res)
Definition: env_spec_w32.h:647
#define NonPagedPool
Definition: env_spec_w32.h:307
ULONG ERESOURCE
Definition: env_spec_w32.h:594
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define PagedPool
Definition: env_spec_w32.h:308
FORCEINLINE VOID ExReleasePushLock(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1299
#define ExInitializePushLock
Definition: ex.h:1016
FORCEINLINE VOID ExAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1039
_Inout_opt_ PUNICODE_STRING Extension
Definition: fltkernel.h:1092
#define FILE_NO_COMPRESSION
Definition: from_kernel.h:43
#define FILE_OPEN
Definition: from_kernel.h:54
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
@ FileFsSizeInformation
Definition: from_kernel.h:221
#define FILE_NO_INTERMEDIATE_BUFFERING
Definition: from_kernel.h:28
#define FILE_RANDOM_ACCESS
Definition: from_kernel.h:38
#define FILE_OPEN_IF
Definition: from_kernel.h:56
#define FILE_SUPERSEDE
Definition: from_kernel.h:53
Status
Definition: gdiplustypes.h:24
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
VOID FASTCALL KeInitializeGuardedMutex(OUT PKGUARDED_MUTEX GuardedMutex)
Definition: gmutex.c:31
#define KeGetCurrentThread
Definition: hal.h:55
#define HBLOCK_SIZE
Definition: hivedata.h:42
#define HINIT_FILE
Definition: hivedata.h:15
#define HINIT_MEMORY
Definition: hivedata.h:14
#define HFILE_TYPE_ALTERNATE
Definition: hivedata.h:36
#define HFILE_TYPE_MAX
Definition: hivedata.h:37
#define HFILE_TYPE_LOG
Definition: hivedata.h:34
#define HIVE_VOLATILE
Definition: hivedata.h:23
#define HFILE_TYPE_PRIMARY
Definition: hivedata.h:33
#define HINIT_MAPFILE
Definition: hivedata.h:18
#define HFILE_TYPE_EXTERNAL
Definition: hivedata.h:35
#define HINIT_MEMORY_INPLACE
Definition: hivedata.h:16
#define HSECTOR_SIZE
Definition: hivedata.h:43
if(dx< 0)
Definition: linetemp.h:194
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
static IDispatch External
Definition: htmldoc.c:521
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:115
#define KernelMode
Definition: asm.h:38
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
#define SYNCHRONIZE
Definition: nt_native.h:61
#define FILE_WRITE_DATA
Definition: nt_native.h:631
#define FILE_READ_DATA
Definition: nt_native.h:628
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define FILE_CREATED
Definition: nt_native.h:770
#define FSCTL_MARK_AS_SYSTEM_HIVE
Definition: nt_native.h:845
#define FSCTL_SET_COMPRESSION
Definition: nt_native.h:842
#define UNICODE_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
@ NotificationEvent
static OUT PIO_STATUS_BLOCK OUT PVOID FileInformation
Definition: pipe.c:100
NTSYSAPI NTSTATUS NTAPI ZwFsControlFile(IN HANDLE DeviceHandle, IN HANDLE Event OPTIONAL, IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, IN PVOID ApcContext OPTIONAL, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG IoControlCode, IN PVOID InputBuffer, IN ULONG InputBufferSize, OUT PVOID OutputBuffer, IN ULONG OutputBufferSize)
NTSYSAPI NTSTATUS NTAPI ZwQueryVolumeInformationFile(IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock, OUT PVOID FsInformation, IN ULONG Length, IN FS_INFORMATION_CLASS FsInformationClass)
VOID NTAPI CmpCloseHiveFiles(IN PCMHIVE Hive)
Definition: cminit.c:645
NTSTATUS NTAPI CmpInitializeHive(_Out_ PCMHIVE *CmHive, _In_ ULONG OperationType, _In_ ULONG HiveFlags, _In_ ULONG FileType, _In_opt_ PVOID HiveData, _In_ HANDLE Primary, _In_ HANDLE Log, _In_ HANDLE External, _In_ HANDLE Alternate, _In_opt_ PCUNICODE_STRING FileName, _In_ ULONG CheckFlags)
Definition: cminit.c:19
NTSTATUS NTAPI CmpOpenHiveFiles(IN PCUNICODE_STRING BaseName, IN PCWSTR Extension OPTIONAL, OUT PHANDLE Primary, OUT PHANDLE Log, OUT PULONG PrimaryDisposition, OUT PULONG LogDisposition, IN BOOLEAN CreateAllowed, IN BOOLEAN MarkAsSystemHive, IN BOOLEAN NoBuffering, OUT PULONG ClusterSize OPTIONAL)
Definition: cminit.c:274
NTSTATUS NTAPI CmpDestroyHive(IN PCMHIVE CmHive)
Definition: cminit.c:243
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
#define STATUS_CANNOT_LOAD_REGISTRY_FILE
Definition: ntstatus.h:790
#define STATUS_REGISTRY_CORRUPT
Definition: ntstatus.h:662
#define STATUS_REGISTRY_IO_FAILED
Definition: ntstatus.h:663
short WCHAR
Definition: pedump.c:58
unsigned short USHORT
Definition: pedump.c:61
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define FileStandardInformation
Definition: propsheet.cpp:61
#define STATUS_SUCCESS
Definition: shellext.h:65
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
Definition: cmlib.h:323
ULONG FlushCount
Definition: cmlib.h:366
PKTHREAD HiveSecurityLockOwner
Definition: cmlib.h:336
HHIVE Hive
Definition: cmlib.h:324
BOOLEAN HiveIsLoading
Definition: cmlib.h:367
LIST_ENTRY NotifyList
Definition: cmlib.h:326
BOOLEAN Frozen
Definition: cmlib.h:355
PKGUARDED_MUTEX ViewLock
Definition: cmlib.h:330
LIST_ENTRY HiveList
Definition: cmlib.h:327
EX_PUSH_LOCK WriterLock
Definition: cmlib.h:332
PKTHREAD HiveLockOwner
Definition: cmlib.h:329
PERESOURCE FlusherLock
Definition: cmlib.h:334
PKTHREAD WriterLockOwner
Definition: cmlib.h:333
BOOLEAN GrowOnlyMode
Definition: cmlib.h:357
LIST_ENTRY KnodeConvertListHead
Definition: cmlib.h:360
EX_PUSH_LOCK SecurityLock
Definition: cmlib.h:335
PWORK_QUEUE_ITEM UnloadWorkItem
Definition: cmlib.h:356
PKTHREAD CreatorOwner
Definition: cmlib.h:368
LIST_ENTRY TrustClassEntry
Definition: cmlib.h:365
ULONG Flags
Definition: cmlib.h:364
CM_USE_COUNT_LOG UseCountLog
Definition: cmlib.h:362
HANDLE FileHandles[HFILE_TYPE_MAX]
Definition: cmlib.h:325
LIST_ENTRY KcbConvertListHead
Definition: cmlib.h:359
PKEVENT UnloadEvent
Definition: cmlib.h:353
UNICODE_STRING FileUserName
Definition: cmlib.h:341
PFILE_OBJECT FileObject
Definition: cmlib.h:339
PCM_KEY_CONTROL_BLOCK RootKcb
Definition: cmlib.h:354
PKTHREAD ViewLockOwner
Definition: cmlib.h:331
PCM_CELL_REMAP_BLOCK CellRemapArray
Definition: cmlib.h:361
ULONG GrowOffset
Definition: cmlib.h:358
EX_PUSH_LOCK HiveLock
Definition: cmlib.h:328
CM_USE_COUNT_LOG LockHiveLog
Definition: cmlib.h:363
UNICODE_STRING FileFullPath
Definition: cmlib.h:340
UNICODE_STRING HiveRootPath
Definition: cmlib.h:343
USHORT Next
Definition: cmlib.h:314
struct _LIST_ENTRY * Blink
Definition: typedefs.h:122
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
void * Buffer
Definition: sprintf.c:453
unsigned short MaximumLength
Definition: sprintf.c:452
#define max(a, b)
Definition: svc.c:63
#define STATUS_PENDING
Definition: telnetd.h:14
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2664
_In_ WDFDEVICE _In_ WDF_SPECIAL_FILE_TYPE FileType
Definition: wdfdevice.h:2747
_Must_inspect_result_ _In_opt_ WDFKEY _In_ PCUNICODE_STRING _In_ ACCESS_MASK _In_ ULONG _Out_opt_ PULONG CreateDisposition
Definition: wdfregistry.h:120
_Out_ PHANDLE EventHandle
Definition: iofuncs.h:857
@ Executive
Definition: ketypes.h:467
#define ObDereferenceObject
Definition: obfuncs.h:203
_In_ PSTRING FullName
Definition: rtlfuncs.h:1665