summaryrefslogtreecommitdiff
path: root/simemi/simemi.c
diff options
context:
space:
mode:
authortapanansel <[email protected]>2024-04-01 22:56:50 +0000
committertapanansel <[email protected]>2024-04-01 22:56:50 +0000
commitc8a2c55f6ccfef3f8d115d40be2900ffeac7a89b (patch)
tree473070176fe0efc17244ab413fb30e45ab063978 /simemi/simemi.c
parentb968cfbed5566a3a9597f5368334beb3b6dad4d2 (diff)
Simulated EMI driver sampleuser/tapana/simemi
Diffstat (limited to 'simemi/simemi.c')
-rw-r--r--simemi/simemi.c76
1 files changed, 76 insertions, 0 deletions
diff --git a/simemi/simemi.c b/simemi/simemi.c
new file mode 100644
index 00000000..9d22fd0a
--- /dev/null
+++ b/simemi/simemi.c
@@ -0,0 +1,76 @@
+/*++
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Module Name:
+
+ simemi.c
+
+Abstract:
+
+ This module contains the driver initialization routines.
+
+--*/
+
+#include <initguid.h>
+#include "simemi.h"
+#include <devguid.h>
+
+NTSTATUS
+DriverEntry (
+ _In_ PDRIVER_OBJECT DriverObject,
+ _In_ PUNICODE_STRING RegistryPath
+ );
+
+#pragma alloc_text(INIT, DriverEntry)
+
+NTSTATUS
+DriverEntry (
+ _In_ PDRIVER_OBJECT DriverObject,
+ _In_ PUNICODE_STRING RegistryPath
+ )
+
+/*++
+
+Routine Description:
+
+ This routine is the entry point for the driver.
+
+Arguments:
+
+ DriverObject - Supplies a pointer to the driver object instance.
+
+ RegistryPath - Supplies a pointer to the driver's registry path.
+
+Return Value:
+
+ NTSTATUS.
+
+--*/
+
+{
+
+ NTSTATUS Status;
+ WDF_DRIVER_CONFIG WdfConfig;
+
+ //
+ // Initialize WDF.
+ //
+
+ WDF_DRIVER_CONFIG_INIT(&WdfConfig, &SimEmiFdoCreateDevice);
+ Status = WdfDriverCreate(DriverObject,
+ RegistryPath,
+ WDF_NO_OBJECT_ATTRIBUTES,
+ &WdfConfig,
+ WDF_NO_HANDLE);
+
+ if (!NT_SUCCESS(Status)) {
+ KdPrint(("WdfDriverCreate failed with status 0x%08X\n", Status));
+ goto DriverEntryEnd;
+ }
+
+ KdPrint(("Successfully created SimEmi Driver.\n"));
+
+DriverEntryEnd:
+ return Status;
+} \ No newline at end of file