NDIS 6 miniport - MiniportInitialize is not called

Discussion in 'Windows Vista Drivers' started by miki, Dec 3, 2006.

  1. miki

    miki Guest

    Hi,
    I am trying to write an ndis 6 miniport virtual driver (I am not strong
    in names so meanwhile I called him netvmini)


    On the device manager I get the message:
    "This device is not working properly because Windows cannot load the
    drivers required for this device. (Code 31)"

    When using WinDbg I see that my driverentry is called and return
    SUCCESS.
    but my MiniportInitializeEx is not called instead the DriverUnload is
    called.

    cmd: c:\tools\devcon.exe install netvmini.inf root\netvmini
    !!! sto: Inf file does not contain CatalogFile directive for the
    specified processor architecture. Inf = c:\ndis6\netvmini.inf
    ! sto: The Driver Package does not contain a catalog file, but user
    wants to install anyway.
    ! sig: No installed catalogs matching catalog name '' were found
    that validated the file.
    ! sig: Error 1168: Element not found.
    ! sig: No installed catalogs matching catalog name '' were found
    that validated the file.
    ! sig: Error 1168: Element not found.
    ! dvi: Device restart was skipped becasuse the DI_DONOTCALLCONFIGMG
    flag was set.
    !!! dvi: Device not started: Device has problem: 0x1f:
    CM_PROB_FAILED_ADD.
    ! sig: No installed catalogs matching catalog name '' were found
    that validated the file.
    ! sig: Error 1168: Element not found.
    ! ndv: Queueing up error report since device has a PnP problem...
    ! dvi: Driver list already built
    <<< Section end 2006/12/03 17:23:19.139
    <<< [Exit status: SUCCESS]

    (I don't understand why the Exit status is SUCCESS)

    As I understand since I am not running vista x64 I don't have to sign
    the driver on the development phase so I ignore the !sig warnings.

    I tried to use my own written INF file and also the INF file of
    netvmini from WDK samples (NDIS 5 driver) for loading the driver both
    resulted with the same error code - 31

    What can be the reason that MiniportInitializeEx is not called even
    though DriverEntry succeeded?

    Thanks
    Miki
     
    miki, Dec 3, 2006
    #1
    1. Advertisements

  2. miki

    Calvin Guan Guest

    Did you run check inf against your inf file?

    there are couple of reasons off my head why miniportinitEx wouldn't get
    call:
    1) make sure you have include 3 newly introduced keys in your DD.install
    section. Ndis!AddDevice will fail if they are missing or misspelled.
    2) registry corrupted.
    3) resource allocation failure (not likely applicable to your case since
    yours is a vmp)
    4) other pnp failures occurred between addDev and Irp_mn_start_dev inside
    ndis(could be miniport's fault).

    --
    Calvin Guan (DDK MVP)
    Sr. Staff Engineer
    NetXtreme Vista/LH Server Miniport
    Broadcom Corporation
    Connecting Everything(r)

     
    Calvin Guan, Dec 4, 2006
    #2
    1. Advertisements

  3. miki

    miki Guest

    Thanks Calvin

    The only error chkinf show on my inf file was
    "Directive: CatalogFile required (and must not be blank) in section
    [Version] for WHQL digital signature. "

    but following your advise I decided to look at other inf samples and
    saw the following

    *IfType = 6 ; IF_TYPE_ETHERNET_CSMACD
    *MediaType = 0 ; NdisMedium802_3
    *PhysicalMediaType = 0 ; NdisPhysicalMediumUnspecified

    I added them to the inf file and its works !!! - Thanks a lot.

    Are those params mentioned somewhere in the WDK doc as mandatory? I
    have not seen them.

    I don't know why chkinf did not warn about those missing params (is
    there a special way to run chkinf on an NDIS inf file?)

    Another questions regarding the inf file in the doc it says about the
    AddService directive:

    "It specifies characteristics of the services associated with Windows
    2000 or later drivers, such as how and when the services are loaded"

    What is the connection between driver and service?
    Why should a driver have an associated service?


    Thanks
    Miki





     
    miki, Dec 4, 2006
    #3
  4. miki

    Calvin Guan Guest

    *IfType = 6 ; IF_TYPE_ETHERNET_CSMACD
    I have not checked the WDK doc so often (I don't think it's very useful at
    the time I was developing my ndis6 driver). Neither did I follow the msft
    ndis6 sample driver(it's good for educational purpose though). I got burned
    by the same problem. I learned it the hard way by stepping through the
    NDIS!AddDevice and find out these keys are newly added and necessary to load
    the driver. It wasn't stated in the DOC at that time.
    A kernel mode driver is one of a few service type in SCM's eyes.

    --
    Calvin Guan (DDK MVP)
    Sr. Staff Engineer
    NetXtreme Vista/LH Server Miniport
    Broadcom Corporation
    Connecting Everything(r)

     
    Calvin Guan, Dec 4, 2006
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.