none
[SOLVED]Doubt in DriverEntry function for wince7 using ndis6.0?? RRS feed

  • Question

  • Dear Developers,

    Greetings!!

    I am developing for miniport driver for wince7 using ndis6.0 library and I have used first function called DriverEntry function as : -

    PHYTEC_NTSTATUS
    DriverEntry(
    	PCEDRIVER_OBJECT      DriverObject,
        PUNICODE_STRING     RegistryPath
    )
    {
    
    PHY_RTLMSG(TRUE,(TEXT("+NDIS DriverEntry: Driver Object & RegistryPath is (0x%X, 0x%X)\r\n"),DriverObject,RegistryPath));
    
     return TRUE;
    }

    The output for the following function is  as: -

    8186 PID:400002 TID:9e0006 +NDIS DriverEntry: Driver Object & RegistryPath is (0x9E432C50, 0x0)

    Is it possible to have the registry path 0 address or not.

    Each and every time I am having either 0x0 or 0x01 address for registry path when the function is invoked

    and my registry entries are as:-

    [HKEY_LOCAL_MACHINE\Comm\phywl18xx]
    	"DisplayName"="PHYTECWL1835"
    	"Group"="NDIS"
    	"ImagePath"="phywl18xx.dll"
    	
    [HKEY_LOCAL_MACHINE\Comm\phywl18xx\Linkage]
    	"Route"=multi_sz:"phywl18xx1"
    	
    
    [HKEY_LOCAL_MACHINE\Comm\phywl18xx1]
    	"DisplayName"="PHYTECWL1835 miniport driver"
    	"Group"="NDIS"
    	"ImagePath"="phywl18xx.dll"
    
    
    [HKEY_LOCAL_MACHINE\comm\phywl18xx1\Parms]
    	"BusNumber"=dword:0
    	"BusType"=dword:0


    These are the minimal entries that I have added....



    Tuesday, October 20, 2015 7:37 AM

Answers

  • Dear Developers,

    Greetings!!!

    The above issue is resolved after discussion with many persons and putting day and night efforts..

    Now, I can read the correct registry path and the miniport driver is successfully registered with NDIS library and after that ndis is calling my miniport initialize function.

    Below are the working logs

    7568 PID:400002 TID:9e0006 OSAXST1: >>> Loading Module 'phywl18xx.dll' (0x9E432CA0) at address 0xEDE90000-0xEDE95000 in Process 'NK.EXE' (0x87D7FAD0)
    PB Debugger Loaded symbols for 'C:\WINCE700\OSDESIGN\PHYTEC_OPENBOARD\PHYTEC_OPENBOARD\RELDIR\PHYTEC_AM335X_BSP_ARMV7_DEBUG\PHYWL18XX.DLL'
       7569 PID:400002 TID:9e0006 +NDIS DriverEntry: dwReason address: 0x1, value: -1639764832
       7570 PID:400002 TID:9e0006 Warning! Kernel DLL 'phywl18xx.dll' is registered for thread creation/deletion notification.  To improve performance if you dont need thread notifications call DisableThreadLibraryCalls from inside 
       7571 PID:400002 TID:9e0006 +NDIS Driver Entry Point......
       7571 PID:400002 TID:9e0006 +NDIS DriverEntry: Driver Object & RegistryPath is (0xA24742D0, 0xA24742E0)
       7572 PID:400002 TID:9e0006 +phytec_miniport_characteristics.
       7573 PID:400002 TID:9e0006 The major version is 6 
       7574 PID:400002 TID:9e0006 The minor version is 0 
       7574 PID:400002 TID:9e0006 +NDIS DriverEntry: Driver Object & RegistryPath is (0xA24742D0, 0xA24742E0)
       7582 PID:400002 TID:9e0006 ==>NdisMRegisterMiniportDriver: DriverObject A24742D0
       7582 PID:400002 TID:9e0006 <==NdisMRegisterMiniportDriver: MiniBlock A7F92DD0
       7583 PID:400002 TID:9e0006 STATUS: Success
       7584 PID:400002 TID:9e0006 -phytec_miniport_characteristics.
       7585 PID:400002 TID:9e0006 -NDIS Driver Exit Point...... 
       7589 PID:400002 TID:9e0006 ==>ndisReadOffloadRegistry: Miniport A7F93020
       7589 PID:400002 TID:9e0006 <==ndisReadOffloadRegistry: Miniport A7F93020, Status c0000001, Registry 20000
       7591 PID:400002 TID:9e0006 +phytec_initialize.
       7592 PID:400002 TID:9e0006 +phytec_initialize.
       7592 PID:400002 TID:9e0006 +phytec_initialize.
       7593 PID:400002 TID:9e0006 +phytec_initialize.
       7594 PID:400002 TID:9e0006 ==>NdisMRegisterAdapterShutdownHandler: Miniport A7F93020
       7595 PID:400002 TID:9e0006 <==NdisMRegisterAdapterShutdownHandler: Miniport A7F93020

    Thanks for your valuable support


    Wednesday, October 28, 2015 4:40 AM

