none
Two tabs in the driver properties RRS feed

  • Question

  • In the property of my driver I want to see two tabs properties. But there is only one or inhomogeneous if I do it:

    HKR,,EnumPropPages32,,"PropPage.dll, PropPageProvider", "MsPorts.dll, SerialPortPropPageProvider"

    MsPorts.dl - standard tab

    PropPage.dll - my tab. 

    What can I do to bring up the two tabs?

    Tuesday, October 9, 2012 10:57 AM

Answers

  • What you need to do is call CreatePropertySheetPage twice, once for each page.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Tuesday, October 9, 2012 2:55 PM

All replies

  • There is not stopping a property page provider from having multipe property pages.  Take a look at the callback functions you can indicate you are providine multiple pages.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Tuesday, October 9, 2012 11:17 AM
  • I am not very understand what the problem is? Necessary changes in the code of the program or in the .inf file?
    Tuesday, October 9, 2012 11:58 AM
  • You change the code.  Take a look at http://www.osronline.com/ddkx/install/prop-pages_6c4n.htm this is one place where the newer Microsoft documentation has missed the information that was in the older doc's.  Bascially you create more than one page in your property page provider.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Tuesday, October 9, 2012 12:47 PM
  • More not understand. Where it is necessary call the SetupDiGetClassInstallParams

    I have a separate project in which I am doing MFC DLL  page properties. That I created:

    HPROPSHEETPAGE InitSettingsPage( PROPSHEETPAGE *psp, OUT PPORT_PARAMS Params )
    {
      //  debugPrint("InitSetting");
      psp->dwSize = sizeof( PROPSHEETPAGE );
      psp->dwFlags = PSP_USECALLBACK; // | PSP_HASHELP;
      psp->hInstance = hInst;
      psp->pszTemplate = MAKEINTRESOURCE( IDD_PROPPAGE );
      psp->pfnDlgProc = PropDialogProc;
      psp->lParam = ( LPARAM ) Params;
      psp->pfnCallback = PropPageCallback;
      return CreatePropertySheetPage( psp );
    }

    ......

    Installing the driver I do in another program on C #:

     //
                // Use the INF File to extract the Class GUID. 
                //
                string infFile = Application.StartupPath + "\\virtualserial.inf";
                System.Guid ClassGUID = new Guid();
                string className = "Ports";
                bool getInfo = SetupDiGetINFClass(infFile, ref ClassGUID, className, 32, 0);
                if (getInfo == false)
                {
                    MessageBox.Show(new Win32Exception().Message);
                    return;
                }
                //
                // Create the container for the to-be-created Device Information Element.
                //
                IntPtr DeviceInfoSet = SetupDiCreateDeviceInfoList(ref ClassGUID, IntPtr.Zero);


                //className = GetClassNameFromGuid(ClassGUID);

                // 
                // Now create the element. 
                // Use the Class GUID and Name from the INF file.
                //
                SP_DEVINFO_DATA da = new SP_DEVINFO_DATA();
                da.cbSize = Convert.ToUInt32(Marshal.SizeOf(typeof(SP_DEVINFO_DATA)));
                bool success = SetupDiCreateDeviceInfo(DeviceInfoSet, className, ref ClassGUID, "Additional Virtual COM-Port", IntPtr.Zero, DICD_GENERATE_ID, ref da);
                if (success == false)
                {
                    MessageBox.Show(new Win32Exception().Message);
                    return;
                }

                //
                // Add the HardwareID to the Device's HardwareID property.
                //
                bool result = SetupDiSetDeviceRegistryProperty(DeviceInfoSet,
                                                               ref da,
                                                               SPDRP_HARDWAREID,
                                                               "UMDF\\VirtualSerial",
                                                               256);
                if (result == false)
                {
                    MessageBox.Show(new Win32Exception().Message);
                    SetupDiDestroyDeviceInfoList(DeviceInfoSet);
                    return;
                }

                result = SetupDiSetDeviceRegistryProperty(DeviceInfoSet,
                                       ref da,
                                       SPDRP_FRIENDLYNAME,
                                       "Tratata (COM16)",
                                       256);
                //
                // Transform the registry element into an actual devnode 
                // in the PnP HW tree.
                //
               result = SetupDiCallClassInstaller(DIF_REGISTERDEVICE,
                                           DeviceInfoSet,
                                           ref da);
               if (result == false)
                {
                    MessageBox.Show(new Win32Exception().Message);
                    SetupDiDestroyDeviceInfoList(DeviceInfoSet);
                    return;
                }

                //
                // The element is now registered. We must explicitly remove the 
                // device using DIF_REMOVE, if we encounter any failure from now on.
                //

                //
                // Install the Driver.
                //
                bool rest = false;
                result = UpdateDriverForPlugAndPlayDevices(IntPtr.Zero, "UMDF\\VirtualSerial", infFile, 0x00000001, rest);
                if (result == false)
                {
                    MessageBox.Show(new Win32Exception().Message);
                    result = SetupDiCallClassInstaller(0x00000005, DeviceInfoSet, ref da);
                }
                return;

    Where to use your code?

    Tuesday, October 9, 2012 2:35 PM
  • What you need to do is call CreatePropertySheetPage twice, once for each page.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Tuesday, October 9, 2012 2:55 PM
  • MsPorts.dll -  is a library of Windows. I just wrote to the inf file  "MsPorts.dll, SerialPortPropPageProvider"

    [PropGUI_AddReg]
    HKR,,EnumPropPages32,,"PropPage.dll, PropPageProvider", "MsPorts.dll, SerialPortPropPageProvider"

    And before that:

    [PropGUI_AddReg]

    HKR,,EnumPropPages32,,"PropPage.dll, PropPageProvider"

    and the tab was visible.

    Tuesday, October 9, 2012 3:08 PM
  • What are you asking?  How to get rid of the property page from Microsoft?  If so the answer is don't do that.  If the question is you aren't getting your pages, we need more data.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Tuesday, October 9, 2012 3:14 PM
  • I need to have two tabs. One Miсrosoft (MsPorts.dl) and one mine (PropPage.dl). If the .inf file, select:
    [PropGUI_AddReg]
    HKR,, EnumPropPages32, "PropPage.dll, PropPageProvider"
    then it appears. And if you choose
    [PropGUI_AddReg]
    HKR,, EnumPropPages32, "MsPorts.dll, SerialPortPropPageProvider"
    also appears. And if you choose just two

    [PropGUI_AddReg]
    HKR,, EnumPropPages32, "PropPage.dll, PropPageProvider", "MsPorts.dll, SerialPortPropPageProvider" 
    Then do not have any. Why?

    Thank you.
    • Marked as answer by Artemprodigy Wednesday, October 10, 2012 7:05 AM
    • Unmarked as answer by Artemprodigy Wednesday, October 10, 2012 7:05 AM
    • Marked as answer by Artemprodigy Wednesday, October 10, 2012 7:06 AM
    • Unmarked as answer by Artemprodigy Wednesday, October 10, 2012 7:06 AM
    Wednesday, October 10, 2012 6:47 AM
  • EnumPropPages32 does not support multiple providers, just one. see msdn, http://msdn.microsoft.com/en-us/library/windows/hardware/ff552311(v=vs.85).aspx . the way to get more providers is through a device class installer via DIF_ADDPROPERTYPAGE_ADVANCED , see http://msdn.microsoft.com/en-us/library/windows/hardware/ff540201(v=vs.85).aspx and  http://msdn.microsoft.com/en-us/library/windows/hardware/ff540201(v=vs.85).aspx


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, October 10, 2012 7:28 AM