?? drvclass.cpp
字號:
//****************************************************************************
// File DRVCLASS.CPP
//
// Driver object of functional driver
//
// Copyright (c) APSoft, 1998-2002.
// All rights reserved.
//
//****************************************************************************
extern "C"
{
#include <ntddk.h> // Main DDK's include
#include <stdio.h> // swprintf
}
#include <drvclass.h> // Class declaration
#include <devclass.h> // Device class
///////////////////////////////////////////////////////////////////////////////
// --- Class CFuncDriver --- //
///////////////////////////////////////////////////////////////////////////////
//****************************************************************************
// --- CFuncDriver::OnAddDevice ---
//
// Purpose: New device arrived
// Input: PDEVICE_OBJECT pPdo - PDO for new device
// Output: NTSTATUS - Operation status
// Written: by Anton V. Krivenko 4/10/2002
//****************************************************************************
NTSTATUS CFuncDriver::OnAddDevice(PDEVICE_OBJECT pPdo)
{
NTSTATUS ntStatus = STATUS_NO_SUCH_DEVICE;
// Assumes, failed
WCHAR wszDevName[256]; // Device name
WCHAR wszLnkName[256]; // Link name
swprintf(wszDevName, L"\\Device\\FUJIXEROX-READCARD-Device%d", m_uNextDevice);
swprintf(wszLnkName, L"\\DosDevices\\FUJIXEROX-READCARD-Device%d", m_uNextDevice++);
PDEVICE_OBJECT pDevice = NULL; // Device object
ntStatus = CFuncDevice::OnCreate( m_pDrvObject,
&pDevice,
sizeof(CFuncDevice),
wszDevName,
wszLnkName);
if (NT_SUCCESS(ntStatus))
{
CFuncDevice * p = new (pDevice) CFuncDevice(pDevice, pPdo, wszLnkName);
if (p != NULL)
ntStatus = STATUS_SUCCESS;
} // if (NT_SUCCESS(ntStatus))
return ntStatus;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -