/*++
Copyright (C) Microsoft Corporation, 1991 - 2010
Module Name:
class.c
Abstract:
SCSI class driver routines
Environment:
kernel mode only
Notes:
Revision History:
--*/
#define CLASS_INIT_GUID 1
#define DEBUG_MAIN_SOURCE 1
#include "classp.h"
#include "debug.h"
#include <process.h>
#include <devpkey.h>
#include <ntiologc.h>
#ifdef DEBUG_USE_WPP
#include "class.tmh"
#endif
#ifdef ALLOC_PRAGMA
#pragma alloc_text(INIT, DriverEntry)
#pragma alloc_text(PAGE, ClassAddDevice)
#pragma alloc_text(PAGE, ClassClaimDevice)
#pragma alloc_text(PAGE, ClassCreateDeviceObject)
#pragma alloc_text(PAGE, ClassDispatchPnp)
#pragma alloc_text(PAGE, ClassGetDescriptor)
#pragma alloc_text(PAGE, ClassGetPdoId)
#pragma alloc_text(PAGE, ClassInitialize)
#pragma alloc_text(PAGE, ClassInitializeEx)
#pragma alloc_text(PAGE, ClassInvalidateBusRelations)
#pragma alloc_text(PAGE, ClassMarkChildMissing)
#pragma alloc_text(PAGE, ClassMarkChildrenMissing)
#pragma alloc_text(PAGE, ClassModeSense)
#pragma alloc_text(PAGE, ClassPnpQueryFdoRelations)
#pragma alloc_text(PAGE, ClassPnpStartDevice)
#pragma alloc_text(PAGE, ClassQueryPnpCapabilities)
#pragma alloc_text(PAGE, ClassQueryTimeOutRegistryValue)
#pragma alloc_text(PAGE, ClassRemoveDevice)
#pragma alloc_text(PAGE, ClassRetrieveDeviceRelations)
#pragma alloc_text(PAGE, ClassUpdateInformationInRegistry)
#pragma alloc_text(PAGE, ClassSendDeviceIoControlSynchronous)
#pragma alloc_text(PAGE, ClassUnload)
#pragma alloc_text(PAGE, ClasspAllocateReleaseRequest)
#pragma alloc_text(PAGE, ClasspFreeReleaseRequest)
#pragma alloc_text(PAGE, ClasspInitializeHotplugInfo)
#pragma alloc_text(PAGE, ClasspRegisterMountedDeviceInterface)
#pragma alloc_text(PAGE, ClasspScanForClassHacks)
#pragma alloc_text(PAGE, ClasspScanForSpecialInRegistry)
#pragma alloc_text(PAGE, ClasspModeSense)
#pragma alloc_text(PAGE, ClasspIsPortable)
#pragma alloc_text(PAGE, ClassAcquireChildLock)
#pragma alloc_text(PAGE, ClassDetermineTokenOperationCommandSupport)
#pragma alloc_text(PAGE, ClassDeviceProcessOffloadRead)
#pragma alloc_text(PAGE, ClassDeviceProcessOffloadWrite)
#pragma alloc_text(PAGE, ClasspServicePopulateTokenTransferRequest)
#pragma alloc_text(PAGE, ClasspServiceWriteUsingTokenTransferRequest)
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
#pragma alloc_text(PAGE, ClassModeSenseEx)
#endif
#endif
#pragma prefast(disable:28159, "There are certain cases when we have to bugcheck...")
IO_COMPLETION_ROUTINE ClassCheckVerifyComplete;
ULONG ClassPnpAllowUnload = TRUE;
ULONG ClassMaxInterleavePerCriticalIo = CLASS_MAX_INTERLEAVE_PER_CRITICAL_IO;
CONST LARGE_INTEGER Magic10000 = {0xe219652c, 0xd1b71758};
GUID StoragePredictFailureDPSGuid = WDI_STORAGE_PREDICT_FAILURE_DPS_GUID;
#define FirstDriveLetter 'C'
#define LastDriveLetter 'Z'
BOOLEAN UseQPCTime = FALSE;
//
// Keep track of whether security cookie is initialized or not. This is
// required by SDL.
//
BOOLEAN InitSecurityCookie = FALSE;
//
// List Identifier for offload data transfer operations
//
ULONG MaxTokenOperationListIdentifier = MAX_TOKEN_LIST_IDENTIFIERS;
volatile ULONG TokenOperationListIdentifier = (ULONG)-1;
//
// List of FDOs that have enabled idle power management.
//
LIST_ENTRY IdlePowerFDOList = {0};
KGUARDED_MUTEX IdlePowerFDOListMutex;
//
// Handle used to register for power setting notifications.
//
PVOID PowerSettingNotificationHandle;
//
// Handle used to register for screen state setting notifications.
//
PVOID ScreenStateNotificationHandle;
//
// Disk idle timeout in milliseconds.
// We default this to 0xFFFFFFFF as this is what the power manager considers
// "never" and ensures we do not set a disk idle timeout until the power
// manager calls us back with a different value.
//
ULONG DiskIdleTimeoutInMS = 0xFFFFFFFF;
NTSTATUS DllUnload(VOID)
{
DbgPrintEx(DPFLTR_CLASSPNP_ID, DPFLTR_INFO_LEVEL, "classpnp.sys is now unloading\n");
if (PowerSettingNotificationHandle) {
PoUnregisterPowerSettingCallback(PowerSettingNotificationHandle);
PowerSettingNotificationHandle = NULL;
}
if (ScreenStateNotificationHandle) {
PoUnregisterPowerSettingCallback(ScreenStateNotificationHandle);
ScreenStateNotificationHandle = NULL;
}
return STATUS_SUCCESS;
}
/*++////////////////////////////////////////////////////////////////////////////
DriverEntry()
Routine Description:
Temporary entry point needed to initialize the class system dll.
It doesn't do anything.
Arguments:
DriverObject - Pointer to the driver object created by the system.
Return Value:
STATUS_SUCCESS
--*/
NTSTATUS
DriverEntry(
IN PDRIVER_OBJECT DriverObject,
IN PUNICODE_STRING RegistryPath
)
{
UNREFERENCED_PARAMETER(DriverObject);
UNREFERENCED_PARAMETER(RegistryPath);
return STATUS_SUCCESS;
}
/*++////////////////////////////////////////////////////////////////////////////
ClassInitialize()
Routine Description:
This routine is called by a class driver during its
DriverEntry routine to initialize the driver.
Arguments:
Argument1 - Driver Object.
Argument2 - Registry Path.
InitializationData - Device-specific driver's initialization data.
Return Value:
A valid return code for a DriverEntry routine.
--*/
_IRQL_requires_max_(PASSIVE_LEVEL)
_Must_inspect_result_
ULONG
ClassInitialize(
_In_ PVOID Argument1,
_In_ PVOID Argument2,
_In_ PCLASS_INIT_DATA InitializationData
)
{
PDRIVER_OBJECT DriverObject = Argument1;
PUNICODE_STRING RegistryPath = Argument2;
PCLASS_DRIVER_EXTENSION driverExtension;
NTSTATUS status;
PAGED_CODE();
//
// Initialize the security cookie if needed.
//
if (InitSecurityCookie == FALSE) {
__security_init_cookie();
InitSecurityCookie = TRUE;
}
TracePrint((TRACE_LEVEL_INFORMATION, TRACE_FLAG_INIT, "\n\nSCSI Class Driver\n"));
ClasspInitializeDebugGlobals();
//
// Validate the length of this structure. This is effectively a
// version check.
//
if (InitializationData->InitializationDataSize != sizeof(CLASS_INIT_DATA)) {
//
// This DebugPrint is to help third-party driver writers
//
TracePrint((TRACE_LEVEL_ERROR, TRACE_FLAG_INIT, "ClassInitialize: Class driver wrong version\n"));
return (ULONG) STATUS_REVISION_MISMATCH;
}
//
// Check that each required entry is not NULL. Note that Shutdown, Flush and Error
// are not required entry points.
//
if ((!InitializationData->FdoData.ClassDeviceControl) ||
(!((InitializationData->FdoData.ClassReadWriteVerification) ||
(InitializationData->ClassStartIo))) ||
(!InitializationData->ClassAddDevice) ||
(!InitializationData->FdoData.ClassStartDevice)) {
//
// This DebugPrint is to help third-party driver writers
//
TracePrint((TRACE_LEVEL_ERROR, TRACE_FLAG_INIT,
"ClassInitialize: Class device-specific driver missing required "
"FDO entry\n"));
return (ULONG) STATUS_REVISION_MISMATCH;
}
if ((InitializationData->ClassEnumerateDevice) &&
((!InitializationData->PdoData.ClassDeviceControl) ||
(!InitializationData->PdoData.ClassStartDevice) ||
(!((InitializationData->PdoData.ClassReadWriteVerification) ||
(InitializationData->ClassStartIo))))) {
//
// This DebugPrint is to help third-party driver writers
//
没有合适的资源?快使用搜索试试~ 我知道了~
windows sdk8.1安装
共2000个文件
h:1332个
css:1098个
cpp:740个
1星 需积分: 43 75 下载量 93 浏览量
2019-04-23
15:58:03
上传
评论
收藏 101.29MB ZIP 举报
温馨提示
windows sdk8.1 对于Visual Studio 中出现的无法找到编译器DLL,请确保正确的路径,通过安装Windows SDK8.1离线安装包即可解决。 解决windows7安装vs2013后显示不能找到windowssdkdir,以致不能编译或者链接失败的问题;解决Windows7安装VS2013后编译提示“Could not find WindowsSDKDir variable from the registry.”的问题,从微软官网上下载,亲测,可以正确安装使用
资源推荐
资源详情
资源评论
收起资源包目录
windows sdk8.1安装 (2000个子文件)
class.c 569KB
dsmmain.c 331KB
ioctl.c 295KB
utils.c 295KB
lsi_u3.c 289KB
lsi_u3.c 280KB
utils.c 263KB
wmisample.c 249KB
fsctrl.c 220KB
dispvid.c 217KB
common.c 217KB
create.c 204KB
disk.c 185KB
st_oids.c 173KB
intrface.c 172KB
ap_assocmgr.c 158KB
display.c 156KB
allocsup.c 155KB
ecdisp.c 150KB
fileinfo.c 142KB
cdrom.c 135KB
autorun.c 134KB
hclient.c 126KB
ncfsctrl.c 126KB
hw_send.c 125KB
wmi.c 124KB
common.c 124KB
deviosup.c 117KB
ncdirnotify.c 117KB
diskwmi.c 113KB
st_adhoc.c 111KB
hw_recv.c 108KB
dirsup.c 107KB
easup.c 106KB
pnppower.c 106KB
autorun.c 105KB
vmq.c 104KB
ap_oids.c 103KB
enum.c 102KB
strucsup.c 101KB
write.c 101KB
deviosup.c 101KB
entrypts.c 100KB
port_oids.c 99KB
protocol.c 98KB
power.c 98KB
miniport.c 96KB
floppy.c 96KB
sense.c 96KB
delete.c 94KB
init.c 93KB
avscan.c 92KB
simrep.c 91KB
hw_mac.c 91KB
codec.c 91KB
fsctrl.c 90KB
create.c 88KB
codec.c 87KB
pnp.c 85KB
st_conn.c 79KB
simgpio_i2c.c 78KB
bitblt.c 77KB
plotgpc.c 77KB
base_port_oids.c 75KB
hw_oids.c 75KB
simgpio.c 75KB
MsForwardExt.c 75KB
xferpkt.c 74KB
adapter.c 73KB
htblt.c 71KB
output.c 71KB
Fdo.c 71KB
nic_init.c 71KB
polygon.c 68KB
swapBuffers.c 68KB
strucsup.c 68KB
helper_port_main.c 67KB
hbastat.c 67KB
CdoOperations.c 65KB
vnic_oids.c 65KB
gsm610.c 64KB
ndisbind.c 62KB
ioctl.c 62KB
vnic_main.c 61KB
io.c 61KB
filter.c 60KB
ncfileinfo.c 59KB
ndisbind.c 59KB
mmc.c 58KB
nc.c 58KB
isoch.c 57KB
ea.c 56KB
io.c 56KB
uvcview.c 55KB
cachesup.c 55KB
verfysup.c 53KB
device.c 53KB
aacs.c 53KB
scratch.c 52KB
PCIDRV.C 51KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
- 予非池物2020-05-06在线安装工具
weixin_42647005
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功