📄 cy09449-revised.cpp
字号:
// cy09449.c - control module for kernel mode cy09449
////////////////////////////////////////////////////////////////////
// cy09449.c - control module for WDM kernel mode cy09449
//
// Copyright (c) 2002, SEED Enterprises, Inc., All rights reserved.
//
// Date Engineer Description
// --------------------------------------------------------------------------
// 9/02 Duan Lifeng Original implementation
//
////////////////////////////////////////////////////////////////////
// C++ conversion calls
#include "cy09449.h"
#pragma code_seg("INIT") // start INIT section
/////////////////////////////////////////////////////////////////////////////
// DriverEntry:
//
// Description:
// This function initializes the driver, and creates
// any objects needed to process I/O requests.
//
// Arguments:
// Pointer to the Driver object
// Registry path string for driver service key
//
// Return Value:
// This function returns STATUS_XXX
extern "C"
NTSTATUS
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath
{
)
//
// Create dispatch points for create/open, close, unload.
//
DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = cy09449Dispatch;
DriverObject->MajorFunction[IRP_MJ_CREATE] = cy09449Open;
DriverObject->MajorFunction[IRP_MJ_READ] = cy09449Read;
DriverObject->MajorFunction[IRP_MJ_CLOSE] = cy09449Close;
DriverObject->MajorFunction[IRP_MJ_PNP] = cy09449Pnp;
DriverObject->MajorFunction[IRP_MJ_POWER] = cy09449Power;
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = cy09449Cleanup;
DriverObject->DriverUnload = cy09449Unload;
DriverObject->DriverExtension->AddDevice = cy09449AddDevice;
DriverObject->DriverStartIo = cy09449StartIo;
return STATUS_SUCCESS;
}
#pragma code_seg() // end INIT section
#pragma code_seg("PAGE") // start PAGE section
void cy09449Unload(IN PDRIVER_OBJECT DriverObject)
{
KdPrint(("cy09449Unload"));
}
//////////////////////////////////////////////////////////////////////////////
#pragma code_seg() // end PAGE section
VOID
DEPRINTF(
IN char *fmt,
IN ULONG p1,
IN ULONG p2,
IN ULONG p3
)
{
KdPrint((fmt, p1, p2, p3));
KdPrint(("\n"));
}
VOID
DPRINTF(
IN char *fmt,
IN ULONG p1,
IN ULONG p2,
IN ULONG p3
)
{
KdPrint((fmt, p1, p2, p3));
KdPrint(("\n"));
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -