Virual Com port [ no receiving Pop-Up FOUND new Hardware]

Discussion in 'Windows Vista Drivers' started by DDWin, Mar 17, 2006.

  1. DDWin

    DDWin Guest

    I have written a BUS driver for the virtual Serial port, and also an
    enumerator( i am not using the microsoft serenum driver or the serial).
    I am facing a strange problem,
    When i receive IRP_MN_QUERY_ID for the new PDO i have created in the
    add device routine, and then notifying this PDO to the Pnp mgr when i
    receive IRP_MN_QUERY_DEVICE_RELATIONS, The PNP mgr then send me the PNP
    irp for this new PDO, and in the IRP_MN_QUERY_ID i respond with a
    unique ID still i dont ge the pop up of found New hardware, i even
    checked any reg entries with the information to that ID i responded,
    ther is nothing. Plz tell me what may the problem?

    I want the IO mgr to ask me for the FOUND NEW HARDWARE wizard.

    these are the ID's i am responding with

    DeviceId --->SERENUM\\GEM0410
    InstanceId----> 0000
    HardwareIds----> SERENUM\\GEM0410\\0000

    looking forward for your response...

    Regards
    Amit
     
    DDWin, Mar 17, 2006
    #1
    1. Advertisements

  2. i would suggest that you write all of your drivers for this project using
    KMDF, it will make writing a bus driver much easier. there are many more
    rules involved when writing a bus driver, this is only the tip of the
    iceburg.

    d
     
    Doron Holan [MS], Mar 17, 2006
    #2
    1. Advertisements

  3. DDWin

    Vetzak Guest

    When nothing happens it means you're not handling all required minor
    PnP IRPs for the PDO context. Personally I noticed this when I ran a
    Win98 bus driver on Win2000 for the first time :)

    I always handle the following PDO IRPs:

    * IRP_MN_QUERY_CAPABILITIES
    \ -> Set-up PDO's device capabilities; I copy power attributes from the
    FDO's dev.caps. and init other fields as required.

    * IRP_MN_QUERY_DEVICE_RELATIONS
    \ -> TargetDeviceRelations (see ddk doc for the recepee)

    * IRP_MN_QUERY_ID
    \ -> BusQueryDeviceID (return UNICODE string)
    \ -> BusQueryInstanceID (return UNICODE string); I usually return an
    empty string here.
    \ -> BusQueryHardwareIDs (return UNICODE multi-string); I usually
    return 1 string, same as device ID.
    \ -> BusQueryCompatibleIDs (return UNICODE multi-string); I usually
    return an empty multi-string.

    * IRP_MN_QUERY_BUS_INFORMATION
    \ -> Report bus guid.

    * IRP_MN_START_DEVICE
    * IRP_MN_QUERY_REMOVE
    * IRP_MN_REMOVE_DEVICE
    * IRP_MN_CANCEL_REMOVE_DEVICE
    * IRP_MN_STOP_DEVICE
    * IRP_MN_QUERY_STOP_DEVICE
    * IRP_MN_CANCEL_STOP_DEVICE
    * IRP_MN_SURPRISE_REMOVAL

    And don't forget to read the ddk documentation. It explains how to
    handle each IRP in detail.
     
    Vetzak, Mar 17, 2006
    #3
  4. DDWin

    DDWin Guest

    I get all these IRP for the new PDO

    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT /
    DeviceTextDescription
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_BUS_INFORMATION
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES


    I reply to all these as documented in DDK
     
    DDWin, Mar 21, 2006
    #4
  5. DDWin

    Vetzak Guest

    You're forgetting this one:

    * IRP_MN_QUERY_DEVICE_RELATIONS
    \ -> TargetDeviceRelations (see ddk doc for the recepee)

    The system has an habit of not enumerating a PDO at all when you don't
    process all required PDO IRPs.
     
    Vetzak, Mar 21, 2006
    #5
  6. DDWin

    DDWin Guest

    I dont get this query
    * IRP_MN_QUERY_DEVICE_RELATIONS
    \ -> TargetDeviceRelations
     
    DDWin, Mar 21, 2006
    #6
  7. DDWin

    Vetzak Guest

    Well, can you drop here a more detailed log of what your driver gets
    and answers? Probably somewhere along the way the system isn't
    satisfied with one of the driver's responses.
     
    Vetzak, Mar 21, 2006
    #7
  8. DDWin

    DDWin Guest

    DriverEntry=====>
    Serial: SerialAddDeviceInternal called
    Serenum: SerenumAddDevice called. Pdo = 82332F18
    Serenum: IRP_MJ_PNP / unknown minor function 0x18
    Serial: unknown minor function 0x18
    Serenum: IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS
    Serenum: IRP_MJ_PNP / unknown minor function 0x8
    Serial: unknown minor function 0x8
    Serenum: IRP_MJ_PNP / IRP_MN_START_DEVICE
    Serenum: Calling lower device 823B2E50 [\Driver\BeceemSerial]
    Serial: IRP_MJ_PNP / IRP_MN_START_DEVICE
    Creating SymbolicLink-------->\DosDevices\COM3 -> \Device\Serial3
    IoReportResourceForDetection Failed ----->
    ResourceList Assignment : ConflictDetected ===========> Even if it
    fails here i continue with it....
    Serenum: SerenumFdoStartDevice() called
    Serenum: IRP_MJ_PNP / unknown minor function 0x9
    Serial : IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES
    Serenum: IRP_MJ_PNP / unknown minor function 0x14
    Serial : IRP_MN_QUERY_PNP_DEVICE_STATE
    Serenum: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations type

    SerenumFdoQueryBusRelations===>
    Enumerating LEGACY DEVICE ====>
    SerenumDetectLegacyDevice ==>IoCreateDevice Success
    DeviceDesc : Gemplus GemPC410 Serial Smart Card Reader [Gemplus
    GemPC410 Serial Smart Card Reader]
    HardwareIds : MYSERENUM\GEM0410\5&23DE782&0&0000
    CompatibleIds : GEM0410P<===ReportDetectedDevice
    ReportDetectedDevice Complete
    <=== SerenumDetectLegacyDevice Building DeviceRelations ====>NumPDO = 1

    <=== SerenumFdoQueryBusRelations
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryDeviceID : [
    MYSERENUM\GEM0410 ]
    Success
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_CAPABILITIES
    Success
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT /
    DeviceTextDescription :
    [Gemplus GemPC410 Serial Smart Card Reader ]
    Success
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_TEXT /
    DeviceTextDescription
    DeviceLocInfo : [on myCommunication Port]
    Success
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryInstanceID : [
    5&23DE782&0&0000 ]
    Success
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryHardwareIDs : [
    MYSERENUM\GEM0410\5&23DE782&0&0000
    Success
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_ID / BusQueryCompatibleIDs :
    [ GEM0410P
    Success
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCE_REQUIREMENTS
    Success
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_BUS_INFORMATION
    Success
    Serenum_NEWPDO: IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES
    Success
     
    DDWin, Mar 22, 2006
    #8
  9. DDWin

    Vetzak Guest

    I have 3 remarks:

    1. Your driver returns a string for IRP_MN_QUERY_ID /
    BusQueryInstanceID. There is a relation with the UniqueID in the
    DEVICE_CAPABILITIES structure. Read the DDK documentation. I suggest
    you don't use a unique ID unless you need to.

    2. When your driver doesn't handle an IRP, it should return success. It
    must return the status that the system initialized in the IRP (usually
    STATUS_NOT_SUPPORTED). Maybe IRP_MJ_PNP / IRP_MN_QUERY_RESOURCES causes
    problems (I suppose your device doesn't exposes hw resources).

    3. For God's sake, don't re-use ddk example sources. DDK examples are
    often bloated with legacy stuff and dubious locking semantics, esp. the
    sources for serenum.sys and serial.sys. You can look at them, but don't
    re-use them. Write your driver from scratch. By doing so you'll also
    gain better understanding of wdm drivers.
     
    Vetzak, Mar 22, 2006
    #9
  10. DDWin

    DDWin Guest

    Well i have not modified the DDK sample source, I have written it from
    scratch
     
    DDWin, Mar 22, 2006
    #10
  11. DDWin

    DDWin Guest

    I am not reusing their code, My coding is completely different from
    that of DDK sample, i had just refered it for the first time in the
    begining, later after seeing the code i thought of never refer that
    code for any reason, he uses lot of things.
     
    DDWin, Mar 22, 2006
    #11
  12. DDWin

    DDWin Guest

    Hi All,
    Let me tell what i have done till now,
    1 .I have written a serial bus driver( not the DDK sample)
    2. then i wrote an enumerator for my virtual COM port.
    3. I used the msports.inf file and modified it to installl the bus
    driver as another COM port
    4. Now i create a PDO (DriverObject in the IOcreatedeivce is that of
    enumerator) and return this as a child device on my virtual bus to the
    IRP_MN_QUERY_DEVICE_RELATIONS PNP IRP
    5. Soon i get all the PNP IRP for this new PDO
    6. I respond IRP_MN_QUERY_ID with a unique ID

    Now here is the problem....
    7. I dont get the FOUND NEW HARDWARE wizard pop-up, to install the
    driver for this new PDO
    8. i get all the PNP IRP's.


    Please tell me what is the problem, why i am not receiving the FOUND
    NEW HARDWARE Wizard


    Regards,
    Amit
     
    DDWin, Mar 22, 2006
    #12
    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.