https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5e242c556646f8905485a…
commit 5e242c556646f8905485afbb5b9fd9fc8da6af5a
Author: Victor Perevertkin <victor.perevertkin(a)reactos.org>
AuthorDate: Fri Aug 28 15:28:45 2020 +0300
Commit: Victor Perevertkin <victor.perevertkin(a)reactos.org>
CommitDate: Fri Aug 28 15:28:45 2020 +0300
[NTOSKRNL_VISTA] Implement/stubplement more Etw, Io, Ke, Po functions
CORE-17129
---
sdk/lib/drivers/ntoskrnl_vista/CMakeLists.txt | 2 +
sdk/lib/drivers/ntoskrnl_vista/etw.c | 46 +++++++++++++
sdk/lib/drivers/ntoskrnl_vista/io.c | 93 +++++++++++++++++++++++++--
sdk/lib/drivers/ntoskrnl_vista/ke.c | 40 ++++++++++--
sdk/lib/drivers/ntoskrnl_vista/po.c | 43 +++++++++++++
5 files changed, 214 insertions(+), 10 deletions(-)
diff --git a/sdk/lib/drivers/ntoskrnl_vista/CMakeLists.txt
b/sdk/lib/drivers/ntoskrnl_vista/CMakeLists.txt
index 0fd8fd8c7e7..5ce01354762 100644
--- a/sdk/lib/drivers/ntoskrnl_vista/CMakeLists.txt
+++ b/sdk/lib/drivers/ntoskrnl_vista/CMakeLists.txt
@@ -4,8 +4,10 @@ add_definitions(-D_WIN32_WINNT=0x600)
add_definitions(-DUNICODE -D_UNICODE -D__NTOSKRNL__ -D_NTOSKRNL_ -D_NTSYSTEM_)
list(APPEND SOURCE
+ etw.c
fsrtl.c
io.c
+ po.c
ke.c
rtl.c)
diff --git a/sdk/lib/drivers/ntoskrnl_vista/etw.c b/sdk/lib/drivers/ntoskrnl_vista/etw.c
new file mode 100644
index 00000000000..903b0497297
--- /dev/null
+++ b/sdk/lib/drivers/ntoskrnl_vista/etw.c
@@ -0,0 +1,46 @@
+/*
+ * PROJECT: ReactOS Kernel - Vista+ APIs
+ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Etw functions of Vista+
+ * COPYRIGHT: 2020 Victor Perevertkin (victor.perevertkin(a)reactos.org)
+ */
+
+#include <ntdef.h>
+#include <ntifs.h>
+
+_IRQL_requires_max_(HIGH_LEVEL)
+NTSTATUS
+NTKERNELAPI
+NTAPI
+EtwWrite(
+ _In_ REGHANDLE RegHandle,
+ _In_ PCEVENT_DESCRIPTOR EventDescriptor,
+ _In_opt_ LPCGUID ActivityId,
+ _In_ ULONG UserDataCount,
+ _In_reads_opt_(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData)
+{
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+_IRQL_requires_max_(PASSIVE_LEVEL)
+NTSTATUS
+NTKERNELAPI
+NTAPI
+EtwRegister(
+ _In_ LPCGUID ProviderId,
+ _In_opt_ PETWENABLECALLBACK EnableCallback,
+ _In_opt_ PVOID CallbackContext,
+ _Out_ PREGHANDLE RegHandle)
+{
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+_IRQL_requires_max_(PASSIVE_LEVEL)
+NTSTATUS
+NTKERNELAPI
+NTAPI
+EtwUnregister(
+ _In_ REGHANDLE RegHandle)
+{
+ return STATUS_NOT_IMPLEMENTED;
+}
diff --git a/sdk/lib/drivers/ntoskrnl_vista/io.c b/sdk/lib/drivers/ntoskrnl_vista/io.c
index 1d88cbb68f1..3f58ce9574c 100644
--- a/sdk/lib/drivers/ntoskrnl_vista/io.c
+++ b/sdk/lib/drivers/ntoskrnl_vista/io.c
@@ -1,14 +1,23 @@
/*
- * PROJECT: ReactOS Kernel - Vista+ APIs
- * LICENSE: GPL v2 - See COPYING in the top level directory
- * FILE: lib/drivers/ntoskrnl_vista/io.c
- * PURPOSE: Io functions of Vista+
- * PROGRAMMERS: Pierre Schweitzer <pierre(a)reactos.org>
+ * PROJECT: ReactOS Kernel - Vista+ APIs
+ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Io functions of Vista+
+ * COPYRIGHT: 2016 Pierre Schweitzer (pierre(a)reactos.org)
+ * 2020 Victor Perevertkin (victor.perevertkin(a)reactos.org)
*/
#include <ntdef.h>
#include <ntifs.h>
+typedef struct _EX_WORKITEM_CONTEXT
+{
+ PIO_WORKITEM WorkItem;
+ PIO_WORKITEM_ROUTINE_EX WorkItemRoutineEx;
+ PVOID Context;
+} EX_WORKITEM_CONTEXT, *PEX_WORKITEM_CONTEXT;
+
+#define TAG_IOWI 'IWOI'
+
NTKERNELAPI
NTSTATUS
NTAPI
@@ -25,3 +34,77 @@ IoGetIrpExtraCreateParameter(IN PIRP Irp,
*ExtraCreateParameter = Irp->UserBuffer;
return STATUS_SUCCESS;
}
+
+_Function_class_(IO_WORKITEM_ROUTINE)
+static
+VOID
+NTAPI
+IopWorkItemExCallback(
+ PDEVICE_OBJECT DeviceObject,
+ PVOID Ctx)
+{
+ PEX_WORKITEM_CONTEXT context = Ctx;
+
+ context->WorkItemRoutineEx(DeviceObject, context->Context,
context->WorkItem);
+ ExFreePoolWithTag(context, TAG_IOWI);
+}
+
+NTKERNELAPI
+VOID
+NTAPI
+IoQueueWorkItemEx(
+ _Inout_ PIO_WORKITEM IoWorkItem,
+ _In_ PIO_WORKITEM_ROUTINE_EX WorkerRoutine,
+ _In_ WORK_QUEUE_TYPE QueueType,
+ _In_opt_ __drv_aliasesMem PVOID Context)
+{
+ PEX_WORKITEM_CONTEXT newContext = ExAllocatePoolWithTag(NonPagedPoolMustSucceed,
sizeof(*newContext), TAG_IOWI);
+ newContext->WorkItem = IoWorkItem;
+ newContext->WorkItemRoutineEx = WorkerRoutine;
+ newContext->Context = Context;
+
+ IoQueueWorkItem(IoWorkItem, IopWorkItemExCallback, QueueType, Context);
+}
+
+_IRQL_requires_max_(PASSIVE_LEVEL)
+_Must_inspect_result_
+NTKERNELAPI
+NTSTATUS
+NTAPI
+IoGetDevicePropertyData(
+ _In_ PDEVICE_OBJECT Pdo,
+ _In_ CONST DEVPROPKEY *PropertyKey,
+ _In_ LCID Lcid,
+ _Reserved_ ULONG Flags,
+ _In_ ULONG Size,
+ _Out_ PVOID Data,
+ _Out_ PULONG RequiredSize,
+ _Out_ PDEVPROPTYPE Type)
+{
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+_IRQL_requires_max_(PASSIVE_LEVEL)
+_Must_inspect_result_
+NTKERNELAPI
+NTSTATUS
+IoSetDeviceInterfacePropertyData(
+ _In_ PUNICODE_STRING SymbolicLinkName,
+ _In_ CONST DEVPROPKEY *PropertyKey,
+ _In_ LCID Lcid,
+ _In_ ULONG Flags,
+ _In_ DEVPROPTYPE Type,
+ _In_ ULONG Size,
+ _In_reads_bytes_opt_(Size) PVOID Data)
+{
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+NTKERNELAPI
+IO_PRIORITY_HINT
+NTAPI
+IoGetIoPriorityHint(
+ _In_ PIRP Irp)
+{
+ return IoPriorityNormal;
+}
\ No newline at end of file
diff --git a/sdk/lib/drivers/ntoskrnl_vista/ke.c b/sdk/lib/drivers/ntoskrnl_vista/ke.c
index e807225d87b..2f982659393 100644
--- a/sdk/lib/drivers/ntoskrnl_vista/ke.c
+++ b/sdk/lib/drivers/ntoskrnl_vista/ke.c
@@ -1,9 +1,9 @@
/*
- * PROJECT: ReactOS Kernel - Vista+ APIs
- * LICENSE: GPL v2 - See COPYING in the top level directory
- * FILE: lib/drivers/ntoskrnl_vista/ke.c
- * PURPOSE: Ke functions of Vista+
- * PROGRAMMERS: Pierre Schweitzer <pierre(a)reactos.org>
+ * PROJECT: ReactOS Kernel - Vista+ APIs
+ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Ke functions of Vista+
+ * COPYRIGHT: 2016 Pierre Schweitzer (pierre(a)reactos.org)
+ * 2020 Victor Perevertkin (victor.perevertkin(a)reactos.org)
*/
#include <ntdef.h>
@@ -25,3 +25,33 @@ KeQueryActiveProcessorCount(OUT PKAFFINITY ActiveProcessors OPTIONAL)
RtlInitializeBitMap(&Bitmap, (PULONG)&ActiveMap, sizeof(ActiveMap) * 8);
return RtlNumberOfSetBits(&Bitmap);
}
+
+NTKERNELAPI
+USHORT
+NTAPI
+KeQueryHighestNodeNumber()
+{
+ return 0;
+}
+
+NTKERNELAPI
+USHORT
+NTAPI
+KeGetCurrentNodeNumber()
+{
+ return 0;
+}
+
+_IRQL_requires_max_(DISPATCH_LEVEL)
+NTKERNELAPI
+BOOLEAN
+NTAPI
+KeSetCoalescableTimer(
+ _Inout_ PKTIMER Timer,
+ _In_ LARGE_INTEGER DueTime,
+ _In_ ULONG Period,
+ _In_ ULONG TolerableDelay,
+ _In_opt_ PKDPC Dpc)
+{
+ return KeSetTimerEx(Timer, DueTime, Period, Dpc);
+}
diff --git a/sdk/lib/drivers/ntoskrnl_vista/po.c b/sdk/lib/drivers/ntoskrnl_vista/po.c
new file mode 100644
index 00000000000..22d44bdd892
--- /dev/null
+++ b/sdk/lib/drivers/ntoskrnl_vista/po.c
@@ -0,0 +1,43 @@
+/*
+ * PROJECT: ReactOS Kernel - Vista+ APIs
+ * LICENSE: GPL-2.0-or-later (
https://spdx.org/licenses/GPL-2.0-or-later)
+ * PURPOSE: Po functions of Vista+
+ * COPYRIGHT: 2020 Victor Perevertkin (victor.perevertkin(a)reactos.org)
+ */
+
+#include <ntdef.h>
+#include <ntifs.h>
+
+NTKERNELAPI
+NTSTATUS
+NTAPI
+PoRegisterPowerSettingCallback(
+ _In_opt_ PDEVICE_OBJECT DeviceObject,
+ _In_ LPCGUID SettingGuid,
+ _In_ PPOWER_SETTING_CALLBACK Callback,
+ _In_opt_ PVOID Context,
+ _Outptr_opt_ PVOID *Handle)
+{
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+_IRQL_requires_max_(APC_LEVEL)
+NTKERNELAPI
+NTSTATUS
+NTAPI
+PoUnregisterPowerSettingCallback(
+ _Inout_ PVOID Handle)
+{
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+_IRQL_requires_max_(DISPATCH_LEVEL)
+NTKERNELAPI
+BOOLEAN
+NTAPI
+PoQueryWatchdogTime(
+ _In_ PDEVICE_OBJECT Pdo,
+ _Out_ PULONG SecondsRemaining)
+{
+ return FALSE;
+}
\ No newline at end of file