All replies

  • Hi,

    I think in windows CE the registry entry is opaque to miniport driver (assuming you are developing one). To open/access the registry keys as mentioned by you, you could try using NDIS APIs like NdisOpenConfiguration (for NDIS 5.1) or NdisOpenConfigurationEx (for NDIS 6.0).

    Usually you would use it in NdisMxxx functions as is.

    Regards,

    Balaji. 


    • Edited by balajitrv1 Monday, October 26, 2015 8:48 AM typo.
    Monday, October 26, 2015 8:47 AM
  • Dear Developers,

    Greetings!!

    Hi Balaji,

    So, it is mandatory to use the above function that you mentioned in the previous thread in DriverEntry function of miniport driver to read the registry value.

    If, yes then we can not register our miniport driver by using NdisMRegisterMiniportDriver with ndis library.

    I have read in many samples that they are using the above function in MPInitializeHandlerEx rather than using in DriverEntry.....

    Monday, October 26, 2015 11:23 AM
  • Hi,

    I didn't mean you need to use the function in DriverEntry. You may use it anywhere else as well. What i meant is the parameter RegistryPath usually goes into other APIs and is not as such used to decode or work with from within the miniport driver. It is just passed on to other NDIS API calls you'd make within the driver.

    For example:

    NdisMInitializeWrapper

    NdisMRegisterMiniportDriver

    are the functions called usually from within the DriverEntry context which use RegistryPath parameter. If you need to access your NDIS miniport driver registry contents you should use the NdisOpenConfiguration or NdisOpenConfigurationEx function depending on the NDIS version your driver supports.

    The parameter RegistryPath is opaque to the driver (miniport) as the documentation of the DriverEntry would suggest on MSDN.

    Also NdisMRegisterMiniportDriver driver is the API which would use be used to register the several handlers that your driver would support. So it would have to be done from DriverEntry only.

    Regards,

    Balaji.


    • Edited by balajitrv1 Monday, October 26, 2015 12:34 PM
    Monday, October 26, 2015 12:30 PM
  • Dear Developers,

    Greetings!!

    Hi Balaji,

    Thanks for reply and I am 100% agree with you but the thing is that we need some registrypath so that we can pass the same path to the NdisMRegisterMiniportDriver and in my case I am having 0x01.

    Please have a look on the link https://social.msdn.microsoft.com/Forums/en-US/1e906392-4cfd-4875-bd6b-8aaefb45e0ed/wec7-ndis-60-driver-question?forum=winembplatdev

    My RegistryPath is quiet different and seems that the path is not correct ... 

    Monday, October 26, 2015 1:22 PM
  • Hi,

    I am guessing you are getting a NULL pointer for RegistryPath member?. If so, then your registry settings for the driver could be wrong.  

    I am guessing the driver you seem to be developing is a WiFi driver? (TI WL1835?). if yes refer to the registry sample for AR6002 at:

    \public\COMMON\oak\drivers\netcard\ar6k2_nwf\host\os\windows\sdio for an AR6002 based WiFi driver based on SDIO. This location has a sample entry for this particular card.

    I am guessing based on what you have posted you are missing :

    "*PhysicalMediaType", "*MediaType","*IfType" entries. 

    Besides the above , it would be good to add:

    "Wireless"=dword:1 under [HKEY_LOCAL_MACHINE\Comm\phywl18xx1]

    For other types of interfaces , you may refer common.reg for getting proper entries.

    Regards,

    Balaji.


    Monday, October 26, 2015 2:48 PM
  • Dear Developers,

    Greetings!!!

    Hi Balaji,

    I have added the missing entries that was suggested by you and still I have got no success.

    While debugging. I can see the following values -

    Debug->Windows->Autos

    DriverEntry(_CEDRIVER_OBJECT*, _UNICODE_STRING *)

    NAME                VALUE
    pDriverObject       0x9e432ca0
    
    Registrypath        0x00000001
       Length           CXX0030: Error: Expression cannot be evaluated
       MaximumLength    CXX0030: Error: Expression cannot be evaluated
       Buffer           CXX0030: Error: Expression cannot be evaluated

    Below are my new registry entries

    [HKEY_LOCAL_MACHINE\Comm\phywl18xx]
    	"DisplayName"="PHYTECWL1835"
    	"Group"="NDIS"
    	"ImagePath"="phywl18xx.dll"
    	
    [HKEY_LOCAL_MACHINE\Comm\phywl18xx\Linkage]
    	"Route"=multi_sz:"phywl18xx1"
    	
    
    [HKEY_LOCAL_MACHINE\Comm\phywl18xx1]
    	"DisplayName"="PHYTECWL1835 miniport driver"
    	"Group"="NDIS"
    	"ImagePath"="phywl18xx.dll"
    	"Wireless"=dword:1
    
    
    ; instance 1 parameters
    [HKEY_LOCAL_MACHINE\comm\phywl18xx1\Parms]
    	"BusNumber"=dword:0
    	"BusType"=dword:0
    	"RebindOnResume"=dword:0
    	;"*NdisDeviceType"=dword:1        ;for NDIS_DEVICE_TYPE_ENDPOINT 0x00000001
    	"*PhysicalMediaType"=dword:00000009			; NdisPhysicalMediumNative802_11
    	"*MediaType"=dword:00000010					; NdisMediumNative802_11
    	"*IfType"=dword:00000047		
    	"SDClockRate"=dword:25000000			; IF_TYPE_IEEE80211
    	
    	
    	
    ;;[HKEY_LOCAL_MACHINE\comm\phywl18xx\Linkage]
    	;;"Route"=multi_sz:"phywl18xx"
    	;; Enable High Throughput Bus 
    	
    [HKEY_LOCAL_MACHINE\Comm\phywl18xx1\Parms]
        ;"SdioFastPath"=dword:1
         
    
    [HKEY_LOCAL_MACHINE\Comm\Tcpip\Linkage] 
    	"Bind"=multi_sz:"ppp","phywl18xx1"
    
    
    [HKEY_LOCAL_MACHINE\Comm\phywl18xx1\Parms\TcpIp]
    	;"EnableWINS"=dword:1
        "EnableDHCP"=dword:1
        "DefaultGateway" = "" 
        "UseZeroBroadcast" = dword: 0 
        "IpAddress" = "0.0.0.0" 
        "Subnetmask" = "255.255.255.0"


    I think so, these entries are sufficient for the basic functionality

    Tuesday, October 27, 2015 6:15 AM
  • Dear Developers,

    Greetings!!!

    The above issue is resolved after discussion with many persons and putting day and night efforts..

    Now, I can read the correct registry path and the miniport driver is successfully registered with NDIS library and after that ndis is calling my miniport initialize function.

    Thanks for your valuable support...

    Wednesday, October 28, 2015 4:38 AM
  • Dear Developers,

    Greetings!!!

    The above issue is resolved after discussion with many persons and putting day and night efforts..

    Now, I can read the correct registry path and the miniport driver is successfully registered with NDIS library and after that ndis is calling my miniport initialize function.

    Below are the working logs

    7568 PID:400002 TID:9e0006 OSAXST1: >>> Loading Module 'phywl18xx.dll' (0x9E432CA0) at address 0xEDE90000-0xEDE95000 in Process 'NK.EXE' (0x87D7FAD0)
    PB Debugger Loaded symbols for 'C:\WINCE700\OSDESIGN\PHYTEC_OPENBOARD\PHYTEC_OPENBOARD\RELDIR\PHYTEC_AM335X_BSP_ARMV7_DEBUG\PHYWL18XX.DLL'
       7569 PID:400002 TID:9e0006 +NDIS DriverEntry: dwReason address: 0x1, value: -1639764832
       7570 PID:400002 TID:9e0006 Warning! Kernel DLL 'phywl18xx.dll' is registered for thread creation/deletion notification.  To improve performance if you dont need thread notifications call DisableThreadLibraryCalls from inside 
       7571 PID:400002 TID:9e0006 +NDIS Driver Entry Point......
       7571 PID:400002 TID:9e0006 +NDIS DriverEntry: Driver Object & RegistryPath is (0xA24742D0, 0xA24742E0)
       7572 PID:400002 TID:9e0006 +phytec_miniport_characteristics.
       7573 PID:400002 TID:9e0006 The major version is 6 
       7574 PID:400002 TID:9e0006 The minor version is 0 
       7574 PID:400002 TID:9e0006 +NDIS DriverEntry: Driver Object & RegistryPath is (0xA24742D0, 0xA24742E0)
       7582 PID:400002 TID:9e0006 ==>NdisMRegisterMiniportDriver: DriverObject A24742D0
       7582 PID:400002 TID:9e0006 <==NdisMRegisterMiniportDriver: MiniBlock A7F92DD0
       7583 PID:400002 TID:9e0006 STATUS: Success
       7584 PID:400002 TID:9e0006 -phytec_miniport_characteristics.
       7585 PID:400002 TID:9e0006 -NDIS Driver Exit Point...... 
       7589 PID:400002 TID:9e0006 ==>ndisReadOffloadRegistry: Miniport A7F93020
       7589 PID:400002 TID:9e0006 <==ndisReadOffloadRegistry: Miniport A7F93020, Status c0000001, Registry 20000
       7591 PID:400002 TID:9e0006 +phytec_initialize.
       7592 PID:400002 TID:9e0006 +phytec_initialize.
       7592 PID:400002 TID:9e0006 +phytec_initialize.
       7593 PID:400002 TID:9e0006 +phytec_initialize.
       7594 PID:400002 TID:9e0006 ==>NdisMRegisterAdapterShutdownHandler: Miniport A7F93020
       7595 PID:400002 TID:9e0006 <==NdisMRegisterAdapterShutdownHandler: Miniport A7F93020

    Thanks for your valuable support


    Wednesday, October 28, 2015 4:40 AM