📄 driver.c
字号:
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil -*- (for GNU Emacs)
//
// (c) Microsoft Corporation. All rights reserved.
//
// This file is part of the Microsoft Virtual Ring Routing distribution.
// You should have received a copy of the Microsoft Research Shared Source
// license agreement (MSR-SSLA) for this software; see the file "license.txt".
// If not, please see http://research.microsoft.com/vrr/license.htm,
// or write to Microsoft Research, One Microsoft Way, Redmond, WA 98052-6399.
//
// This file is derived from the Microsoft Research Mesh Connectivity Layer,
// available under the MSR-SSLA license, and downloadable from
// http://research.microsoft.com/mesh/.
//
#include "headers.h"
uint Version = 65;
DEVICE_OBJECT *OurDeviceObject;
PDRIVER_DISPATCH IoMajorFunctions[IRP_MJ_MAXIMUM_FUNCTION + 1];
//* DriverEntry
//
// This is the driver entry point, called by NT upon loading us.
// Main initialization routine for the VRR miniport driver.
//
NTSTATUS
DriverEntry(
IN PDRIVER_OBJECT DriverObject, // VRR driver object.
IN PUNICODE_STRING RegistryPath) // Path to our info in the registry.
{
KdPrint(("VRR!DriverEntry(Driver %p)\n", DriverObject));
//
// Initialize our IO handlers.
// NdisMRegisterDevice will need this.
//
IoMajorFunctions[IRP_MJ_CREATE] = IoCreate;
IoMajorFunctions[IRP_MJ_CLEANUP] = IoCleanup;
IoMajorFunctions[IRP_MJ_CLOSE] = IoClose;
IoMajorFunctions[IRP_MJ_DEVICE_CONTROL] = IoControl;
//
// Initialize our data structures.
//
#if COUNTING_MALLOC
InitCountingMalloc();
#endif
RandomInit();
if (! MiniportInit(DriverObject, RegistryPath)) {
KdPrint(("VRR!MiniportInit failed\n"));
return STATUS_UNSUCCESSFUL;
}
return STATUS_SUCCESS;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -