Jump to content


  • Posts

  • Joined

  • Last visited

  • Donations


About kulkarniquiet

kulkarniquiet's Achievements



  1. Hi All, Need urgent help. We have console based driver installation EXE which is developed through DDK API. On my PC two network adapter card inserted (D-Link) in two PCI slot. When i am installing both Network Adapetr PCI Ethernet throgh my application, It install driver properly. But in Device manager it shows 2 Network Adpater Card (D-Link) properly installed but one extra Network Adpater Card(D-Link) entry is there with yellow mark (black exclamation) [This device cannot start. (Code 10)]. Why this third extra driver entry viewing in Device manager. Entry in Device Manager : 1. D-Link DGE-530T Gigabit Ethernet Adapter 2. D-Link DGE-530T Gigabit Ethernet Adapter # 2 3. D-Link DGE-530T Gigabit Ethernet Adapter #15 (With Yellow,black exclamation mark) Location : Unknown Is there any other API need to call before UpdateDriverForPlugAndPlayDevices(). How to select device to install in particular PCI slot. Or is there any API which takes Location like PCI Slot 3 (PCI bus 4, device 2, function 0). And install driver for that location. Any suggestion or even reply most welcome. Please reply soon. /****************************************************************************** * Name : InstallClassDriver * Description : Function install driver for each device information. * Input Parameters : None * Output Parameters : None * Return Value : BOOL ******************************************************************************/ BOOL CDriverInstaller::InstallClassDriver() { GUID guid = {0}; SP_DEVINFO_DATA spDevData = {0}; HDEVINFO hDevInfo = 0L; char l_chClassName[MAX_CLASS_NAME_LEN] = {0}; char *pHID = 0L; short wLoop = 0; BOOL bRebootRequired = FALSE; CErrorDisplay l_ErrMsg; /* Get the class of a specified Windows NT 4.0-style INF file */ if (SetupDiGetINFClass(m_csINFPath, &guid, l_chClassName, MAX_CLASS_NAME_LEN, 0) != TRUE){ l_ErrMsg.DisplayError("SetupDiGetINFClass",GetLastError()); return(FALSE); }; /* Create an empty device information set */ hDevInfo = SetupDiCreateDeviceInfoList(&guid, 0); if (hDevInfo == INVALID_HANDLE_VALUE){ l_ErrMsg.DisplayError("SetupDiCreateDeviceInfoList",GetLastError()); return(FALSE); }; spDevData.cbSize = sizeof(SP_DEVINFO_DATA); /* Create a new device information element and add it as a new member to the specified device information set */ if (SetupDiCreateDeviceInfo(hDevInfo,l_chClassName,&guid,0L, 0L, DICD_GENERATE_ID,&spDevData) != TRUE){ l_ErrMsg.DisplayError("SetupDiCreateDeviceInfo",GetLastError()); SetupDiDestroyDeviceInfoList(hDevInfo); return(FALSE); }; for (wLoop = 0; wLoop < m_carrHardWareID.GetSize(); ++wLoop){ if (pHID){ LocalFree(pHID); } /* Allocate the specified number of bytes from the heap */ pHID = (char*)LocalAlloc(LPTR, strlen(m_carrHardWareID.GetAt(wLoop))*HDWARE_ID*sizeof(char)); if (!pHID){ l_ErrMsg.DisplayError("LocalAlloc",GetLastError()); SetupDiDestroyDeviceInfoList(hDevInfo); return(FALSE); }; strcpy(pHID, m_carrHardWareID.GetAt(wLoop)); /* Set the specified device registry property */ if (SetupDiSetDeviceRegistryProperty(hDevInfo, &spDevData, SPDRP_HARDWAREID, (PBYTE)pHID, (DWORD)(strlen(m_carrHardWareID.GetAt(wLoop))*HDWARE_ID*sizeof(char))) != TRUE){ l_ErrMsg.DisplayError("SetupDiSetDeviceRegistryProperty",GetLastError()); SetupDiDestroyDeviceInfoList(hDevInfo); LocalFree(pHID); return(FALSE); }; /* Call the appropriate class installer with the specified installation request (DI_FUNCTION) */ if (SetupDiCallClassInstaller(DIF_REGISTERDEVICE,hDevInfo, &spDevData) != TRUE){ l_ErrMsg.DisplayError("SetupDiCallClassInstaller",GetLastError()); SetupDiDestroyDeviceInfoList(hDevInfo); LocalFree(pHID); return(FALSE); }; printf("\n Installing or updating driver for device: %s",m_carrHardWareID.GetAt(wLoop)); bRebootRequired = 0; /* Install updated drivers for devices that match the hardware ID */ if (UpdateDriverForPlugAndPlayDevices(0L, m_carrHardWareID.GetAt(wLoop), m_csINFPath, INSTALLFLAG_FORCE, &bRebootRequired) != TRUE){ l_ErrMsg.DisplayError("UpdateDriverForPlugAndPlayDevices",GetLastError()); if (SetupDiCallClassInstaller(DIF_REMOVE, hDevInfo, &spDevData) != TRUE){ SetupDiDestroyDeviceInfoList(hDevInfo); } LocalFree(pHID); return(FALSE); }; LocalFree(pHID); pHID = 0L; }; /* Destroy a device information set and frees all associated memory */ SetupDiDestroyDeviceInfoList(hDevInfo); printf("\n\n \t Driver Installation Successfully Completed\n\n\n\n"); return(TRUE); };
  2. Hi all, I have created win PE CD and customised it to run one of user application through it. I am able to acheive this successfully. Can anyone let me know is this drive name from PE i.e. X: can be changed? How to map local computer drive's with others in PE CD(as shown in below table). Also inform me is it possible to run any package/installer through PE CD. In the current PE CD Creation steps,We are creating a Virtual Drive (X:) but this X: Drive is already present in one of my Machine, so in this condition we have we have to perform mapping of drives with the actual Drives Present in the System and Drives Displayed while PE Execution. This mapping may be as shown below: Hard Disk Drives: ----> mapped to Windows PE drives C:----> C: D:---->D: E:---->E: F:---->F: G:---->G: H:---->H: I:---->I: S:---->J: V:---->K: X:---->E: Requesting you to get back on this at the earliest. Thanks in advance. Thanks and Regards, Abhijit
  3. Hi there, I am also finding the same problem. I am not able to install driver if I use DPInst exe in legacy mode. Error coming as No matching devices found in INF on the Machine. Can anyone help me in this? I do not have cat file for driver and there is no entry in INF file also. Please reply.
  4. Hi All, I need your urgent help. I am working in slient installation (Without Wizard) of any simple driver(PNP and non PNP drivers). I tried to use UpdateDriverForPlugAndPlayDevices(NULL, H/w_id, inf_file, 0, &reboot) function installs updated drivers for devices but when i call, function returns "NO_ERROR" but driver is not getting installed.Even i am nt sure whether driver installed or not. OEMxx.inf file is nt copied at %windir%/inf location and .sys file and othe supporting files also nt copied at %windir%/system32/drivers location. I also tried SetupCopyOEMInf(inf_file, NULL, SPOST_PATH, 0, NULL, 0, NULL, NULL) function, it copies only .inf file. then who will copy .sys file or any other supporting driver files. I am using below mentioned driver files : 1. hpdltw32.inf ------- Extract H/W Id from inf file 2. hpdltw32.CAT 3. hpdltw32.sys Called UpdateDriverForPlugAndPlayDevices(NULL,H/W Id , inf_file, 0, &reboot) returns NO_ERROR but nt copied OEMxx.inf in "%windir%/inf" pathand nt copied .sys file at "%windir%/system32/drivers". Can any one give me driver installtion API sequence Or give me any sample code for installing sample driver. I am waiting for your kindly help. Even your reply or valuable suggestion would be great for me. Thanks & Regards, Abhijit
  5. Thanks a lot for the reply. i was studiying DDK examples and I found that there are API's like UpdateDriverForPlugnPlay and SetupCopyOEM which can be used to install drivers? Are these two sufficient for installing driver? Kindly correct me if I am wrong. While installing driver,there are certain sections in registry which gets updates (e.g. HKLM\CurrentControlSet\Control\Class and HKLM\CurrentControlSet\Services whose information is present in .inf file. We need to copy manually INF file to proper location i.e. \\windir\\INF\ and .sys file to \\system32\\drivers. Is this completes driver instllation process? My driver type is not fixed. It can be PnP or NonPnp also. I mean it can be ethernet,network,CD,USB or DVD etc.. Do I need to update registry entries and copy file (inf and sys) manually to respective location or above mentioned API's will do this thing? Can ynyone provide some samples? If devcon can be used for this, How can I know the GUID or Hardware ID or device ID If I know the driver type e.g. USB? How devcon can beused? Sample code is welcome. Please help and reply. Best regards Abhijit
  6. Hi there, Can you please reply to me? I am working on the module in which I need to install driver (PnP or Non PNP ) without using the add hardware wizard. As of now I am not aware of how to implement such thing. Do you have any idea how to achieve this without using wizard? Is it possible? Can you please give me some useful link/hint/sample code that I can use in my module. Requesting you to reply me as this is very new part for me and urgent too. Thanks in advance for your kind help. Awaiting your reply. Abhijit
  7. Hi There, Myself Abhijit and need some input from your side about DEVCON. I hope you will help me in this regard. I am working on module in which USB drive needs to be ENABLED or DIABLED through command line argument ON or OFF. Initially I achieved it by changing registry values for USBSTOR and imagepath location. But as REBOOTING of system is required, I used devcon.exe to enable or disable USB drive. I used command Devcon disable USBSTOR\DISK* to Disable USB and devcon enable USBSTOR\DISK* to enable USB. Devcon.exe was placed in my code folder. Now problem is I want to remove devcon dependency and use devcon's code in my application for enabling or disabling USB drive. I am not getting which functions to used for the same and how? Do you have any idea or sample code in this regard with you so that i can proceed further. I am getting lot of compilations errors when I include devcon.h and use functions from devcon.cpp like enumeratedevices and so on. Can you please help me in this regard as this is very urgent for me? I do not have any prior knowledge about devcon. Hoping a positive reply from your side. Best Regards, Abhijit Kulkarni,
  8. Hi All, I am working on WIN PE and creating bootable CD and run user defined exe (my application) from it. I am trying to run virus checking exe i.e. MRT.exe or MRTSTUB.exe from PE CD. But it is giving me message as error has occurred and contact malicious software removal tool help page. I searched for it and visited http://support.microsoft.com/?kbid=890830 Here no information is given such that weather executing MRT or MRTSTUB (Details can be found at above URL) from PE environment is possible or not. Prerequisite for this on Microsoft site mentioned at http://support.microsoft.com/?kbid=890830 Do I need to create Admin user for running this exe?How to create user in PE enviornment as RUNAS command is not working in this. Can you please let me know if you know the answer for this? This is very urgent for me. Please help in this regard. Best regards, Abhijit

  • Create New...