【问题标题】:Two binaries in one INF file for NDIS 6 LWFNDIS 6 LWF 的一个 INF 文件中有两个二进制文件
【发布时间】:2014-10-27 11:18:32
【问题描述】:

在之前的 NDIS 5.1 中,我们设法制作了一个 inf 文件来安装相应的 32 位或 64 位 sys 文件二进制文件,具体取决于安装它的操作系统。

我们现在正在尝试使用 NDIS 6 LWF INF 文件做同样的事情,但不知道如何复制 [Install.Services] 部分,因此操作系统会自动选择要拾取的二进制文件,32 或64 位的。

这基本上将我们带到以下 INF 文件部分:

[Install.Services]
; You may also want to add the SPSVCINST_STARTSERVICE flag, like this:
;     AddService=NdisLwf,0x800,NdisLwf_Service_Inst ; SPSVCINST_STARTSERVICE
AddService=Daihinia,,Daihinia_Service_Inst

[Daihinia_Service_Inst]
DisplayName     = %Daihinia_Desc%
ServiceType     = 1 ;SERVICE_KERNEL_DRIVER
; Typically you will want your filter driver to start with SERVICE_SYSTEM_START.
; If it is an Optional filter, you may also use 3;SERVICE_DEMAND_START.
StartType       = 1 ;SERVICE_SYSTEM_START
ErrorControl    = 1 ;SERVICE_ERROR_NORMAL
ServiceBinary   = %12%\daihinia6-32.sys
LoadOrderGroup  = NDIS
Description     = %Daihinia_Desc%
AddReg          = Common.Params.reg, NdisImPlatformBindingOptions.reg

在 [Daihinia_Service_Inst] 中,我们有上例中的 32 位二进制文​​件。

鉴于 [Install.Services] 部分未在 INF 中的任何地方明确引用,因此我们无法在那里进行分叉,知道如何修改它们吗?

【问题讨论】:

    标签: ndis


    【解决方案1】:

    我们通常不鼓励驱动程序根据 CPU 架构使用不同的名称。所有内置驱动程序在 x86、ia64、amd64、arm 等上都具有相同的名称。因此,解决问题的一种简单方法是在所有平台上发布一个名为“daihinia.sys”的文件。

    但如果你真的想拥有不同的文件名,那么你有两个高级选项:

    1. 在所有平台上使用相同的 INF,但使用每个架构的 INF 部分装饰 Manufacturer section;或
    2. 在每个体系结构上提供不同的 INF。唯一的区别是 ServiceBinary 的名称。 The stampinf tool 可以通过从一个 INX 模板生成每个特定于体系结构的 INF 来帮助您避免代码重复。

    第一个选项的示例:

    [Manufacturer]
    %Msft%=MSFT,NTx86,NTamd64
    
    [MSFT.NTx86]
    %NdisLwf_Desc%=Install32, MS_NdisLwf
    
    [MSFT.NTamd64]
    %NdisLwf_Desc%=Install64, MS_NdisLwf
    
    [Install32.Services]
    AddService=MyService,,Service32
    
    [Install64.Services]
    AddService=MyService,,Service64
    
    [Service32]
    ServiceBinary=%12%\MyImage32.sys
    . . . other options . . .
    
    [Service64]
    ServiceBinary=%12%\MyImage64.sys
    . . . other options . . .
    

    【讨论】:

    • 谢谢,杰弗里,它奏效了(在一定程度上)。我将很快发布另一个相关问题,因为它可以通过适配器的属性表正常安装,但不能通过 DIFxAPI 或 DPInst 安装。
    猜你喜欢
    • 2015-09-30
    • 2019-06-27
    • 2020-09-14
    • 1970-01-01
    • 1970-01-01
    • 2011-06-14
    • 2019-04-06
    • 2014-05-25
    • 1970-01-01
    相关资源
    最近更新 更多