mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 08:53:02 +00:00
[NTOSKRNL]
- Add some missing return value checks - Add some annotations - Fix format specifiers - Fix variable scope conflicts - Fix possible closing of a NULL handle - Use ObCloseHandle instead of ZwClose svn path=/trunk/; revision=57954
This commit is contained in:
parent
ed547ad4a5
commit
1a64a18b5e
16 changed files with 163 additions and 112 deletions
9
reactos/ntoskrnl/cache/section/data.c
vendored
9
reactos/ntoskrnl/cache/section/data.c
vendored
|
@ -154,9 +154,10 @@ MiZeroFillSection(PVOID Address, PLARGE_INTEGER FileOffsetPtr, ULONG Length)
|
||||||
DPRINT("Pulling zero pages for %08x%08x-%08x%08x\n",
|
DPRINT("Pulling zero pages for %08x%08x-%08x%08x\n",
|
||||||
FileOffset.u.HighPart, FileOffset.u.LowPart,
|
FileOffset.u.HighPart, FileOffset.u.LowPart,
|
||||||
End.u.HighPart, End.u.LowPart);
|
End.u.HighPart, End.u.LowPart);
|
||||||
|
|
||||||
while (FileOffset.QuadPart < End.QuadPart)
|
while (FileOffset.QuadPart < End.QuadPart)
|
||||||
{
|
{
|
||||||
PVOID Address;
|
PVOID CurrentAddress;
|
||||||
ULONG_PTR Entry;
|
ULONG_PTR Entry;
|
||||||
|
|
||||||
if (!NT_SUCCESS(MmRequestPageMemoryConsumer(MC_CACHE, TRUE, &Page)))
|
if (!NT_SUCCESS(MmRequestPageMemoryConsumer(MC_CACHE, TRUE, &Page)))
|
||||||
|
@ -169,14 +170,14 @@ MiZeroFillSection(PVOID Address, PLARGE_INTEGER FileOffsetPtr, ULONG Length)
|
||||||
if (Entry == 0)
|
if (Entry == 0)
|
||||||
{
|
{
|
||||||
MmSetPageEntrySectionSegment(Segment, &FileOffset, MAKE_PFN_SSE(Page));
|
MmSetPageEntrySectionSegment(Segment, &FileOffset, MAKE_PFN_SSE(Page));
|
||||||
Address = ((PCHAR)MemoryArea->StartingAddress) + FileOffset.QuadPart - FirstMapped.QuadPart;
|
CurrentAddress = ((PCHAR)MemoryArea->StartingAddress) + FileOffset.QuadPart - FirstMapped.QuadPart;
|
||||||
|
|
||||||
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
|
OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
|
||||||
MmReferencePage(Page);
|
MmReferencePage(Page);
|
||||||
KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
|
KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
|
||||||
|
|
||||||
MmCreateVirtualMapping(NULL, Address, PAGE_READWRITE, &Page, 1);
|
MmCreateVirtualMapping(NULL, CurrentAddress, PAGE_READWRITE, &Page, 1);
|
||||||
MmInsertRmap(Page, NULL, Address);
|
MmInsertRmap(Page, NULL, CurrentAddress);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
33
reactos/ntoskrnl/cache/section/fault.c
vendored
33
reactos/ntoskrnl/cache/section/fault.c
vendored
|
@ -102,11 +102,12 @@ the page is present.
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
MmNotPresentFaultCachePage(PMMSUPPORT AddressSpace,
|
MmNotPresentFaultCachePage (
|
||||||
MEMORY_AREA* MemoryArea,
|
_In_ PMMSUPPORT AddressSpace,
|
||||||
PVOID Address,
|
_In_ MEMORY_AREA* MemoryArea,
|
||||||
BOOLEAN Locked,
|
_In_ PVOID Address,
|
||||||
PMM_REQUIRED_RESOURCES Required)
|
_In_ BOOLEAN Locked,
|
||||||
|
_Inout_ PMM_REQUIRED_RESOURCES Required)
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PVOID PAddress;
|
PVOID PAddress;
|
||||||
|
@ -317,11 +318,12 @@ In the ultimate form of this code, CoW is reenabled.
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
MiCowCacheSectionPage(PMMSUPPORT AddressSpace,
|
MiCowCacheSectionPage (
|
||||||
PMEMORY_AREA MemoryArea,
|
_In_ PMMSUPPORT AddressSpace,
|
||||||
PVOID Address,
|
_In_ PMEMORY_AREA MemoryArea,
|
||||||
BOOLEAN Locked,
|
_In_ PVOID Address,
|
||||||
PMM_REQUIRED_RESOURCES Required)
|
_In_ BOOLEAN Locked,
|
||||||
|
_Inout_ PMM_REQUIRED_RESOURCES Required)
|
||||||
{
|
{
|
||||||
PMM_SECTION_SEGMENT Segment;
|
PMM_SECTION_SEGMENT Segment;
|
||||||
PFN_NUMBER NewPage, OldPage;
|
PFN_NUMBER NewPage, OldPage;
|
||||||
|
@ -422,8 +424,8 @@ MiCowCacheSectionPage(PMMSUPPORT AddressSpace,
|
||||||
|
|
||||||
DPRINT("Allocated page %x\n", NewPage);
|
DPRINT("Allocated page %x\n", NewPage);
|
||||||
|
|
||||||
/* Unshare the old page */
|
/* Unshare the old page */
|
||||||
MmDeleteRmap(OldPage, Process, PAddress);
|
MmDeleteRmap(OldPage, Process, PAddress);
|
||||||
|
|
||||||
/* Copy the old page */
|
/* Copy the old page */
|
||||||
DPRINT("Copying\n");
|
DPRINT("Copying\n");
|
||||||
|
@ -474,10 +476,13 @@ by fault handling, making recursive fault handling possible when required.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
_Function_class_(WORKER_THREAD_ROUTINE)
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
MmpFaultWorker(PWORK_QUEUE_WITH_CONTEXT WorkItem)
|
MmpFaultWorker(PVOID Parameter)
|
||||||
{
|
{
|
||||||
|
PWORK_QUEUE_WITH_CONTEXT WorkItem = Parameter;
|
||||||
|
|
||||||
DPRINT("Calling work\n");
|
DPRINT("Calling work\n");
|
||||||
WorkItem->Status = WorkItem->Required->DoAcquisition(WorkItem->AddressSpace,
|
WorkItem->Status = WorkItem->Required->DoAcquisition(WorkItem->AddressSpace,
|
||||||
WorkItem->MemoryArea,
|
WorkItem->MemoryArea,
|
||||||
|
@ -622,7 +627,7 @@ MmpSectionAccessFaultInner(KPROCESSOR_MODE Mode,
|
||||||
KeInitializeEvent(&Context.Wait, NotificationEvent, FALSE);
|
KeInitializeEvent(&Context.Wait, NotificationEvent, FALSE);
|
||||||
|
|
||||||
ExInitializeWorkItem(&Context.WorkItem,
|
ExInitializeWorkItem(&Context.WorkItem,
|
||||||
(PWORKER_THREAD_ROUTINE)MmpFaultWorker,
|
MmpFaultWorker,
|
||||||
&Context);
|
&Context);
|
||||||
|
|
||||||
DPRINT("Queue work item\n");
|
DPRINT("Queue work item\n");
|
||||||
|
|
1
reactos/ntoskrnl/cache/section/io.c
vendored
1
reactos/ntoskrnl/cache/section/io.c
vendored
|
@ -71,6 +71,7 @@ This completion function is really required. Paging io completion does almost
|
||||||
nothing, including freeing the mdls.
|
nothing, including freeing the mdls.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
_Function_class_(IO_COMPLETION_ROUTINE)
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
MiSimpleReadComplete(PDEVICE_OBJECT DeviceObject,
|
MiSimpleReadComplete(PDEVICE_OBJECT DeviceObject,
|
||||||
|
|
26
reactos/ntoskrnl/cache/section/newmm.h
vendored
26
reactos/ntoskrnl/cache/section/newmm.h
vendored
|
@ -251,13 +251,16 @@ NTAPI
|
||||||
MiFreeSegmentPage(PMM_SECTION_SEGMENT Segment,
|
MiFreeSegmentPage(PMM_SECTION_SEGMENT Segment,
|
||||||
PLARGE_INTEGER FileOffset);
|
PLARGE_INTEGER FileOffset);
|
||||||
|
|
||||||
|
_Success_(1)
|
||||||
|
_When_(return==STATUS_MORE_PROCESSING_REQUIRED, _At_(Required->DoAcquisition, _Post_notnull_))
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
MiCowCacheSectionPage(PMMSUPPORT AddressSpace,
|
MiCowCacheSectionPage (
|
||||||
PMEMORY_AREA MemoryArea,
|
_In_ PMMSUPPORT AddressSpace,
|
||||||
PVOID Address,
|
_In_ PMEMORY_AREA MemoryArea,
|
||||||
BOOLEAN Locked,
|
_In_ PVOID Address,
|
||||||
PMM_REQUIRED_RESOURCES Required);
|
_In_ BOOLEAN Locked,
|
||||||
|
_Inout_ PMM_REQUIRED_RESOURCES Required);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -344,13 +347,16 @@ NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
MmUnmapCacheViewInSystemSpace(PVOID Address);
|
MmUnmapCacheViewInSystemSpace(PVOID Address);
|
||||||
|
|
||||||
|
_Success_(1)
|
||||||
|
_When_(return==STATUS_MORE_PROCESSING_REQUIRED, _At_(Required->DoAcquisition, _Post_notnull_))
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
MmNotPresentFaultCachePage(PMMSUPPORT AddressSpace,
|
MmNotPresentFaultCachePage (
|
||||||
PMEMORY_AREA MemoryArea,
|
_In_ PMMSUPPORT AddressSpace,
|
||||||
PVOID Address,
|
_In_ MEMORY_AREA* MemoryArea,
|
||||||
BOOLEAN Locked,
|
_In_ PVOID Address,
|
||||||
PMM_REQUIRED_RESOURCES Required);
|
_In_ BOOLEAN Locked,
|
||||||
|
_Inout_ PMM_REQUIRED_RESOURCES Required);
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
|
|
5
reactos/ntoskrnl/cache/section/sptab.c
vendored
5
reactos/ntoskrnl/cache/section/sptab.c
vendored
|
@ -64,6 +64,7 @@ paging machinery.
|
||||||
|
|
||||||
extern KSPIN_LOCK MiSectionPageTableLock;
|
extern KSPIN_LOCK MiSectionPageTableLock;
|
||||||
|
|
||||||
|
_Function_class_(RTL_GENERIC_ALLOCATE_ROUTINE)
|
||||||
static
|
static
|
||||||
PVOID
|
PVOID
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -75,6 +76,7 @@ MiSectionPageTableAllocate(PRTL_GENERIC_TABLE Table, CLONG Bytes)
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_Function_class_(RTL_GENERIC_FREE_ROUTINE)
|
||||||
static
|
static
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -84,6 +86,7 @@ MiSectionPageTableFree(PRTL_GENERIC_TABLE Table, PVOID Data)
|
||||||
ExFreePoolWithTag(Data, 'MmPt');
|
ExFreePoolWithTag(Data, 'MmPt');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_Function_class_(RTL_GENERIC_COMPARE_ROUTINE)
|
||||||
static
|
static
|
||||||
RTL_GENERIC_COMPARE_RESULTS
|
RTL_GENERIC_COMPARE_RESULTS
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -341,7 +344,7 @@ MmGetSectionAssociation(PFN_NUMBER Page,
|
||||||
{
|
{
|
||||||
Segment = PageTable->Segment;
|
Segment = PageTable->Segment;
|
||||||
Offset->QuadPart = PageTable->FileOffset.QuadPart +
|
Offset->QuadPart = PageTable->FileOffset.QuadPart +
|
||||||
(RawOffset << PAGE_SHIFT);
|
((ULONG64)RawOffset << PAGE_SHIFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Segment;
|
return Segment;
|
||||||
|
|
|
@ -242,6 +242,7 @@ CcUnpinRepinnedBcb (
|
||||||
{
|
{
|
||||||
PINTERNAL_BCB iBcb = Bcb;
|
PINTERNAL_BCB iBcb = Bcb;
|
||||||
|
|
||||||
|
IoStatus->Status = STATUS_SUCCESS;
|
||||||
if (--iBcb->RefCount == 0)
|
if (--iBcb->RefCount == 0)
|
||||||
{
|
{
|
||||||
IoStatus->Information = 0;
|
IoStatus->Information = 0;
|
||||||
|
|
|
@ -67,7 +67,12 @@ CmpInitializeRegistryNode(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
|
||||||
|
|
||||||
/* Convert it to Unicode */
|
/* Convert it to Unicode */
|
||||||
RtlInitEmptyUnicodeString(&KeyName, Buffer, sizeof(Buffer));
|
RtlInitEmptyUnicodeString(&KeyName, Buffer, sizeof(Buffer));
|
||||||
RtlAnsiStringToUnicodeString(&KeyName, &TempString, FALSE);
|
Status = RtlAnsiStringToUnicodeString(&KeyName, &TempString, FALSE);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
NtClose(KeyHandle);
|
||||||
|
return Status;
|
||||||
|
}
|
||||||
|
|
||||||
/* Create the key */
|
/* Create the key */
|
||||||
ParentHandle = KeyHandle;
|
ParentHandle = KeyHandle;
|
||||||
|
|
|
@ -35,6 +35,7 @@ KTIMER CmpDelayDerefKCBTimer;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
_Function_class_(KDEFERRED_ROUTINE)
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
CmpDelayCloseDpcRoutine(IN PKDPC Dpc,
|
CmpDelayCloseDpcRoutine(IN PKDPC Dpc,
|
||||||
|
@ -49,6 +50,7 @@ CmpDelayCloseDpcRoutine(IN PKDPC Dpc,
|
||||||
ExQueueWorkItem(&CmpDelayCloseWorkItem, DelayedWorkQueue);
|
ExQueueWorkItem(&CmpDelayCloseWorkItem, DelayedWorkQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_Function_class_(WORKER_THREAD_ROUTINE)
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
CmpDelayCloseWorker(IN PVOID Context)
|
CmpDelayCloseWorker(IN PVOID Context)
|
||||||
|
@ -203,6 +205,7 @@ CmpInitializeDelayedCloseTable(VOID)
|
||||||
KeInitializeTimer(&CmpDelayCloseTimer);
|
KeInitializeTimer(&CmpDelayCloseTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_Function_class_(KDEFERRED_ROUTINE)
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
CmpDelayDerefKCBDpcRoutine(IN PKDPC Dpc,
|
CmpDelayDerefKCBDpcRoutine(IN PKDPC Dpc,
|
||||||
|
@ -217,6 +220,7 @@ CmpDelayDerefKCBDpcRoutine(IN PKDPC Dpc,
|
||||||
ExQueueWorkItem(&CmpDelayDerefKCBWorkItem, DelayedWorkQueue);
|
ExQueueWorkItem(&CmpDelayDerefKCBWorkItem, DelayedWorkQueue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_Function_class_(WORKER_THREAD_ROUTINE)
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
CmpDelayDerefKCBWorker(IN PVOID Context)
|
CmpDelayDerefKCBWorker(IN PVOID Context)
|
||||||
|
|
|
@ -116,31 +116,31 @@ CmRegisterCallback(IN PEX_CALLBACK_FUNCTION Function,
|
||||||
ASSERT(Function && Cookie);
|
ASSERT(Function && Cookie);
|
||||||
|
|
||||||
Callback = ExAllocatePoolWithTag(PagedPool,
|
Callback = ExAllocatePoolWithTag(PagedPool,
|
||||||
sizeof(REGISTRY_CALLBACK),
|
sizeof(REGISTRY_CALLBACK),
|
||||||
'bcMC');
|
'bcMC');
|
||||||
if (Callback != NULL)
|
if (Callback == NULL)
|
||||||
{
|
{
|
||||||
/* initialize the callback */
|
return STATUS_INSUFFICIENT_RESOURCES;
|
||||||
ExInitializeRundownProtection(&Callback->RundownRef);
|
|
||||||
Callback->Function = Function;
|
|
||||||
Callback->Context = Context;
|
|
||||||
Callback->PendingDelete = FALSE;
|
|
||||||
|
|
||||||
/* add it to the callback list and receive a cookie for the callback */
|
|
||||||
ExAcquireFastMutex(&CmiCallbackLock);
|
|
||||||
|
|
||||||
/* FIXME - to receive a unique cookie we'll just return the pointer to the
|
|
||||||
callback object */
|
|
||||||
Callback->Cookie.QuadPart = (ULONG_PTR)Callback;
|
|
||||||
InsertTailList(&CmiCallbackHead, &Callback->ListEntry);
|
|
||||||
|
|
||||||
ExReleaseFastMutex(&CmiCallbackLock);
|
|
||||||
|
|
||||||
*Cookie = Callback->Cookie;
|
|
||||||
return STATUS_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return STATUS_INSUFFICIENT_RESOURCES;
|
/* initialize the callback */
|
||||||
|
ExInitializeRundownProtection(&Callback->RundownRef);
|
||||||
|
Callback->Function = Function;
|
||||||
|
Callback->Context = Context;
|
||||||
|
Callback->PendingDelete = FALSE;
|
||||||
|
|
||||||
|
/* add it to the callback list and receive a cookie for the callback */
|
||||||
|
ExAcquireFastMutex(&CmiCallbackLock);
|
||||||
|
|
||||||
|
/* FIXME - to receive a unique cookie we'll just return the pointer to the
|
||||||
|
callback object */
|
||||||
|
Callback->Cookie.QuadPart = (ULONG_PTR)Callback;
|
||||||
|
InsertTailList(&CmiCallbackHead, &Callback->ListEntry);
|
||||||
|
|
||||||
|
ExReleaseFastMutex(&CmiCallbackLock);
|
||||||
|
|
||||||
|
*Cookie = Callback->Cookie;
|
||||||
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -118,6 +118,7 @@ CmpDoFlushNextHive(IN BOOLEAN ForceFlush,
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_Function_class_(KDEFERRED_ROUTINE)
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
CmpEnableLazyFlushDpcRoutine(IN PKDPC Dpc,
|
CmpEnableLazyFlushDpcRoutine(IN PKDPC Dpc,
|
||||||
|
@ -129,6 +130,7 @@ CmpEnableLazyFlushDpcRoutine(IN PKDPC Dpc,
|
||||||
CmpHoldLazyFlush = FALSE;
|
CmpHoldLazyFlush = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_Function_class_(KDEFERRED_ROUTINE)
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
CmpLazyFlushDpcRoutine(IN PKDPC Dpc,
|
CmpLazyFlushDpcRoutine(IN PKDPC Dpc,
|
||||||
|
@ -161,6 +163,7 @@ CmpLazyFlush(VOID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_Function_class_(WORKER_THREAD_ROUTINE)
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
CmpLazyFlushWorker(IN PVOID Parameter)
|
CmpLazyFlushWorker(IN PVOID Parameter)
|
||||||
|
|
|
@ -433,7 +433,10 @@ ExCreateCallback(OUT PCALLBACK_OBJECT *CallbackObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Everything went fine, so return a pointer to the Object */
|
/* Everything went fine, so return a pointer to the Object */
|
||||||
if (NT_SUCCESS(Status)) *CallbackObject = Callback;
|
if (NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
*CallbackObject = Callback;
|
||||||
|
}
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ GENERIC_MAPPING ExpKeyedEventMapping =
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
|
_IRQL_requires_max_(APC_LEVEL)
|
||||||
BOOLEAN
|
BOOLEAN
|
||||||
INIT_FUNCTION
|
INIT_FUNCTION
|
||||||
NTAPI
|
NTAPI
|
||||||
|
@ -116,6 +117,7 @@ ExpInitializeKeyedEvent(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_IRQL_requires_max_(APC_LEVEL)
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
ExpReleaseOrWaitForKeyedEvent(
|
ExpReleaseOrWaitForKeyedEvent(
|
||||||
|
@ -203,6 +205,7 @@ ExpReleaseOrWaitForKeyedEvent(
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_IRQL_requires_max_(APC_LEVEL)
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
ExpWaitForKeyedEvent(
|
ExpWaitForKeyedEvent(
|
||||||
|
@ -219,6 +222,7 @@ ExpWaitForKeyedEvent(
|
||||||
FALSE);
|
FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_IRQL_requires_max_(APC_LEVEL)
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
ExpReleaseKeyedEvent(
|
ExpReleaseKeyedEvent(
|
||||||
|
@ -235,6 +239,7 @@ ExpReleaseKeyedEvent(
|
||||||
TRUE);
|
TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_IRQL_requires_max_(APC_LEVEL)
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
NtCreateKeyedEvent(
|
NtCreateKeyedEvent(
|
||||||
|
@ -311,6 +316,7 @@ NtCreateKeyedEvent(
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_IRQL_requires_max_(APC_LEVEL)
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
NtOpenKeyedEvent(
|
NtOpenKeyedEvent(
|
||||||
|
@ -359,6 +365,7 @@ NtOpenKeyedEvent(
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_IRQL_requires_max_(APC_LEVEL)
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
NtWaitForKeyedEvent(
|
NtWaitForKeyedEvent(
|
||||||
|
@ -401,6 +408,7 @@ NtWaitForKeyedEvent(
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_IRQL_requires_max_(APC_LEVEL)
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
NtReleaseKeyedEvent(
|
NtReleaseKeyedEvent(
|
||||||
|
|
|
@ -209,7 +209,7 @@ NtSetDefaultLocale(IN BOOLEAN UserProfile,
|
||||||
HANDLE KeyHandle;
|
HANDLE KeyHandle;
|
||||||
ULONG ValueLength;
|
ULONG ValueLength;
|
||||||
WCHAR ValueBuffer[20];
|
WCHAR ValueBuffer[20];
|
||||||
HANDLE UserKey = NULL;
|
HANDLE UserKey;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
PAGED_CODE();
|
PAGED_CODE();
|
||||||
|
|
||||||
|
@ -231,6 +231,7 @@ NtSetDefaultLocale(IN BOOLEAN UserProfile,
|
||||||
L"\\Registry\\Machine\\System\\CurrentControlSet"
|
L"\\Registry\\Machine\\System\\CurrentControlSet"
|
||||||
L"\\Control\\Nls\\Language");
|
L"\\Control\\Nls\\Language");
|
||||||
RtlInitUnicodeString(&ValueName, L"Default");
|
RtlInitUnicodeString(&ValueName, L"Default");
|
||||||
|
UserKey = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initailize the object attributes */
|
/* Initailize the object attributes */
|
||||||
|
@ -286,7 +287,10 @@ NtSetDefaultLocale(IN BOOLEAN UserProfile,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Close the user key */
|
/* Close the user key */
|
||||||
ZwClose(UserKey);
|
if (UserKey)
|
||||||
|
{
|
||||||
|
ObCloseHandle(UserKey, KernelMode);
|
||||||
|
}
|
||||||
|
|
||||||
/* Check for success */
|
/* Check for success */
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
|
|
|
@ -133,6 +133,7 @@ ExpDeleteTimer(IN PVOID ObjectBody)
|
||||||
KeFlushQueuedDpcs();
|
KeFlushQueuedDpcs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_Function_class_(KDEFERRED_ROUTINE)
|
||||||
VOID
|
VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
ExpTimerDpcRoutine(IN PKDPC Dpc,
|
ExpTimerDpcRoutine(IN PKDPC Dpc,
|
||||||
|
@ -355,7 +356,8 @@ NtCancelTimer(IN HANDLE TimerHandle,
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(ExSystemExceptionFilter())
|
_SEH2_EXCEPT(ExSystemExceptionFilter())
|
||||||
{
|
{
|
||||||
|
/* Do nothing */
|
||||||
|
(void)0;
|
||||||
}
|
}
|
||||||
_SEH2_END;
|
_SEH2_END;
|
||||||
}
|
}
|
||||||
|
@ -445,7 +447,8 @@ NtCreateTimer(OUT PHANDLE TimerHandle,
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(ExSystemExceptionFilter())
|
_SEH2_EXCEPT(ExSystemExceptionFilter())
|
||||||
{
|
{
|
||||||
|
/* Do nothing */
|
||||||
|
(void)0;
|
||||||
}
|
}
|
||||||
_SEH2_END;
|
_SEH2_END;
|
||||||
}
|
}
|
||||||
|
@ -500,7 +503,8 @@ NtOpenTimer(OUT PHANDLE TimerHandle,
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(ExSystemExceptionFilter())
|
_SEH2_EXCEPT(ExSystemExceptionFilter())
|
||||||
{
|
{
|
||||||
|
/* Do nothing */
|
||||||
|
(void)0;
|
||||||
}
|
}
|
||||||
_SEH2_END;
|
_SEH2_END;
|
||||||
}
|
}
|
||||||
|
@ -740,7 +744,8 @@ NtSetTimer(IN HANDLE TimerHandle,
|
||||||
}
|
}
|
||||||
_SEH2_EXCEPT(ExSystemExceptionFilter())
|
_SEH2_EXCEPT(ExSystemExceptionFilter())
|
||||||
{
|
{
|
||||||
|
/* Do nothing */
|
||||||
|
(void)0;
|
||||||
}
|
}
|
||||||
_SEH2_END;
|
_SEH2_END;
|
||||||
}
|
}
|
||||||
|
|
|
@ -841,8 +841,8 @@ Ki386PerfEnd(VOID)
|
||||||
{
|
{
|
||||||
extern ULONGLONG BootCyclesEnd, BootCycles;
|
extern ULONGLONG BootCyclesEnd, BootCycles;
|
||||||
BootCyclesEnd = __rdtsc();
|
BootCyclesEnd = __rdtsc();
|
||||||
DbgPrint("Boot took %I64d cycles!\n", BootCyclesEnd - BootCycles);
|
DbgPrint("Boot took %I64u cycles!\n", BootCyclesEnd - BootCycles);
|
||||||
DbgPrint("Interrupts: %d System Calls: %d Context Switches: %d\n",
|
DbgPrint("Interrupts: %u System Calls: %u Context Switches: %u\n",
|
||||||
KeGetCurrentPrcb()->InterruptCount,
|
KeGetCurrentPrcb()->InterruptCount,
|
||||||
KeGetCurrentPrcb()->KeSystemCalls,
|
KeGetCurrentPrcb()->KeSystemCalls,
|
||||||
KeGetContextSwitches(KeGetCurrentPrcb()));
|
KeGetContextSwitches(KeGetCurrentPrcb()));
|
||||||
|
|
|
@ -237,10 +237,12 @@ IopDisplayLoadingMessage(PUNICODE_STRING ServiceName)
|
||||||
* The input image path isn't freed on error.
|
* The input image path isn't freed on error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
NTSTATUS FASTCALL
|
NTSTATUS
|
||||||
|
FASTCALL
|
||||||
IopNormalizeImagePath(
|
IopNormalizeImagePath(
|
||||||
IN OUT PUNICODE_STRING ImagePath,
|
_Inout_ _When_(return>=0, _At_(ImagePath->Buffer, _Post_notnull_ __drv_allocatesMem(Mem)))
|
||||||
IN PUNICODE_STRING ServiceName)
|
PUNICODE_STRING ImagePath,
|
||||||
|
_In_ PUNICODE_STRING ServiceName)
|
||||||
{
|
{
|
||||||
UNICODE_STRING InputImagePath;
|
UNICODE_STRING InputImagePath;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue