hello. iam can
t english very wall. sorry.
Irq number I had obtained through the inf file.
I obtained the Interrupt vector by using the createinterrupt () to interrupt the connection.
I have one I want to assign an interrupt to the CPU.
To assign an affinity in the inf file [ddinstall.HW] was used.
However, check with winDBG 0x3 This value was the result of affinity.
Also in the device driver source by using the WdfInterruptSetExtendedPolicy () tries to get affinity.
But I did not come get the desired affinity.
Please help to assign affinity.
This is my inf file and source code is written.
My development environment is a dual-core of win7, kmdf.
============= inf file===================
;Copyright (c) 1990-2000 Microsoft Corporation All rights Reserved
;
;Module Name:
;
; WdfRTiK.INF
;
;Abstract:
; INF file for installing sample RTiK driver
[Version]
Signature=“$WINDOWS NT$”
Class=RTiK
ClassGuid={cfb15040-5bc7-11d3-b194-0060b0efd4aa}
Provider=“SYSTEM SOFTWARE LAB.”
DriverVer=09/06/2011,6.1.7600.16385
catalogfile=WdfRTiK.cat
[DestinationDirs]
DefaultDestDir=12
; ============================== class section ============================
[ClassInstall32]
Addreg = RTiKClass
[RTiKClass]
HKR,0,%ClassName%
HKR,Icon,-5
HKR,DeviceCharacteristics,0x10001,0x100 ;Use same security checks on relative opens
HKR,Security,“D:P(A;;GA;;;SY)(A;;GA;;;BA)” ;Allow generic all access to system and built-in Admin.
;======================== device install section =======================
[Manufacturer]
%Mfg%=MfgDeviceSection,NT$ARCH$
[MfgDeviceSection]
%DeviceDesc% = WdfRTiK_Inst, SSLAB_VIRTUAL_INTRTIK_DEVICE
[MfgDeviceSection.NT$ARCH$]
%DeviceDesc% = WdfRTiK_Inst, SSLAB_VIRTUAL_INTRTIK_DEVICE
[WdfRTiK.NT$ARCH$.HW]
AddReg=WdfRTiK_MP
[WdfRTiK_MP]
HKR,“Interrupt Management”,0x00010001
HKR,“Interrupt Management\Affinity Policy”,0x00010001
HKR,“Interrupt Management\Affinity Policy”,DevicePolicy,0x00010001,4
HKR,“Interrupt Management\Affinity Policy”,AssignmentSetOverride,0x00000001,1
HKR,“Interrupt Management\Affinity Policy”,DevicePriority,0x00010001,3
[WdfRTiK_Inst.NT$ARCH$]
CopyFiles=WdfRTiK.CopyFiles
;CopyFiles=WdfRTiK.sys
;LogConfig=WdfRTiK.LC0, WdfRTiK.LC1, WdfRTiK.LC2
LogConfig=WdfRTiK.LC0
;LogConfig=WdfRTiK.LC1
;LogConfig=WdfRTiK.LC2
[WdfRTiK.CopyFiles]
WdfRTiK.sys
[WdfRTiK_Inst.NT.Services]
AddService = WdfRTiK,%SPSVCINST_ASSOCSERVICE%,WdfRTiK_Service
[WdfRTiK.LC0]
ConfigPriority = DESIRED
IRQConfig = L:7
[WdfRTiK.LC1]
ConfigPriority = NORMAL
IRQConfig = L:7
[WdfRTiK.LC2]
ConfigPriority = DISABLED
IRQConfig = L:7
[WdfRTiK_Service]
ServiceType = %SERVICE_KERNEL_DRIVER%
StartType = %SERVICE_MANUAL_START%
ErrorControl = %SERVICE_ERROR_NORMAL%
ServiceBinary = %12%\WdfRTiK.sys
[SourceDisksFiles]
WdfRTiK.sys=1,
[SourceDisksNames]
1=%DiskId%,“”
;-------------- WDF Coinstaller installation
[DestinationDirs]
RTiK_Device_CoInstaller_CopyFiles = 11
[WdfRTiK_Device.NT.CoInstallers]
AddReg=RTiK_Device_CoInstaller_AddReg
CopyFiles=RTiK_Device_CoInstaller_CopyFiles
[RTiK_Device_CoInstaller_AddReg]
HKR,CoInstallers32,0x00010000, “WdfCoinstaller01009.dll,WdfCoInstaller”
[RTiK_Device_CoInstaller_CopyFiles]
WdfCoinstaller01009.dll
[SourceDisksFiles]
WdfCoinstaller01009.dll=1 ; make sure the number matches with SourceDisksNames
[RTiK_Device.NT.Wdf]
KmdfService = WdfRTiK, WdfRTiK_wdfsect
[WdfRTiK_wdfsect]
KmdfLibraryVersion = 1.9
;---------------------------------------------------------------;
[Strings]
ClassName =“WDF RTiK MP Driver”
DeviceDesc = “WDF RTiK Driver V1.9”
DiskId = “Install disk (1)”
Mfg = “SYSTEM SOFTWARE LAB.”
SPSVCINST_ASSOCSERVICE = 0x00000002
SERVICE_KERNEL_DRIVER = 1
SERVICE_MANUAL_START = 3
SERVICE_ERROR_NORMAL = 1
=============== source code ==================
for (ULONG i=0; i < WdfCmResourceListGetCount(ResourcesTranslated); i++) {
resourceTrans = WdfCmResourceListGetDescriptor(ResourcesTranslated, i);
if(!resourceTrans){
#if DBG
DbgPrint(“NULL resource returned??\n”);
#endif
return(STATUS_DEVICE_CONFIGURATION_ERROR);
}
switch (resourceTrans->Type) {
case CmResourceTypePort:
#if DBG
DbgPrint(“Resource %d: Port 0x%0x, Length %d.\n”,
i,
resourceTrans->u.Port.Start.LowPart,
resourceTrans->u.Port.Length);
#endif
break;
case CmResourceTypeMemory:
#if DBG
DbgPrint(“Resource %d: Register 0x%0x:%0x Length %d.\n”,
i,
resourceTrans->u.Memory.Start.HighPart,
resourceTrans->u.Memory.Start.LowPart,
resourceTrans->u.Memory.Length);
#endif
break;
case CmResourceTypeInterrupt:
DbgPrint(“111 %x \n”,resourceTrans->Flags);
resourceTrans->Flags = (CM_RESOURCE_INTERRUPT_POLICY_INCLUDED | CM_RESOURCE_INTERRUPT_LATCHED);
DbgPrint(“222 %x \n”,resourceTrans->Flags);
WdfInterruptSetPolicy(
devContext->WdfInterrupt, WdfIrqPolicySpecifiedProcessors,
WdfIrqPriorityHigh,
AFFINITY_MASK(0)
);
#if DBG
DbgPrint(“Resource %d: Interrupt level: 0x%0x, Vector: 0x%0x, Affinity: 0x%0x\n”,
i,
resourceTrans->u.Interrupt.Level,
resourceTrans->u.Interrupt.Vector,
resourceTrans->u.Interrupt.Affinity);
#endif